libMesh::PeriodicBoundaries Class Reference

#include <periodic_boundaries.h>

Inheritance diagram for libMesh::PeriodicBoundaries:

Public Member Functions

PeriodicBoundaryBaseboundary (boundary_id_type id)
 
const PeriodicBoundaryBaseboundary (boundary_id_type id) const
 
 PeriodicBoundaries ()
 
 ~PeriodicBoundaries ()
 
const Elemneighbor (boundary_id_type boundary_id, const PointLocatorBase &point_locator, const Elem *e, unsigned int side) const
 

Detailed Description

We're using a class instead of a typedef to allow forward declarations and future flexibility. Note that std::map has no virtual destructor, so downcasting here would be dangerous.

Definition at line 48 of file periodic_boundaries.h.

Constructor & Destructor Documentation

libMesh::PeriodicBoundaries::PeriodicBoundaries ( )
inline

Definition at line 55 of file periodic_boundaries.h.

55 {}
libMesh::PeriodicBoundaries::~PeriodicBoundaries ( )

Definition at line 34 of file periodic_boundaries.C.

References end.

35 {
36  for (std::map<boundary_id_type, PeriodicBoundaryBase*>::iterator it = begin(); it != end(); ++it)
37  delete it->second;
38 }

Member Function Documentation

PeriodicBoundaryBase * libMesh::PeriodicBoundaries::boundary ( boundary_id_type  id)

Definition at line 42 of file periodic_boundaries.C.

References end.

Referenced by libMesh::FEGenericBase< T >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), neighbor(), and libMesh::Elem::topological_neighbor().

43 {
44  iterator i = this->find(id);
45  if (i == this->end())
46  return NULL;
47  return i->second;
48 }
const PeriodicBoundaryBase * libMesh::PeriodicBoundaries::boundary ( boundary_id_type  id) const

Definition at line 52 of file periodic_boundaries.C.

References end.

53 {
54  const_iterator i = this->find(id);
55  if (i == this->end())
56  return NULL;
57  return i->second;
58 }
const Elem * libMesh::PeriodicBoundaries::neighbor ( boundary_id_type  boundary_id,
const PointLocatorBase point_locator,
const Elem e,
unsigned int  side 
) const

Definition at line 63 of file periodic_boundaries.C.

References boundary(), libMesh::Elem::build_side(), libMesh::PeriodicBoundaryBase::get_corresponding_pos(), and libMesh::libmesh_assert().

Referenced by libMesh::FEGenericBase< T >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), and libMesh::Elem::topological_neighbor().

67 {
68  // Find a point on that side (and only that side)
69 
70  Point p = e->build_side(side)->centroid();
71 
72  const PeriodicBoundaryBase *b = this->boundary(boundary_id);
73  libmesh_assert (b);
74  p = b->get_corresponding_pos(p);
75 
76  return point_locator.operator()(p);
77 }

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

Site Created By: libMesh Developers
Last modified: February 07 2014 16:58:01 UTC

Hosted By:
SourceForge.net Logo