MAIA bb96820c
Multiphysics at AIA
|
#include <container.h>
Classes | |
struct | Copy |
Public Member Functions | |
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 () |
template<class T > | |
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... | |
template<class T > | |
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... | |
Derived & | derived () |
const Derived & | derived () const |
template<class T > | |
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... | |
template<class T > | |
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 |
Protected Types | |
template<class T > | |
using | Storage = std::vector< T > |
Protected Member Functions | |
template<class T > | |
void | resetStorage (const MInt n, Storage< T > &c) |
Create new container with given size and replace original one. More... | |
template<class T > | |
void | resizeStorage (const MInt n, Storage< T > &c) |
Resize container with given size. More... | |
virtual void | resize () |
template<typename Container_ , typename T = typename Container_::value_type> | |
void | fill_invalid (Container_ &c, const MInt begin, const MInt end, const MInt solverSize=1, const T value=Invalid< T >::value()) |
template<typename Container_ , typename Functor > | |
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... | |
Private Attributes | |
MInt | m_capacity = 0 |
MInt | m_size = 0 |
Base class for collector-like containers.
To use this as a base class for a specific container type, a derived class must implement the following:
Definition at line 77 of file container.h.
|
protected |
Definition at line 121 of file container.h.
|
constexprdefault |
|
inline |
Definition at line 94 of file container.h.
void maia::container::Container< Derived, Invalid >::append | ( | const MInt | count | ) |
Definition at line 223 of file container.h.
|
inlineconstexpr |
Definition at line 85 of file container.h.
void maia::container::Container< Derived, Invalid >::clear |
Definition at line 395 of file container.h.
|
inline |
Definition at line 103 of file container.h.
|
inline |
Definition at line 104 of file container.h.
void maia::container::Container< Derived, Invalid >::copy | ( | const T & | source, |
const MInt | begin, | ||
const MInt | end, | ||
const MInt | to | ||
) |
Definition at line 253 of file container.h.
|
inline |
Definition at line 100 of file container.h.
|
inlineprotected |
Definition at line 138 of file container.h.
|
inline |
Definition at line 169 of file container.h.
|
inline |
Definition at line 146 of file container.h.
|
inline |
Definition at line 147 of file container.h.
|
inlineconstexpr |
Definition at line 172 of file container.h.
void maia::container::Container< Derived, Invalid >::erase | ( | const MInt | begin, |
const MInt | end | ||
) |
Definition at line 335 of file container.h.
|
inline |
Definition at line 111 of file container.h.
|
inlineprotected |
Definition at line 131 of file container.h.
void maia::container::Container< Derived, Invalid >::insert | ( | const MInt | id, |
const MInt | count | ||
) |
Insert 'count' nodes and push back existing nodes while updating parent/child/neighbor information.
Definition at line 318 of file container.h.
|
inline |
Definition at line 109 of file container.h.
|
protected |
Definition at line 443 of file container.h.
void maia::container::Container< Derived, Invalid >::move | ( | const MInt | begin, |
const MInt | end, | ||
const MInt | to | ||
) |
Definition at line 270 of file container.h.
|
inline |
Definition at line 106 of file container.h.
|
inline |
Definition at line 171 of file container.h.
|
inline |
Definition at line 170 of file container.h.
void maia::container::Container< Derived, Invalid >::rawCopy | ( | const T & | source, |
const MInt | begin, | ||
const MInt | end, | ||
const MInt | to | ||
) |
Definition at line 404 of file container.h.
|
inline |
Definition at line 166 of file container.h.
void maia::container::Container< Derived, Invalid >::removeAndFill | ( | const MInt | begin, |
const MInt | end | ||
) |
Remove nodes in range [begin, end) and fill gap with nodes from end while updating parent/child/neighbor information.
Definition at line 374 of file container.h.
|
inline |
Definition at line 115 of file container.h.
void maia::container::Container< Derived, Invalid >::removeAndShift | ( | const MInt | begin, |
const MInt | end | ||
) |
Remove nodes in range [begin, end) and pull forward existing nodes while updating parent/child/neighbor information.
Definition at line 352 of file container.h.
|
inline |
Definition at line 113 of file container.h.
void maia::container::Container< Derived, Invalid >::reset | ( | const MInt | capacity | ) |
Definition at line 187 of file container.h.
|
protected |
Definition at line 420 of file container.h.
|
inlineprotectedvirtual |
Reimplemented in maia::acoustic_analogy::collector::SurfaceDataCollector< nDim >, maia::fv::collector::FvCellCollector< nDim >, and maia::fv::surface_collector::FvSurfaceCollector< nDim >.
Definition at line 127 of file container.h.
void maia::container::Container< Derived, Invalid >::resize | ( | const MInt | capacity | ) |
Definition at line 199 of file container.h.
|
protected |
Definition at line 436 of file container.h.
|
inline |
Definition at line 96 of file container.h.
void maia::container::Container< Derived, Invalid >::shrink | ( | const MInt | count | ) |
Definition at line 242 of file container.h.
|
inlineconstexpr |
Definition at line 89 of file container.h.
void maia::container::Container< Derived, Invalid >::size | ( | const MInt | size_ | ) |
Definition at line 213 of file container.h.
void maia::container::Container< Derived, Invalid >::swap | ( | const MInt | a, |
const MInt | b | ||
) |
Definition at line 289 of file container.h.
|
private |
Definition at line 180 of file container.h.
|
private |
Definition at line 181 of file container.h.