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 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
vtkSPHKernel::CutoffArray
vtkDataArray * CutoffArray
Definition: vtkSPHKernel.h:191
vtkStdString.h
vtkSPHKernel::DensityArray
vtkDataArray * DensityArray
Definition: vtkSPHKernel.h:192
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:31
vtkIdType
int vtkIdType
Definition: vtkType.h:349
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
vtkSPHKernel::SpatialStep
double SpatialStep
Definition: vtkSPHKernel.h:187
vtkSPHKernel::CutoffFactor
double CutoffFactor
Definition: vtkSPHKernel.h:197
vtkSPHKernel::UseCutoffArray
bool UseCutoffArray
Definition: vtkSPHKernel.h:203
vtkInterpolationKernel::Initialize
virtual void Initialize(vtkAbstractPointLocator *loc, vtkDataSet *ds, vtkPointData *pd)
Initialize the kernel.
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkSPHKernel::Cutoff
double Cutoff
Definition: vtkSPHKernel.h:198
vtkSPHKernel::Sigma
double Sigma
Definition: vtkSPHKernel.h:199
vtkInterpolationKernel.h
vtkInterpolationKernel::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInterpolationKernel::ComputeBasis
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...
vtkSPHKernel::UseArraysForVolume
bool UseArraysForVolume
Definition: vtkSPHKernel.h:204
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkSPHKernel::Dimension
int Dimension
Definition: vtkSPHKernel.h:188
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:169
vtkSPHKernel::MassArray
vtkDataArray * MassArray
Definition: vtkSPHKernel.h:193
vtkSPHKernel
a family of SPH interpolation kernels
Definition: vtkSPHKernel.h:67
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkSPHKernel::DistNorm
double DistNorm
Definition: vtkSPHKernel.h:200
vtkSPHKernel::DefaultVolume
double DefaultVolume
Definition: vtkSPHKernel.h:202
vtkAbstractPointLocator
abstract class to quickly locate points in 3-space
Definition: vtkAbstractPointLocator.h:38
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:35
vtkSPHKernel::NormFactor
double NormFactor
Definition: vtkSPHKernel.h:201
vtkInterpolationKernel::ComputeWeights
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...
vtkInterpolationKernel
base class for interpolation kernels
Definition: vtkInterpolationKernel.h:63