VTK  9.0.20200918
vtkQuadratureSchemeDefinition.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQuadratureSchemeDefinition.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 =========================================================================*/
35 #ifndef vtkQuadratureSchemeDefinition_h
36 #define vtkQuadratureSchemeDefinition_h
37 
38 #include "vtkCommonDataModelModule.h" // For export macro
39 #include "vtkObject.h"
40 
43 class vtkXMLDataElement;
44 
45 class VTKCOMMONDATAMODEL_EXPORT vtkQuadratureSchemeDefinition : public vtkObject
46 {
47 public:
48  // vtk stuff
50  void PrintSelf(ostream& os, vtkIndent indent) override;
52  static vtkInformationStringKey* QUADRATURE_OFFSET_ARRAY_NAME();
53 
59 
63  int DeepCopy(const vtkQuadratureSchemeDefinition* other);
64 
69  int SaveState(vtkXMLDataElement* root);
73  int RestoreState(vtkXMLDataElement* root);
74 
79  void Clear();
80 
84  void Initialize(
85  int cellType, int numberOfNodes, int numberOfQuadraturePoints, double* shapeFunctionWeights);
89  void Initialize(int cellType, int numberOfNodes, int numberOfQuadraturePoints,
90  double* shapeFunctionWeights, double* quadratureWeights);
91 
95  int GetCellType() const { return this->CellType; }
99  int GetQuadratureKey() const { return this->QuadratureKey; }
103  int GetNumberOfNodes() const { return this->NumberOfNodes; }
107  int GetNumberOfQuadraturePoints() const { return this->NumberOfQuadraturePoints; }
113  const double* GetShapeFunctionWeights() const { return this->ShapeFunctionWeights; }
115 
119  const double* GetShapeFunctionWeights(int quadraturePointId) const
120  {
121  int idx = quadraturePointId * this->NumberOfNodes;
122  return this->ShapeFunctionWeights + idx;
123  }
125 
128  const double* GetQuadratureWeights() const { return this->QuadratureWeights; }
129 
130 protected:
132  ~vtkQuadratureSchemeDefinition() override;
133 
134 private:
139  void ReleaseResources();
144  int SecureResources();
149  void SetShapeFunctionWeights(const double* W);
154  void SetQuadratureWeights(const double* W);
155 
156  //
158  void operator=(const vtkQuadratureSchemeDefinition&) = delete;
159  friend ostream& operator<<(ostream& s, const vtkQuadratureSchemeDefinition& d);
160  friend istream& operator>>(istream& s, vtkQuadratureSchemeDefinition& d);
161  //
162  int CellType;
163  int QuadratureKey;
164  int NumberOfNodes;
165  int NumberOfQuadraturePoints;
166  double* ShapeFunctionWeights;
167  double* QuadratureWeights;
168 };
169 
170 #endif
operator>>
vtkMultiProcessStream & operator>>(vtkMultiProcessStream &stream, T &value)
Definition: vtkMultiProcessStreamSerialization.h:177
vtkInformationStringKey
Key for string values in vtkInformation.
Definition: vtkInformationStringKey.h:33
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkQuadratureSchemeDefinition::GetQuadratureWeights
const double * GetQuadratureWeights() const
Access to the quadrature weights.
Definition: vtkQuadratureSchemeDefinition.h:128
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkQuadratureSchemeDefinition
Definition: vtkQuadratureSchemeDefinition.h:45
vtkQuadratureSchemeDefinition::GetNumberOfNodes
int GetNumberOfNodes() const
Get the number of nodes associated with the interpolation.
Definition: vtkQuadratureSchemeDefinition.h:103
vtkQuadratureSchemeDefinition::GetCellType
int GetCellType() const
Access the VTK cell type id.
Definition: vtkQuadratureSchemeDefinition.h:95
vtkQuadratureSchemeDefinition::GetNumberOfQuadraturePoints
int GetNumberOfQuadraturePoints() const
Get the number of quadrature points associated with the scheme.
Definition: vtkQuadratureSchemeDefinition.h:107
vtkQuadratureSchemeDefinition::GetQuadratureKey
int GetQuadratureKey() const
Access to an alternative key.
Definition: vtkQuadratureSchemeDefinition.h:99
vtkQuadratureSchemeDefinition::GetShapeFunctionWeights
const double * GetShapeFunctionWeights() const
Get the array of shape function weights.
Definition: vtkQuadratureSchemeDefinition.h:113
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkXMLDataElement
Represents an XML element and those nested inside.
Definition: vtkXMLDataElement.h:36
vtkObject.h
vtkObjectBase::operator<<
friend VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, vtkObjectBase &o)
vtkQuadratureSchemeDefinition::GetShapeFunctionWeights
const double * GetShapeFunctionWeights(int quadraturePointId) const
Get the array of shape function weights associated with a single quadrature point.
Definition: vtkQuadratureSchemeDefinition.h:119
vtkInformationQuadratureSchemeDefinitionVectorKey
Key for vtkQuadratureSchemeDefinition vector values.
Definition: vtkInformationQuadratureSchemeDefinitionVectorKey.h:36