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

Class that represents DG element collector. More...

#include <dgcartesianspongeelementcollector.h>

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

Public Types

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

Public Member Functions

constexpr SpongeElementCollector ()=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...
 
MFloatspongeEta (const MInt id)
 Accessor for sponge eta. More...
 
MFloat spongeEta (const MInt id, const MInt pos) const
 Accessor for sponge eta (const version). More...
 
MFloat spongeEta (const MInt id) const
 
MInt maxPolyDeg () const
 Return maximum polynomial degree. More...
 
MInt maxPolyDeg (const MInt maxPolyDeg_)
 Set maximum polynomial degree and update number of nodes in 2D/3D. More...
 
- Public Member Functions inherited from maia::container::Container< SpongeElementCollector< 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...
 
SpongeElementCollector< nDim, SysEqn > & derived ()
 
const SpongeElementCollector< 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
 

Private Types

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

Private Member Functions

constexpr MInt noNodesXD () const
 Return number of nodes in 2D/3D. More...
 
void reset ()
 Reset SpongeElementCollector, 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

MInt m_maxPolyDeg = -1
 Maximum polynomial degree. More...
 
MInt m_noNodesXD = -1
 Number of nodes in 2D/3D. More...
 
Storage< MIntm_elementId {}
 
Storage< MFloatm_spongeEta {}
 

Friends

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

Additional Inherited Members

- Protected Types inherited from maia::container::Container< SpongeElementCollector< nDim, SysEqn >, Invalid >
using Storage = std::vector< T >
 
- Protected Member Functions inherited from maia::container::Container< SpongeElementCollector< 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::SpongeElementCollector< nDim, SysEqn >

Definition at line 54 of file dgcartesianspongeelementcollector.h.

Member Typedef Documentation

◆ Base

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

Definition at line 59 of file dgcartesianspongeelementcollector.h.

◆ Invalid

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

Definition at line 70 of file dgcartesianspongeelementcollector.h.

◆ Storage

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

Definition at line 62 of file dgcartesianspongeelementcollector.h.

Constructor & Destructor Documentation

◆ SpongeElementCollector()

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

Member Function Documentation

◆ elementId() [1/2]

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

Definition at line 122 of file dgcartesianspongeelementcollector.h.

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

◆ elementId() [2/2]

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

Definition at line 132 of file dgcartesianspongeelementcollector.h.

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

◆ invalidate()

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

Definition at line 167 of file dgcartesianspongeelementcollector.h.

167 {
168// Prevent accidental compilation without support for SoA layout
169#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
170#error Missing implementation for structure-of-arrays memory layout.
171#endif
172
173 // Element id
174 fill_invalid(m_elementId, begin, end);
175
176 // Sponge eta
177 fill_invalid(m_spongeEta, begin, end, noNodesXD());
178}
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
constexpr MInt noNodesXD() const
Return number of nodes in 2D/3D.

◆ maxPolyDeg() [1/2]

template<MInt nDim, class SysEqn >
MInt maia::dg::collector::SpongeElementCollector< nDim, SysEqn >::maxPolyDeg ( ) const
inline

Definition at line 89 of file dgcartesianspongeelementcollector.h.

89{ return m_maxPolyDeg; }

◆ maxPolyDeg() [2/2]

template<MInt nDim, class SysEqn >
MInt maia::dg::collector::SpongeElementCollector< nDim, SysEqn >::maxPolyDeg ( const MInt  maxPolyDeg_)

Definition at line 201 of file dgcartesianspongeelementcollector.h.

201 {
202 const MInt oldMaxPolyDeg = m_maxPolyDeg;
203 m_maxPolyDeg = maxPolyDeg_;
204 m_noNodesXD = ipow(m_maxPolyDeg + 1, nDim);
205 return oldMaxPolyDeg;
206}
MInt ipow(MInt base, MInt exp)
Integer exponent function for non-negative exponents.
Definition: functions.h:317
int32_t MInt
Definition: maiatypes.h:62

◆ noNodesXD()

template<MInt nDim, class SysEqn >
constexpr MInt maia::dg::collector::SpongeElementCollector< nDim, SysEqn >::noNodesXD ( ) const
inlineconstexprprivate

Definition at line 65 of file dgcartesianspongeelementcollector.h.

65{ return m_noNodesXD; }

◆ rawCopyGeneric()

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

Definition at line 184 of file dgcartesianspongeelementcollector.h.

185 {
186// Prevent accidental compilation without support for SoA layout
187#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
188#error Missing implementation for structure-of-arrays memory layout.
189#endif
190
191 // Element id
192 copyData(source.m_elementId, m_elementId, c, begin, end, destination);
193
194 // Sponge eta
195 copyData(source.m_spongeEta, m_spongeEta, c, begin, end, destination, noNodesXD());
196}
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::SpongeElementCollector< nDim, SysEqn >::reset
private

Definition at line 114 of file dgcartesianspongeelementcollector.h.

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

◆ spongeEta() [1/3]

template<MInt nDim, class SysEqn >
MFloat & maia::dg::collector::SpongeElementCollector< nDim, SysEqn >::spongeEta ( const MInt  id)

Definition at line 144 of file dgcartesianspongeelementcollector.h.

144 {
145// Prevent accidental compilation without support for SoA layout
146#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
147#error Missing implementation for structure-of-arrays memory layout.
148#endif
149 ENSURE_VALID_ID_ACCESSOR(id);
150 return m_spongeEta[id * noNodesXD()];
151}

◆ spongeEta() [2/3]

template<MInt nDim, class SysEqn >
MFloat maia::dg::collector::SpongeElementCollector< nDim, SysEqn >::spongeEta ( const MInt  id) const
inline

Definition at line 86 of file dgcartesianspongeelementcollector.h.

86{ return spongeEta(id, 0); };
MFloat & spongeEta(const MInt id)
Accessor for sponge eta.

◆ spongeEta() [3/3]

template<MInt nDim, class SysEqn >
MFloat maia::dg::collector::SpongeElementCollector< nDim, SysEqn >::spongeEta ( const MInt  id,
const MInt  pos 
) const

Definition at line 154 of file dgcartesianspongeelementcollector.h.

154 {
155// Prevent accidental compilation without support for SoA layout
156#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
157#error Missing implementation for structure-of-arrays memory layout.
158#endif
159 ENSURE_VALID_ID_ACCESSOR(id);
160 ENSURE_VALID_NODE_ID_ACCESSOR(pos);
161 return m_spongeEta[id * noNodesXD() + pos];
162}

Friends And Related Function Documentation

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

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

Definition at line 201 of file dgcartesianspongeelementcollector.h.

Member Data Documentation

◆ m_elementId

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

Definition at line 107 of file dgcartesianspongeelementcollector.h.

◆ m_maxPolyDeg

template<MInt nDim, class SysEqn >
MInt maia::dg::collector::SpongeElementCollector< nDim, SysEqn >::m_maxPolyDeg = -1
private

Definition at line 101 of file dgcartesianspongeelementcollector.h.

◆ m_noNodesXD

template<MInt nDim, class SysEqn >
MInt maia::dg::collector::SpongeElementCollector< nDim, SysEqn >::m_noNodesXD = -1
private

Definition at line 104 of file dgcartesianspongeelementcollector.h.

◆ m_spongeEta

template<MInt nDim, class SysEqn >
Storage<MFloat> maia::dg::collector::SpongeElementCollector< nDim, SysEqn >::m_spongeEta {}
private

Definition at line 108 of file dgcartesianspongeelementcollector.h.


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