Commit c2bc1779 authored by brugger's avatar brugger

I modified all the vtk classes that inherit from vtDataSetaToDataSetFilter
to inherit from vtkDataSetAlgorithm, since vtkDataSetToDataSetFilter
is deprecated and isn't in VTK6.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@19971 18c085ea-50e0-402c-830e-de6fd14e8384
parent 98276673
......@@ -37,10 +37,15 @@
*****************************************************************************/
#include "vtkCrackWidthFilter.h"
#include <math.h>
#include <vtkCell.h>
#include <vtkCellData.h>
#include <vtkDataSet.h>
#include <vtkDoubleArray.h>
#include <vtkInformation.h>
#include <vtkInformationVector.h>
#include <vtkMassProperties.h>
#include <vtkObjectFactory.h>
#include <vtkSlicer.h>
......@@ -49,21 +54,13 @@
#include <ImproperUseException.h>
#include <vtkVisItUtility.h>
#include <math.h>
#ifdef SUNOS
#include <ieeefp.h> // for 'finite'
#endif
vtkStandardNewMacro(vtkCrackWidthFilter);
// ***************************************************************************
// Method: vtkCrackWidthFilter constructor
// Method: vtkCrackWidthFilter constructor
//
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
//
// Modifications:
// Kathleen Bonnell, Wed Sep 13 07:45:06 PDT 2006
......@@ -90,12 +87,11 @@ vtkCrackWidthFilter::vtkCrackWidthFilter()
this->MassProp = vtkMassProperties::New();
}
// ***************************************************************************
// Method: vtkCrackWidthFilter destructor
// Method: vtkCrackWidthFilter destructor
//
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
//
// Modifications:
// Kathleen Bonnell, Wed Sep 13 07:45:06 PDT 2006
......@@ -111,10 +107,10 @@ vtkCrackWidthFilter::vtkCrackWidthFilter()
vtkCrackWidthFilter::~vtkCrackWidthFilter()
{
this->SetCrack1Var(NULL);
this->SetCrack2Var(NULL);
this->SetCrack3Var(NULL);
this->SetStrainVar(NULL);
this->SetCrack1Var(NULL);
this->SetCrack2Var(NULL);
this->SetCrack3Var(NULL);
this->SetStrainVar(NULL);
if (this->Slicer)
{
this->Slicer->Delete();
......@@ -128,12 +124,12 @@ vtkCrackWidthFilter::~vtkCrackWidthFilter()
}
// ***************************************************************************
// Method: vtkCrackWidthFilter_OrderThem
// Method: vtkCrackWidthFilter_OrderThem
//
// Purpose: Creates a max-to-min ordering based on the passed deltas.
// Purpose: Creates a max-to-min ordering based on the passed deltas.
//
// Programmer: Kathleen Bonnell
// Creation: October 13, 2006
// Programmer: Kathleen Bonnell
// Creation: October 13, 2006
//
// Modifications:
//
......@@ -171,12 +167,12 @@ vtkCrackWidthFilter_OrderThem(double delta1, double delta2, double delta3,
}
// ***************************************************************************
// Method: vtkCrackWidthFilter::Execute
// Method: vtkCrackWidthFilter::RequestData
//
// Purpose: Executes this filter.
// Purpose: Executes this filter.
//
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
//
// Modifications:
// Modified to determine crack width in max-to-min order based on
......@@ -185,11 +181,29 @@ vtkCrackWidthFilter_OrderThem(double delta1, double delta2, double delta3,
// Kathleen Biagas, Tue Aug 14 1:07:23 MST 2012
// Support double-precision.
//
// Eric Brugger, Wed Jan 9 16:25:38 PST 2013
// Modified to inherit from vtkDataSetAlgorithm.
//
// ***************************************************************************
void
vtkCrackWidthFilter::Execute()
int
vtkCrackWidthFilter::RequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
//
// Initialize some frequently used values.
//
vtkDataSet *input = vtkDataSet::SafeDownCast(
inInfo->Get(vtkDataObject::DATA_OBJECT()));
vtkDataSet *output = vtkDataSet::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
if (this->StrainVar == NULL)
EXCEPTION0(ImproperUseException);
......@@ -198,8 +212,6 @@ vtkCrackWidthFilter::Execute()
this->Crack3Var == NULL)
EXCEPTION0(ImproperUseException);
vtkDataSet *input = GetInput();
vtkCellData *inCD = input->GetCellData();
this->Slicer->SetInput(input);
......@@ -219,7 +231,6 @@ vtkCrackWidthFilter::Execute()
if (cd1 == NULL || cd2 == NULL || cd3 == NULL)
EXCEPTION0(ImproperUseException);
vtkDataSet *output = GetOutput();
output->DeepCopy(input);
vtkIdType numCells = input->GetNumberOfCells();
......@@ -260,7 +271,6 @@ vtkCrackWidthFilter::Execute()
// T33 for crack dir3 = component 8 of strain_tensor
//
//
// step through cells, calculating cell centers and crack widths for
// each crack direction. Terminate early when possible.
......@@ -338,7 +348,6 @@ vtkCrackWidthFilter::Execute()
}
}
output->GetCellData()->AddArray(cellCenters);
output->GetCellData()->CopyFieldOn("avtCellCenters");
cellCenters->Delete();
......@@ -354,26 +363,27 @@ vtkCrackWidthFilter::Execute()
output->GetCellData()->AddArray(crack3Width);
output->GetCellData()->CopyFieldOn("avtCrack3Width");
crack3Width->Delete();
}
return 1;
}
// ***************************************************************************
// Method: vtkCrackWidthFilter::CrackWidthForCell
// Method: vtkCrackWidthFilter::CrackWidthForCell
//
// Purpose: Determines the crack width for a given cell
// Purpose: Determines the crack width for a given cell
//
// Arguments:
// cell The cell.
// cellId The id of the cell.
// center The coordinates of the cell center.
// delta A component of strain_tensor
// dir A vector representing the diretion of the crack.
// zoneVol A volume of this cell.
// cell The cell.
// cellId The id of the cell.
// center The coordinates of the cell center.
// delta A component of strain_tensor
// dir A vector representing the diretion of the crack.
// zoneVol A volume of this cell.
//
// Returns: The width of the crack.
// Returns: The width of the crack.
//
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
//
// Modifications:
// Kathleen Bonnell, Wed Sep 13 07:52:03 PDT 2006
......@@ -399,24 +409,23 @@ vtkCrackWidthFilter::CrackWidthForCell(vtkCell *cell, vtkIdType cellId,
this->MassProp->SetInput(this->Slicer->GetOutput());
this->MassProp->Update();
L = zVol / this->MassProp->GetSurfaceArea();
}
}
return L*(1.0-exp(-delta));
}
// ***************************************************************************
// Method: vtkCrackWidthFilter::GetMaxCrackWidth
// Method: vtkCrackWidthFilter::GetMaxCrackWidth
//
// Purpose: Returns the maximum calculated crack width for a specified
// crack direction.
// Purpose: Returns the maximum calculated crack width for a specified
// crack direction.
//
// Arguments:
// whichCrack The specified crack direction.
//
// Returns: The maximum crack width.
// Returns: The maximum crack width.
//
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
//
// Modifications:
//
......@@ -433,4 +442,3 @@ vtkCrackWidthFilter::GetMaxCrackWidth(int whichCrack)
default: return this->MaxCrack1Width;
}
}
......@@ -39,22 +39,22 @@
#ifndef VTK_CRACK_WIDTH_FILTER_H
#define VTK_CRACK_WIDTH_FILTER_H
#include <vtkDataSetToDataSetFilter.h>
#include <vtkDataSetAlgorithm.h>
class vtkCell;
class vtkMassProperties;
class vtkSlicer;
// ****************************************************************************
// Class: vtkCrackWidthFilter
// Class: vtkCrackWidthFilter
//
// Purpose:
// Calculates the width of cracks along given crack directions for
// each cell, and stores each width in a cell array. Also calculates
// the cell centers.
//
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
// Programmer: Kathleen Bonnell
// Creation: August 22, 2005
//
// Modifications:
// Kathleen Bonnell, Wed Sep 13 07:42:59 PDT 2006
......@@ -68,12 +68,15 @@ class vtkSlicer;
// Kathleen Biagas, Tue Aug 14 15:55:27 MST 2012
// Removed unused vtkQuad and vtkTriangle.
//
// Eric Brugger, Wed Jan 9 16:20:40 PST 2013
// Modified to inherit from vtkDataSetAlgorithm.
//
// ****************************************************************************
class vtkCrackWidthFilter : public vtkDataSetToDataSetFilter
class vtkCrackWidthFilter : public vtkDataSetAlgorithm
{
public:
vtkTypeMacro(vtkCrackWidthFilter,vtkDataSetToDataSetFilter);
vtkTypeMacro(vtkCrackWidthFilter,vtkDataSetAlgorithm);
static vtkCrackWidthFilter *New();
......@@ -92,7 +95,9 @@ class vtkCrackWidthFilter : public vtkDataSetToDataSetFilter
vtkCrackWidthFilter();
~vtkCrackWidthFilter();
void Execute();
virtual int RequestData(vtkInformation *,
vtkInformationVector **,
vtkInformationVector *);
private:
double MaxCrack1Width;
......@@ -107,17 +112,14 @@ class vtkCrackWidthFilter : public vtkDataSetToDataSetFilter
vtkSlicer *Slicer;
vtkMassProperties *MassProp;
double CrackWidthForCell(vtkCell *cell, vtkIdType cellId, const double *center,
const double delta, const double *dir,
const double zvol, const double L1L2);
double CrackWidthForCell(vtkCell *cell, vtkIdType cellId,
const double *center,
const double delta, const double *dir,
const double zvol, const double L1L2);
vtkCrackWidthFilter(const vtkCrackWidthFilter&); // Not implemented.
void operator=(const vtkCrackWidthFilter&); // Not implemented.
};
#endif
This diff is collapsed.
......@@ -46,9 +46,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define __vtkDataSetRemoveGhostCells_h
#include <visit_vtk_exports.h>
#include "vtkDataSetToDataSetFilter.h"
#include "vtkDataSetAlgorithm.h"
// ****************************************************************************
// Class: vtkDataSetRemoveGhostCells
//
// Modifications:
// Kathleen Bonnell, Wed Jul 10 16:02:56 PDT 2002
// Removed FindCellMins and FindCellMax methods.
......@@ -62,11 +64,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Hank Childs, Sun Oct 28 10:48:50 PST 2007
// Added GhostZoneTypesToRemove
//
class VISIT_VTK_API vtkDataSetRemoveGhostCells : public vtkDataSetToDataSetFilter
// Eric Brugger, Wed Jan 9 14:56:34 PST 2013
// Modified to inherit from vtkDataSetAlgorithm.
//
// ****************************************************************************
class VISIT_VTK_API vtkDataSetRemoveGhostCells : public vtkDataSetAlgorithm
{
public:
static vtkDataSetRemoveGhostCells *New();
vtkTypeMacro(vtkDataSetRemoveGhostCells, vtkDataSetToDataSetFilter);
vtkTypeMacro(vtkDataSetRemoveGhostCells, vtkDataSetAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
vtkSetMacro(GhostNodeTypesToRemove,unsigned char);
......@@ -79,11 +85,10 @@ protected:
vtkDataSetRemoveGhostCells();
~vtkDataSetRemoveGhostCells() {};
unsigned char GhostNodeTypesToRemove;
unsigned char GhostZoneTypesToRemove;
virtual int RequestData(vtkInformation *,
vtkInformationVector **,
vtkInformationVector *);
// Usual data generation method
void Execute();
// Specific data generation methods
void StructuredGridExecute();
void UnstructuredGridExecute();
......@@ -91,6 +96,12 @@ protected:
void PolyDataExecute();
void GenericExecute();
vtkDataSet *input;
vtkDataSet *output;
unsigned char GhostNodeTypesToRemove;
unsigned char GhostZoneTypesToRemove;
private:
vtkDataSetRemoveGhostCells(const vtkDataSetRemoveGhostCells&);
void operator=(const vtkDataSetRemoveGhostCells&);
......
......@@ -21,6 +21,8 @@
#include "vtkCellData.h"
#include "vtkDataSet.h"
#include "vtkIdList.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkRectilinearGrid.h"
......@@ -38,7 +40,6 @@ vtkVisItCellDataToPointData::vtkVisItCellDataToPointData()
// ****************************************************************************
// Modifications:
//
// Hank Childs, Wed Mar 9 16:23:01 PST 2005
// Fix minor UMR.
//
......@@ -50,9 +51,10 @@ vtkVisItCellDataToPointData::vtkVisItCellDataToPointData()
// Added templatized helper method to handle double-precision.
//
// ****************************************************************************
template <class Accessor> inline void
vtkVisItCellDataToPointData_Copy(int ptId, double weight, int *ids, int nids,
Accessor var_out, Accessor var_in)
Accessor var_out, Accessor var_in)
{
double val = 0.;
for (int m = 0 ; m < nids ; ++m)
......@@ -62,12 +64,32 @@ vtkVisItCellDataToPointData_Copy(int ptId, double weight, int *ids, int nids,
var_out.SetComponent(ptId, val);
}
void vtkVisItCellDataToPointData::Execute()
// ****************************************************************************
// Modifications:
// Eric Brugger, Wed Jan 9 14:48:17 PST 2013
// Modified to inherit from vtkDataSetAlgorithm.
//
// ****************************************************************************
int vtkVisItCellDataToPointData::RequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
//
// Initialize some frequently used values.
//
vtkDataSet *input = vtkDataSet::SafeDownCast(
inInfo->Get(vtkDataObject::DATA_OBJECT()));
vtkDataSet *output = vtkDataSet::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
vtkIdType cellId, ptId, i, j, k, l, m;
vtkIdType numCells, numPts;
vtkDataSet *input= this->GetInput();
vtkDataSet *output= this->GetOutput();
vtkCellData *inPD=input->GetCellData();
vtkPointData *outPD=output->GetPointData();
vtkIdList *cellIds;
......@@ -86,7 +108,7 @@ void vtkVisItCellDataToPointData::Execute()
{
vtkErrorMacro(<<"No input point data!");
cellIds->Delete();
return;
return 1;
}
weights = new double[VTK_MAX_CELLS_PER_POINT];
......@@ -260,6 +282,8 @@ void vtkVisItCellDataToPointData::Execute()
cellIds->Delete();
delete [] weights;
return 1;
}
void vtkVisItCellDataToPointData::PrintSelf(ostream& os, vtkIndent indent)
......
......@@ -30,20 +30,29 @@
// of output you want.
// .SECTION See Also
// vtkDataSetToDataSetFilter vtkPointData vtkCellData vtkPointDataToCellData
// vtkDataSetAlgorithm vtkPointData vtkCellData vtkPointDataToCellData
#ifndef __vtkVisItCellDataToPointData_h
#define __vtkVisItCellDataToPointData_h
#include "vtkDataSetToDataSetFilter.h"
#include <visit_vtk_exports.h>
class VISIT_VTK_API vtkVisItCellDataToPointData : public vtkDataSetToDataSetFilter
#include "vtkDataSetAlgorithm.h"
// ****************************************************************************
// Class: vtkVisItCellDataToPointData
//
// Modifications:
// Eric Brugger, Wed Jan 9 14:42:30 PST 2013
// Modified to inherit from vtkDataSetAlgorithm.
//
// ****************************************************************************
class VISIT_VTK_API vtkVisItCellDataToPointData : public vtkDataSetAlgorithm
{
public:
static vtkVisItCellDataToPointData *New();
vtkTypeMacro(vtkVisItCellDataToPointData,vtkDataSetToDataSetFilter);
vtkTypeMacro(vtkVisItCellDataToPointData,vtkDataSetAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
......@@ -58,14 +67,15 @@ protected:
vtkVisItCellDataToPointData();
~vtkVisItCellDataToPointData() {};
void Execute();
virtual int RequestData(vtkInformation *,
vtkInformationVector **,
vtkInformationVector *);
int PassCellData;
private:
vtkVisItCellDataToPointData(const vtkVisItCellDataToPointData&); // Not implemented.
void operator=(const vtkVisItCellDataToPointData&); // Not implemented.
};
#endif
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