|
| | TraversalVTKPlotter (const std::string &filename, int treeId=-1) |
| | You have to invoke startNewSnapshot() if you wanna have a pvd file immediately after you've created this observer in the main code.
|
| |
| virtual | ~TraversalVTKPlotter () |
| |
| virtual void | beginTraversal (const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &h) override |
| | Begin the traversal.
|
| |
| virtual void | endTraversal (const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &h) override |
| |
| virtual void | loadCell (const GridTraversalEvent &event) override |
| |
| virtual void | storeCell (const GridTraversalEvent &event) override |
| |
| virtual void | enterCell (const GridTraversalEvent &event) override |
| | Event is invoked per cell.
|
| |
| virtual void | leaveCell (const GridTraversalEvent &event) override |
| |
| virtual TraversalObserver * | clone (int spacetreeId) override |
| |
| virtual std::vector< GridControlEvent > | getGridControlEvents () const override |
| | Obviously empty for this particular observer.
|
| |
| virtual | ~TraversalObserver () |
| |
| virtual void | exchangeAllVerticalDataExchangeStacks (int) |
| | Send local data from top level of local mesh to master and receive its top-down information in return.
|
| |
| virtual void | exchangeAllHorizontalDataExchangeStacks (bool) |
| | Exchange all the data along the domain boundaries.
|
| |
| virtual void | exchangeAllPeriodicBoundaryDataStacks () |
| | Exchange all periodic boundary data.
|
| |
| virtual void | streamDataFromSplittingTreeToNewTree (int) |
| | Stream data from current tree on which this routine is called to the new worker.
|
| |
| virtual void | streamDataFromJoiningTreeToMasterTree (int) |
| |
| virtual void | finishAllOutstandingSendsAndReceives () |
| | Wrap up all sends and receives, i.e.
|
| |
| virtual void | sendVertex (int, int, SendReceiveContext, const GridTraversalEvent &) |
| |
| virtual void | sendFace (int, int, SendReceiveContext, const GridTraversalEvent &) |
| |
| virtual void | sendCell (int, SendReceiveContext, const GridTraversalEvent &) |
| |
| virtual void | receiveAndMergeVertex (int, int, SendReceiveContext, const GridTraversalEvent &) |
| |
| virtual void | receiveAndMergeFace (int, int, SendReceiveContext, const GridTraversalEvent &) |
| |
| virtual void | receiveAndMergeCell (int, SendReceiveContext, const GridTraversalEvent &) |
| |
| virtual void | deleteAllStacks () |
| |
Observer which pipes the automaton transitions into a VTK file.
While we use the up-to-date vtk format, the observer plots the whole thing as a discontinuous unstructured mesh. It is not particular sophisticated.
The plotter can write whole time series. For this, you have to invoke startNewSnapshot() prior to each plot. It is the latter which also ensures that parallel plots in an MPI environment do work.
Parallel plotting
Each tree dumps its own vtk file. That is, each thread and each rank in theory might write its file parallel to the other guys. VTK/VTU offers us to define a metafile (pvtu) which collocates various dumps. As we create one observer per thread through clone(), every thread on every rank has its instance and pipes its data. getFilename() ensures that no file is overwritten. It combines the tree number with a counter, and _counter, which is static, is incremented through endTraversalOnRank() which I expect the user to call once after each traversal.
Known bugs
As the MPI domain decomposition creates fake observers for the master of a local rank when it is created, we'll have multiple entries for forking ranks in the meta file.
Definition at line 48 of file TraversalVTKPlotter.h.
| virtual TraversalObserver * peano4::grid::TraversalVTKPlotter::clone |
( |
int | spacetreeId | ) |
|
|
overridevirtual |
I use the clone to create one observer object per traversal thread. So
between different spacetrees of one spacetree set, there can be no race
condition. Yet, the clone() itself could be called in parallel.
\section Global per-sweep actions
If you want to implement an operation once per sweep in a parallel
environment, then you can exploit the fact that the spacetree set also
creates an observer for the global master thread, i.e. tree no 0. So if
you add a statement alike
<pre>
if (peano4::parallel::Node::isGlobalMaster(spacetreeId)) { ... }
then you can be sure that the branch body is executed only once globally per grid sweep.
The counterpart of the clone operation is the destructor.
Implements peano4::grid::TraversalObserver.