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

adding code images

parent 2f22a2cf
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,9 @@ It will generate the CxxFullExampleAdaptor executable file. This can be later ru ...@@ -45,7 +45,9 @@ 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. 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). Fourth parametr expects a name of a Python script that sets up ParaView-Catalyst environment. 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).
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.
![](insitu/img/FEDriver.png "FEDriver.cxx") ![](insitu/img/FEDriver.png "FEDriver.cxx")
......
...@@ -106,7 +106,7 @@ void BuildVTKDataStructures(Grid& grid, Attributes& attributes, vtkCPInputDataDe ...@@ -106,7 +106,7 @@ void BuildVTKDataStructures(Grid& grid, Attributes& attributes, vtkCPInputDataDe
namespace FEAdaptor namespace FEAdaptor
{ {
void Initialize(int numScripts, char* scripts[]) void Initialize(char* script)
{ {
if (Processor == NULL) if (Processor == NULL)
{ {
...@@ -117,12 +117,10 @@ void Initialize(int numScripts, char* scripts[]) ...@@ -117,12 +117,10 @@ void Initialize(int numScripts, char* scripts[])
{ {
Processor->RemoveAllPipelines(); Processor->RemoveAllPipelines();
} }
for (int i = 0; i < numScripts; i++)
{ vtkNew<vtkCPPythonScriptPipeline> pipeline;
vtkNew<vtkCPPythonScriptPipeline> pipeline; pipeline->Initialize(script);
pipeline->Initialize(scripts[i]); Processor->AddPipeline(pipeline.GetPointer());
Processor->AddPipeline(pipeline.GetPointer());
}
} }
void Finalize() void Finalize()
......
...@@ -6,7 +6,7 @@ class Grid; ...@@ -6,7 +6,7 @@ class Grid;
namespace FEAdaptor namespace FEAdaptor
{ {
void Initialize(int numScripts, char* scripts[]); void Initialize(char* script);
void Finalize(); void Finalize();
......
...@@ -10,6 +10,17 @@ ...@@ -10,6 +10,17 @@
#endif #endif
// Example of a C++ adaptor for a simulation code // 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) int main(int argc, char** argv)
{ {
...@@ -35,7 +46,7 @@ int main(int argc, char** argv) ...@@ -35,7 +46,7 @@ int main(int argc, char** argv)
#ifdef USE_CATALYST #ifdef USE_CATALYST
// The first argument is the program name // The first argument is the program name
FEAdaptor::Initialize(argc - 4, &argv[4]); FEAdaptor::Initialize(argv[4]);
#endif #endif
unsigned int numberOfTimeSteps = 1000; unsigned int numberOfTimeSteps = 1000;
for (unsigned int timeStep = 0; timeStep < numberOfTimeSteps; timeStep++) for (unsigned int timeStep = 0; timeStep < numberOfTimeSteps; timeStep++)
......
docs.it4i/software/viz/insitu/img/FEDriver.png

150 KiB | W: | H:

docs.it4i/software/viz/insitu/img/FEDriver.png

187 KiB | W: | H:

docs.it4i/software/viz/insitu/img/FEDriver.png
docs.it4i/software/viz/insitu/img/FEDriver.png
docs.it4i/software/viz/insitu/img/FEDriver.png
docs.it4i/software/viz/insitu/img/FEDriver.png
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment