VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkQuadratureSchemeDefinition.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00034 #ifndef vtkQuadratureSchemeDefinition_h 00035 #define vtkQuadratureSchemeDefinition_h 00036 00037 #include "vtkObject.h" 00038 00039 class vtkInformationQuadratureSchemeDefinitionVectorKey; 00040 class vtkXMLDataElement; 00041 00042 class VTK_COMMON_EXPORT vtkQuadratureSchemeDefinition : public vtkObject 00043 { 00044 public: 00045 // vtk stuff 00046 vtkTypeRevisionMacro(vtkQuadratureSchemeDefinition,vtkObject); 00047 void PrintSelf(ostream& os, vtkIndent indent); 00048 static vtkInformationQuadratureSchemeDefinitionVectorKey* DICTIONARY(); 00049 00052 static vtkQuadratureSchemeDefinition *New(); 00053 00055 int DeepCopy(const vtkQuadratureSchemeDefinition *other); 00056 00058 00060 int SaveState(vtkXMLDataElement *e); 00061 // Description: 00062 // Restore the object from an XML representation. 00063 int RestoreState(vtkXMLDataElement *e); 00065 00068 void Clear(); 00069 00071 00072 void Initialize(int cellType, 00073 int numberOfNodes, 00074 int numberOfQuadraturePoints, 00075 double *shapeFunctionWeights); 00076 // Description: 00077 // Initialize the object allocating resources as needed. 00078 void Initialize(int cellType, 00079 int numberOfNodes, 00080 int numberOfQuadraturePoints, 00081 double *shapeFunctionWeights, 00082 double *quadratureWeights); 00084 00086 00087 int GetCellType() const { return this->CellType; } 00088 // Description: 00089 // Access to an alternative key. 00090 int GetQuadratureKey() const { return this->QuadratureKey; } 00091 // Description: 00092 // Get the number of nodes associated with the interpolation. 00093 int GetNumberOfNodes() const { return this->NumberOfNodes; } 00094 // Description: 00095 // Get the number of quadrature points associated with the scheme. 00096 int GetNumberOfQuadraturePoints() const { return this->NumberOfQuadraturePoints; } 00097 // Description: 00098 // Get the array of shape function weights. Shape function weights are 00099 // the shape functions evaluated at the quadrature points. There are 00100 // "NumberOfNodes" weights for each quadrature point. 00101 const double *GetShapeFunctionWeights() const { return this->ShapeFunctionWeights; } 00102 // Description: 00103 // Get the array of shape function weights associated with a 00104 // single quadrature point. 00105 const double *GetShapeFunctionWeights(int quadraturePointId) const 00106 { 00107 int idx=quadraturePointId*this->NumberOfNodes; 00108 return this->ShapeFunctionWeights+idx; 00109 } 00110 // Description: 00111 // Access to teh quadrature weights. 00112 const double *GetQuadratureWeights() const { return this->QuadratureWeights; } 00114 00115 protected: 00116 vtkQuadratureSchemeDefinition(); 00117 ~vtkQuadratureSchemeDefinition(); 00118 private: 00120 00122 void ReleaseResources(); 00123 // Description: 00124 // Allocate resources according to the objects 00125 // current internal state. 00126 int SecureResources(); 00127 // Description: 00128 // Initialize the shape function weights definition. 00129 // Must call SecureResources prior. 00130 void SetShapeFunctionWeights(const double *W); 00131 // Description: 00132 // Initialize the shape function weights definition. 00133 // Must call SecureResources prior. 00134 void SetQuadratureWeights(const double *W); 00136 00137 // 00138 vtkQuadratureSchemeDefinition(const vtkQuadratureSchemeDefinition &); // Not implemented. 00139 void operator=(const vtkQuadratureSchemeDefinition &); // Not implemented. 00140 friend ostream &operator<<(ostream &s, const vtkQuadratureSchemeDefinition &d); 00141 friend istream &operator>>(istream &s, const vtkQuadratureSchemeDefinition &d); 00142 // 00143 int CellType; 00144 int QuadratureKey; 00145 int NumberOfNodes; 00146 int NumberOfQuadraturePoints; 00147 double *ShapeFunctionWeights; 00148 double *QuadratureWeights; 00149 }; 00150 00151 #endif 00152