ExodusIIWriter

VTKExamples/Java/Parallel/ExodusIIWriter

Description

Example Program to Demonstrate the usage of vtkExodusIIWriter - a vtkWriter that writes it's vtkUnstructuredGrid input to an Exodus II file Exodus files contain much information that is not captured in a vtkUnstructuredGrid, such as time steps, information lines, node sets, and side sets.

Other Languages

See (Cxx)

Question

If you have a simple question about this example contact us at VTKExamplesProject If your question is more complex and may require extended discussion, please use the VTK Discourse Forum

Code

ExodusIIWriter.java

import vtk.vtkNativeLibrary;
import vtk.vtkExodusIIWriter;
import vtk.vtkTimeSourceExample;

public class ExodusIIWriter 
{
// -----------------------------------------------------------------
// Load VTK library and print which library was not properly loaded
static 
{
  if (!vtkNativeLibrary.LoadAllNativeLibraries()) 
  {
    for (vtkNativeLibrary lib : vtkNativeLibrary.values()) 
    {
      if (!lib.IsLoaded()) 
      { 
        System.out.println(lib.GetLibraryName() + " not loaded");
      }
    }
  }
  vtkNativeLibrary.DisableOutputWindow(null);
}
// -----------------------------------------------------------------

public static void main(String args[]) 
{                   
  // Provide default values.
  String fileName = "Output.exii";
  for(int i = 0; i < args.length; ++i)
  {
    switch (i) 
    {
      case 0:
      fileName = args[i];
      break;

    }
  }
  vtkTimeSourceExample TimeSource = new vtkTimeSourceExample();
  vtkExodusIIWriter ExodusWriter = new vtkExodusIIWriter();
  ExodusWriter.SetFileName(fileName);
  ExodusWriter.SetInputConnection(TimeSource.GetOutputPort());
  ExodusWriter.WriteAllTimeStepsOn();
  ExodusWriter.Write();
 }        
}