libMesh::HPSingularity Class Reference

#include <hp_singular.h>

Public Member Functions

 HPSingularity ()
 
virtual ~HPSingularity ()
 
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

libMesh::HPSingularity::HPSingularity ( )
inline

Constructor.

Definition at line 56 of file hp_singular.h.

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

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_local_elements_begin(), libMesh::MeshBase::active_local_elements_end(), libMesh::Elem::contains_point(), libMesh::Elem::DO_NOTHING, libMesh::System::get_mesh(), mesh, libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_refinement_flag(), and singular_points.

Referenced by ~HPSingularity().

37 {
38  LOG_SCOPE("select_refinement()", "HPSingularity");
39 
40  // The current mesh
41  MeshBase & mesh = system.get_mesh();
42 
43  MeshBase::element_iterator elem_it =
44  mesh.active_local_elements_begin();
45  const MeshBase::element_iterator elem_end =
46  mesh.active_local_elements_end();
47 
48  for (; elem_it != elem_end; ++elem_it)
49  {
50  Elem * elem = *elem_it;
51 
52  // We're only checking elements that are already flagged for h
53  // refinement
54  if (elem->refinement_flag() != Elem::REFINE)
55  continue;
56 
57  elem->set_p_refinement_flag(Elem::REFINE);
58  elem->set_refinement_flag(Elem::DO_NOTHING);
59 
60  for (std::list<Point>::iterator ppoint =
61  singular_points.begin();
62  ppoint != singular_points.end(); ++ppoint)
63  {
64  if (elem->contains_point(*ppoint))
65  {
66  elem->set_p_refinement_flag(Elem::DO_NOTHING);
67  elem->set_refinement_flag(Elem::REFINE);
68  break;
69  }
70  }
71  }
72 }
MeshBase & mesh
std::list< Point > singular_points
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 select_refinement().


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