Commit 9ed41922 authored by George Zagaris's avatar George Zagaris
Browse files

COMP: Use renamed class vtkAMRGhostExchange

Updates to reflect the class name change
vtkAMRDataTransferFilter->vtkAMRGhostExchange
parent 0b805013
......@@ -38,7 +38,8 @@
#include "vtkMultiProcessController.h"
#include "vtkAMRConnectivityFilter.h"
#include "vtkAMRDataTransferFilter.h"
#include "vtkAMRGhostExchange.h"
//#include "vtkAMRDataTransferFilter.h"
//
// Standard methods
......@@ -48,6 +49,9 @@ vtkStandardNewMacro( vtkAMRDualMeshExtractor );
vtkAMRDualMeshExtractor::vtkAMRDualMeshExtractor()
{
this->Controller = NULL;
this->NumberOfGhostLayers = 1;
this->SetNumberOfInputPorts( 1 );
this->SetNumberOfOutputPorts( 1 );
}
......@@ -158,22 +162,20 @@ vtkHierarchicalBoxDataSet* vtkAMRDualMeshExtractor::ExchangeGhostInformation(
// STEP 1: Create a single layer of ghost cells and exhange information
// at the ghost cells
vtkAMRDataTransferFilter* transferFilter = vtkAMRDataTransferFilter::New();
transferFilter->SetController(
vtkMultiProcessController::GetGlobalController() );
transferFilter->SetAMRDataSet( input );
transferFilter->SetNumberOfGhostLayers( 1 );
transferFilter->SetRemoteConnectivity(
vtkAMRGhostExchange *gridSolutionExchanger = vtkAMRGhostExchange::New();
gridSolutionExchanger->SetController( this->Controller );
gridSolutionExchanger->SetNumberOfGhostLayers( this->NumberOfGhostLayers );
gridSolutionExchanger->SetRemoteConnectivity(
connectivityFilter->GetRemoteConnectivity() );
transferFilter->SetLocalConnectivity(
gridSolutionExchanger->SetLocalConnectivity(
connectivityFilter->GetLocalConnectivity() );
transferFilter->Transfer();
gridSolutionExchanger->Update();
vtkHierarchicalBoxDataSet *newData = transferFilter->GetExtrudedData();
vtkHierarchicalBoxDataSet *newData = gridSolutionExchanger->GetOutput();
assert( "extruded data is NULL!" && (newData != NULL) );
connectivityFilter->Delete();
transferFilter->Delete();
gridSolutionExchanger->Delete();
return( newData );
}
......@@ -220,7 +222,7 @@ void vtkAMRDualMeshExtractor::ProcessDual(
assert( "pre: AMR dataset is NULL" && (amrData != NULL) );
assert( "pre: dual mesh is NULL" && (dualMesh != NULL) );
assert( "pre: level index out-of-bounds" &&
( myLevel >= 0 && myLevel < amrData->GetNumberOfLevels()) );
(myLevel < amrData->GetNumberOfLevels()) );
if( myLevel == 0 )
return;
......
......@@ -35,6 +35,7 @@ class vtkUniformGrid;
class vtkHierarchicalBoxDataSet;
class vtkMultiBlockDataSet;
class vtkUnstructuredGrid;
class vtkMultiProcessController;
class vtkIdList;
class VTK_AMR_EXPORT vtkAMRDualMeshExtractor :
......@@ -45,6 +46,19 @@ class VTK_AMR_EXPORT vtkAMRDualMeshExtractor :
vtkTypeMacro(vtkAMRDualMeshExtractor,vtkMultiBlockDataSetAlgorithm);
void PrintSelf( std::ostream& oss, vtkIndent indent);
// Description:
// Set & Get macro for the multi-process controller.
// The controller is set to NULL by default in which
// case the algorithm will operate serially.
vtkSetMacro(Controller,vtkMultiProcessController*);
vtkGetMacro(Controller,vtkMultiProcessController*);
// Description:
// Sets the number of ghost layers to use when stitching the duals at
// the inter-level boundaries. Default is 1.
vtkSetMacro(NumberOfGhostLayers,int);
vtkGetMacro(NumberOfGhostLayers,int);
// Description:
// This method writes multiblock data. Note, this method is mostly used
// for debugging purposes.
......@@ -121,6 +135,8 @@ class VTK_AMR_EXPORT vtkAMRDualMeshExtractor :
virtual int FillInputPortInformation(int port, vtkInformation *info);
virtual int FillOutputPortInformation(int port, vtkInformation *info);
vtkMultiProcessController *Controller;
int NumberOfGhostLayers;
private:
vtkAMRDualMeshExtractor(const vtkAMRDualMeshExtractor&);// Not implemented
void operator=(const vtkAMRDualMeshExtractor&);// Not implemented
......
......@@ -32,7 +32,7 @@
#include "vtkCellData.h"
#include "vtkAMRBox.h"
#include "vtkAMRConnectivityFilter.h"
#include "vtkAMRDataTransferFilter.h"
#include "vtkAMRGhostExchange.h"
#include "vtkHierarchicalBoxDataSet.h"
#include "vtkXMLHierarchicalBoxDataWriter.h"
#include "vtkMultiProcessController.h"
......@@ -75,18 +75,16 @@ int main( int argc, char **argv )
std::cout << " -- Transfering solution...\n";
std::cout.flush();
vtkAMRDataTransferFilter* transferFilter = vtkAMRDataTransferFilter::New();
transferFilter->SetController( Controller );
transferFilter->SetAMRDataSet( amrData );
transferFilter->SetNumberOfGhostLayers( 1 );
transferFilter->SetRemoteConnectivity(
connectivityFilter->GetRemoteConnectivity() );
transferFilter->SetLocalConnectivity(
connectivityFilter->GetLocalConnectivity() );
transferFilter->Transfer();
vtkHierarchicalBoxDataSet *newData = transferFilter->GetExtrudedData();
vtkAMRGhostExchange* gridSolutionExchanger = vtkAMRGhostExchange::New();
gridSolutionExchanger->SetAMRDataSet( amrData );
gridSolutionExchanger->SetNumberOfGhostLayers( 1 );
gridSolutionExchanger->SetRemoteConnectivity(
connectivityFilter->GetRemoteConnectivity() );
gridSolutionExchanger->SetLocalConnectivity(
connectivityFilter->GetLocalConnectivity() );
gridSolutionExchanger->Update();
vtkHierarchicalBoxDataSet *newData = gridSolutionExchanger->GetOutput();
assert( "extruded data is NULL!" && (newData != NULL) );
AMRCommon::WriteAMRData( newData, "EXTRUDED" );
......@@ -108,7 +106,6 @@ int main( int argc, char **argv )
dme->Delete();
amrData->Delete();
connectivityFilter->Delete();
transferFilter->Delete();
Controller->Finalize();
Controller->Delete();
......
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