Skip to content
Snippets Groups Projects
Commit 67357650 authored by Petr Strakos's avatar Petr Strakos
Browse files

adding code images

parent 1384ab24
No related branches found
No related tags found
6 merge requests!368Update prace.md to document the change from qprace to qprod as the default...,!367Update prace.md to document the change from qprace to qprod as the default...,!366Update prace.md to document the change from qprace to qprod as the default...,!323extended-acls-storage-section,!229In situ,!228In situ
......@@ -47,17 +47,20 @@ It will generate the CxxFullExampleAdaptor executable file. This can be later ru
Provided example is a simple MPI program. Main executing part is written in FEDriver.cxx. It is a simulator code that creates computational grid and performs simulation-adaptor interaction (see below).
Dimensions of the computational grid in terms of number of points in x, y, z direction are supplied as input parameters to the *main* function (see lines 22-24). Based on the number of MPI ranks each MPI process creates different part of the overall grid. The fourth parametr in *main* is for the name of a Python script (we use feslicescript.py) that sets up the ParaView-Catalyst pipeline. After the Adaptor initialization on line 36 we start the simulation by linearly progressing *timeStep* value in the *for* loop. Each iteration of the loop upates the grid attributes (Velocity and Pressure) by calling the UpdateFields method in Attributes class
Dimensions of the computational grid in terms of number of points in x, y, z direction are supplied as input parameters to the *main* function (see lines 22-24 in code below). Based on the number of MPI ranks each MPI process creates different part of the overall grid. This is done by grid initialization, see line 30. The respective code for this is in FEDataStructures.cxx.
The fourth parametr in *main* is for the name of a Python script (we use feslicescript.py). It sets up the ParaView-Catalyst pipeline. After the Adaptor initialization on line 36 we start the simulation by linearly progressing *timeStep* value in the *for* loop. Each iteration of the loop upates the grid attributes (Velocity and Pressure) by calling the i*UpdateFields* method from *Attributes* class
![](insitu/img/FEDriver.png "FEDriver.cxx")
Within the UpdateFields method the velocity progresses with the value of *time* and with the specific value of *setting* which depends on the respective MPI rank. In this way, different processes can be visually distinguished during the simulation.
In the *UpdateFields* method the velocity progresses with the value of *time* and with the specific value of *setting* which depends on the actual MPI rank. In this way, different processes can be visually distinguished during the simulation.
![](insitu/img/UpdateFields.png "UpdateFields method of the Attributes class")
In each iteration of the simulation, adaptor's CoProcess function is called by using actual parameters of the grid in time.
Further in the simulation loop, the adaptor's CoProcess function is called by using actual parameters of the grid in time.
![](insitu/img/CoProcess.png "CoProcess function of the adaptor")
mpirun -n 2 ./CxxFullExample 30 30 30 ../SampleScripts/feslicescript.py
......
......@@ -9,19 +9,6 @@
#include "FEAdaptor.h"
#endif
// Example of a C++ adaptor for a simulation code
// where the simulation code has a fixed topology
// grid. We treat the grid as an unstructured
// grid even though in the example provided it
// would be best described as a vtkImageData.
// Also, the points are stored in an inconsistent
// manner with respect to the velocity vector.
// This is purposefully done to demonstrate
// the different approaches for getting data
// into Catalyst. Note that through configuration
// that the driver can be run without linking
// to Catalyst.
int main(int argc, char** argv)
{
// Check the input arguments for area size
......
docs.it4i/software/viz/insitu/img/CoProcess.png

54.5 KiB

File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment