$extrastylesheet
libMesh::HPSingularity Class Reference

#include <hp_singular.h>

List of all members.

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, 2006.

Definition at line 48 of file hp_singular.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 55 of file hp_singular.h.

  {
    libmesh_experimental();
  }
virtual libMesh::HPSingularity::~HPSingularity ( ) [inline, virtual]

Destructor.

Definition at line 63 of file hp_singular.h.

{}

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(), singular_points, and libMesh::START_LOG().

{
  START_LOG("select_refinement()", "HPSingularity");

  // The current mesh
  MeshBase& mesh = system.get_mesh();

  MeshBase::element_iterator       elem_it  =
    mesh.active_local_elements_begin();
  const MeshBase::element_iterator elem_end =
    mesh.active_local_elements_end();

  for (; elem_it != elem_end; ++elem_it)
    {
      Elem* elem = *elem_it;

      // We're only checking elements that are already flagged for h
      // refinement
      if (elem->refinement_flag() != Elem::REFINE)
        continue;

      elem->set_p_refinement_flag(Elem::REFINE);
      elem->set_refinement_flag(Elem::DO_NOTHING);

      for (std::list<Point>::iterator ppoint =
             singular_points.begin();
           ppoint != singular_points.end(); ++ppoint)
        {
          if (elem->contains_point(*ppoint))
            {
              elem->set_p_refinement_flag(Elem::DO_NOTHING);
              elem->set_refinement_flag(Elem::REFINE);
              break;
            }
        }
    }

  STOP_LOG("select_refinement()", "HPSingularity");
}

Member Data Documentation

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

Definition at line 78 of file hp_singular.h.

Referenced by select_refinement().


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