VTK  9.0.1
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 class VTKFILTERSPOINTS_EXPORT vtkSPHKernel : public vtkInterpolationKernel
68 {
69 public:
71 
75  void PrintSelf(ostream& os, vtkIndent indent) override;
77 
79 
83  vtkSetClampMacro(SpatialStep, double, 0.0, VTK_FLOAT_MAX);
84  vtkGetMacro(SpatialStep, double);
86 
88 
91  vtkSetClampMacro(Dimension, int, 1, 3);
92  vtkGetMacro(Dimension, int);
94 
96 
100  vtkGetMacro(CutoffFactor, double);
102 
104 
110  virtual void SetCutoffArray(vtkDataArray*);
111  vtkGetObjectMacro(CutoffArray, vtkDataArray);
113 
115 
119  virtual void SetDensityArray(vtkDataArray*);
120  vtkGetObjectMacro(DensityArray, vtkDataArray);
122 
124 
128  virtual void SetMassArray(vtkDataArray*);
129  vtkGetObjectMacro(MassArray, vtkDataArray);
131 
136  void Initialize(vtkAbstractPointLocator* loc, vtkDataSet* ds, vtkPointData* pd) override;
137 
146  vtkIdType ComputeBasis(double x[3], vtkIdList* pIds, vtkIdType ptId = 0) override;
147 
152  vtkIdType ComputeWeights(double x[3], vtkIdList* pIds, vtkDoubleArray* weights) override;
153 
158  virtual vtkIdType ComputeDerivWeights(
159  double x[3], vtkIdList* pIds, vtkDoubleArray* weights, vtkDoubleArray* gradWeights);
160 
164  virtual double ComputeFunctionWeight(const double d) = 0;
165 
170  virtual double ComputeDerivWeight(const double d) = 0;
171 
173 
179  vtkGetMacro(NormFactor, double);
181 
182 protected:
183  vtkSPHKernel();
184  ~vtkSPHKernel() override;
185 
186  // Instance variables
187  double SpatialStep; // also known as smoothing length h
188  int Dimension; // sptial dimension of the kernel
189 
190  // Optional arrays aid in the interpolation process (computes volume)
194 
195  // Internal data members generated during construction and initialization
196  // Terminology is spatial step = smoothing length h
197  double CutoffFactor; // varies across each kernel, e.g. cubic=2, quartic=2.5, quintic=3
198  double Cutoff; // the spatial step * cutoff factor
199  double Sigma; // normalization constant
200  double DistNorm; // distance normalization factor 1/(spatial step)
201  double NormFactor; // dimensional normalization factor sigma/(spatial step)^Dimension
202  double DefaultVolume; // if mass and density arrays not specified, use this
203  bool UseCutoffArray; // if single component cutoff array provided
204  bool UseArraysForVolume; // if both mass and density arrays are present
205 
206 private:
207  vtkSPHKernel(const vtkSPHKernel&) = delete;
208  void operator=(const vtkSPHKernel&) = delete;
209 };
210 
211 #endif
double CutoffFactor
Definition: vtkSPHKernel.h:197
double SpatialStep
Definition: vtkSPHKernel.h:187
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:193
base class for interpolation kernels
represent and manipulate point attribute data
Definition: vtkPointData.h:31
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
double DefaultVolume
Definition: vtkSPHKernel.h:202
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:35
int vtkIdType
Definition: vtkType.h:338
dynamic, self-adjusting array of double
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
double NormFactor
Definition: vtkSPHKernel.h:201
vtkDataArray * CutoffArray
Definition: vtkSPHKernel.h:191
a simple class to control print indentation
Definition: vtkIndent.h:33
abstract class to quickly locate points in 3-space
list of point or cell ids
Definition: vtkIdList.h:30
double DistNorm
Definition: vtkSPHKernel.h:200
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
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:203
vtkDataArray * DensityArray
Definition: vtkSPHKernel.h:192
a family of SPH interpolation kernels
Definition: vtkSPHKernel.h:67
bool UseArraysForVolume
Definition: vtkSPHKernel.h:204