mfem / web

MFEM website
http://mfem.org
9 stars 15 forks source link

Documentation on DG boundary conditions is misleading (for 1D at least) #271

Closed cjvogl closed 3 months ago

cjvogl commented 3 months ago

The documentation on boundary conditions reads, "In the Discontinuous Galerkin (DG) formulation the Natural, Neumann, and Robin can be implemented in precisely the same manner as in the continuous case." (see https://github.com/mfem/web/blob/12882dfb42bf16fa181a0da7b9c1c92abbb57642/src/fem_bc.md?plain=1#L217)

I found this to misleading: Natural/Neumann conditions for CG are imposed by, e.g., adding a boundary integrator to the RHS linear form. Doing the same for a one-dimensional DG finite element space generates a seg fault because L2_Elements[Geometry::POINT] is NULL... so the following line in LinearForm fails: https://github.com/mfem/mfem/blob/master/fem/linearform.cpp#L260.

pazner commented 3 months ago

I suppose in DG it needs to be a boundary face integrator rather than a boundary integrator (added with AddBdrFaceIntegrator rather than AddBoundaryIntegrator). Please see if #272 helps clarify things.

cjvogl commented 3 months ago

That's exactly what I found. Thanks for putting together #272 , I'll take a look now.