MAIA bb96820c
Multiphysics at AIA
|
Class that represents grid tree and contains all relevant per-node data. More...
#include <cartesiangridtree.h>
Public Types | |
template<class T > | |
using | Invalid = typename maia::grid::tree::Invalid< T > |
using | Cell = maia::grid::tree::Cell |
using | PropertyBitsetType = maia::grid::tree::PropertyBitsetType |
using | SolverBitsetType = maia::grid::tree::SolverBitsetType |
Public Member Functions | |
constexpr | Tree ()=default |
Default c'tor does nothing. More... | |
MLong & | parent (const MInt id) |
Accessor for parent node. More... | |
MLong | parent (const MInt id) const |
Accessor for parent node (const version). More... | |
MBool | hasParent (const MInt id) const |
Return whether node has parent. More... | |
MLong & | child (const MInt id, const MInt pos) |
Accessor for child node. More... | |
MLong | child (const MInt id, const MInt pos) const |
Accessor for child node (const version). More... | |
MBool | hasChild (const MInt id, const MInt pos) const |
Return whether node has child at given position. More... | |
MBool | hasChildren (const MInt id) const |
Return whether node has any children. More... | |
MBool | hasChildren (const MInt id, const MInt solverId) const |
Return whether node has any children living on the specified solver (Lennart). More... | |
MInt | noChildren (const MInt id) const |
Return number of children of given node. More... | |
MLong & | neighbor (const MInt id, const MInt dir) |
Accessor for neighbor node. More... | |
MLong | neighbor (const MInt id, const MInt dir) const |
Accessor for neighbor node (const version). More... | |
MBool | hasNeighbor (const MInt id, const MInt dir) const |
Return whether node has same-level neighbor in given direction. More... | |
MBool | hasAnyNeighbor (const MInt id, const MInt dir) const |
Return whether node or its parent has neighbor in given direction. More... | |
MLong & | globalId (const MInt id) |
Accessor for global id. More... | |
MLong | globalId (const MInt id) const |
Accessor for global id (const version). More... | |
MInt & | level (const MInt id) |
Accessor for level. More... | |
MInt | level (const MInt id) const |
Accessor for level (const version). More... | |
MFloat & | coordinate (const MInt id, const MInt dim) |
Accessor for coordinates. More... | |
MFloat | coordinate (const MInt id, const MInt dim) const |
Accessor for coordinates (const version). More... | |
const MFloat * | coordinate (const MInt id) const |
MFloat & | weight (const MInt id) |
Accessor for weight. More... | |
MFloat | weight (const MInt id) const |
Accessor for weight (const version). More... | |
SolverBitsetType::reference | solver (const MInt id, const MInt solverId) |
Accessor for solver usage. More... | |
MBool | solver (const MInt id, const MInt solverId) const |
Accessor for solver usage (const version). More... | |
void | resetSolver (const MInt id) |
Reset all solver use. More... | |
MUlong | solverToBits (const MInt id) const |
Convert solver usage to bits. More... | |
void | solverFromBits (const MInt id, const MUlong bits) |
Convert solver usage from bits. More... | |
MBool | cellHasSolver (const MInt cellId, const MInt solverId) |
Check if solver is contained for cell. More... | |
SolverBitsetType & | solverBits (const MInt id) |
Accessor for properties. More... | |
MBool | isLeafCell (const MInt id) const |
Accessor for isLeafCell usage (const version). More... | |
SolverBitsetType::reference | isLeafCell (const MInt id, const MInt solverId) |
Accessor for isLeafCell usage. More... | |
MBool | isLeafCell (const MInt id, const MInt solverId) const |
Accessor for isLeafCell usage (const version). More... | |
void | resetIsLeafCell (const MInt id) |
Reset all isLeafCell. More... | |
SolverBitsetType & | leafCellBits (const MInt id) |
Accessor for properties. More... | |
PropertyBitsetType::reference | hasProperty (const MInt id, const Cell p) |
Accessor for properties. More... | |
MBool | hasProperty (const MInt id, const Cell p) const |
Accessor for properties (const version). More... | |
void | resetProperties (const MInt id) |
Reset all properties. More... | |
MUlong | propertiesToBits (const MInt id) const |
Convert properties to bits. More... | |
void | propertiesFromBits (const MInt id, const MUlong bits) |
Convert properties from bits. More... | |
MString | propertiesToString (const MInt id) const |
Convert properties to string. More... | |
PropertyBitsetType & | properties (const MInt id) |
Accessor for properties. More... | |
MInt & | noOffsprings (const MInt id) |
Accessor for noOffsprings. More... | |
MInt | noOffsprings (const MInt id) const |
Accessor for noOffsprings (const version). More... | |
MFloat & | workload (const MInt id) |
Accessor for workload. More... | |
MFloat | workload (const MInt id) const |
Accessor for workload (const version). More... | |
constexpr MInt | noSolvers () const |
Return currently set number of solvers. More... | |
void | setNoSolvers (const MInt count) |
Set number of solvers. More... | |
MInt | noNodesBySolver (const MInt solverId) const |
Return number of nodes for a given solver. More... | |
MInt | nodesBySolver (const MInt solverId, MInt *const ids) const |
Generate list of node ids that are used by a given solver and return number of used nodes. More... | |
MInt | capacity () |
Public Member Functions inherited from maia::container::Container< Tree< nDim >, maia::grid::tree::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... | |
Tree< nDim > & | derived () |
const Tree< nDim > & | 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 | noChildrenPerNode () |
Return maximum number of children per node. More... | |
static constexpr MInt | noNeighborsPerNode () |
Return maximum number of same-level neighbors per node. More... | |
static constexpr MInt | oppositeNeighborDir (const MInt dir) |
Return opposite direction for given neighbor direction. More... | |
static constexpr MInt | noProperties () |
Return number of properties defined for each node. More... | |
static constexpr MInt | maxNoSolvers () |
Return maximum number of supported solvers. More... | |
Private Types | |
using | Base = maia::container::Container< Tree< nDim >, maia::grid::tree::Invalid > |
template<class T > | |
using | Storage = typename Base::template Storage< T > |
Private Member Functions | |
void | reset () |
Reset tree, re-create data structures with given capacity, and set size to zero. 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... | |
void | deleteConnectivity (const MInt begin, const MInt end) |
Update parent/children/neighbors before nodes are erased. More... | |
void | moveConnectivity (const MInt begin, const MInt end, const MInt to) |
Update parent/children/neighbors after nodes have moved. More... | |
Private Attributes | |
Storage< MLong > | m_parentIds {} |
Storage< MLong > | m_childIds {} |
Storage< MLong > | m_neighborIds {} |
Storage< MLong > | m_globalIds {} |
Storage< MInt > | m_levels {} |
Storage< MFloat > | m_coordinates {} |
Storage< MFloat > | m_weight {} |
Storage< SolverBitsetType > | m_solver {} |
Storage< SolverBitsetType > | m_isLeafCell {} |
Storage< PropertyBitsetType > | m_properties {} |
Storage< MInt > | m_noOffsprings {} |
Storage< MFloat > | m_workload {} |
MInt | m_noSolvers = -1 |
Number of solvers that are actively using this tree. More... | |
Friends | |
class | maia::container::Container< Tree< nDim >, maia::grid::tree::Invalid > |
Additional Inherited Members | |
Protected Types inherited from maia::container::Container< Tree< nDim >, maia::grid::tree::Invalid > | |
using | Storage = std::vector< T > |
Protected Member Functions inherited from maia::container::Container< Tree< nDim >, maia::grid::tree::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=maia::grid::tree::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... | |
Definition at line 178 of file cartesiangridtree.h.
|
private |
Definition at line 183 of file cartesiangridtree.h.
using maia::grid::tree::Tree< nDim >::Cell = maia::grid::tree::Cell |
Definition at line 193 of file cartesiangridtree.h.
using maia::grid::tree::Tree< nDim >::Invalid = typename maia::grid::tree::Invalid<T> |
Definition at line 192 of file cartesiangridtree.h.
using maia::grid::tree::Tree< nDim >::PropertyBitsetType = maia::grid::tree::PropertyBitsetType |
Definition at line 194 of file cartesiangridtree.h.
using maia::grid::tree::Tree< nDim >::SolverBitsetType = maia::grid::tree::SolverBitsetType |
Definition at line 195 of file cartesiangridtree.h.
|
private |
Definition at line 186 of file cartesiangridtree.h.
|
constexprdefault |
|
inline |
Definition at line 287 of file cartesiangridtree.h.
MBool maia::grid::tree::Tree< nDim >::cellHasSolver | ( | const MInt | cellId, |
const MInt | solverId | ||
) |
Definition at line 605 of file cartesiangridtree.h.
MLong & maia::grid::tree::Tree< nDim >::child | ( | const MInt | id, |
const MInt | pos | ||
) |
Definition at line 359 of file cartesiangridtree.h.
MLong maia::grid::tree::Tree< nDim >::child | ( | const MInt | id, |
const MInt | pos | ||
) | const |
Definition at line 370 of file cartesiangridtree.h.
const MFloat * maia::grid::tree::Tree< nDim >::coordinate | ( | const MInt | id | ) | const |
Definition at line 519 of file cartesiangridtree.h.
MFloat & maia::grid::tree::Tree< nDim >::coordinate | ( | const MInt | id, |
const MInt | dim | ||
) |
Definition at line 497 of file cartesiangridtree.h.
MFloat maia::grid::tree::Tree< nDim >::coordinate | ( | const MInt | id, |
const MInt | dim | ||
) | const |
Definition at line 508 of file cartesiangridtree.h.
|
private |
Definition at line 846 of file cartesiangridtree.h.
MLong & maia::grid::tree::Tree< nDim >::globalId | ( | const MInt | id | ) |
Definition at line 469 of file cartesiangridtree.h.
MLong maia::grid::tree::Tree< nDim >::globalId | ( | const MInt | id | ) | const |
Definition at line 475 of file cartesiangridtree.h.
MBool maia::grid::tree::Tree< nDim >::hasAnyNeighbor | ( | const MInt | id, |
const MInt | dir | ||
) | const |
Definition at line 460 of file cartesiangridtree.h.
MBool maia::grid::tree::Tree< nDim >::hasChild | ( | const MInt | id, |
const MInt | pos | ||
) | const |
Definition at line 383 of file cartesiangridtree.h.
MBool maia::grid::tree::Tree< nDim >::hasChildren | ( | const MInt | id | ) | const |
Definition at line 396 of file cartesiangridtree.h.
MBool maia::grid::tree::Tree< nDim >::hasChildren | ( | const MInt | id, |
const MInt | solverId | ||
) | const |
Definition at line 403 of file cartesiangridtree.h.
MBool maia::grid::tree::Tree< nDim >::hasNeighbor | ( | const MInt | id, |
const MInt | dir | ||
) | const |
Definition at line 449 of file cartesiangridtree.h.
MBool maia::grid::tree::Tree< nDim >::hasParent | ( | const MInt | id | ) | const |
Definition at line 351 of file cartesiangridtree.h.
Tree< nDim >::PropertyBitsetType::reference maia::grid::tree::Tree< nDim >::hasProperty | ( | const MInt | id, |
const Cell | p | ||
) |
Definition at line 653 of file cartesiangridtree.h.
MBool maia::grid::tree::Tree< nDim >::hasProperty | ( | const MInt | id, |
const Cell | p | ||
) | const |
Definition at line 660 of file cartesiangridtree.h.
|
private |
Definition at line 753 of file cartesiangridtree.h.
MBool maia::grid::tree::Tree< nDim >::isLeafCell | ( | const MInt | id | ) | const |
Definition at line 618 of file cartesiangridtree.h.
Tree< nDim >::SolverBitsetType::reference maia::grid::tree::Tree< nDim >::isLeafCell | ( | const MInt | id, |
const MInt | solverId | ||
) |
Definition at line 624 of file cartesiangridtree.h.
MBool maia::grid::tree::Tree< nDim >::isLeafCell | ( | const MInt | id, |
const MInt | solverId | ||
) | const |
Definition at line 632 of file cartesiangridtree.h.
SolverBitsetType & maia::grid::tree::Tree< nDim >::leafCellBits | ( | const MInt | id | ) |
Definition at line 646 of file cartesiangridtree.h.
MInt & maia::grid::tree::Tree< nDim >::level | ( | const MInt | id | ) |
Definition at line 483 of file cartesiangridtree.h.
MInt maia::grid::tree::Tree< nDim >::level | ( | const MInt | id | ) | const |
Definition at line 489 of file cartesiangridtree.h.
|
inlinestaticconstexpr |
Definition at line 275 of file cartesiangridtree.h.
|
private |
Definition at line 877 of file cartesiangridtree.h.
MLong & maia::grid::tree::Tree< nDim >::neighbor | ( | const MInt | id, |
const MInt | dir | ||
) |
Definition at line 425 of file cartesiangridtree.h.
MLong maia::grid::tree::Tree< nDim >::neighbor | ( | const MInt | id, |
const MInt | dir | ||
) | const |
Definition at line 436 of file cartesiangridtree.h.
MInt maia::grid::tree::Tree< nDim >::noChildren | ( | const MInt | id | ) | const |
Definition at line 411 of file cartesiangridtree.h.
|
inlinestaticconstexpr |
Definition at line 264 of file cartesiangridtree.h.
MInt maia::grid::tree::Tree< nDim >::nodesBySolver | ( | const MInt | solverId, |
MInt *const | ids | ||
) | const |
Definition at line 727 of file cartesiangridtree.h.
|
inlinestaticconstexpr |
Definition at line 266 of file cartesiangridtree.h.
MInt maia::grid::tree::Tree< nDim >::noNodesBySolver | ( | const MInt | solverId | ) | const |
Definition at line 709 of file cartesiangridtree.h.
MInt & maia::grid::tree::Tree< nDim >::noOffsprings | ( | const MInt | id | ) |
Definition at line 545 of file cartesiangridtree.h.
MInt maia::grid::tree::Tree< nDim >::noOffsprings | ( | const MInt | id | ) | const |
Definition at line 551 of file cartesiangridtree.h.
|
inlinestaticconstexpr |
Definition at line 272 of file cartesiangridtree.h.
|
inlineconstexpr |
Definition at line 279 of file cartesiangridtree.h.
|
inlinestaticconstexpr |
Definition at line 269 of file cartesiangridtree.h.
MLong & maia::grid::tree::Tree< nDim >::parent | ( | const MInt | id | ) |
Definition at line 337 of file cartesiangridtree.h.
MLong maia::grid::tree::Tree< nDim >::parent | ( | const MInt | id | ) | const |
Definition at line 343 of file cartesiangridtree.h.
PropertyBitsetType & maia::grid::tree::Tree< nDim >::properties | ( | const MInt | id | ) |
Definition at line 691 of file cartesiangridtree.h.
void maia::grid::tree::Tree< nDim >::propertiesFromBits | ( | const MInt | id, |
const MUlong | bits | ||
) |
Definition at line 679 of file cartesiangridtree.h.
MUlong maia::grid::tree::Tree< nDim >::propertiesToBits | ( | const MInt | id | ) | const |
Definition at line 673 of file cartesiangridtree.h.
MString maia::grid::tree::Tree< nDim >::propertiesToString | ( | const MInt | id | ) | const |
Definition at line 685 of file cartesiangridtree.h.
|
private |
Definition at line 800 of file cartesiangridtree.h.
|
private |
Definition at line 319 of file cartesiangridtree.h.
void maia::grid::tree::Tree< nDim >::resetIsLeafCell | ( | const MInt | id | ) |
Definition at line 640 of file cartesiangridtree.h.
void maia::grid::tree::Tree< nDim >::resetProperties | ( | const MInt | id | ) |
Definition at line 667 of file cartesiangridtree.h.
void maia::grid::tree::Tree< nDim >::resetSolver | ( | const MInt | id | ) |
Definition at line 587 of file cartesiangridtree.h.
void maia::grid::tree::Tree< nDim >::setNoSolvers | ( | const MInt | count | ) |
Definition at line 699 of file cartesiangridtree.h.
Tree< nDim >::SolverBitsetType::reference maia::grid::tree::Tree< nDim >::solver | ( | const MInt | id, |
const MInt | solverId | ||
) |
Definition at line 573 of file cartesiangridtree.h.
MBool maia::grid::tree::Tree< nDim >::solver | ( | const MInt | id, |
const MInt | solverId | ||
) | const |
Definition at line 580 of file cartesiangridtree.h.
SolverBitsetType & maia::grid::tree::Tree< nDim >::solverBits | ( | const MInt | id | ) |
Definition at line 610 of file cartesiangridtree.h.
void maia::grid::tree::Tree< nDim >::solverFromBits | ( | const MInt | id, |
const MUlong | bits | ||
) |
Definition at line 599 of file cartesiangridtree.h.
MUlong maia::grid::tree::Tree< nDim >::solverToBits | ( | const MInt | id | ) | const |
Definition at line 593 of file cartesiangridtree.h.
MFloat & maia::grid::tree::Tree< nDim >::weight | ( | const MInt | id | ) |
Definition at line 531 of file cartesiangridtree.h.
MFloat maia::grid::tree::Tree< nDim >::weight | ( | const MInt | id | ) | const |
Definition at line 537 of file cartesiangridtree.h.
MFloat & maia::grid::tree::Tree< nDim >::workload | ( | const MInt | id | ) |
Definition at line 559 of file cartesiangridtree.h.
MFloat maia::grid::tree::Tree< nDim >::workload | ( | const MInt | id | ) | const |
Definition at line 565 of file cartesiangridtree.h.
|
friend |
Definition at line 159 of file cartesiangridtree.h.
|
private |
Definition at line 300 of file cartesiangridtree.h.
|
private |
Definition at line 304 of file cartesiangridtree.h.
|
private |
Definition at line 302 of file cartesiangridtree.h.
|
private |
Definition at line 307 of file cartesiangridtree.h.
|
private |
Definition at line 303 of file cartesiangridtree.h.
|
private |
Definition at line 301 of file cartesiangridtree.h.
|
private |
Definition at line 309 of file cartesiangridtree.h.
|
private |
Definition at line 313 of file cartesiangridtree.h.
|
private |
Definition at line 299 of file cartesiangridtree.h.
|
private |
Definition at line 308 of file cartesiangridtree.h.
|
private |
Definition at line 306 of file cartesiangridtree.h.
|
private |
Definition at line 305 of file cartesiangridtree.h.
|
private |
Definition at line 310 of file cartesiangridtree.h.