Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bill Lorensen
VTK
Commits
4a7a1b4f
Commit
4a7a1b4f
authored
Feb 16, 2012
by
George Zagaris
Browse files
ENH:Make AMRResampler a vtkOverlappingAMRAlgorithm
Change-Id: I81a3f8add9cac92b59d80f448d2f75d425aec525
parent
aa0820b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
AMR/vtkAMRResampleFilter.cxx
View file @
4a7a1b4f
...
...
@@ -20,7 +20,7 @@
#include
"vtkInformation.h"
#include
"vtkInformationVector.h"
#include
"vtkMultiBlockDataSet.h"
#include
"vtk
HierarchicalBoxDataSet
.h"
#include
"vtk
OverlappingAMR
.h"
#include
"vtkMultiProcessController.h"
#include
"vtkUniformGrid.h"
#include
"vtkIndent.h"
...
...
@@ -94,7 +94,7 @@ int vtkAMRResampleFilter::FillInputPortInformation(
{
assert
(
"pre: information object is NULL"
&&
(
info
!=
NULL
)
);
info
->
Set
(
vtkAlgorithm
::
INPUT_REQUIRED_DATA_TYPE
(),
"vtk
HierarchicalBoxDataSet
"
);
vtkAlgorithm
::
INPUT_REQUIRED_DATA_TYPE
(),
"vtk
OverlappingAMR
"
);
return
1
;
}
...
...
@@ -144,9 +144,9 @@ int vtkAMRResampleFilter::RequestInformation(
if
(
this
->
DemandDrivenMode
==
1
&&
input
->
Has
(
vtkCompositeDataPipeline
::
COMPOSITE_DATA_META_DATA
()
)
)
{
this
->
AMRMetaData
=
vtk
HierarchicalBoxDataSet
::
New
();
this
->
AMRMetaData
=
vtk
OverlappingAMR
::
New
();
this
->
AMRMetaData
->
ShallowCopy
(
vtk
HierarchicalBoxDataSet
::
SafeDownCast
(
vtk
OverlappingAMR
::
SafeDownCast
(
input
->
Get
(
vtkCompositeDataPipeline
::
COMPOSITE_DATA_META_DATA
()
)
)
);
...
...
@@ -172,8 +172,8 @@ int vtkAMRResampleFilter::RequestData(
// STEP 0: Get input object
vtkInformation
*
input
=
inputVector
[
0
]
->
GetInformationObject
(
0
);
assert
(
"pre: Null information object!"
&&
(
input
!=
NULL
)
);
vtk
HierarchicalBoxDataSet
*
amrds
=
vtk
HierarchicalBoxDataSet
::
SafeDownCast
(
vtk
OverlappingAMR
*
amrds
=
vtk
OverlappingAMR
::
SafeDownCast
(
input
->
Get
(
vtkDataObject
::
DATA_OBJECT
()));
assert
(
"pre: input AMR dataset is NULL"
&&
(
amrds
!=
NULL
)
);
...
...
@@ -330,7 +330,7 @@ void vtkAMRResampleFilter::ComputeCellCentroid(
//-----------------------------------------------------------------------------
void
vtkAMRResampleFilter
::
TransferToCellCenters
(
vtkUniformGrid
*
g
,
vtk
HierarchicalBoxDataSet
*
amrds
)
vtkUniformGrid
*
g
,
vtk
OverlappingAMR
*
amrds
)
{
assert
(
"pre: uniform grid is NULL"
&&
(
g
!=
NULL
)
);
assert
(
"pre: AMR data-strucutre is NULL"
&&
(
amrds
!=
NULL
)
);
...
...
@@ -389,7 +389,7 @@ void vtkAMRResampleFilter::TransferToCellCenters(
//-----------------------------------------------------------------------------
void
vtkAMRResampleFilter
::
SearchForDonorGridAtLevel
(
double
q
[
3
],
vtk
HierarchicalBoxDataSet
*
amrds
,
double
q
[
3
],
vtk
OverlappingAMR
*
amrds
,
unsigned
int
level
,
unsigned
int
donorGridId
,
vtkUniformGrid
*&
donorGrid
,
int
&
donorCellIdx
)
{
...
...
@@ -428,7 +428,7 @@ void vtkAMRResampleFilter::SearchForDonorGridAtLevel(
//-----------------------------------------------------------------------------
int
vtkAMRResampleFilter
::
ProbeGridPointInAMR
(
double
q
[
3
],
vtkUniformGrid
*&
donorGrid
,
unsigned
int
&
donorLevel
,
vtk
HierarchicalBoxDataSet
*
amrds
,
unsigned
int
maxLevel
)
vtk
OverlappingAMR
*
amrds
,
unsigned
int
maxLevel
)
{
assert
(
"pre: AMR dataset is NULL"
&&
amrds
!=
NULL
);
...
...
@@ -577,7 +577,7 @@ int vtkAMRResampleFilter::ProbeGridPointInAMR(
//-----------------------------------------------------------------------------
void
vtkAMRResampleFilter
::
SearchGridAncestors
(
double
q
[
3
],
vtk
HierarchicalBoxDataSet
*
amrds
,
vtk
OverlappingAMR
*
amrds
,
unsigned
int
&
level
,
unsigned
int
&
gridId
,
vtkUniformGrid
*&
grid
,
...
...
@@ -611,7 +611,7 @@ void vtkAMRResampleFilter::SearchGridAncestors(double q[3],
}
//-----------------------------------------------------------------------------
void
vtkAMRResampleFilter
::
SearchGridDecendants
(
double
q
[
3
],
vtk
HierarchicalBoxDataSet
*
amrds
,
vtk
OverlappingAMR
*
amrds
,
unsigned
int
maxLevel
,
unsigned
int
&
level
,
unsigned
int
&
gridId
,
...
...
@@ -661,7 +661,7 @@ void vtkAMRResampleFilter::SearchGridDecendants(double q[3],
int
vtkAMRResampleFilter
::
ProbeGridPointInAMRGraph
(
double
q
[
3
],
vtkUniformGrid
*&
donorGrid
,
unsigned
int
&
donorLevel
,
unsigned
int
&
donorGridId
,
vtk
HierarchicalBoxDataSet
*
amrds
,
unsigned
int
maxLevel
)
vtk
OverlappingAMR
*
amrds
,
unsigned
int
maxLevel
)
{
assert
(
"pre: AMR dataset is NULL"
&&
amrds
!=
NULL
);
...
...
@@ -704,7 +704,7 @@ ProbeGridPointInAMRGraph(double q[3], vtkUniformGrid *&donorGrid,
//-----------------------------------------------------------------------------
void
vtkAMRResampleFilter
::
TransferToGridNodes
(
vtkUniformGrid
*
g
,
vtk
HierarchicalBoxDataSet
*
amrds
)
vtkUniformGrid
*
g
,
vtk
OverlappingAMR
*
amrds
)
{
this
->
NumberOfBlocksTested
=
0
;
this
->
NumberOfBlocksVisSkipped
=
0
;
...
...
@@ -835,7 +835,7 @@ void vtkAMRResampleFilter::TransferToGridNodes(
//-----------------------------------------------------------------------------
void
vtkAMRResampleFilter
::
TransferSolution
(
vtkUniformGrid
*
g
,
vtk
HierarchicalBoxDataSet
*
amrds
)
vtkUniformGrid
*
g
,
vtk
OverlappingAMR
*
amrds
)
{
assert
(
"pre: uniform grid is NULL"
&&
(
g
!=
NULL
)
);
assert
(
"pre: AMR data-strucutre is NULL"
&&
(
amrds
!=
NULL
)
);
...
...
@@ -852,8 +852,8 @@ void vtkAMRResampleFilter::TransferSolution(
//-----------------------------------------------------------------------------
void
vtkAMRResampleFilter
::
ExtractRegion
(
vtk
HierarchicalBoxDataSet
*
amrds
,
vtkMultiBlockDataSet
*
mbds
,
vtk
HierarchicalBoxDataSet
*
metadata
)
vtk
OverlappingAMR
*
amrds
,
vtkMultiBlockDataSet
*
mbds
,
vtk
OverlappingAMR
*
metadata
)
{
assert
(
"pre: input AMR data-structure is NULL"
&&
(
amrds
!=
NULL
)
);
...
...
@@ -888,7 +888,7 @@ void vtkAMRResampleFilter::ExtractRegion(
//-----------------------------------------------------------------------------
void
vtkAMRResampleFilter
::
ComputeAMRBlocksToLoad
(
vtk
HierarchicalBoxDataSet
*
metadata
)
vtk
OverlappingAMR
*
metadata
)
{
assert
(
"pre: metadata is NULL"
&&
(
metadata
!=
NULL
)
);
...
...
@@ -927,7 +927,7 @@ void vtkAMRResampleFilter::ComputeAMRBlocksToLoad(
//-----------------------------------------------------------------------------
void
vtkAMRResampleFilter
::
GetDomainParameters
(
vtk
HierarchicalBoxDataSet
*
amr
,
vtk
OverlappingAMR
*
amr
,
double
domainMin
[
3
],
double
domainMax
[
3
],
double
h
[
3
],
int
dims
[
3
],
double
&
rf
)
{
...
...
@@ -1090,7 +1090,7 @@ void vtkAMRResampleFilter::AdjustNumberOfSamplesInRegion(
//-----------------------------------------------------------------------------
void
vtkAMRResampleFilter
::
ComputeAndAdjustRegionParameters
(
vtk
HierarchicalBoxDataSet
*
amrds
,
double
h
[
3
]
)
vtk
OverlappingAMR
*
amrds
,
double
h
[
3
]
)
{
assert
(
"pre: AMR dataset is NULL"
&&
(
amrds
!=
NULL
)
);
...
...
@@ -1290,7 +1290,7 @@ bool vtkAMRResampleFilter::IsParallel()
//-----------------------------------------------------------------------------
vtkUniformGrid
*
vtkAMRResampleFilter
::
GetReferenceGrid
(
vtk
HierarchicalBoxDataSet
*
amrds
)
vtk
OverlappingAMR
*
amrds
)
{
assert
(
"pre:AMR dataset is NULL"
&&
(
amrds
!=
NULL
)
);
...
...
AMR/vtkAMRResampleFilter.h
View file @
4a7a1b4f
...
...
@@ -26,18 +26,18 @@
// Data of the input AMR dataset is assumed to be cell-centered.
//
// .SECTION See Also
// vtk
HierarchicalBoxDataSet
, vtkUniformGrid
// vtk
OverlappingAMR
, vtkUniformGrid
#ifndef __vtkAMRResampleFilter_h
#define __vtkAMRResampleFilter_h
#include
"vtkMultiBlockDataSetAlgorithm.h"
#include
<
vtkstd/
vector>
// For STL vector
#include
<vector>
// For STL vector
class
vtkInformation
;
class
vtkInformationVector
;
class
vtkUniformGrid
;
class
vtk
HierarchicalBoxDataSet
;
class
vtk
OverlappingAMR
;
class
vtkMultiBlockDataSet
;
class
vtkMultiProcessController
;
class
vtkFieldData
;
...
...
@@ -126,7 +126,7 @@ class VTK_AMR_EXPORT vtkAMRResampleFilter : public vtkMultiBlockDataSetAlgorithm
vtkAMRResampleFilter
();
virtual
~
vtkAMRResampleFilter
();
vtk
HierarchicalBoxDataSet
*
AMRMetaData
;
vtk
OverlappingAMR
*
AMRMetaData
;
vtkMultiBlockDataSet
*
ROI
;
// Pointer to the region of interest.
int
NumberOfSamples
[
3
];
int
GridNumberOfSamples
[
3
];
...
...
@@ -152,7 +152,7 @@ class VTK_AMR_EXPORT vtkAMRResampleFilter : public vtkMultiBlockDataSetAlgorithm
int
NumberOfFailedPoints
;
double
AverageLevel
;
// BTX
vtk
std
::
vector
<
int
>
BlocksToLoad
;
// Holds the ids of the blocks to load.
std
::
vector
<
int
>
BlocksToLoad
;
// Holds the ids of the blocks to load.
// ETX
// Description:
...
...
@@ -196,7 +196,7 @@ class VTK_AMR_EXPORT vtkAMRResampleFilter : public vtkMultiBlockDataSetAlgorithm
// grid at the given level that contains the point if one exists. If a grid
// is not found, donorGrid is set to NULL.
void
SearchForDonorGridAtLevel
(
double
q
[
3
],
vtk
HierarchicalBoxDataSet
*
amrds
,
double
q
[
3
],
vtk
OverlappingAMR
*
amrds
,
unsigned
int
level
,
unsigned
int
gridId
,
vtkUniformGrid
*&
donorGrid
,
int
&
donorCellIdx
);
...
...
@@ -207,7 +207,7 @@ class VTK_AMR_EXPORT vtkAMRResampleFilter : public vtkMultiBlockDataSetAlgorithm
// contains the probe point q.
int
ProbeGridPointInAMR
(
double
q
[
3
],
vtkUniformGrid
*&
donorGrid
,
unsigned
int
&
donorLevel
,
vtk
HierarchicalBoxDataSet
*
amrds
,
unsigned
int
maxLevel
);
vtk
OverlappingAMR
*
amrds
,
unsigned
int
maxLevel
);
// Description:
// Finds the AMR grid that contains the point q. If donorGrid points to a
...
...
@@ -217,30 +217,30 @@ class VTK_AMR_EXPORT vtkAMRResampleFilter : public vtkMultiBlockDataSetAlgorithm
int
ProbeGridPointInAMRGraph
(
double
q
[
3
],
vtkUniformGrid
*&
donorGrid
,
unsigned
int
&
donorLevel
,
unsigned
int
&
donorGridId
,
vtk
HierarchicalBoxDataSet
*
amrds
,
unsigned
int
maxLevel
);
vtk
OverlappingAMR
*
amrds
,
unsigned
int
maxLevel
);
// Description:
// Transfers the solution from the AMR dataset to the cell-centers of
// the given uniform grid.
void
TransferToCellCenters
(
vtkUniformGrid
*
g
,
vtk
HierarchicalBoxDataSet
*
amrds
);
vtkUniformGrid
*
g
,
vtk
OverlappingAMR
*
amrds
);
// Description:
// Transfer the solution from the AMR dataset to the nodes of the
// given uniform grid.
void
TransferToGridNodes
(
vtkUniformGrid
*
g
,
vtk
HierarchicalBoxDataSet
*
amrds
);
vtkUniformGrid
*
g
,
vtk
OverlappingAMR
*
amrds
);
// Description:
// Transfers the solution
void
TransferSolution
(
vtkUniformGrid
*
g
,
vtk
HierarchicalBoxDataSet
*
amrds
);
vtkUniformGrid
*
g
,
vtk
OverlappingAMR
*
amrds
);
// Description:
// Extract the region (as a multiblock) from the given AMR dataset.
void
ExtractRegion
(
vtk
HierarchicalBoxDataSet
*
amrds
,
vtkMultiBlockDataSet
*
mbds
,
vtk
HierarchicalBoxDataSet
*
metadata
);
vtk
OverlappingAMR
*
amrds
,
vtkMultiBlockDataSet
*
mbds
,
vtk
OverlappingAMR
*
metadata
);
// Description:
// Checks if the AMR block, described by a uniform grid, is within the
...
...
@@ -251,18 +251,18 @@ class VTK_AMR_EXPORT vtkAMRResampleFilter : public vtkMultiBlockDataSetAlgorithm
// Given a user-supplied region of interest and the metadata by a module
// upstream, this method generates the list of linear AMR block indices
// that need to be loaded.
void
ComputeAMRBlocksToLoad
(
vtk
HierarchicalBoxDataSet
*
metadata
);
void
ComputeAMRBlocksToLoad
(
vtk
OverlappingAMR
*
metadata
);
// Description:
// Computes the region parameters
void
ComputeRegionParameters
(
vtk
HierarchicalBoxDataSet
*
amrds
,
vtk
OverlappingAMR
*
amrds
,
int
N
[
3
],
double
min
[
3
],
double
max
[
3
],
double
h
[
3
]
);
// Description:
// This method accesses the domain boundaries
void
GetDomainParameters
(
vtk
HierarchicalBoxDataSet
*
amr
,
vtk
OverlappingAMR
*
amr
,
double
domainMin
[
3
],
double
domainMax
[
3
],
double
h
[
3
],
int
dims
[
3
],
double
&
rf
);
...
...
@@ -299,7 +299,7 @@ class VTK_AMR_EXPORT vtkAMRResampleFilter : public vtkMultiBlockDataSetAlgorithm
// region always fall within the AMR region and the number of samples is
// adjusted if the region of interest moves outsided the domain.
void
ComputeAndAdjustRegionParameters
(
vtk
HierarchicalBoxDataSet
*
amrds
,
double
h
[
3
]
);
vtk
OverlappingAMR
*
amrds
,
double
h
[
3
]
);
// Description:
// This method gets the region of interest as perscribed by the user.
...
...
@@ -311,7 +311,7 @@ class VTK_AMR_EXPORT vtkAMRResampleFilter : public vtkMultiBlockDataSetAlgorithm
// Description:
// Returns a reference grid from the amrdataset.
vtkUniformGrid
*
GetReferenceGrid
(
vtk
HierarchicalBoxDataSet
*
amrds
);
vtkUniformGrid
*
GetReferenceGrid
(
vtk
OverlappingAMR
*
amrds
);
// Description:
// Writes a uniform grid to a file. Used for debugging purposes.
...
...
@@ -325,7 +325,7 @@ class VTK_AMR_EXPORT vtkAMRResampleFilter : public vtkMultiBlockDataSetAlgorithm
// If none is found then the original grid information is returned.
// The search is limited to levels < maxLevel
void
SearchGridDecendants
(
double
q
[
3
],
vtk
HierarchicalBoxDataSet
*
amrds
,
vtk
OverlappingAMR
*
amrds
,
unsigned
int
maxLevel
,
unsigned
int
&
level
,
unsigned
int
&
gridId
,
...
...
@@ -335,7 +335,7 @@ class VTK_AMR_EXPORT vtkAMRResampleFilter : public vtkMultiBlockDataSetAlgorithm
// Find an ancestor of the specified grid that contains the point.
// If none is found then the original grid information is returned
void
SearchGridAncestors
(
double
q
[
3
],
vtk
HierarchicalBoxDataSet
*
amrds
,
vtk
OverlappingAMR
*
amrds
,
unsigned
int
&
level
,
unsigned
int
&
gridId
,
vtkUniformGrid
*&
grid
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment