[petsc-users] Boundary integral problem

Matthew Knepley knepley at gmail.com
Tue Oct 31 06:00:00 CDT 2023


On Mon, Sep 25, 2023 at 8:58 AM Azeddine Messikh via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Dear developers
>
> I tried to run ex24.c
> https://petsc.org/release/src/snes/tutorials/ex24.c.html using the
> following command line
>
> ./ex24 -sol_type quadratic -dm_plex_simplex 0  -field_petscspace_degree 1
> -potential_petscspace_degree 1 -dm_plex_box_faces 2,1
>
> I discovered that at
>
> 254:     PetscCall <https://petsc.org/release/manualpages/Sys/PetscCall/>(PetscWeakFormSetIndexBdResidual(wf, label, 1, 0, 0, 0, f0_bd_quadratic_q, 0, NULL));
>
>  reverses the value of the integrals at the top only. That is
> The boundary integral corresponding to node 5 becomes that of 4 and
> vise-versa.
> Same thing for nodes 5 and 6.
>

I apologize for taking so long to reply. This email fell out of my Inbox.

I believe the problem is understanding the ordering of unknowns in Plex.
For all shapes, I orient the boundary to have outward normals. This means
that for quads, the vertex ordering would be

  1--2--5--4    and    2--3--6--5

Does this make sense?

  Thanks,

     Matt


> The mesh index is as follows
> *4---*5---*6
>  |       |      |
>  |       |      |
> *1--- *2---*3
>
> However,  if I use  -dm_plex_simplex 1 there is no problem.
>
> The model is in the form Au = b
>
> the value of b with  "-dm_plex_simplex 0" is
> [0.25
> 0.0104167
> 0.
> 0.
> 0.145833
> 0.
> -0.583333
> 0.177083
> 0.
> 0.0833333
> -0.28125
> 0.
> 0.
> -0.6875
> 0.
> -0.75
> -0.364583
> 0.]
>
> and for -dm_plex_simplex 1
> [0.0833333
> 0.0104167
> 0.
> 0.
> 0.145833
> 0.
> -0.583333
> 0.177083
> 0.
> 0.25
> -0.260417
> 0.
> 1.43404e-16
> -0.645833
> 0.
> -0.75
> -0.427083
> 0.]
>
> you can see that the value at node 1 =0.25  and node 4 = 0.0833333 (
> simplex 0)
> which is reversed, that is,      node 4 =0.25  and node 1 = 0.0833333
> (simplex 1)
>
> So, my own calculation shows that at node 1 should be 0.083333 not 0.25.
> The -dm_plex_simplex 1 gives the correct answer but -dm_plex_simplex 0
> gives wrong answer.
>
>
> Would you please help me in this matter.
> Sincerely yours
> Azeddine M
>
>
>
>
>
>
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20231031/6ff93085/attachment.html>


More information about the petsc-users mailing list