Commit d559d079 authored by George Zagaris's avatar George Zagaris
Browse files

ENH: Change AMR readers to use vtkOverlappingAMR

Changed the AMR base reader and sub-classes for flash and enzo to use
vtkOverlappingAMR. Further, updated vtkAMRUtilities to work on
vtkOverlappingAMR.

Change-Id: I1a71d37302aaba11ca5897b4832aae8e1b3b30af
parent 328166ee
......@@ -17,7 +17,7 @@
#include "vtkInformationVector.h"
#include "vtkDataObject.h"
#include "vtkMultiProcessController.h"
#include "vtkHierarchicalBoxDataSet.h"
#include "vtkOverlappingAMR.h"
#include "vtkDataArraySelection.h"
#include "vtkCallbackCommand.h"
#include "vtkIndent.h"
......@@ -68,7 +68,7 @@ vtkAMRBaseReader::~vtkAMRBaseReader()
int vtkAMRBaseReader::FillOutputPortInformation(
int vtkNotUsed(port),vtkInformation *info )
{
info->Set( vtkDataObject::DATA_TYPE_NAME(), "vtkHierarchicalBoxDataSet" );
info->Set( vtkDataObject::DATA_TYPE_NAME(), "vtkOverlappingAMR" );
return 1;
}
......@@ -251,7 +251,7 @@ int vtkAMRBaseReader::RequestInformation(
this->Superclass::RequestInformation( rqst, inputVector, outputVector );
if( this->Metadata == NULL )
{
this->Metadata = vtkHierarchicalBoxDataSet::New();
this->Metadata = vtkOverlappingAMR::New();
vtkInformation* info = outputVector->GetInformationObject(0);
assert( "pre: output information object is NULL" && (info != NULL) );
this->FillMetaData( );
......@@ -422,7 +422,7 @@ void vtkAMRBaseReader::LoadCellData(
}
//------------------------------------------------------------------------------
void vtkAMRBaseReader::LoadRequestedBlocks( vtkHierarchicalBoxDataSet *output )
void vtkAMRBaseReader::LoadRequestedBlocks( vtkOverlappingAMR *output )
{
assert( "pre: AMR data-structure is NULL" && (output != NULL) );
......@@ -474,7 +474,7 @@ void vtkAMRBaseReader::LoadRequestedBlocks( vtkHierarchicalBoxDataSet *output )
}
//------------------------------------------------------------------------------
void vtkAMRBaseReader::AssignAndLoadBlocks( vtkHierarchicalBoxDataSet *output )
void vtkAMRBaseReader::AssignAndLoadBlocks( vtkOverlappingAMR *output )
{
assert( "pre: AMR data-structure is NULL" && (output != NULL) );
......@@ -538,8 +538,8 @@ int vtkAMRBaseReader::RequestData(
this->NumBlocksFromFile = 0;
vtkInformation *outInf = outputVector->GetInformationObject( 0 );
vtkHierarchicalBoxDataSet *output =
vtkHierarchicalBoxDataSet::SafeDownCast(
vtkOverlappingAMR *output =
vtkOverlappingAMR::SafeDownCast(
outInf->Get( vtkDataObject::DATA_OBJECT() ) );
assert( "pre: output AMR dataset is NULL" && ( output != NULL ) );
......
......@@ -20,13 +20,13 @@
#ifndef VTKAMRBASEREADER_H_
#define VTKAMRBASEREADER_H_
#include "vtkHierarchicalBoxDataSetAlgorithm.h"
#include "vtkOverlappingAMRAlgorithm.h"
#include <vector> // STL vector header
#include <map> // STL map header
#include <utility> // for STL pair
// Forward Declarations
class vtkHierarchicalBoxDataSet;
class vtkOverlappingAMR;
class vtkMultiProcessController;
class vtkDataArraySelection;
class vtkCallbackCommand;
......@@ -36,10 +36,10 @@ class vtkUniformGrid;
class vtkDataArray;
class VTK_AMR_EXPORT vtkAMRBaseReader :
public vtkHierarchicalBoxDataSetAlgorithm
public vtkOverlappingAMRAlgorithm
{
public:
vtkTypeMacro( vtkAMRBaseReader, vtkHierarchicalBoxDataSetAlgorithm );
vtkTypeMacro( vtkAMRBaseReader, vtkOverlappingAMRAlgorithm );
void PrintSelf(std::ostream &os, vtkIndent indent);
// Description:
......@@ -129,14 +129,14 @@ class VTK_AMR_EXPORT vtkAMRBaseReader :
// Description:
// This method assigns blocks to processes using block-cyclic distribution.
// It is the method that is used to load distributed AMR data by default.
void AssignAndLoadBlocks( vtkHierarchicalBoxDataSet *amrds );
void AssignAndLoadBlocks( vtkOverlappingAMR *amrds );
// Description:
// This method loads all the blocks in the BlockMap for the given process.
// It assumes that the downstream module is doing an upstream request with
// the flag LOAD_REQUESTED_BLOCKS which indicates that the downstream filter
// has already assigned which blocks are needed for each process.
void LoadRequestedBlocks( vtkHierarchicalBoxDataSet *amrds );
void LoadRequestedBlocks( vtkOverlappingAMR *amrds );
// Description:
// Loads the AMR data corresponding to the given field name.
......@@ -257,7 +257,7 @@ class VTK_AMR_EXPORT vtkAMRBaseReader :
int NumBlocksFromFile;
int NumBlocksFromCache;
vtkHierarchicalBoxDataSet *Metadata;
vtkOverlappingAMR *Metadata;
bool LoadedMetaData;
......
......@@ -15,7 +15,7 @@
#include "vtkAMREnzoReader.h"
#include "vtkObjectFactory.h"
#include "vtkHierarchicalBoxDataSet.h"
#include "vtkOverlappingAMR.h"
#include "vtkUniformGrid.h"
#include "vtkDataArraySelection.h"
#include "vtkDataArray.h"
......
......@@ -25,7 +25,7 @@
#include <map> // For STL map
class vtkHierarchicalBoxDataSet;
class vtkOverlappingAMR;
class vtkEnzoReaderInternal;
class VTK_AMR_EXPORT vtkAMREnzoReader : public vtkAMRBaseReader
......
......@@ -14,7 +14,7 @@
=========================================================================*/
#include "vtkAMRFlashReader.h"
#include "vtkObjectFactory.h"
#include "vtkHierarchicalBoxDataSet.h"
#include "vtkOverlappingAMR.h"
#include "vtkAMRUtilities.h"
#include "vtkByteSwap.h"
#include "vtkUniformGrid.h"
......
......@@ -23,7 +23,7 @@
#include "vtkAMRBaseReader.h"
class vtkHierarchicalBoxDataSet;
class vtkOverlappingAMR;
class vtkFlashReaderInternal;
class VTK_AMR_EXPORT vtkAMRFlashReader : public vtkAMRBaseReader
......
......@@ -15,7 +15,7 @@
#include "vtkAMRUtilities.h"
#include "vtkAMRBox.h"
#include "vtkUniformGrid.h"
#include "vtkHierarchicalBoxDataSet.h"
#include "vtkOverlappingAMR.h"
#include "vtkMultiProcessController.h"
#include "vtkMPIController.h"
#include "vtkCommunicator.h"
......@@ -33,7 +33,7 @@ void vtkAMRUtilities::PrintSelf( std::ostream& os, vtkIndent indent )
//------------------------------------------------------------------------------
void vtkAMRUtilities::GenerateMetaData(
vtkHierarchicalBoxDataSet *amrData,
vtkOverlappingAMR *amrData,
vtkMultiProcessController *controller )
{
// Sanity check
......@@ -51,7 +51,7 @@ void vtkAMRUtilities::GenerateMetaData(
//------------------------------------------------------------------------------
void vtkAMRUtilities::ComputeDataSetOrigin(
double origin[3], vtkHierarchicalBoxDataSet *amrData,
double origin[3], vtkOverlappingAMR *amrData,
vtkMultiProcessController *controller )
{
// Sanity check
......@@ -107,7 +107,7 @@ void vtkAMRUtilities::ComputeDataSetOrigin(
//------------------------------------------------------------------------------
void vtkAMRUtilities::ComputeGlobalBounds(
double bounds[6], vtkHierarchicalBoxDataSet *amrData,
double bounds[6], vtkOverlappingAMR *amrData,
vtkMultiProcessController *myController )
{
// Sanity check
......@@ -187,7 +187,7 @@ void vtkAMRUtilities::ComputeGlobalBounds(
//------------------------------------------------------------------------------
void vtkAMRUtilities::CollectAMRMetaData(
vtkHierarchicalBoxDataSet *amrData,
vtkOverlappingAMR *amrData,
vtkMultiProcessController *myController )
{
// Sanity check
......@@ -211,7 +211,7 @@ void vtkAMRUtilities::CollectAMRMetaData(
//------------------------------------------------------------------------------
void vtkAMRUtilities::SerializeMetaData(
vtkHierarchicalBoxDataSet *amrData,
vtkOverlappingAMR *amrData,
unsigned char *&buffer,
vtkIdType &numBytes )
{
......@@ -288,7 +288,7 @@ void vtkAMRUtilities::DeserializeMetaData(
//------------------------------------------------------------------------------
void vtkAMRUtilities::DistributeMetaData(
vtkHierarchicalBoxDataSet *amrData,
vtkOverlappingAMR *amrData,
vtkMultiProcessController *myController )
{
// Sanity check
......@@ -443,7 +443,7 @@ void vtkAMRUtilities::CreateAMRBoxForGrid(
//------------------------------------------------------------------------------
void vtkAMRUtilities::ComputeLocalMetaData(
double origin[3], vtkHierarchicalBoxDataSet* myAMRData, const int process )
double origin[3], vtkOverlappingAMR* myAMRData, const int process )
{
// Sanity check
assert( "Input AMR data is NULL" && (myAMRData != NULL) );
......@@ -468,7 +468,7 @@ void vtkAMRUtilities::ComputeLocalMetaData(
//------------------------------------------------------------------------------
void vtkAMRUtilities::ComputeLevelRefinementRatio(
vtkHierarchicalBoxDataSet *amr )
vtkOverlappingAMR *amr )
{
// sanity check
assert( "Input AMR Data is NULL" && (amr != NULL) );
......@@ -485,7 +485,7 @@ void vtkAMRUtilities::ComputeLevelRefinementRatio(
{
// No refinement, data-set has only a single level.
// The refinement ratio is set to 2 to satisfy the
// vtkHierarchicalBoxDataSet requirement.
// vtkOverlappingAMR requirement.
amr->SetRefinementRatio(0,2);
return;
}
......
......@@ -30,7 +30,7 @@
// Forward declarations
class vtkAMRBox;
class vtkHierarchicalBoxDataSet;
class vtkOverlappingAMR;
class vtkMPIController;
class vtkMultiProcessController;
class vtkUniformGrid;
......@@ -48,7 +48,7 @@ class VTK_PARALLEL_EXPORT vtkAMRUtilities : public vtkObject
// Specifically, this method computes & distributes the AMR box
// metadata and computes the level refinement ratio.
static void GenerateMetaData(
vtkHierarchicalBoxDataSet *amrData,
vtkOverlappingAMR *amrData,
vtkMultiProcessController *myController=NULL );
// Description:
......@@ -59,7 +59,7 @@ class VTK_PARALLEL_EXPORT vtkAMRUtilities : public vtkObject
// Upon return of this method, the bounds array consists of the global
// bounds ordered as follows: {xmin,ymin,zmin,xmax,ymax,zmax}
static void ComputeGlobalBounds(
double bounds[6], vtkHierarchicalBoxDataSet *amrData,
double bounds[6], vtkOverlappingAMR *amrData,
vtkMultiProcessController *myController=NULL );
// Description:
......@@ -73,7 +73,7 @@ class VTK_PARALLEL_EXPORT vtkAMRUtilities : public vtkObject
// Only level 0 is checked, since the grid(s) at level 0 is guaranteed to
// cover the entire domain.
static void ComputeDataSetOrigin(
double origin[3], vtkHierarchicalBoxDataSet *amrData,
double origin[3], vtkOverlappingAMR *amrData,
vtkMultiProcessController *myController=NULL );
// Description:
......@@ -81,7 +81,7 @@ class VTK_PARALLEL_EXPORT vtkAMRUtilities : public vtkObject
// If the data is distributed, the AMR meta-data is communicated s.t. each
// process has a complete hierarchical box data-set with meta-data.
static void CollectAMRMetaData(
vtkHierarchicalBoxDataSet *amrData,
vtkOverlappingAMR *amrData,
vtkMultiProcessController *myController=NULL );
// Description:
......@@ -96,7 +96,7 @@ class VTK_PARALLEL_EXPORT vtkAMRUtilities : public vtkObject
// 2) Within each level, the refinement ratios are the same for all blocks.
// 3) The refinement ratio is uniform along each dimension of the block.
static void ComputeLevelRefinementRatio(
vtkHierarchicalBoxDataSet *amrData );
vtkOverlappingAMR *amrData );
protected:
vtkAMRUtilities() {};
......@@ -106,7 +106,7 @@ class VTK_PARALLEL_EXPORT vtkAMRUtilities : public vtkObject
// This method serializes all the metadata within the given instance of
// AMR data-set in to the user-supplied buffer.
static void SerializeMetaData(
vtkHierarchicalBoxDataSet *amrData,
vtkOverlappingAMR *amrData,
unsigned char *&buffer,
vtkIdType &numBytes );
......@@ -122,7 +122,7 @@ class VTK_PARALLEL_EXPORT vtkAMRUtilities : public vtkObject
// This method distributes the AMR data to all process. Upon completion,
// the give AMR data-set has a complete tree with all meta-data.
static void DistributeMetaData(
vtkHierarchicalBoxDataSet *amrData,
vtkOverlappingAMR *amrData,
vtkMultiProcessController *myController );
// Description:
......@@ -139,7 +139,7 @@ class VTK_PARALLEL_EXPORT vtkAMRUtilities : public vtkObject
// Description:
// Computes the metadata for the grids that are owned by this process.
static void ComputeLocalMetaData(
double origin[3], vtkHierarchicalBoxDataSet *myAMRData,
double origin[3], vtkOverlappingAMR *myAMRData,
const int process );
private:
......
Supports Markdown
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