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 2968 of file elem.h.

Constructor & Destructor Documentation

◆ SideIter() [1/3]

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

Definition at line 2972 of file elem.h.

2974  : _side(),
2975  _side_ptr(nullptr),
2976  _parent(parent),
2977  _side_number(side_number)
2978  {}
const Elem * parent() const
Definition: elem.h:2607
unsigned int _side_number
Definition: elem.h:3072
std::unique_ptr< Elem > _side
Definition: elem.h:3057

◆ SideIter() [2/3]

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

Definition at line 2982 of file elem.h.

2983  : _side(),
2984  _side_ptr(nullptr),
2985  _parent(nullptr),
2987  {}
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:3072
std::unique_ptr< Elem > _side
Definition: elem.h:3057

◆ SideIter() [3/3]

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

Definition at line 2991 of file elem.h.

2992  : _side(),
2993  _side_ptr(nullptr),
2994  _parent(other._parent),
2995  _side_number(other._side_number)
2996  {}
unsigned int _side_number
Definition: elem.h:3072
std::unique_ptr< Elem > _side
Definition: elem.h:3057

Member Function Documentation

◆ _update_side_ptr()

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

Definition at line 3045 of file elem.h.

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

Referenced by operator*().

3046  {
3047  // Construct new side, store in std::unique_ptr
3048  this->_side = this->_parent->build_side_ptr(this->_side_number);
3049 
3050  // Also set our internal naked pointer. Memory is still owned
3051  // by the std::unique_ptr.
3052  this->_side_ptr = _side.get();
3053  }
unsigned int _side_number
Definition: elem.h:3072
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
std::unique_ptr< Elem > _side
Definition: elem.h:3057

◆ operator*()

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

Definition at line 3008 of file elem.h.

References _side_ptr, and _update_side_ptr().

3009  {
3010  // Set the std::unique_ptr
3011  this->_update_side_ptr();
3012 
3013  // Return a reference to _side_ptr
3014  return this->_side_ptr;
3015  }
void _update_side_ptr() const
Definition: elem.h:3045

◆ operator++()

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

Definition at line 3018 of file elem.h.

References _side_number.

3019  {
3020  ++_side_number;
3021  return *this;
3022  }
unsigned int _side_number
Definition: elem.h:3072

◆ operator=()

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

Definition at line 3000 of file elem.h.

References _parent, and _side_number.

3001  {
3002  this->_parent = other._parent;
3003  this->_side_number = other._side_number;
3004  return *this;
3005  }
unsigned int _side_number
Definition: elem.h:3072

◆ operator==()

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

Definition at line 3026 of file elem.h.

References _parent, and _side_number.

3027  {
3028  return (this->_side_number == other._side_number &&
3029  this->_parent == other._parent);
3030  }
unsigned int _side_number
Definition: elem.h:3072

◆ side_on_boundary()

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

Definition at line 3037 of file elem.h.

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

3038  {
3039  return this->_parent->neighbor_ptr(_side_number) == nullptr;
3040  }
unsigned int _side_number
Definition: elem.h:3072
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2150

Member Data Documentation

◆ _parent

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

Definition at line 3069 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 3057 of file elem.h.

Referenced by _update_side_ptr().

◆ _side_number

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

Definition at line 3072 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 3066 of file elem.h.

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


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