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
59 #include "vtkInterpolationKernel.h"
60 #include "vtkStdString.h" // For vtkStdString ivars
61 
62 class vtkIdList;
63 class vtkDoubleArray;
64 class vtkDataArray;
65 class vtkFloatArray;
66 
67 
68 class VTKFILTERSPOINTS_EXPORT vtkSPHKernel : public vtkInterpolationKernel
69 {
70 public:
72 
76  void PrintSelf(ostream& os, vtkIndent indent) override;
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 
111  virtual void SetCutoffArray(vtkDataArray*);
112  vtkGetObjectMacro(CutoffArray,vtkDataArray);
114 
116 
120  virtual void SetDensityArray(vtkDataArray*);
121  vtkGetObjectMacro(DensityArray,vtkDataArray);
123 
125 
129  virtual void SetMassArray(vtkDataArray*);
130  vtkGetObjectMacro(MassArray,vtkDataArray);
132 
138  vtkPointData *pd) override;
139 
148  vtkIdType ComputeBasis(double x[3], vtkIdList *pIds, vtkIdType ptId=0) override;
149 
154  vtkIdType ComputeWeights(double x[3], vtkIdList *pIds,
155  vtkDoubleArray *weights) override;
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 
186 protected:
187  vtkSPHKernel();
188  ~vtkSPHKernel() override;
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 
210 private:
211  vtkSPHKernel(const vtkSPHKernel&) = delete;
212  void operator=(const vtkSPHKernel&) = delete;
213 };
214 
215 #endif
double CutoffFactor
Definition: vtkSPHKernel.h:201
double SpatialStep
Definition: vtkSPHKernel.h:191
virtual vtkIdType ComputeBasis(double x[3], vtkIdList *pIds, vtkIdType ptId=0)=0
Given a point x (and optional associated point id), determine the points around x which form an inter...
vtkDataArray * MassArray
Definition: vtkSPHKernel.h:197
base class for interpolation kernels
represent and manipulate point attribute data
Definition: vtkPointData.h:37
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
double DefaultVolume
Definition: vtkSPHKernel.h:206
virtual vtkIdType ComputeWeights(double x[3], vtkIdList *pIds, vtkDoubleArray *weights)=0
Given a point x, and a list of basis points pIds, compute interpolation weights associated with these...
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:41
int vtkIdType
Definition: vtkType.h:349
dynamic, self-adjusting array of double
#define VTK_FLOAT_MAX
Definition: vtkType.h:169
double NormFactor
Definition: vtkSPHKernel.h:205
vtkDataArray * CutoffArray
Definition: vtkSPHKernel.h:195
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract class to quickly locate points in 3-space
list of point or cell ids
Definition: vtkIdList.h:36
double DistNorm
Definition: vtkSPHKernel.h:204
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
virtual void Initialize(vtkAbstractPointLocator *loc, vtkDataSet *ds, vtkPointData *pd)
Initialize the kernel.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard method for type and printing.
bool UseCutoffArray
Definition: vtkSPHKernel.h:207
vtkDataArray * DensityArray
Definition: vtkSPHKernel.h:196
a family of SPH interpolation kernels
Definition: vtkSPHKernel.h:68
bool UseArraysForVolume
Definition: vtkSPHKernel.h:208