libMesh
Public Member Functions | Private Member Functions | Private Attributes | List of all members
libMesh::Elem::SideIter Class Reference

The definition of the protected nested SideIter class. More...

#include <elem.h>

Public Member Functions

 SideIter (const unsigned int side_number, Elem *parent)
 
 SideIter ()
 
 SideIter (const SideIter &other)
 
SideIteroperator= (const SideIter &other)
 
Elem *& operator* () const
 
SideIteroperator++ ()
 
bool operator== (const SideIter &other) const
 
bool side_on_boundary () const
 

Private Member Functions

void _update_side_ptr () const
 

Private Attributes

std::unique_ptr< Elem_side
 
Elem_side_ptr
 
Elem_parent
 
unsigned int _side_number
 

Detailed Description

The definition of the protected nested SideIter class.

Definition at line 2746 of file elem.h.

Constructor & Destructor Documentation

◆ SideIter() [1/3]

libMesh::Elem::SideIter::SideIter ( const unsigned int  side_number,
Elem parent 
)

Definition at line 2750 of file elem.h.

2752  : _side(),
2753  _side_ptr(nullptr),
2754  _parent(parent),
2755  _side_number(side_number)
2756  {}
const Elem * parent() const
Definition: elem.h:2385
unsigned int _side_number
Definition: elem.h:2850
std::unique_ptr< Elem > _side
Definition: elem.h:2835

◆ SideIter() [2/3]

libMesh::Elem::SideIter::SideIter ( )

Definition at line 2760 of file elem.h.

2761  : _side(),
2762  _side_ptr(nullptr),
2763  _parent(nullptr),
2765  {}
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:245
unsigned int _side_number
Definition: elem.h:2850
std::unique_ptr< Elem > _side
Definition: elem.h:2835

◆ SideIter() [3/3]

libMesh::Elem::SideIter::SideIter ( const SideIter other)

Definition at line 2769 of file elem.h.

2770  : _side(),
2771  _side_ptr(nullptr),
2772  _parent(other._parent),
2773  _side_number(other._side_number)
2774  {}
unsigned int _side_number
Definition: elem.h:2850
std::unique_ptr< Elem > _side
Definition: elem.h:2835

Member Function Documentation

◆ _update_side_ptr()

void libMesh::Elem::SideIter::_update_side_ptr ( ) const
private

Definition at line 2823 of file elem.h.

References _parent, _side, _side_number, _side_ptr, and libMesh::Elem::build_side_ptr().

Referenced by operator*().

2824  {
2825  // Construct new side, store in std::unique_ptr
2826  this->_side = this->_parent->build_side_ptr(this->_side_number);
2827 
2828  // Also set our internal naked pointer. Memory is still owned
2829  // by the std::unique_ptr.
2830  this->_side_ptr = _side.get();
2831  }
unsigned int _side_number
Definition: elem.h:2850
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
std::unique_ptr< Elem > _side
Definition: elem.h:2835

◆ operator*()

Elem*& libMesh::Elem::SideIter::operator* ( ) const

Definition at line 2786 of file elem.h.

References _side_ptr, and _update_side_ptr().

2787  {
2788  // Set the std::unique_ptr
2789  this->_update_side_ptr();
2790 
2791  // Return a reference to _side_ptr
2792  return this->_side_ptr;
2793  }
void _update_side_ptr() const
Definition: elem.h:2823

◆ operator++()

SideIter& libMesh::Elem::SideIter::operator++ ( )

Definition at line 2796 of file elem.h.

References _side_number.

2797  {
2798  ++_side_number;
2799  return *this;
2800  }
unsigned int _side_number
Definition: elem.h:2850

◆ operator=()

SideIter& libMesh::Elem::SideIter::operator= ( const SideIter other)

Definition at line 2778 of file elem.h.

References _parent, and _side_number.

2779  {
2780  this->_parent = other._parent;
2781  this->_side_number = other._side_number;
2782  return *this;
2783  }
unsigned int _side_number
Definition: elem.h:2850

◆ operator==()

bool libMesh::Elem::SideIter::operator== ( const SideIter other) const

Definition at line 2804 of file elem.h.

References _parent, and _side_number.

2805  {
2806  return (this->_side_number == other._side_number &&
2807  this->_parent == other._parent);
2808  }
unsigned int _side_number
Definition: elem.h:2850

◆ side_on_boundary()

bool libMesh::Elem::SideIter::side_on_boundary ( ) const

Definition at line 2815 of file elem.h.

References _parent, _side_number, and libMesh::Elem::neighbor_ptr().

2816  {
2817  return this->_parent->neighbor_ptr(_side_number) == nullptr;
2818  }
unsigned int _side_number
Definition: elem.h:2850
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2006

Member Data Documentation

◆ _parent

Elem* libMesh::Elem::SideIter::_parent
private

Definition at line 2847 of file elem.h.

Referenced by _update_side_ptr(), operator=(), operator==(), and side_on_boundary().

◆ _side

std::unique_ptr<Elem> libMesh::Elem::SideIter::_side
mutableprivate

Definition at line 2835 of file elem.h.

Referenced by _update_side_ptr().

◆ _side_number

unsigned int libMesh::Elem::SideIter::_side_number
private

Definition at line 2850 of file elem.h.

Referenced by _update_side_ptr(), operator++(), operator=(), operator==(), and side_on_boundary().

◆ _side_ptr

Elem* libMesh::Elem::SideIter::_side_ptr
mutableprivate

Definition at line 2844 of file elem.h.

Referenced by _update_side_ptr(), and operator*().


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