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

adding code images

parent 32d122f8
No related branches found
No related tags found
No related merge requests found
...@@ -45,12 +45,19 @@ It will generate the CxxFullExampleAdaptor executable file. This can be later ru ...@@ -45,12 +45,19 @@ It will generate the CxxFullExampleAdaptor executable file. This can be later ru
## Code explanation ## Code explanation
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 (see below). 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). The fourth parametr in *main* is for the name of a Python script (we use feslicescript.py) that sets up the ParaView-Catalyst pipeline. 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
![](insitu/img/FEDriver.png "FEDriver.cxx")
![](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.
![](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.
mpirun -n 2 ./CxxFullExample 30 30 30 ../SampleScripts/feslicescript.py mpirun -n 2 ./CxxFullExample 30 30 30 ../SampleScripts/feslicescript.py
......
...@@ -145,7 +145,7 @@ void CoProcess( ...@@ -145,7 +145,7 @@ void CoProcess(
dataDescription->SetTimeData(time, timeStep); dataDescription->SetTimeData(time, timeStep);
if (lastTimeStep == true) if (lastTimeStep == true)
{ {
// assume that we want to all the pipelines to execute if it // assume that we want to execute all the pipelines if it
// is the last time step. // is the last time step.
dataDescription->ForceOutputOn(); dataDescription->ForceOutputOn();
} }
......
...@@ -24,9 +24,8 @@ class Attributes ...@@ -24,9 +24,8 @@ class Attributes
{ {
// A class for generating and storing point and cell fields. // A class for generating and storing point and cell fields.
// Velocity is stored at the points and pressure is stored // Velocity is stored at the points and pressure is stored
// for the cells. The current velocity profile is for a // for the cells.
// shearing flow with U(y,t) = y*t, V = 0 and W = 0.
// Pressure is constant through the domain.
public: public:
Attributes(); Attributes();
void Initialize(Grid* grid); void Initialize(Grid* grid);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment