Skip to content

Segmentation fault in inf_compute_constraints with 2D infinite elements #4227

@AlbertoBittes

Description

@AlbertoBittes

Hello everyone,
I have a D-shaped domain and I generated infinite elements on the circular boundary of my domain. I issued a mesh.find_neighbors(); after generating as shown in the examples. I am not doing any AMR. During creation of constraints I am getting a segmentation fault in
inf_compute_constraints function, which is called by lagrange_compute_constraints:

template <unsigned int Dim, FEFamily T_radial, InfMapType T_map>
void InfFE<Dim, T_radial, T_map>::inf_compute_constraints (DofConstraints & constraints,
                                                           DofMap & dof_map,
                                                           const unsigned int variable_number,
                                                           const Elem * child_elem)
{

  // only constrain elements in 2,3d.
  if (Dim == 1)
    return;

  libmesh_assert(child_elem);

  // only constrain active and ancestor elements
  if (child_elem->subactive())
    return;

  // Before we start to compute anything, lets check if any confinement is needed:
  bool need_constraints=false;
  for (auto child_neighbor : child_elem->neighbor_ptr_range())
    if (child_neighbor->level() < child_elem->level())
      {
        need_constraints = true;
        break;
      }
  if (!need_constraints)
    return;

The neighbor_ptr_range() is returning a nullptr and I am getting a segmentation fault. By compiling libMesh without AMR, the function is skipped and I could complete the constraints creation (BTW, I figured out later that 2D InfFE shape functions are not implemented, is there any workaround or plan to make them available?).
Thank you in advance for your help.

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