Commit 07bf5dd2 authored by Petr Strakos's avatar Petr Strakos

adding code images

parent 2f22a2cf
......@@ -45,7 +45,9 @@ It will generate the CxxFullExampleAdaptor executable file. This can be later ru
## 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")
......
......@@ -106,7 +106,7 @@ void BuildVTKDataStructures(Grid& grid, Attributes& attributes, vtkCPInputDataDe
namespace FEAdaptor
{
void Initialize(int numScripts, char* scripts[])
void Initialize(char* script)
{
if (Processor == NULL)
{
......@@ -117,12 +117,10 @@ void Initialize(int numScripts, char* scripts[])
{
Processor->RemoveAllPipelines();
}
for (int i = 0; i < numScripts; i++)
{
vtkNew<vtkCPPythonScriptPipeline> pipeline;
pipeline->Initialize(scripts[i]);
Processor->AddPipeline(pipeline.GetPointer());
}
vtkNew<vtkCPPythonScriptPipeline> pipeline;
pipeline->Initialize(script);
Processor->AddPipeline(pipeline.GetPointer());
}
void Finalize()
......
......@@ -6,7 +6,7 @@ class Grid;
namespace FEAdaptor
{
void Initialize(int numScripts, char* scripts[]);
void Initialize(char* script);
void Finalize();
......
......@@ -10,6 +10,17 @@
#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)
{
......@@ -35,7 +46,7 @@ int main(int argc, char** argv)
#ifdef USE_CATALYST
// The first argument is the program name
FEAdaptor::Initialize(argc - 4, &argv[4]);
FEAdaptor::Initialize(argv[4]);
#endif
unsigned int numberOfTimeSteps = 1000;
for (unsigned int timeStep = 0; timeStep < numberOfTimeSteps; timeStep++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment