|
Peano
|
| peano4::grid::GridControlEvent peano4::grid::internal::createBoundingBoxEvent | ( | const peano4::grid::GridControlEvent & | lhs, |
| const peano4::grid::GridControlEvent & | rhs ) |
| bool peano4::grid::internal::equals | ( | const peano4::grid::GridControlEvent & | lhs, |
| const peano4::grid::GridControlEvent & | rhs ) |
| void peano4::grid::internal::mergeAdjacentRefinementEvents | ( | std::list< peano4::grid::GridControlEvent > & | inputEvents, |
| int | Tolerance ) |
Merge adjacent events.
This routine merges adjacent events, i.e. events of the same time which share a common face and can be combined into one larger, rectangular event. The routine does not distinguish refine from coarsen events, i.e. you should only pass in events of the same type.
To make this routine faster, we first sort() the events geometrically. After that, we sweep over them and merge. As we have sorted the elements, we can "only" consider neighbouring events. Once a sweep has completed, we have to decide to rerun the whole procedure. This is necessary if something has changed within the list.
| bool peano4::grid::internal::refinementEventOverrulesCoarsening | ( | const peano4::grid::GridControlEvent & | refineEvent, |
| const peano4::grid::GridControlEvent & | eraseEvent ) |
A refinement event overrules the coarsening if.
| void peano4::grid::internal::removeEraseEventsThatAreCancelledByRefineEvents | ( | const std::list< peano4::grid::GridControlEvent > & | refineEvents, |
| std::list< peano4::grid::GridControlEvent > & | eraseEvents ) |
This is the first thing I do.
Before I even start to think about the erase events, lets get rid of those that are definitely cancelled.
Uses the routine internal::refinementEventOverrulesCoarsening() to flag those events within eraseEvents which have to go.
| void peano4::grid::internal::sort | ( | std::list< peano4::grid::GridControlEvent > & | events | ) |
Sort grid control events geometrically.
Very simplistic sorting algorithm. The only "interesting" thing here is the fact that we provide the actual comparison operator. In a real C++ world, we would define the operator < over GridControlEvent. This GridControlEvent class however is usually generated, i.e. we dump it through Python. It would be a little bit of a headache to add the operator (it would have to be defined in Python, and then piped into the C++ code), so I decided to wrap one here manually.
The routine defines a natural order over the individual coordinates.
Sort has to work purely spatially. Otherwise, we would never be able to handle strong AMR.
The comparison operator represents a < operator. First of all, we distinguish events that trigger different mesh sizes. That is, if you request a mesh size of h=0.1 and then of h=0.001, then the latter request is always bigger than the first one. If two events request the same mesh resolution, we first sort along the x-axis, then along the y-axis, and so forth. This way, we ensure that merges (which always merge two events next to each other) are deterministic.
| events | Input and output set of grid control events |
| bool peano4::grid::internal::twoEventsAreAdjacent | ( | const peano4::grid::GridControlEvent & | lhs, |
| const peano4::grid::GridControlEvent & | rhs, | ||
| double | Tolerance ) |
Are two events adjacent.
Two events are adjacent if they have the same h, and if the sum of their bounding box volumes is roughly the same as the bounding box volume of the merger. We notice that the name is slightly wrong: We are not only flagging adjacent events, we are even searching for adjacent events of the same size.
| bool peano4::grid::internal::twoEventsOverlap | ( | const peano4::grid::GridControlEvent & | lhs, |
| const peano4::grid::GridControlEvent & | rhs ) |
Helper function which helps us throughout the merge.