libMesh::PeriodicBoundary Class Reference

Used for implementing periodic BCs via constraints. More...

#include <periodic_boundary.h>

Inheritance diagram for libMesh::PeriodicBoundary:

Public Types

enum  TransformationType { FORWARD =0, INVERSE =1 }
 

Public Member Functions

 PeriodicBoundary ()
 
virtual ~PeriodicBoundary ()
 
 PeriodicBoundary (const PeriodicBoundary &o, TransformationType t=FORWARD)
 
 PeriodicBoundary (const RealVectorValue &vector)
 
virtual Point get_corresponding_pos (const Point &pt) const libmesh_override
 
virtual UniquePtr< PeriodicBoundaryBaseclone (TransformationType t=FORWARD) const libmesh_override
 
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
 
boundary_id_type pairedboundary
 

Protected Attributes

RealVectorValue translation_vector
 
std::set< unsigned int > variables
 

Detailed Description

Used for implementing periodic BCs via constraints.

The definition of a periodic boundary.

Author
Roy Stogner
Date
2010

Definition at line 45 of file periodic_boundary.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

libMesh::PeriodicBoundary::PeriodicBoundary ( )

Constructor

Definition at line 29 of file periodic_boundary.C.

Referenced by clone(), and ~PeriodicBoundary().

virtual libMesh::PeriodicBoundary::~PeriodicBoundary ( )
inlinevirtual

Destructor

Definition at line 56 of file periodic_boundary.h.

References clone(), libMesh::PeriodicBoundaryBase::FORWARD, get_corresponding_pos(), and PeriodicBoundary().

56 {}
libMesh::PeriodicBoundary::PeriodicBoundary ( const PeriodicBoundary o,
TransformationType  t = FORWARD 
)

Copy constructor, with option for the copy to represent an inverse transformation.

Definition at line 37 of file periodic_boundary.C.

References libMesh::PeriodicBoundaryBase::INVERSE, libMesh::PeriodicBoundaryBase::myboundary, libMesh::PeriodicBoundaryBase::pairedboundary, swap(), and translation_vector.

37  :
39  translation_vector(o.translation_vector)
40 {
41  if (t == INVERSE)
42  {
44  translation_vector *= -1.0;
45  }
46 }
RealVectorValue translation_vector
void swap(Iterator &lhs, Iterator &rhs)
libMesh::PeriodicBoundary::PeriodicBoundary ( const RealVectorValue vector)

Constructor taking a reference to the translation vector.

Definition at line 50 of file periodic_boundary.C.

50  :
52  translation_vector(vector)
53 {
54 }
RealVectorValue translation_vector

Member Function Documentation

UniquePtr< PeriodicBoundaryBase > libMesh::PeriodicBoundary::clone ( TransformationType  t = FORWARD) const
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.

Implements libMesh::PeriodicBoundaryBase.

Definition at line 65 of file periodic_boundary.C.

References PeriodicBoundary().

Referenced by ~PeriodicBoundary().

66 {
67  return UniquePtr<PeriodicBoundaryBase>(new PeriodicBoundary(*this, t));
68 }
Point libMesh::PeriodicBoundary::get_corresponding_pos ( const Point pt) const
virtual

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

Implements libMesh::PeriodicBoundaryBase.

Definition at line 58 of file periodic_boundary.C.

References translation_vector.

Referenced by ~PeriodicBoundary().

59 {
60  return pt + translation_vector;
61 }
RealVectorValue translation_vector
bool libMesh::PeriodicBoundaryBase::is_my_variable ( unsigned int  var_num) const
inherited

Definition at line 60 of file periodic_boundary_base.C.

References libMesh::PeriodicBoundaryBase::variables.

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

61 {
62  bool a = variables.empty() || (!variables.empty() && variables.find(var_num) != variables.end());
63  return a;
64 }
std::set< unsigned int > variables
void libMesh::PeriodicBoundaryBase::merge ( const PeriodicBoundaryBase pb)
inherited

Definition at line 53 of file periodic_boundary_base.C.

References libMesh::PeriodicBoundaryBase::variables.

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

54 {
55  variables.insert(pb.variables.begin(), pb.variables.end());
56 }
std::set< unsigned int > variables
void libMesh::PeriodicBoundaryBase::set_variable ( unsigned int  var)
inherited

Definition at line 46 of file periodic_boundary_base.C.

References libMesh::PeriodicBoundaryBase::variables.

Referenced by libMesh::PeriodicBoundaryBase::~PeriodicBoundaryBase().

47 {
48  variables.insert(var);
49 }
std::set< unsigned int > variables

Member Data Documentation

boundary_id_type libMesh::PeriodicBoundaryBase::myboundary
inherited

The boundary ID of this boundary and its counterpart

Definition at line 58 of file periodic_boundary_base.h.

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

RealVectorValue libMesh::PeriodicBoundary::translation_vector
protected

Definition at line 88 of file periodic_boundary.h.

Referenced by get_corresponding_pos(), and PeriodicBoundary().

std::set<unsigned int> libMesh::PeriodicBoundaryBase::variables
protectedinherited

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

Definition at line 106 of file periodic_boundary_base.h.

Referenced by libMesh::PeriodicBoundaryBase::is_my_variable(), libMesh::PeriodicBoundaryBase::merge(), and libMesh::PeriodicBoundaryBase::set_variable().


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