libMesh
Public Member Functions | Public Attributes | List of all members
libMesh::HPSingularity Class Reference

This class uses a user-provided list of singularity locations to choose between h refining and p elevation. More...

#include <hp_singular.h>

Public Member Functions

 HPSingularity ()
 Constructor. More...
 
virtual ~HPSingularity ()
 Destructor. More...
 
virtual void select_refinement (System &system)
 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. More...
 

Public Attributes

std::list< Pointsingular_points
 This list, to be filled by the user, should include all singular points in the solution. More...
 

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

libMesh::HPSingularity::HPSingularity ( )

Constructor.

Definition at line 56 of file hp_singular.h.

57  {
58  libmesh_experimental();
59  }
virtual libMesh::HPSingularity::~HPSingularity ( )
virtual

Destructor.

Definition at line 64 of file hp_singular.h.

References select_refinement().

64 {}

Member Function Documentation

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::MeshBase::active_element_ptr_range(), libMesh::Elem::DO_NOTHING, libMesh::System::get_mesh(), mesh, libMesh::Elem::REFINE, and singular_points.

Referenced by main(), and ~HPSingularity().

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 (std::list<Point>::iterator ppoint =
54  singular_points.begin();
55  ppoint != singular_points.end(); ++ppoint)
56  {
57  if (elem->contains_point(*ppoint))
58  {
59  elem->set_p_refinement_flag(Elem::DO_NOTHING);
60  elem->set_refinement_flag(Elem::REFINE);
61  break;
62  }
63  }
64  }
65 }
MeshBase & mesh
std::list< Point > singular_points
This list, to be filled by the user, should include all singular points in the solution.
Definition: hp_singular.h:79

Member Data Documentation

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 79 of file hp_singular.h.

Referenced by main(), and select_refinement().


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