MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
maia::dg::collector::HElementCollector< nDim, SysEqn > Class Template Reference

Class that represents DG element collector. More...

#include <dgcartesianhelementcollector.h>

Inheritance diagram for maia::dg::collector::HElementCollector< nDim, SysEqn >:
[legend]
Collaboration diagram for maia::dg::collector::HElementCollector< nDim, SysEqn >:
[legend]

Public Types

template<class T >
using Invalid = typename maia::dg::collector::Invalid< T >
 

Public Member Functions

constexpr HElementCollector ()=default
 Default c'tor does nothing. More...
 
MIntelementId (const MInt id)
 Accessor for element id. More...
 
MInt elementId (const MInt id) const
 Accessor for element id (const version). More...
 
MInthrefSurfaceIds (const MInt id, const MInt dir, const MInt pos)
 Accessor for h-refined surface ids. More...
 
MInt hrefSurfaceIds (const MInt id, const MInt dir, const MInt pos) const
 Accessor for h-refined surface ids (const version). More...
 
- Public Member Functions inherited from maia::container::Container< HElementCollector< nDim, SysEqn >, Invalid >
constexpr Container ()=default
 Default c'tor does nothing. More...
 
constexpr MInt capacity () const
 Return capacity (i.e., maximum number of nodes) More...
 
void reset (const MInt capacity)
 Reset tree, re-create data structures with given capacity, and set size to zero. More...
 
void resize (const MInt capacity)
 Resize the container capacity. More...
 
constexpr MInt size () const
 Return size (i.e., currently used number of nodes) More...
 
void size (const MInt size_)
 Resize tree WITHOUT CONSIDERING ANY NODE CONSISTENCY! Use at own risk and remove ASAP... More...
 
void append (const MInt count)
 Append nodes to end of tree. More...
 
void append ()
 
void shrink (const MInt count)
 Remove nodes from end of tree. More...
 
void shrink ()
 
void copy (const T &source, const MInt begin, const MInt end, const MInt to)
 Copy nodes to another location without changing any parent/child/neighbor information. More...
 
void copy (const T &source, const MInt from, const MInt to)
 
void copy (const MInt begin, const MInt end, const MInt to)
 
void copy (const MInt from, const MInt to)
 
void move (const MInt begin, const MInt end, const MInt to)
 Move nodes to another location and update parent/child/neighbor information accordingly. More...
 
void move (const MInt from, const MInt to)
 
void swap (const MInt a, const MInt b)
 Swap two nodes and update parent/child/neighbor information accordingly. More...
 
void insert (const MInt begin, const MInt count)
 
void insert (const MInt id)
 
void erase (const MInt begin, const MInt end)
 Erase nodes in range [begin, end) and update parent/child/neighbor information. More...
 
void erase (const MInt id)
 
void removeAndShift (const MInt begin, const MInt end)
 
void removeAndShift (const MInt id)
 
void removeAndFill (const MInt begin, const MInt end)
 
void removeAndFill (const MInt id)
 
void clear ()
 Clear tree by invalidating all nodes and setting size to zero. More...
 
HElementCollector< nDim, SysEqn > & derived ()
 
const HElementCollector< nDim, SysEqn > & derived () const
 
void rawCopy (const T &source, const MInt begin, const MInt end, const MInt to)
 Copy range of nodes [begin, end) to range starting at 'to'. More...
 
void rawCopy (const T &source, const MInt from, const MInt to)
 
void deleteConnectivity (const MInt NotUsed(begin), const MInt NotUsed(end))
 
void moveConnectivity (const MInt NotUsed(begin), const MInt NotUsed(end), const MInt NotUsed(to))
 
void moveConnectivity (const MInt from, const MInt to)
 
constexpr MInt dummy () const
 

Static Public Member Functions

static constexpr MInt noHrefSurfaces ()
 Return number of h-refined surfaces. More...
 
static constexpr MInt noDirs ()
 Return number of directions. More...
 
static constexpr MInt noHrefSurfaceIds ()
 

Private Types

using Base = maia::container::Container< HElementCollector< nDim, SysEqn >, Invalid >
 
template<class T >
using Storage = typename Base::template Storage< T >
 

Private Member Functions

void reset ()
 Reset HElementCollector, re-create data structures. More...
 
void invalidate (const MInt begin, const MInt end)
 Erase range of nodes such that they contain no sensible values anymore. More...
 
template<class Functor , class T >
void rawCopyGeneric (Functor &&c, const T &source, const MInt begin, const MInt end, const MInt destination)
 Helper function for rawCopy(). Destination may refer to beginning or end of target range. More...
 

Private Attributes

Storage< MIntm_elementId {}
 
Storage< MIntm_hrefSurfaceIds {}
 

Friends

class maia::container::Container< HElementCollector< nDim, SysEqn >, Invalid >
 

Additional Inherited Members

- Protected Types inherited from maia::container::Container< HElementCollector< nDim, SysEqn >, Invalid >
using Storage = std::vector< T >
 
- Protected Member Functions inherited from maia::container::Container< HElementCollector< nDim, SysEqn >, Invalid >
virtual void resize ()
 
void resetStorage (const MInt n, Storage< T > &c)
 Create new container with given size and replace original one. More...
 
void resizeStorage (const MInt n, Storage< T > &c)
 Resize container with given size. More...
 
void fill_invalid (Container_ &c, const MInt begin, const MInt end, const MInt solverSize=1, const T value=Invalid< T >::value())
 
void copyData (const Container_ &source, Container_ &target, Functor &&f, const MInt begin, const MInt end, const MInt dest, const MInt solverSize=1)
 Copy [begin, end) range with given solver size from source to dest position of target. More...
 
MBool isValidId (const MInt id) const
 Return whether given id refers to a valid node (auxiliary method). More...
 

Detailed Description

template<MInt nDim, class SysEqn>
class maia::dg::collector::HElementCollector< nDim, SysEqn >

Definition at line 62 of file dgcartesianhelementcollector.h.

Member Typedef Documentation

◆ Base

template<MInt nDim, class SysEqn >
using maia::dg::collector::HElementCollector< nDim, SysEqn >::Base = maia::container::Container<HElementCollector<nDim, SysEqn>, Invalid>
private

Definition at line 67 of file dgcartesianhelementcollector.h.

◆ Invalid

template<MInt nDim, class SysEqn >
template<class T >
using maia::dg::collector::HElementCollector< nDim, SysEqn >::Invalid = typename maia::dg::collector::Invalid<T>

Definition at line 76 of file dgcartesianhelementcollector.h.

◆ Storage

template<MInt nDim, class SysEqn >
template<class T >
using maia::dg::collector::HElementCollector< nDim, SysEqn >::Storage = typename Base::template Storage<T>
private

Definition at line 70 of file dgcartesianhelementcollector.h.

Constructor & Destructor Documentation

◆ HElementCollector()

template<MInt nDim, class SysEqn >
constexpr maia::dg::collector::HElementCollector< nDim, SysEqn >::HElementCollector ( )
constexprdefault

Member Function Documentation

◆ elementId() [1/2]

template<MInt nDim, class SysEqn >
MInt & maia::dg::collector::HElementCollector< nDim, SysEqn >::elementId ( const MInt  id)

Definition at line 125 of file dgcartesianhelementcollector.h.

125 {
126// Prevent accidental compilation without support for SoA layout
127#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
128#error Missing implementation for structure-of-arrays memory layout.
129#endif
130 ENSURE_VALID_ID_ACCESSOR(id);
131 return m_elementId[id];
132}
MInt id
Definition: maiatypes.h:71

◆ elementId() [2/2]

template<MInt nDim, class SysEqn >
MInt maia::dg::collector::HElementCollector< nDim, SysEqn >::elementId ( const MInt  id) const

Definition at line 135 of file dgcartesianhelementcollector.h.

135 {
136// Prevent accidental compilation without support for SoA layout
137#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
138#error Missing implementation for structure-of-arrays memory layout.
139#endif
140 ENSURE_VALID_ID_ACCESSOR(id);
141 return m_elementId[id];
142}

◆ hrefSurfaceIds() [1/2]

template<MInt nDim, class SysEqn >
MInt & maia::dg::collector::HElementCollector< nDim, SysEqn >::hrefSurfaceIds ( const MInt  id,
const MInt  dir,
const MInt  pos 
)

Definition at line 147 of file dgcartesianhelementcollector.h.

147 {
148// Prevent accidental compilation without support for SoA layout
149#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
150#error Missing implementation for structure-of-arrays memory layout.
151#endif
152 ENSURE_VALID_ID_ACCESSOR(id);
153 ENSURE_VALID_SURFACE_DIR_ACCESSOR(dir);
154 ENSURE_VALID_SURFACE_POS_ACCESSOR(pos);
155 return m_hrefSurfaceIds[id * noHrefSurfaceIds() + dir * noHrefSurfaces() + pos];
156}
static constexpr MInt noHrefSurfaces()
Return number of h-refined surfaces.

◆ hrefSurfaceIds() [2/2]

template<MInt nDim, class SysEqn >
MInt maia::dg::collector::HElementCollector< nDim, SysEqn >::hrefSurfaceIds ( const MInt  id,
const MInt  dir,
const MInt  pos 
) const

Definition at line 159 of file dgcartesianhelementcollector.h.

159 {
160// Prevent accidental compilation without support for SoA layout
161#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
162#error Missing implementation for structure-of-arrays memory layout.
163#endif
164 ENSURE_VALID_ID_ACCESSOR(id * noHrefSurfaceIds());
165 ENSURE_VALID_SURFACE_DIR_ACCESSOR(dir);
166 ENSURE_VALID_SURFACE_POS_ACCESSOR(pos);
167 return m_hrefSurfaceIds[id * noHrefSurfaceIds() + dir * noHrefSurfaces() + pos];
168}

◆ invalidate()

template<MInt nDim, class SysEqn >
void maia::dg::collector::HElementCollector< nDim, SysEqn >::invalidate ( const MInt  begin,
const MInt  end 
)
private

Definition at line 173 of file dgcartesianhelementcollector.h.

173 {
174// Prevent accidental compilation without support for SoA layout
175#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
176#error Missing implementation for structure-of-arrays memory layout.
177#endif
178
179 // Element id
180 fill_invalid(m_elementId, begin, end);
181
182 // H-refined surface ids
184}
void fill_invalid(Container_ &c, const MInt begin, const MInt end, const MInt solverSize=1, const T value=Invalid< T >::value())
Definition: container.h:131

◆ noDirs()

template<MInt nDim, class SysEqn >
static constexpr MInt maia::dg::collector::HElementCollector< nDim, SysEqn >::noDirs ( )
inlinestaticconstexpr

Definition at line 97 of file dgcartesianhelementcollector.h.

97{ return 2 * nDim; }

◆ noHrefSurfaceIds()

template<MInt nDim, class SysEqn >
static constexpr MInt maia::dg::collector::HElementCollector< nDim, SysEqn >::noHrefSurfaceIds ( )
inlinestaticconstexpr

Definition at line 100 of file dgcartesianhelementcollector.h.

100{ return noHrefSurfaces() * noDirs(); }
static constexpr MInt noDirs()
Return number of directions.

◆ noHrefSurfaces()

template<MInt nDim, class SysEqn >
static constexpr MInt maia::dg::collector::HElementCollector< nDim, SysEqn >::noHrefSurfaces ( )
inlinestaticconstexpr

Definition at line 94 of file dgcartesianhelementcollector.h.

94{ return 2 * (nDim - 1); }

◆ rawCopyGeneric()

template<MInt nDim, class SysEqn >
template<class Functor , class T >
void maia::dg::collector::HElementCollector< nDim, SysEqn >::rawCopyGeneric ( Functor &&  c,
const T &  source,
const MInt  begin,
const MInt  end,
const MInt  destination 
)
private

Definition at line 190 of file dgcartesianhelementcollector.h.

191 {
192// Prevent accidental compilation without support for SoA layout
193#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
194#error Missing implementation for structure-of-arrays memory layout.
195#endif
196
197 // Element id
198 copyData(source.m_elementId, m_elementId, c, begin, end, destination);
199
200 // H-refined surface ids
201 copyData(source.m_hrefSurfaceIds, m_hrefSurfaceIds, c, begin, end, destination, noHrefSurfaceIds());
202}
void copyData(const Container_ &source, Container_ &target, Functor &&f, const MInt begin, const MInt end, const MInt dest, const MInt solverSize=1)
Copy [begin, end) range with given solver size from source to dest position of target.
Definition: container.h:138

◆ reset()

template<MInt nDim, class SysEqn >
void maia::dg::collector::HElementCollector< nDim, SysEqn >::reset
private

Definition at line 117 of file dgcartesianhelementcollector.h.

117 {
120}
void resetStorage(const MInt n, Storage< T > &c)
Create new container with given size and replace original one.
Definition: container.h:420

Friends And Related Function Documentation

◆ maia::container::Container< HElementCollector< nDim, SysEqn >, Invalid >

template<MInt nDim, class SysEqn >
friend class maia::container::Container< HElementCollector< nDim, SysEqn >, Invalid >
friend

Definition at line 190 of file dgcartesianhelementcollector.h.

Member Data Documentation

◆ m_elementId

template<MInt nDim, class SysEqn >
Storage<MInt> maia::dg::collector::HElementCollector< nDim, SysEqn >::m_elementId {}
private

Definition at line 110 of file dgcartesianhelementcollector.h.

◆ m_hrefSurfaceIds

template<MInt nDim, class SysEqn >
Storage<MInt> maia::dg::collector::HElementCollector< nDim, SysEqn >::m_hrefSurfaceIds {}
private

Definition at line 111 of file dgcartesianhelementcollector.h.


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