Skip to content

SEGFAULT while assembling a MixedBilinearForm #330

@denislachapelle

Description

@denislachapelle

I got a segmentation fault while assembling a MixedBilinearForm.

One space is H1 on main mesh while the other space is L2 on an extracted SubMesh using CreateFromBoundary.

Here the code snippets...

//Create the mesh.
mesh = new Mesh();
*mesh = Mesh::MakeCartesian2D(nbrSeg, static_cast<int>(endTime / deltaT),
                                  Element::QUADRILATERAL, false, lenght, endTime, true);

//create a submesh of the boundary.
Array<int> is_bdr_attrs;
is_bdr_attrs.Append(1); // Attribute ID to extract, e.g., boundary marker 1
ismesh = new SubMesh(SubMesh::CreateFromBoundary(*mesh, is_bdr_attrs));
for (int i = 0; i < ismesh->GetNBE(); i++)
{
     ismesh->SetBdrAttribute(i, 1); // Set to attribute 1
}

//space for current.
   IFEC = new H1_FECollection(order, 2);
   IFESpace = new FiniteElementSpace(mesh, IFEC);

   //space for lagrange multiplier relate to Vs Rs,
   //which cause boundary cnditions on I(0,y).
   ISFEC = new L2_FECollection(order, 1);
   ISFESpace = new FiniteElementSpace(ismesh, ISFEC);   

//Mixed Bilinear form VL.
   MBLFVL = new MixedBilinearForm(VFESpace, ISFESpace); //I swap both FESpace and get the same result.
   ConstantCoefficient oneOverRs(1.0/Rs);
   MBLFVL->AddBoundaryIntegrator(new BoundaryMassIntegrator(oneOverRs));
   MBLFVL->Assemble();

//SEGFAULT happens here.

Here is the GDB output snippet...

Program received signal SIGSEGV, Segmentation fault.
0x000055555575a938 in mfem::MixedBilinearForm::Assemble(int) ()
(gdb) bt
#0 0x000055555575a938 in mfem::MixedBilinearForm::Assemble(int) ()
#1 0x00005555555c5eca in Stltfe2d::CreateForms (this=0x7fffffffdf10) at stltfe2d.cpp:310
#2 0x00005555555c6651 in main (argc=1, argv=0x7fffffffe1a8) at stltfe2d.cpp:414
(gdb)

Any help will be very appreciated,
Denis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions