libMesh
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
libMesh::PeriodicBoundaryBase Class Referenceabstract

The base class for defining periodic boundaries. More...

#include <periodic_boundary_base.h>

Inheritance diagram for libMesh::PeriodicBoundaryBase:
[legend]

Public Types

enum  TransformationType { FORWARD =0, INVERSE =1 }
 

Public Member Functions

 PeriodicBoundaryBase ()
 Constructor. More...
 
 PeriodicBoundaryBase (const PeriodicBoundaryBase &other)
 Copy constructor. More...
 
virtual ~PeriodicBoundaryBase ()
 Destructor. More...
 
virtual Point get_corresponding_pos (const Point &pt) const =0
 This function should be overridden by derived classes to define how one finds corresponding nodes on the periodic boundary pair. More...
 
virtual UniquePtr< PeriodicBoundaryBaseclone (TransformationType t=FORWARD) const =0
 If we want the DofMap to be able to make copies of references and store them in the underlying map, this class must be clone'able, i.e. More...
 
void set_variable (unsigned int var)
 
void merge (const PeriodicBoundaryBase &pb)
 
bool is_my_variable (unsigned int var_num) const
 

Public Attributes

boundary_id_type myboundary
 The boundary ID of this boundary and its counterpart. More...
 
boundary_id_type pairedboundary
 

Protected Attributes

std::set< unsigned intvariables
 Set of variables for this periodic boundary, empty means all variables possible. More...
 

Detailed Description

The base class for defining periodic boundaries.

Author
Roy Stogner
Date
2010 Base class for all PeriodicBoundary implementations.

Definition at line 47 of file periodic_boundary_base.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

libMesh::PeriodicBoundaryBase::PeriodicBoundaryBase ( )

Constructor.

Definition at line 29 of file periodic_boundary_base.C.

29  :
32 {
33 }
boundary_id_type myboundary
The boundary ID of this boundary and its counterpart.
static const boundary_id_type invalid_id
Number used for internal use.
libMesh::PeriodicBoundaryBase::PeriodicBoundaryBase ( const PeriodicBoundaryBase other)

Copy constructor.

Definition at line 37 of file periodic_boundary_base.C.

37  :
38  myboundary(o.myboundary),
39  pairedboundary(o.pairedboundary),
40  variables(o.variables)
41 {
42 }
boundary_id_type myboundary
The boundary ID of this boundary and its counterpart.
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.
virtual libMesh::PeriodicBoundaryBase::~PeriodicBoundaryBase ( )
virtual

Destructor.

Definition at line 72 of file periodic_boundary_base.h.

References clone(), FORWARD, get_corresponding_pos(), is_my_variable(), merge(), and set_variable().

72 {}

Member Function Documentation

virtual UniquePtr<PeriodicBoundaryBase> libMesh::PeriodicBoundaryBase::clone ( TransformationType  t = FORWARD) const
pure virtual

If we want the DofMap to be able to make copies of references and store them in the underlying map, this class must be clone'able, i.e.

have a kind of virtual construction mechanism. The user can also pass a flag to enable an 'inverse transformation' to be cloned from a forward transformation. The simplest way to implement a clone function like this is in terms of a copy constructor, see periodic_boundary.h.

Note
Not every transformation needs to provide an automatic way to clone an inverse: you can simply add a pair of PeriodicBoundaryBase objects using the appropriate DofMap interface instead.

Implemented in libMesh::PeriodicBoundary.

Referenced by libMesh::DofMap::add_periodic_boundary(), and ~PeriodicBoundaryBase().

virtual Point libMesh::PeriodicBoundaryBase::get_corresponding_pos ( const Point pt) const
pure virtual

This function should be overridden by derived classes to define how one finds corresponding nodes on the periodic boundary pair.

Implemented in libMesh::PeriodicBoundary.

Referenced by libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::PeriodicBoundaries::neighbor(), and ~PeriodicBoundaryBase().

bool libMesh::PeriodicBoundaryBase::is_my_variable ( unsigned int  var_num) const

Definition at line 60 of file periodic_boundary_base.C.

References variables.

Referenced by libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), and ~PeriodicBoundaryBase().

61 {
62  bool a = variables.empty() || (!variables.empty() && variables.find(var_num) != variables.end());
63  return a;
64 }
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.
void libMesh::PeriodicBoundaryBase::merge ( const PeriodicBoundaryBase pb)

Definition at line 53 of file periodic_boundary_base.C.

References variables.

Referenced by libMesh::DofMap::add_periodic_boundary(), and ~PeriodicBoundaryBase().

54 {
55  variables.insert(pb.variables.begin(), pb.variables.end());
56 }
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.
void libMesh::PeriodicBoundaryBase::set_variable ( unsigned int  var)

Definition at line 46 of file periodic_boundary_base.C.

References variables.

Referenced by ~PeriodicBoundaryBase().

47 {
48  variables.insert(var);
49 }
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.

Member Data Documentation

boundary_id_type libMesh::PeriodicBoundaryBase::myboundary

The boundary ID of this boundary and its counterpart.

Definition at line 57 of file periodic_boundary_base.h.

Referenced by libMesh::DofMap::add_periodic_boundary(), Biharmonic::JR::JR(), main(), and libMesh::PeriodicBoundary::PeriodicBoundary().

boundary_id_type libMesh::PeriodicBoundaryBase::pairedboundary
std::set<unsigned int> libMesh::PeriodicBoundaryBase::variables
protected

Set of variables for this periodic boundary, empty means all variables possible.

Definition at line 108 of file periodic_boundary_base.h.

Referenced by is_my_variable(), merge(), and set_variable().


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