75 struct GridStatistics;
76 struct GridControlEvent;
78 struct AutomatonState;
79 struct GridControlEvent;
87 void clear(GridStatistics& statistics,
bool isGlobalMasterTree);
178 std::vector<GridControlEvent>
merge(std::vector<GridControlEvent> events,
const double Tolerance = 0.1);
208 bool isNewFineGridVertex
263 GridVertex vertices[
TwoPowerD],
bool splittingIsConsideredLocal,
bool joiningIsConsideredLocal,
int id
307 bool overlaps(
const AutomatonState& x,
const GridControlEvent& event);
315 bool isContained(
const AutomatonState& x,
const GridControlEvent& event,
double upscaleAutomatonState = 1.0);
328 std::string
toString(
const std::vector<GridControlEvent>& events);
329 std::string
toString(
const std::list<GridControlEvent>& events);
340 const std::list<peano4::grid::GridControlEvent>& refineEvents,
341 std::list<peano4::grid::GridControlEvent>& eraseEvents
422 void sort(std::list<peano4::grid::GridControlEvent>& events);
bool twoEventsAreAdjacent(const peano4::grid::GridControlEvent &lhs, const peano4::grid::GridControlEvent &rhs, double Tolerance)
Are two events adjacent.
void mergeAdjacentRefinementEvents(std::list< peano4::grid::GridControlEvent > &inputEvents, int Tolerance)
Merge adjacent events.
void removeEraseEventsThatAreCancelledByRefineEvents(const std::list< peano4::grid::GridControlEvent > &refineEvents, std::list< peano4::grid::GridControlEvent > &eraseEvents)
This is the first thing I do.
bool refinementEventOverrulesCoarsening(const peano4::grid::GridControlEvent &refineEvent, const peano4::grid::GridControlEvent &eraseEvent)
A refinement event overrules the coarsening if.
peano4::grid::GridControlEvent createBoundingBoxEvent(const peano4::grid::GridControlEvent &lhs, const peano4::grid::GridControlEvent &rhs)
void sort(std::list< peano4::grid::GridControlEvent > &events)
Sort grid control events geometrically.
bool twoEventsOverlap(const peano4::grid::GridControlEvent &lhs, const peano4::grid::GridControlEvent &rhs)
Helper function which helps us throughout the merge.
bool equals(const peano4::grid::GridControlEvent &lhs, const peano4::grid::GridControlEvent &rhs)
bool isSpacetreeNodeRefined(GridVertex vertices[TwoPowerD])
A spacetree node is refined if any of its adjacent vertices holds one of the following flags:
std::string toString(VertexType type)
bool isSpacetreeNodeLocal(GridVertex vertices[TwoPowerD], bool splittingIsConsideredLocal, bool joiningIsConsideredLocal, int id)
A spacetree node as 2^d adjacent vertices.
void clear(GridStatistics &statistics, bool isGlobalMasterTree)
The term clear() is not 100% correct, as the number of stationary traversals is not reset to a dummy ...
void reduceGridControlEvents(std::vector< GridControlEvent > &events)
Peano 4 does not reduce any grid control events globally.
GridVertex createVertex(GridVertex::State state, const tarch::la::Vector< Dimensions, double > &x, int level, const tarch::la::Vector< TwoPowerD, int > &adjacentRanks, bool isNewFineGridVertex)
Factory mechanism.
@ NewFromSplit
Set if this tree results from a split and if this is the first grid sweep when the former owner actua...
@ JoinTriggered
Join has been triggered for this tree.
@ EmptyRun
Not yet a new root.
std::bitset< TwoPowerD > haveVerticesBeenRefined(GridVertex vertices[TwoPowerD])
bool overlaps(const tarch::la::Vector< Dimensions, double > &x, const GridControlEvent &event)
std::bitset< TwoPowerD > willVerticesBeRefined(GridVertex vertices[TwoPowerD])
A vertex is unrefined if it is hanging.
constexpr int InvalidRank(-1)
bool hasVertexBeenRefined(const GridVertex &vertex)
A vertex has been refined if it is (already) refined or is erasing or the erase has been triggered.
std::vector< GridControlEvent > merge(std::vector< GridControlEvent > events, const double Tolerance=0.1)
Merge set of refinement/coarsening commands.
bool willVertexBeRefined(const GridVertex &vertex)
A vertex will be refined if it is already refined or currently refining.
bool isContained(const AutomatonState &x, const GridControlEvent &event, double upscaleAutomatonState=1.0)
isContained() is defined over the closed interval, i.e.
std::map< int, SplitInstruction > SplitSpecification
peano4::grid::GridStatistics operator+(peano4::grid::GridStatistics lhs, peano4::grid::GridStatistics rhs)
std::ostream & operator<<(std::ostream &out, const peano4::SplitInstruction &instruction)
std::string toString() const
int numberOfFineGridCells