libMesh
Public Member Functions | List of all members
libMesh::PeriodicBoundaries Class Reference

We're using a class instead of a typedef to allow forward declarations and future flexibility. More...

#include <periodic_boundaries.h>

Inheritance diagram for libMesh::PeriodicBoundaries:
[legend]

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
std::map has no virtual destructor, so downcasting here would be dangerous.
Author
Roy Stogner
Date
2010 Maps between boundary ids and PeriodicBoundaryBase objects.

Definition at line 51 of file periodic_boundaries.h.

Constructor & Destructor Documentation

libMesh::PeriodicBoundaries::PeriodicBoundaries ( )

Definition at line 58 of file periodic_boundaries.h.

References neighbor(), side, and ~PeriodicBoundaries().

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

Definition at line 31 of file periodic_boundaries.C.

References end.

Referenced by PeriodicBoundaries().

32 {
33  for (std::map<boundary_id_type, PeriodicBoundaryBase *>::iterator it = begin(); it != end(); ++it)
34  delete it->second;
35 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...

Member Function Documentation

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

Definition at line 39 of file periodic_boundaries.C.

References end, and libmesh_nullptr.

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

40 {
41  iterator i = this->find(id);
42  if (i == this->end())
43  return libmesh_nullptr;
44  return i->second;
45 }
const class libmesh_nullptr_t libmesh_nullptr
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
const PeriodicBoundaryBase * libMesh::PeriodicBoundaries::boundary ( boundary_id_type  id) const

Definition at line 49 of file periodic_boundaries.C.

References end, and libmesh_nullptr.

50 {
51  const_iterator i = this->find(id);
52  if (i == this->end())
53  return libmesh_nullptr;
54  return i->second;
55 }
const class libmesh_nullptr_t libmesh_nullptr
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
const Elem * libMesh::PeriodicBoundaries::neighbor ( boundary_id_type  boundary_id,
const PointLocatorBase point_locator,
const Elem e,
unsigned int  side 
) const

Definition at line 60 of file periodic_boundaries.C.

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

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

64 {
65  // Find a point on that side (and only that side)
66 
67  Point p = e->build_side_ptr(side)->centroid();
68 
69  const PeriodicBoundaryBase * b = this->boundary(boundary_id);
70  libmesh_assert (b);
71  p = b->get_corresponding_pos(p);
72 
73  return point_locator.operator()(p);
74 }
unsigned short int side
Definition: xdr_io.C:49
PeriodicBoundaryBase * boundary(boundary_id_type id)
libmesh_assert(j)

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