best_way_of_writing_transient_multiblocks(unstructured grid dataSets)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

best_way_of_writing_transient_multiblocks(unstructured grid dataSets)

Giorgos Ragkousis

Dear vtkusers,

I am trying to develop an efficient method for writing different vtk unstructured grid datasets which change with time in a single vtk file.

In particular, we have an in-house Boundary Element solver and we would like to save element and node information (unstructured grid DataSets) in a single file. Then, by using vtk methods we would like to visualise the results.

The main question I would like to ask is whether any of you have developed similar vtk applications and what would be the optimal way. I found that multiblocks can be saved in either exodus or vtm file. What is the difference? Is there any other way?

How could I save different time steps of these multiblocks? Is there any simple example of creating such a file? Moreover, I found that vtkHierrarchicalBoxDataSet is for Adaptive Meshing. Is there any example?

Lastly, how I could extract a specific block from a multiblock by giving its name. In the following code I have managed to extract a certain block by giving its index only. Is it possible to call a block from each name?

       private void MultiBlockDisplay()
            string path;
            string domainName;
            string fileName;

            vtkRenderer ren = vtkRenderer.New();
            ren.SetBackground(0.2, 0.3, 0.4);
            vtkRenderWindow renWin = renderWindowControl1.RenderWindow;
            vtkRenderWindowInteractor iren = vtkRenderWindowInteractor.New();

            uint number = 2;
            vtkMultiBlockDataSet mbset = vtkMultiBlockDataSet.New();

            for (uint i = 0; i < number; i++)
                vtkUnstructuredGridReader reader = vtkUnstructuredGridReader.New();

                path = @"C:\\A_directory\\";
                domainName = "MultiBlock_" + i.ToString();
                fileName = path + domainName + ".vtk";


                mbset.SetBlock(i, reader.GetOutput());

                mbset.GetMetaData(i).Set(vtkCompositeDataSet.NAME(), domainName);

                //The following bit prints the name for each block
                string nameDOM = mbset.GetMetaData(i).Get(vtkCompositeDataSet.NAME());

            vtkUnstructuredGrid ug = vtkUnstructuredGrid.SafeDownCast(mbset.GetBlock(1));

            vtkDataSetMapper mapper = vtkDataSetMapper.New();

            vtkActor actor = vtkActor.New();


            ren.SetBackground(0.2, 0.3, 0.4);



Many thanks in advance.


Kindest regards,


Powered by

Visit other Kitware open-source projects at

Please keep messages on-topic and check the VTK FAQ at:

Search the list archives at:

Follow this link to subscribe/unsubscribe:
Reply | Threaded
Open this post in threaded view

Re: best_way_of_writing_transient_multiblocks(unstructured grid dataSets)


Hi Giorgos,
   I am interested in a similar problem. I have some ensight Gold files that I want to convert to a vtk/paraview format, but the files don't have time information and I would like to include that.

Were you able to construct a solution to include the time information into each file?