VTK
vtkSPHKernel.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSPHKernel.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
55#ifndef vtkSPHKernel_h
56#define vtkSPHKernel_h
57
58#include "vtkFiltersPointsModule.h" // For export macro
60#include "vtkStdString.h" // For vtkStdString ivars
61
62class vtkIdList;
63class vtkDoubleArray;
64class vtkDataArray;
65class vtkFloatArray;
66
67
68class VTKFILTERSPOINTS_EXPORT vtkSPHKernel : public vtkInterpolationKernel
69{
70public:
72
76 void PrintSelf(ostream& os, vtkIndent indent);
78
80
84 vtkSetClampMacro(SpatialStep,double,0.0,VTK_FLOAT_MAX);
85 vtkGetMacro(SpatialStep,double);
87
89
92 vtkSetClampMacro(Dimension,int,1,3);
93 vtkGetMacro(Dimension,int);
95
97
101 vtkGetMacro(CutoffFactor,double);
103
105
112 vtkGetObjectMacro(CutoffArray,vtkDataArray);
114
116
121 vtkGetObjectMacro(DensityArray,vtkDataArray);
123
125
130 vtkGetObjectMacro(MassArray,vtkDataArray);
132
138 vtkPointData *pd);
139
148 virtual vtkIdType ComputeBasis(double x[3], vtkIdList *pIds, vtkIdType ptId=0);
149
154 virtual vtkIdType ComputeWeights(double x[3], vtkIdList *pIds,
155 vtkDoubleArray *weights);
156
161 virtual vtkIdType ComputeDerivWeights(double x[3], vtkIdList *pIds,
162 vtkDoubleArray *weights,
163 vtkDoubleArray *gradWeights);
164
168 virtual double ComputeFunctionWeight(const double d) = 0;
169
174 virtual double ComputeDerivWeight(const double d) = 0;
175
177
183 vtkGetMacro(NormFactor,double);
185
186protected:
189
190 // Instance variables
191 double SpatialStep; //also known as smoothing length h
192 int Dimension; //sptial dimension of the kernel
193
194 // Optional arrays aid in the interpolation process (computes volume)
198
199 // Internal data members generated during construction and initialization
200 // Terminology is spatial step = smoothing length h
201 double CutoffFactor; //varies across each kernel, e.g. cubic=2, quartic=2.5, quintic=3
202 double Cutoff; //the spatial step * cutoff factor
203 double Sigma; //normalization constant
204 double DistNorm; //distance normalization factor 1/(spatial step)
205 double NormFactor; //dimensional normalization factor sigma/(spatial step)^Dimension
206 double DefaultVolume; //if mass and density arrays not specified, use this
207 bool UseCutoffArray; //if single component cutoff array provided
208 bool UseArraysForVolume; //if both mass and density arrays are present
209
210private:
211 vtkSPHKernel(const vtkSPHKernel&) VTK_DELETE_FUNCTION;
212 void operator=(const vtkSPHKernel&) VTK_DELETE_FUNCTION;
213};
214
215#endif
abstract class to quickly locate points in 3-space
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
dynamic, self-adjusting array of double
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
list of point or cell ids
Definition: vtkIdList.h:37
a simple class to control print indentation
Definition: vtkIndent.h:40
base class for interpolation kernels
represent and manipulate point attribute data
Definition: vtkPointData.h:38
a family of SPH interpolation kernels
Definition: vtkSPHKernel.h:69
double DistNorm
Definition: vtkSPHKernel.h:204
vtkDataArray * DensityArray
Definition: vtkSPHKernel.h:196
vtkDataArray * CutoffArray
Definition: vtkSPHKernel.h:195
double CutoffFactor
Definition: vtkSPHKernel.h:201
virtual vtkIdType ComputeWeights(double x[3], vtkIdList *pIds, vtkDoubleArray *weights)
Given a point x, and a list of basis points pIds, compute interpolation weights associated with these...
virtual double ComputeDerivWeight(const double d)=0
Compute weighting factor for derivative quantities given a normalized distance from a sample point.
virtual void SetDensityArray(vtkDataArray *)
Specify the (optional) density array.
virtual void SetMassArray(vtkDataArray *)
Specify the (optional) mass array.
virtual vtkIdType ComputeDerivWeights(double x[3], vtkIdList *pIds, vtkDoubleArray *weights, vtkDoubleArray *gradWeights)
Given a point x, and a list of basis points pIds, compute interpolation weights, plus derivative weig...
double SpatialStep
Definition: vtkSPHKernel.h:191
double DefaultVolume
Definition: vtkSPHKernel.h:206
virtual void Initialize(vtkAbstractPointLocator *loc, vtkDataSet *ds, vtkPointData *pd)
Produce the computational parameters for the kernel.
double NormFactor
Definition: vtkSPHKernel.h:205
virtual vtkIdType ComputeBasis(double x[3], vtkIdList *pIds, vtkIdType ptId=0)
Given a point x (and optional associated ptId), determine the points around x which form an interpola...
virtual double ComputeFunctionWeight(const double d)=0
Compute weighting factor given a normalized distance from a sample point.
vtkDataArray * MassArray
Definition: vtkSPHKernel.h:197
bool UseArraysForVolume
Definition: vtkSPHKernel.h:208
virtual void SetCutoffArray(vtkDataArray *)
Specify the (optional) array defining a cutoff distance.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
bool UseCutoffArray
Definition: vtkSPHKernel.h:207
int vtkIdType
Definition: vtkType.h:287
#define VTK_FLOAT_MAX
Definition: vtkType.h:161