libMesh::HPSingularity Class Reference

#include <hp_singular.h>

Public Member Functions

 HPSingularity ()
 
 HPSingularity (const HPSingularity &)=default
 
 HPSingularity (HPSingularity &&)=default
 
HPSingularityoperator= (const HPSingularity &)=default
 
HPSingularityoperator= (HPSingularity &&)=default
 
virtual ~HPSingularity ()=default
 
virtual void select_refinement (System &system)
 

Public Attributes

std::list< Pointsingular_points
 

Detailed Description

This class uses a user-provided list of singularity locations to choose between h refining and p elevation. Currently we assume that a set of elements has already been flagged for h refinement - any elements which do not contain a user-provided singular point are instead flagged for p refinement.

Author
Roy H. Stogner
Date
2006

Definition at line 49 of file hp_singular.h.

Constructor & Destructor Documentation

◆ HPSingularity() [1/3]

libMesh::HPSingularity::HPSingularity ( )
inline

Constructor.

Definition at line 56 of file hp_singular.h.

57  {
58  libmesh_experimental();
59  }

◆ HPSingularity() [2/3]

libMesh::HPSingularity::HPSingularity ( const HPSingularity )
default

Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this simple class.

◆ HPSingularity() [3/3]

libMesh::HPSingularity::HPSingularity ( HPSingularity &&  )
default

◆ ~HPSingularity()

virtual libMesh::HPSingularity::~HPSingularity ( )
virtualdefault

Member Function Documentation

◆ operator=() [1/2]

HPSingularity& libMesh::HPSingularity::operator= ( const HPSingularity )
default

◆ operator=() [2/2]

HPSingularity& libMesh::HPSingularity::operator= ( HPSingularity &&  )
default

◆ select_refinement()

void libMesh::HPSingularity::select_refinement ( System system)
virtual

This pure virtual function must be redefined in derived classes to take a mesh flagged for h refinement and potentially change the desired refinement type.

Definition at line 36 of file hp_singular.C.

References libMesh::Elem::DO_NOTHING, libMesh::System::get_mesh(), mesh, libMesh::Elem::REFINE, and singular_points.

37 {
38  LOG_SCOPE("select_refinement()", "HPSingularity");
39 
40  // The current mesh
41  MeshBase & mesh = system.get_mesh();
42 
43  for (auto & elem : mesh.active_element_ptr_range())
44  {
45  // We're only checking elements that are already flagged for h
46  // refinement
47  if (elem->refinement_flag() != Elem::REFINE)
48  continue;
49 
50  elem->set_p_refinement_flag(Elem::REFINE);
51  elem->set_refinement_flag(Elem::DO_NOTHING);
52 
53  for (const auto & pt : singular_points)
54  if (elem->contains_point(pt))
55  {
56  elem->set_p_refinement_flag(Elem::DO_NOTHING);
57  elem->set_refinement_flag(Elem::REFINE);
58  break;
59  }
60  }
61 }
MeshBase & mesh
std::list< Point > singular_points
Definition: hp_singular.h:83

Member Data Documentation

◆ singular_points

std::list<Point> libMesh::HPSingularity::singular_points

This list, to be filled by the user, should include all singular points in the solution.

Definition at line 83 of file hp_singular.h.

Referenced by select_refinement().


The documentation for this class was generated from the following files: