Peano
Loading...
Searching...
No Matches
VertexMarker.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5
8#include "tarch/la/Vector.h"
9
10
11namespace peano4 {
12 namespace datamanagement {
13 struct VertexMarker;
14
32 const VertexMarker& marker,
33 const std::bitset<Dimensions>& parentVertexPositionWithinParentCell
34 );
35 } // namespace datamanagement
36} // namespace peano4
37
38
39namespace toolbox {
40 namespace particles {
41 namespace tests {
46 class TestHelpers;
47 } // namespace tests
48 } // namespace particles
49} // namespace toolbox
50
51
52std::ostream& operator<<(std::ostream& out, const peano4::datamanagement::VertexMarker& marker);
53
54
91private:
97
102
107
109
110 std::bitset<TwoPowerD> _hasBeenRefined;
111 std::bitset<TwoPowerD> _willBeRefined;
112 std::bitset<TwoPowerD> _isLocal;
113 std::bitset<TwoPowerD> _isHanging;
114 std::bitset<TwoPowerD> _isParentVertexLocal;
115 std::bitset<ThreePowerD> _isAdjacentCellLocal;
116 std::bitset<TwoPowerD> _isParentOfSubtree;
117
119
120 bool isParentLocal() const;
121
123
128
134
140 VertexMarker() = default;
141
142public:
143 VertexMarker(const ::peano4::grid::GridTraversalEvent& event, int select = 0);
144
151 VertexMarker& select(int number);
152
173 int getSelectedVertexNumber() const;
174
183
188
189 bool isParentOfSubtree(int i) const;
190 bool isParentOfSubtree() const;
191
193
194 std::string toString() const;
195
200 bool hasBeenRefined() const;
201 bool hasBeenRefined(int i) const;
202
203 bool willBeRefined() const;
204 bool willBeRefined(int i) const;
205
213 int getNumberOfAdjacentTrees() const;
214 int getNumberOfAdjacentTrees(int i) const;
215
219 bool isLocal() const;
220
224 bool isLocal(int i) const;
225
226 bool isHanging() const;
227
228 bool isHanging(int i) const;
229
234
241 bool isAdjacentToParallelDomainBoundary(int i) const;
242
256 bool isParentCellLocal() const;
257
281 bool isParentVertexLocal(int i) const;
282
283
319
345
346
359 double scaleAdjacentCells = 1.0,
360 double tolerance = tarch::la::NUMERICAL_ZERO_DIFFERENCE
361 ) const;
362
363
383
394
400
416 std::bitset<TwoPowerD> areAdjacentCellsLocal() const;
417};
std::ostream & operator<<(std::ostream &out, const peano4::datamanagement::VertexMarker &marker)
tarch::la::Vector< Dimensions, double > reconstructXOfParentVertex(const VertexMarker &marker, const std::bitset< Dimensions > &parentVertexPositionWithinParentCell)
Reconstruct parent vertex position.
constexpr double NUMERICAL_ZERO_DIFFERENCE
Definition Scalar.h:17
Vertex marker to provide information about selected vertex.
tarch::la::Vector< Dimensions, int > _relativePositionOfCellWithinFatherCell
Entries from (0,1,2).
VertexMarker()=default
Some unit tests prefer to construct a marker manually, so I offer a dummy default constructor.
tarch::la::Vector< Dimensions, double > h() const
bool coincidesWithCoarseGridVertex() const
Does vertex spatially coincide with coarser level's vertex.
std::bitset< TwoPowerD > _isParentVertexLocal
tarch::la::Vector< TwoPowerD, int > _numberOfAdjacentTrees
Number of adjacent trees per vertex.
bool isContainedInAdjacentCells(const tarch::la::Vector< Dimensions, double > &x, double scaleAdjacentCells=1.0, double tolerance=tarch::la::NUMERICAL_ZERO_DIFFERENCE) const
Will return true if x is contained within the adjacent cells.
VertexMarker & select(int number)
Picks a vertex within a cell.
std::bitset< TwoPowerD > _hasBeenRefined
tarch::la::Vector< Dimensions, int > getRelativeAdjacentCell(const tarch::la::Vector< Dimensions, double > &x) const
Each vertex is surrounded by cells.
tarch::la::Vector< Dimensions, double > x() const
tarch::la::Vector< Dimensions, double > getInvokingParentCellsCentre() const
See getInvokingCellCentre().
bool isAdjacentToParallelDomainBoundary() const
Is currently selected/analysed vertex adjacent to parallel domain boundary.
int getNumberOfAdjacentTrees() const
Number of adjacent trees of current vertex.
std::bitset< TwoPowerD > _willBeRefined
std::bitset< TwoPowerD > areAdjacentCellsLocal() const
Are adjacent cells of selected vertex local.
bool isParentCellLocal() const
Whenever we touch a vertex the first or the last time, we touch it from a cell: If we touch a vertex ...
bool hasBeenRefined() const
A vertex is refined iff it is surrounded by cells which are refined.
tarch::la::Vector< Dimensions, double > _h
Size of the underlying cell.
std::bitset< TwoPowerD > _isParentOfSubtree
int getSelectedVertexNumber() const
Information about selected vertex.
VertexMarker(const ::peano4::grid::GridTraversalEvent &event, int select=0)
std::bitset< TwoPowerD > _isLocal
tarch::la::Vector< Dimensions, double > getInvokingCellCentre() const
Return centre of cell from which this vertex marker is constructed.
std::bitset< TwoPowerD > _isHanging
std::bitset< TwoPowerD > _isAdjacentToParallelDomainBoundary
bool isParentVertexLocal(int i) const
Is the parent vertex local.
std::bitset< ThreePowerD > _isAdjacentCellLocal
tarch::la::Vector< Dimensions, double > _cellCentre
Centre of the underlying cell.
tarch::la::Vector< Dimensions, int > getRelativePositionWithinFatherCell() const
Relative position within parent cell.
Simple vector class.
Definition Vector.h:134