diff --git a/docs.it4i/software/viz/insitu.md b/docs.it4i/software/viz/insitu.md index 6070ae7372bba001cc331596c31a946a69edc0cc..6af5eb743dcf7e54d60dd77ec23c1b2021e46aa2 100644 --- a/docs.it4i/software/viz/insitu.md +++ b/docs.it4i/software/viz/insitu.md @@ -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.  diff --git a/docs.it4i/software/viz/insitu/FEAdaptor.cxx b/docs.it4i/software/viz/insitu/FEAdaptor.cxx index 6409f18ff87dadd1ea191ed1a3091f387582334d..8c3b7ef7381cd8b81916eb4d0419fd54e31ab3a7 100644 --- a/docs.it4i/software/viz/insitu/FEAdaptor.cxx +++ b/docs.it4i/software/viz/insitu/FEAdaptor.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() diff --git a/docs.it4i/software/viz/insitu/FEAdaptor.h b/docs.it4i/software/viz/insitu/FEAdaptor.h index 9bc2770484a55b3f117a3bd04ce1107706e8cd43..86154b252eaec4b95065cc7b838d37e996d462fe 100644 --- a/docs.it4i/software/viz/insitu/FEAdaptor.h +++ b/docs.it4i/software/viz/insitu/FEAdaptor.h @@ -6,7 +6,7 @@ class Grid; namespace FEAdaptor { -void Initialize(int numScripts, char* scripts[]); +void Initialize(char* script); void Finalize(); diff --git a/docs.it4i/software/viz/insitu/FEDriver.cxx b/docs.it4i/software/viz/insitu/FEDriver.cxx index 9c7d9ec4e21770daddae374959381a3b1854b375..2f0e4d2c03ee744861ec56b37f802b31ce80aa4f 100644 --- a/docs.it4i/software/viz/insitu/FEDriver.cxx +++ b/docs.it4i/software/viz/insitu/FEDriver.cxx @@ -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++) diff --git a/docs.it4i/software/viz/insitu/img/FEDriver.png b/docs.it4i/software/viz/insitu/img/FEDriver.png index 2c0dc464d4183fe05c5f1dabae68df7cd8e5c01e..7b599f9fea53a72640fa3c5d9cba1ef5b4b95502 100644 Binary files a/docs.it4i/software/viz/insitu/img/FEDriver.png and b/docs.it4i/software/viz/insitu/img/FEDriver.png differ