@Andy_Bauer @utkarsh.ayachit @mwestphal @Francois_Mazen @nicolas.vuaille @cory.quammen
I’m using Paraview Catalyst for In Situ visualization and I want to pass Rectilinear grid to it. However, a sample rectilinear grid that I created with Conduit (just to test and check the code) doesn’t seem to produce the intended result as far as the ParaView rendered plots are concerned. For this test, I ran the code on two processors and divided the domain into two blocks in the x direction. I ran into the unexpected surprises. The Conduit node generates right output when I tested it on Ascent. I’m attaching the rendered image and the relevant sections of the code.
/* setup conduit for catalyst */
conduit_node* catalyst_exec_params = conduit_node_create();
conduit_node_set_path_int64(catalyst_exec_params, "catalyst/state/timestep", cycle);
conduit_node_set_path_float64(catalyst_exec_params, "catalyst/state/time", time);
//create mesh
conduit_node_set_path_char8_str(catalyst_exec_params, "catalyst/channels/grid/type", "mesh");
conduit_node* mesh = conduit_node_create();
// add coordsets
conduit_node_set_path_char8_str(mesh, "coordsets/coords/type", "rectilinear");
// add topologies
conduit_node_set_path_char8_str(mesh, "topologies/mesh/type", "rectilinear");
conduit_node_set_path_char8_str(mesh, "topologies/mesh/coordset", "coords");
// add density (cell-field)
conduit_node_set_path_char8_str(mesh, "fields/density/association", "element");
conduit_node_set_path_char8_str(mesh, "fields/density/topology", "mesh");
conduit_node_set_path_char8_str(mesh, "fields/density/volume_dependent", "false");
// put in the data
if (prank==0){
double zval[] = {0., 1.};
double xval[] = {0.,0.25,0.5};
double yval[] = {0.,0.5,1.};
double vals[] = {0.,0.05,0.5,1.0};
conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/x", xval, 3);
conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/y", yval, 3);
conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/z", zval, 2);
conduit_node_set_path_external_float64_ptr(mesh, "fields/density/values", vals, 4);
}
else{
double zval[] = {0., 1.};
double xval[] = {0.5,0.75,1.0};
double yval[] = {0.,0.5,1.};
double vals[] = {0.1,0.2,2.,3.};
conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/x", xval, 3);
conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/y", yval, 3);
conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/z", zval, 2);
conduit_node_set_path_external_float64_ptr(mesh, "fields/density/values", vals, 4);
}
// add the mesh info (conduit mesh) to catalyst_exec_params
conduit_node_set_path_external_node(catalyst_exec_params, "catalyst/channels/grid/data", mesh);
One more thing I observed is that although my data is 2D, I had to pass a dummy z data to Catalyst through Conduit otherwise the code crashes with the following error.
vtkConduitArrayUtilities invalid node of type 'empty'
This only happens for rectilinear mesh blueprint. Omitting the z-direction in uniform mesh blueprint however is fine and the code works without any issue.