Commit 34e66211 authored by George Zagaris's avatar George Zagaris
Browse files

COMP:Add AMRGhostCellExtruder example to the build

Added AMRGhostCellExtruder example to the build
parent fdfb5946
/*=========================================================================
Program: Visualization Toolkit
Module: AMRGhostCellExtruder.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 AMRGhostCellExtruder.cxx -- Ghost layer extruder
//
// .SECTION Description
// This utility will read in an AMR dataset in *.vth and generate the
// corresponding extruded dataset.
#include <cmath>
#include <sstream>
#include <cassert>
#include <mpi.h>
#include "vtkHierarchicalBoxDataSet.h"
#include "vtkXMLHierarchicalBoxDataWriter.h"
#include "vtkMultiProcessController.h"
#include "vtkMPIController.h"
#include "vtkAMRUtilities.h"
#include "vtkAMRGhostCellExtruder.h"
#include "AMRCommon.h"
// Global Variables
vtkMultiProcessController *Controller;
int main( int argc, char **argv )
{
Controller = vtkMPIController::New();
Controller->Initialize( &argc, &argv );
assert("pre: Controller != NULL" && (Controller != NULL ) );
std::cout << "Reading AMR dataset...";
std::cout.flush();
vtkHierarchicalBoxDataSet *amrData=
AMRCommon::ReadAMRData( std::string(argv[1] ) );
assert( "pre: input AMR dataset is NULL" && (amrData != NULL) );
std::cout << "[DONE]\n";
std::cout.flush();
std::cout << "Number of Ghost layers: ";
int NG = atoi( argv[2] );
std::cout << NG << std::endl;
std::cout.flush();
std::cout << "Extruding...";
std::cout.flush();
vtkAMRGhostCellExtruder *gcExtrusion = vtkAMRGhostCellExtruder::New();
gcExtrusion->SetInput(amrData);
gcExtrusion->SetNumberOfGhostLayers( NG );
gcExtrusion->Update();
std::cout << "[DONE]\n";
std::cout.flush();
vtkHierarchicalBoxDataSet *extrudedAMR = gcExtrusion->GetOutput();
assert( "post: output AMR dataset is NULL" && (extrudedAMR != NULL) );
AMRCommon::WriteAMRData( extrudedAMR, "EXTRUDED" );
gcExtrusion->Delete();
extrudedAMR->Delete();
amrData->Delete();
Controller->Finalize();
Controller->Delete();
return 0;
}
......@@ -82,6 +82,19 @@ TARGET_LINK_LIBRARIES( AMRSlicer
${VTK_HDF5_LIBRARIES}
)
## Add AMR Ghost Cell Extruder
ADD_EXECUTABLE(AMRGhostCellExtruder AMRGhostCellExtruder.cxx)
TARGET_LINK_LIBRARIES( AMRGhostCellExtruder
vtkGraphics
vtkFiltering
vtkRendering
vtkIO
vtkAMR
vtkParallel
${MPI_LIBRARIES}
${VTK_HDF5_LIBRARIES}
)
## Add Generate3DAMRDataSetWithPulse executable
ADD_EXECUTABLE( Generate3DAMRDataSetWithPulse Generate3DAMRDataSetWithPulse.cxx)
TARGET_LINK_LIBRARIES( Generate3DAMRDataSetWithPulse
......
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