VTK  9.3.0
vtkQuadratureSchemeDefinition.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
23 #ifndef vtkQuadratureSchemeDefinition_h
24 #define vtkQuadratureSchemeDefinition_h
25 
26 #include "vtkCommonDataModelModule.h" // For export macro
27 #include "vtkObject.h"
28 
29 VTK_ABI_NAMESPACE_BEGIN
32 class vtkXMLDataElement;
33 
34 class VTKCOMMONDATAMODEL_EXPORT vtkQuadratureSchemeDefinition : public vtkObject
35 {
36 public:
37  // vtk stuff
39  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
48 
53 
63 
68  void Clear();
69 
73  void Initialize(
74  int cellType, int numberOfNodes, int numberOfQuadraturePoints, double* shapeFunctionWeights);
78  void Initialize(int cellType, int numberOfNodes, int numberOfQuadraturePoints,
79  double* shapeFunctionWeights, double* quadratureWeights);
80 
84  int GetCellType() const { return this->CellType; }
88  int GetQuadratureKey() const { return this->QuadratureKey; }
92  int GetNumberOfNodes() const { return this->NumberOfNodes; }
96  int GetNumberOfQuadraturePoints() const { return this->NumberOfQuadraturePoints; }
102  const double* GetShapeFunctionWeights() const { return this->ShapeFunctionWeights; }
104 
108  const double* GetShapeFunctionWeights(int quadraturePointId) const
109  {
110  int idx = quadraturePointId * this->NumberOfNodes;
111  return this->ShapeFunctionWeights + idx;
112  }
114 
117  const double* GetQuadratureWeights() const { return this->QuadratureWeights; }
118 
119 protected:
122 
123 private:
128  void ReleaseResources();
133  int SecureResources();
138  void SetShapeFunctionWeights(const double* W);
143  void SetQuadratureWeights(const double* W);
144 
145  //
147  void operator=(const vtkQuadratureSchemeDefinition&) = delete;
148  friend ostream& operator<<(ostream& s, const vtkQuadratureSchemeDefinition& d);
149  friend istream& operator>>(istream& s, vtkQuadratureSchemeDefinition& d);
150  //
151  int CellType;
152  int QuadratureKey;
153  int NumberOfNodes;
154  int NumberOfQuadraturePoints;
155  double* ShapeFunctionWeights;
156  double* QuadratureWeights;
157 };
158 
159 VTK_ABI_NAMESPACE_END
160 #endif
a simple class to control print indentation
Definition: vtkIndent.h:38
Key for string values in vtkInformation.
abstract base class for most VTK objects
Definition: vtkObject.h:61
An Elemental data type that holds a definition of a numerical quadrature scheme.
void Initialize(int cellType, int numberOfNodes, int numberOfQuadraturePoints, double *shapeFunctionWeights)
Initialize the object allocating resources as needed.
const double * GetShapeFunctionWeights(int quadraturePointId) const
Get the array of shape function weights associated with a single quadrature point.
static vtkInformationStringKey * QUADRATURE_OFFSET_ARRAY_NAME()
void Clear()
Release all allocated resources and set the object to an uninitialized state.
~vtkQuadratureSchemeDefinition() override
friend istream & operator>>(istream &s, vtkQuadratureSchemeDefinition &d)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetQuadratureKey() const
Access to an alternative key.
int GetNumberOfQuadraturePoints() const
Get the number of quadrature points associated with the scheme.
static vtkQuadratureSchemeDefinition * New()
New object in an unusable state.
void Initialize(int cellType, int numberOfNodes, int numberOfQuadraturePoints, double *shapeFunctionWeights, double *quadratureWeights)
Initialize the object allocating resources as needed.
int RestoreState(vtkXMLDataElement *root)
Restore the object from an XML representation.
const double * GetShapeFunctionWeights() const
Get the array of shape function weights.
int SaveState(vtkXMLDataElement *root)
Put the object into an XML representation.
int DeepCopy(const vtkQuadratureSchemeDefinition *other)
Deep copy.
friend ostream & operator<<(ostream &s, const vtkQuadratureSchemeDefinition &d)
const double * GetQuadratureWeights() const
Access to the quadrature weights.
int GetCellType() const
Access the VTK cell type id.
static vtkInformationQuadratureSchemeDefinitionVectorKey * DICTIONARY()
int GetNumberOfNodes() const
Get the number of nodes associated with the interpolation.
Represents an XML element and those nested inside.