MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
dgcartesianelementcollector.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef DGELEMENTCOLLECTOR_H_
8#define DGELEMENTCOLLECTOR_H_
9
10#include <algorithm>
11#include <limits>
12#include <type_traits>
13#include <vector>
14#include "INCLUDE/maiamacro.h"
15#include "INCLUDE/maiatypes.h"
16#include "MEMORY/container.h"
17#include "UTIL/functions.h"
18#include "compiler_config.h"
19
20// The following macro enables the "Structure-of-Arrays" memory layout for multi-dimensional node
21// variables. This might be beneficial for GPU computations. Default is "Array-of-Structures".
22// Examples (for nodes nN with four children cM each)
23// Array-of-Structures (AOS): n0c0, n0c1, n0c2, n0c3, n1c0, n1c1, n1c2, n1c3, n2c0, n2c1, ...
24// Structure-of-Arrays (SOA): n0c0, n1c0, n2c0, n3c0, ..., n0c1, n1c1, n2c1, n3c1, ..., n0c2, ...
25// #define DGCOLLECTOR_SOA_MEMORY_LAYOUT
26
27// The macro 'DGCOLLECTOR_SANITY_CHECKS_ACCESSORS' enables (potentially very expensive) sanity
28// checks
29// for all accessors. It is enabled for build type "extra_debug".
30#ifdef MAIA_EXTRA_DEBUG
31#define DGCOLLECTOR_SANITY_CHECKS_ACCESSORS
32#endif
33
34// Sanity-checking macros for accessors
35#if defined(DGCOLLECTOR_SANITY_CHECKS_ACCESSORS) || defined(MAIA_ASSERT_ACCESSORS)
36#define ENSURE_VALID_ID_ACCESSOR(id) \
37 do { \
38 MAIA_CONTAINER_ENSURE_VALID_ID(id); \
39 } while(false)
40#define ENSURE_VALID_VARIABLE_ID_ACCESSOR(id) \
41 do { \
42 MAIA_CONTAINER_ENSURE( \
43 id >= 0 && id < noVars(), \
44 "variable id " + std::to_string(id) + " out-of-bounds [0, " + std::to_string(noVars()) + ")", AT_); \
45 } while(false)
46#define ENSURE_VALID_NODE_VARIABLE_ID_ACCESSOR(id) \
47 do { \
48 MAIA_CONTAINER_ENSURE( \
49 id >= 0 && id < noNodeVars(), \
50 "node variable id " + std::to_string(id) + " out-of-bounds [0, " + std::to_string(noNodeVars()) + ")", AT_); \
51 } while(false)
52#define ENSURE_VALID_SURFACE_ID_ACCESSOR(id) \
53 do { \
54 MAIA_CONTAINER_ENSURE(id >= 0 && id < noSurfaces(), \
55 "surface id " + std::to_string(id) + " out-of-bounds [0, " + std::to_string(noSurfaces()), \
56 AT_); \
57 } while(false)
58#define ENSURE_CONDITION(condition, message) \
59 do { \
60 MAIA_CONTAINER_ENSURE(condition, message, AT_); \
61 } while(false)
62#else
63#define ENSURE_VALID_ID_ACCESSOR(id) \
64 do { \
65 } while(false)
66#define ENSURE_VALID_VARIABLE_ID_ACCESSOR(id) \
67 do { \
68 } while(false)
69#define ENSURE_VALID_NODE_VARIABLE_ID_ACCESSOR(id) \
70 do { \
71 } while(false)
72#define ENSURE_VALID_SURFACE_ID_ACCESSOR(id) \
73 do { \
74 } while(false)
75#define ENSURE_CONDITION(condition, message) \
76 do { \
77 } while(false)
78#endif
79
80
82namespace maia {
83namespace dg {
84namespace collector {
85
86// Type traits for invalid values. These values are used to initialize/erase nodes
87template <class T>
88struct Invalid {};
89
90// Invalid value for ids is 'INT_MIN'
91template <>
92struct Invalid<MInt> {
93 static constexpr MInt value() { return std::numeric_limits<MInt>::min(); }
94};
95
96// Invalid value for longs is 'INT_MIN'
97template <>
98struct Invalid<MLong> {
99 static constexpr MLong value() { return std::numeric_limits<MLong>::min(); }
100};
101
102// Invalid value for floats is 'NaN'
103template <>
105 static constexpr MFloat value() {
106#ifdef MAIA_PGI_COMPILER
107 return std::numeric_limits<MFloat>::quiet_NaN();
108#else
109 return std::numeric_limits<MFloat>::signaling_NaN();
110#endif
111 }
112};
113
114
116template <MInt nDim, class SysEqn>
117class ElementCollector : public maia::container::Container<ElementCollector<nDim, SysEqn>, Invalid> {
118 // Necessary for CRTP
119 friend class maia::container::Container<ElementCollector<nDim, SysEqn>, Invalid>;
120
121 // Make base class functions known to use without this pointer
123 using Base::resetStorage;
124 template <class T>
125 using Storage = typename Base::template Storage<T>;
126
127 public:
128 // Types
129 template <class T>
131
132 // Constructor
134 constexpr ElementCollector() = default;
135
136 // Ensure that base class method is found when called from outside
137 using Base::copyData;
138 using Base::fill_invalid;
139 using Base::reset;
140
141 // Accessors
142 MInt& cellId(const MInt id);
143 MInt cellId(const MInt id) const;
144 MInt& polyDeg(const MInt id);
145 MInt polyDeg(const MInt id) const;
146 MInt noNodes1D(const MInt id) const;
147 MInt& noNodes1D(const MInt id);
148 MInt noNodesXD(const MInt id) const;
149 MInt& surfaceIds(const MInt id, const MInt dir);
150 MInt surfaceIds(const MInt id, const MInt dir) const;
151 MFloat& nodeCoordinates(const MInt id);
152 MFloat nodeCoordinates(const MInt id) const;
153 MFloat& variables(const MInt id, const MInt pos);
154 MFloat& variables(const MInt id) { return variables(id, 0); };
155 MFloat variables(const MInt id, const MInt pos) const;
156 MFloat variables(const MInt id) const { return variables(id, 0); };
157 MFloat& timeIntStorage(const MInt id);
158 MFloat timeIntStorage(const MInt id) const;
159 MFloat& nodeVars(const MInt id);
160 MFloat nodeVars(const MInt id) const;
161 MFloat& rightHandSide(const MInt id);
162 MFloat rightHandSide(const MInt id) const;
163 MFloat& externalSource(const MInt id);
164 MFloat externalSource(const MInt id) const;
165 MFloat& invJacobian(const MInt id);
166 MFloat invJacobian(const MInt id) const;
167
169 MInt maxPolyDeg() const { return m_maxPolyDeg; }
170 // Set maximum polynomial degree
171 MInt maxPolyDeg(const MInt maxPolyDeg_);
172
174 MInt maxNoNodes1D() const { return m_maxNoNodes1D; }
175 // Set maximum number of nodes 1D
176 void maxNoNodes1D(const MInt maxNoNodesDeg_);
178 MInt maxNoNodesXD() const { return m_maxNoNodesXD; }
179
180 // Set number of node variables
181 void noNodeVars(const MInt noNodeVars_) { m_noNodeVars = noNodeVars_; };
182
184 // constexpr MInt noNodes1D() const { return m_noNodes1D; }
185
187 // constexpr MInt noNodesXD() const { return m_noNodesXD; }
188
190 static constexpr MInt noVars() { return SysEqn::noVars(); }
191
193 constexpr MInt noNodeVars() const { return m_noNodeVars; }
194
196 static constexpr MInt noSurfaces() { return 2 * nDim; }
197
198 // Auxiliary methods
199 MInt getElementByCellId(const MInt cellId) const;
200 MInt getElementByCellId(const MInt first, const MInt last, const MInt cellId) const;
201
202 private:
203 // Methods required by base class for CRTP
204 void reset();
205 void invalidate(const MInt begin, const MInt end);
206 template <class Functor, class T>
207 void rawCopyGeneric(Functor&& c, const T& source, const MInt begin, const MInt end, const MInt destination);
208
211
214
217
218 // Number of node variables
220
221 // Data containers
233};
234
235
237template <MInt nDim, class SysEqn>
239 resetStorage(1, m_cellId);
240 resetStorage(1, m_polyDeg);
241 resetStorage(1, m_noNodes1D);
242 resetStorage(noSurfaces(), m_surfaceIds);
243 resetStorage(maxNoNodesXD() * nDim, m_nodeCoordinates);
244 resetStorage(maxNoNodesXD() * noVars(), m_variables);
245 resetStorage(maxNoNodesXD() * noVars(), m_timeIntStorage);
246 resetStorage(maxNoNodesXD() * noNodeVars(), m_nodeVariables);
247 resetStorage(maxNoNodesXD() * noVars(), m_rightHandSide);
248 resetStorage(maxNoNodesXD() * noVars(), m_externalSource);
249 resetStorage(1, m_invJacobian);
250}
251
252
254template <MInt nDim, class SysEqn>
256// Prevent accidental compilation without support for SoA layout
257#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
258#error Missing implementation for structure-of-arrays memory layout.
259#endif
260 ENSURE_VALID_ID_ACCESSOR(id);
261 return m_cellId[id];
262}
264template <MInt nDim, class SysEqn>
266// Prevent accidental compilation without support for SoA layout
267#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
268#error Missing implementation for structure-of-arrays memory layout.
269#endif
270 ENSURE_VALID_ID_ACCESSOR(id);
271 return m_cellId[id];
272}
273
274
276template <MInt nDim, class SysEqn>
278// Prevent accidental compilation without support for SoA layout
279#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
280#error Missing implementation for structure-of-arrays memory layout.
281#endif
282 ENSURE_VALID_ID_ACCESSOR(id);
283 return m_polyDeg[id];
284}
286template <MInt nDim, class SysEqn>
288// Prevent accidental compilation without support for SoA layout
289#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
290#error Missing implementation for structure-of-arrays memory layout.
291#endif
292 ENSURE_VALID_ID_ACCESSOR(id);
293 return m_polyDeg[id];
294}
295
297template <MInt nDim, class SysEqn>
299// Prevent accidental compilation without support for SoA layout
300#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
301#error Missing implementation for structure-of-arrays memory layout.
302#endif
303 ENSURE_VALID_ID_ACCESSOR(id);
304 return m_noNodes1D[id];
305}
306
308template <MInt nDim, class SysEqn>
310// Prevent accidental compilation without support for SoA layout
311#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
312#error Missing implementation for structure-of-arrays memory layout.
313#endif
314 ENSURE_VALID_ID_ACCESSOR(id);
315 return m_noNodes1D[id];
316}
317
319template <MInt nDim, class SysEqn>
321// Prevent accidental compilation without support for SoA layout
322#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
323#error Missing implementation for structure-of-arrays memory layout.
324#endif
325 ENSURE_VALID_ID_ACCESSOR(id);
326 return ipow(m_noNodes1D[id], nDim);
327}
328
330template <MInt nDim, class SysEqn>
332// Prevent accidental compilation without support for SoA layout
333#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
334#error Missing implementation for structure-of-arrays memory layout.
335#endif
336 ENSURE_VALID_ID_ACCESSOR(id);
337 ENSURE_VALID_SURFACE_ID_ACCESSOR(dir);
338 return m_surfaceIds[id * noSurfaces() + dir];
339}
341template <MInt nDim, class SysEqn>
343// Prevent accidental compilation without support for SoA layout
344#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
345#error Missing implementation for structure-of-arrays memory layout.
346#endif
347 ENSURE_VALID_ID_ACCESSOR(id);
348 ENSURE_VALID_SURFACE_ID_ACCESSOR(dir);
349 return m_surfaceIds[id * noSurfaces() + dir];
350}
351
352
354template <MInt nDim, class SysEqn>
356// Prevent accidental compilation without support for SoA layout
357#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
358#error Missing implementation for structure-of-arrays memory layout.
359#endif
360 ENSURE_VALID_ID_ACCESSOR(id);
361 return m_nodeCoordinates[id * nDim * maxNoNodesXD()];
362}
364template <MInt nDim, class SysEqn>
366// Prevent accidental compilation without support for SoA layout
367#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
368#error Missing implementation for structure-of-arrays memory layout.
369#endif
370 ENSURE_VALID_ID_ACCESSOR(id);
371 return m_nodeCoordinates[id * nDim * maxNoNodesXD()];
372}
373
374
376template <MInt nDim, class SysEqn>
378// Prevent accidental compilation without support for SoA layout
379#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
380#error Missing implementation for structure-of-arrays memory layout.
381#endif
382 ENSURE_VALID_ID_ACCESSOR(id);
383 ENSURE_CONDITION(pos >= 0 && pos < noVars() * maxNoNodesXD(), "Invalid position.");
384 return m_variables[id * noVars() * maxNoNodesXD() + pos];
385}
387template <MInt nDim, class SysEqn>
389// Prevent accidental compilation without support for SoA layout
390#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
391#error Missing implementation for structure-of-arrays memory layout.
392#endif
393 ENSURE_VALID_ID_ACCESSOR(id);
394 ENSURE_CONDITION(pos >= 0 && pos < noVars() * maxNoNodesXD(), "Invalid position.");
395 return m_variables[id * noVars() * maxNoNodesXD() + pos];
396}
397
398
400template <MInt nDim, class SysEqn>
402// Prevent accidental compilation without support for SoA layout
403#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
404#error Missing implementation for structure-of-arrays memory layout.
405#endif
406 ENSURE_VALID_ID_ACCESSOR(id);
407 return m_timeIntStorage[id * noVars() * maxNoNodesXD()];
408}
410template <MInt nDim, class SysEqn>
412// Prevent accidental compilation without support for SoA layout
413#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
414#error Missing implementation for structure-of-arrays memory layout.
415#endif
416 ENSURE_VALID_ID_ACCESSOR(id);
417 return m_timeIntStorage[id * noVars() * maxNoNodesXD()];
418}
419
420
422template <MInt nDim, class SysEqn>
424// Prevent accidental compilation without support for SoA layout
425#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
426#error Missing implementation for structure-of-arrays memory layout.
427#endif
428 ENSURE_VALID_ID_ACCESSOR(id);
429 return m_nodeVariables[id * noNodeVars() * maxNoNodesXD()];
430}
432template <MInt nDim, class SysEqn>
434// Prevent accidental compilation without support for SoA layout
435#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
436#error Missing implementation for structure-of-arrays memory layout.
437#endif
438 ENSURE_VALID_ID_ACCESSOR(id);
439 return m_nodeVariables[id * noNodeVars() * maxNoNodesXD()];
440}
441
442
444template <MInt nDim, class SysEqn>
446// Prevent accidental compilation without support for SoA layout
447#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
448#error Missing implementation for structure-of-arrays memory layout.
449#endif
450 ENSURE_VALID_ID_ACCESSOR(id);
451 return m_rightHandSide[id * noVars() * maxNoNodesXD()];
452}
454template <MInt nDim, class SysEqn>
456// Prevent accidental compilation without support for SoA layout
457#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
458#error Missing implementation for structure-of-arrays memory layout.
459#endif
460 ENSURE_VALID_ID_ACCESSOR(id);
461 return m_rightHandSide[id * noVars() * maxNoNodesXD()];
462}
463
464
466template <MInt nDim, class SysEqn>
468// Prevent accidental compilation without support for SoA layout
469#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
470#error Missing implementation for structure-of-arrays memory layout.
471#endif
472 ENSURE_VALID_ID_ACCESSOR(id);
473 return m_externalSource[id * noVars() * maxNoNodesXD()];
474}
476template <MInt nDim, class SysEqn>
478// Prevent accidental compilation without support for SoA layout
479#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
480#error Missing implementation for structure-of-arrays memory layout.
481#endif
482 ENSURE_VALID_ID_ACCESSOR(id);
483 return m_externalSource[id * noVars() * maxNoNodesXD()];
484}
485
486
488template <MInt nDim, class SysEqn>
490// Prevent accidental compilation without support for SoA layout
491#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
492#error Missing implementation for structure-of-arrays memory layout.
493#endif
494 ENSURE_VALID_ID_ACCESSOR(id);
495 return m_invJacobian[id];
496}
498template <MInt nDim, class SysEqn>
500// Prevent accidental compilation without support for SoA layout
501#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
502#error Missing implementation for structure-of-arrays memory layout.
503#endif
504 ENSURE_VALID_ID_ACCESSOR(id);
505 return m_invJacobian[id];
506}
507
508
510template <MInt nDim, class SysEqn>
512// Prevent accidental compilation without support for SoA layout
513#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
514#error Missing implementation for structure-of-arrays memory layout.
515#endif
516
517 const MInt coordSize = nDim * maxNoNodesXD();
518 const MInt varSize = maxNoNodesXD() * noVars();
519 const MInt nodeVarSize = maxNoNodesXD() * noNodeVars();
520
521 // Cell id
522 fill_invalid(m_cellId, begin, end);
523
524 // Polynomial degree
525 fill_invalid(m_polyDeg, begin, end);
526
527 // Number of nodes 1D
528 fill_invalid(m_noNodes1D, begin, end);
529
530 // Surface ids
531 fill_invalid(m_surfaceIds, begin, end, noSurfaces());
532
533 // Node coordinates
534 fill_invalid(m_nodeCoordinates, begin, end, coordSize);
535
536 // Variables
537 fill_invalid(m_variables, begin, end, varSize);
538
539 // Old variables
540 fill_invalid(m_timeIntStorage, begin, end, varSize);
541
542 // Node variables
543 fill_invalid(m_nodeVariables, begin, end, nodeVarSize);
544
545 // Right hand side
546 fill_invalid(m_rightHandSide, begin, end, varSize);
547
548 // External source terms
549 fill_invalid(m_externalSource, begin, end, varSize);
550
551 // Inverse jacobian
552 fill_invalid(m_invJacobian, begin, end);
553}
554
555
557template <MInt nDim, class SysEqn>
558template <class Functor, class T>
559void ElementCollector<nDim, SysEqn>::rawCopyGeneric(Functor&& c, const T& source, const MInt begin, const MInt end,
560 const MInt destination) {
561// Prevent accidental compilation without support for SoA layout
562#ifdef DGCOLLECTOR_SOA_MEMORY_LAYOUT
563#error Missing implementation for structure-of-arrays memory layout.
564#endif
565
566 const MInt varSize = maxNoNodesXD() * noVars();
567
568 // Cell id
569 copyData(source.m_cellId, m_cellId, c, begin, end, destination);
570
571 // Polynomial degree
572 copyData(source.m_polyDeg, m_polyDeg, c, begin, end, destination);
573
574 // Number of nodes 1D
575 copyData(source.m_noNodes1D, m_noNodes1D, c, begin, end, destination);
576
577 // Surface ids
578 copyData(source.m_surfaceIds, m_surfaceIds, c, begin, end, destination, noSurfaces());
579
580 // Node coordinates
581 copyData(source.m_nodeCoordinates, m_nodeCoordinates, c, begin, end, destination, nDim * maxNoNodesXD());
582
583 // Variables
584 copyData(source.m_variables, m_variables, c, begin, end, destination, varSize);
585
586 // Old variables
587 copyData(source.m_timeIntStorage, m_timeIntStorage, c, begin, end, destination, varSize);
588
589 // Node variables
590 copyData(source.m_nodeVariables, m_nodeVariables, c, begin, end, destination, maxNoNodesXD() * noNodeVars());
591
592 // Right hand side
593 copyData(source.m_rightHandSide, m_rightHandSide, c, begin, end, destination, varSize);
594
595 // External source terms
596 copyData(source.m_externalSource, m_externalSource, c, begin, end, destination, varSize);
597
598 // Inverse jacobian
599 copyData(source.m_invJacobian, m_invJacobian, c, begin, end, destination);
600}
601
602
604template <MInt nDim, class SysEqn>
606 const MInt oldMaxPolyDeg = m_maxPolyDeg;
607 m_maxPolyDeg = maxPolyDeg_;
608 return oldMaxPolyDeg;
609}
610
612template <MInt nDim, class SysEqn>
614 m_maxNoNodes1D = maxNoNodes1D_;
615 m_maxNoNodesXD = ipow(m_maxNoNodes1D, nDim);
616}
617
618
627template <MInt nDim, class SysEqn>
629 return getElementByCellId(0, this->size(), cellId);
630}
631
632
643template <MInt nDim, class SysEqn>
644MInt ElementCollector<nDim, SysEqn>::getElementByCellId(const MInt first, const MInt last, const MInt cellId) const {
645 const MInt* const begin = &m_cellId[0];
646 const MInt* const end = begin + (last - first);
647 const MInt* const low = std::lower_bound(begin, end, cellId);
648
649 // Return not found if searched cell id is smaller than [first, last]
650 if(low == begin && *low != cellId) {
651 return -1;
652 }
653
654 // Return not found if std::lower_bound does not find anything
655 if(low == end) {
656 return -1;
657 }
658
659 // Return not found if the lower bound does not match the searched id (happens
660 // if a cell has no corresponding element)
661 if(*low != cellId) {
662 return -1;
663 }
664
665 // Otherwise return found element id
666 return first + std::distance(begin, low);
667}
668
669} // namespace collector
670} // namespace dg
671} // namespace maia
672
673
674// Undefine macros that should not be used outside this file
675#undef DGCOLLECTOR_SANITY_CHECKS_ACCESSORS
676#undef ENSURE_VALID_ID_ACCESSOR
677#undef ENSURE_VALID_VARIABLE_ID_ACCESSOR
678#undef ENSURE_VALID_NODE_VARIABLE_ID_ACCESSOR
679#undef ENSURE_VALID_SURFACE_ID_ACCESSOR
680#undef ENSURE_CONDITION
681
682#endif // ifndef DGELEMENTCOLLECTOR_H_
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
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
void resetStorage(const MInt n, Storage< T > &c)
Create new container with given size and replace original one.
Definition: container.h:420
void reset(const MInt capacity)
Reset tree, re-create data structures with given capacity, and set size to zero.
Definition: container.h:187
Class that represents DG element collector.
MFloat & externalSource(const MInt id)
Accessor for external source terms.
static constexpr MInt noVars()
Return number of nodes in 1D.
MInt & polyDeg(const MInt id)
Accessor for polynomial degree.
typename maia::dg::collector::Invalid< T > Invalid
typename Base::template Storage< T > Storage
MInt noNodesXD(const MInt id) const
Accessor for number of nodes XD (const version).
constexpr MInt noNodeVars() const
Return number of node variables.
MFloat & nodeCoordinates(const MInt id)
Accessor for node coordinates.
MFloat & invJacobian(const MInt id)
Accessor for inverse jacobian.
MInt & cellId(const MInt id)
Accessor for cell id.
MInt maxNoNodesXD() const
Return maximum number of nodes XD.
MInt m_maxNoNodes1D
Maximum number of nodes 1D.
MInt & surfaceIds(const MInt id, const MInt dir)
Accessor for surface ids.
MInt m_maxNoNodesXD
Maximum number if nodes XD.
MInt maxNoNodes1D() const
Return maximum number of nodes 1D.
MFloat & nodeVars(const MInt id)
Accessor for node variables.
MFloat & variables(const MInt id, const MInt pos)
Accessor for variables.
MInt getElementByCellId(const MInt cellId) const
Return element id for a given cell id (or -1 if not found).
MFloat & timeIntStorage(const MInt id)
Accessor for storage variables.
MFloat & rightHandSide(const MInt id)
Accessor for right hand side.
void invalidate(const MInt begin, const MInt end)
Erase range of nodes such that they contain no sensible values anymore.
MInt maxPolyDeg() const
Return maximum polynomial degree.
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.
static constexpr MInt noSurfaces()
Return number of surfaces per element.
void reset()
Reset tree, re-create data structures with given capacity, and set size to zero.
MInt noNodes1D(const MInt id) const
Accessor for number of nodes 1D (const version).
constexpr ElementCollector()=default
Default c'tor does nothing.
MInt ipow(MInt base, MInt exp)
Integer exponent function for non-negative exponents.
Definition: functions.h:317
int32_t MInt
Definition: maiatypes.h:62
double MFloat
Definition: maiatypes.h:52
int64_t MLong
Definition: maiatypes.h:64
MInt id
Definition: maiatypes.h:71
Namespace for auxiliary functions/classes.