Commit 1a0b05ec authored by George Zagaris's avatar George Zagaris
Browse files

ENH: FLASH AMR to VTH converter utility

Initial commit of utility that converts FLASH
AMR datasets to VTH -- VTK's AMR hierarchical
box datasets.
parent b43aa34b
......@@ -43,6 +43,19 @@ TARGET_LINK_LIBRARIES( AMRDataTransferPipeline
${VTK_HDF5_LIBRARIES}
)
## Add AMRDataTransferPipeline executable
ADD_EXECUTABLE(flash2vth flash2vth.cxx)
TARGET_LINK_LIBRARIES( flash2vth
vtkGraphics
vtkFiltering
vtkRendering
vtkIO
vtkAMR
vtkParallel
${MPI_LIBRARIES}
${VTK_HDF5_LIBRARIES}
)
## Add AMRDataTransferPipeline executable
ADD_EXECUTABLE(enzo2vth enzo2vth.cxx)
TARGET_LINK_LIBRARIES( enzo2vth
......
/*=========================================================================
Program: Visualization Toolkit
Module: flash2vth.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME flash2vth.cxx -- Converts an FLASH dataset into a *vth file.
//
// .SECTION Description
// A simple utility that converts an FLASH AMR datasets into a vth,
// hiearchical box AMR dataset.
//
// .SECTION See Also
// vtkXMLHierarchicalBoxDataWriter{Enter documentation here!}
#include <iostream>
#include "vtkAMRFlashReader.h"
#include "vtkHierarchicalBoxDataSet.h"
#include "AMRCommon.h"
int main( int argc, char **argv )
{
if( argc != 3 )
{
std::cout << "Usage: enzo2vth <file> <max-resolution> \n";
std::cout.flush();
return -1;
}
vtkAMRFlashReader *myReader = vtkAMRFlashReader::New();
myReader->SetMaxLevel( atoi(argv[2]) );
myReader->SetFileName( argv[1] );
myReader->Update();
vtkHierarchicalBoxDataSet *amrds = myReader->GetOutput();
AMRCommon::WriteAMRData( amrds, "AMR" );
myReader->Delete();
return 0;
}
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