VTK
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 =========================================================================*/
34 #ifndef vtkQuadratureSchemeDefinition_h
35 #define vtkQuadratureSchemeDefinition_h
36 
37 #include "vtkObject.h"
38 
41 class vtkXMLDataElement;
42 
44 {
45 public:
46  // vtk stuff
48  void PrintSelf(ostream& os, vtkIndent indent);
50  static vtkInformationStringKey* QUADRATURE_OFFSET_ARRAY_NAME();
51 
55 
57  int DeepCopy(const vtkQuadratureSchemeDefinition *other);
58 
60 
62  int SaveState(vtkXMLDataElement *e);
63  // Description:
64  // Restore the object from an XML representation.
65  int RestoreState(vtkXMLDataElement *e);
67 
70  void Clear();
71 
73 
74  void Initialize(int cellType,
75  int numberOfNodes,
76  int numberOfQuadraturePoints,
77  double *shapeFunctionWeights);
78  // Description:
79  // Initialize the object allocating resources as needed.
80  void Initialize(int cellType,
81  int numberOfNodes,
82  int numberOfQuadraturePoints,
83  double *shapeFunctionWeights,
84  double *quadratureWeights);
86 
88 
89  int GetCellType() const { return this->CellType; }
90  // Description:
91  // Access to an alternative key.
92  int GetQuadratureKey() const { return this->QuadratureKey; }
93  // Description:
94  // Get the number of nodes associated with the interpolation.
95  int GetNumberOfNodes() const { return this->NumberOfNodes; }
96  // Description:
97  // Get the number of quadrature points associated with the scheme.
98  int GetNumberOfQuadraturePoints() const { return this->NumberOfQuadraturePoints; }
99  // Description:
100  // Get the array of shape function weights. Shape function weights are
101  // the shape functions evaluated at the quadrature points. There are
102  // "NumberOfNodes" weights for each quadrature point.
103  const double *GetShapeFunctionWeights() const { return this->ShapeFunctionWeights; }
104  // Description:
105  // Get the array of shape function weights associated with a
106  // single quadrature point.
107  const double *GetShapeFunctionWeights(int quadraturePointId) const
108  {
109  int idx=quadraturePointId*this->NumberOfNodes;
110  return this->ShapeFunctionWeights+idx;
111  }
112  // Description:
113  // Access to the quadrature weights.
114  const double *GetQuadratureWeights() const { return this->QuadratureWeights; }
116 
117 protected:
120 private:
122 
124  void ReleaseResources();
125  // Description:
126  // Allocate resources according to the objects
127  // current internal state.
128  int SecureResources();
129  // Description:
130  // Initialize the shape function weights definition.
131  // Must call SecureResources prior.
132  void SetShapeFunctionWeights(const double *W);
133  // Description:
134  // Initialize the shape function weights definition.
135  // Must call SecureResources prior.
136  void SetQuadratureWeights(const double *W);
138 
139  //
141  void operator=(const vtkQuadratureSchemeDefinition &); // Not implemented.
142  friend ostream &operator<<(ostream &s, const vtkQuadratureSchemeDefinition &d);
143  friend istream &operator>>(istream &s, const vtkQuadratureSchemeDefinition &d);
144  //
145  int CellType;
146  int QuadratureKey;
147  int NumberOfNodes;
148  int NumberOfQuadraturePoints;
149  double *ShapeFunctionWeights;
150  double *QuadratureWeights;
151 };
152 
153 #endif
154 
friend VTK_COMMON_EXPORT ostream & operator<<(ostream &os, vtkObjectBase &o)
abstract base class for most VTK objects
Definition: vtkObject.h:60
Represents an XML element and those nested inside.
Key for string values in vtkInformation.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
#define VTK_COMMON_EXPORT
static vtkObject * New()
const double * GetShapeFunctionWeights(int quadraturePointId) const