29 #ifndef NEMOSYS_CUBATURE_H_ 30 #define NEMOSYS_CUBATURE_H_ 35 #include "nemosys_export.h" 38 #include <vtkDataArray.h> 39 #include <vtkDoubleArray.h> 40 #include <vtkGenericCell.h> 41 #include <vtkPointData.h> 42 #include <vtkPolyData.h> 43 #include <vtkQuadratureSchemeDefinition.h> 47 extern double TRI3W[];
50 extern double TET4W[];
53 using pntDataPair = std::pair<std::vector<double>, std::vector<double>>;
60 GaussCubature(vtkDataSet *_dataSet,
const std::vector<int> &arrayIDs);
67 void constructGaussMesh();
80 void interpolateToGaussPoints();
87 void interpolateToGaussPoints(
const std::vector<std::string> &newArrayNames);
92 std::vector<std::vector<double>> integrateOverAllCells();
102 std::vector<std::vector<double>> integrateOverAllCells(
103 const std::vector<std::string> &newArrayNames,
bool computeRMSE);
105 void setArrayIDs(
const std::vector<int> &_arrayIDs) { arrayIDs = _arrayIDs; }
106 double computeJacobian(vtkSmartPointer<vtkGenericCell> genCell,
108 double computeCellVolume(vtkSmartPointer<vtkGenericCell> genCell,
115 vtkSmartPointer<vtkPolyData>
getGaussMesh()
const {
return gaussMesh; }
116 vtkQuadratureSchemeDefinition **
getDict()
const {
return dict; }
121 void writeGaussMesh(
const char *name)
const;
127 const std::vector<int> &arrayIDs);
128 static std::unique_ptr<GaussCubature> CreateUnique(vtkDataSet *_dataSet);
129 static std::unique_ptr<GaussCubature> CreateUnique(
130 vtkDataSet *_dataSet,
const std::vector<int> &arrayIDs);
131 static std::shared_ptr<GaussCubature> CreateShared(vtkDataSet *_dataSet);
132 static std::shared_ptr<GaussCubature> CreateShared(
133 vtkDataSet *_dataSet,
const std::vector<int> &arrayIDs);
143 vtkQuadratureSchemeDefinition **
dict;
150 int getOffset(
int cellID)
const;
152 int interpolateToGaussPointsAtCell(
153 int cellID, vtkSmartPointer<vtkGenericCell> genCell,
154 const std::vector<vtkSmartPointer<vtkDataArray>> &das,
155 std::vector<vtkSmartPointer<vtkDoubleArray>> &daGausses)
const;
157 void integrateOverCell(
158 int cellID, vtkSmartPointer<vtkGenericCell> genCell,
159 vtkSmartPointer<vtkPointData> pd,
160 std::vector<vtkSmartPointer<vtkDoubleArray>> &integralData,
161 std::vector<std::vector<double>> &totalIntegralData)
const;
164 void integrateOverCell(
165 int cellID, vtkSmartPointer<vtkGenericCell> genCell,
166 vtkSmartPointer<vtkPointData> pd,
167 std::vector<vtkSmartPointer<vtkDoubleArray>> &integralData,
168 std::vector<std::vector<double>> &totalIntegralData,
169 const std::vector<std::string> &newArrayNames,
bool normalizeByVol)
const;
172 #endif // NEMOSYS_CUBATURE_H_
std::vector< int > getArrayIDs() const
std::vector< int > numComponents
vtkDataSet * getDataSet() const
std::pair< std::vector< double >, std::vector< double > > pntDataPair
void setArrayIDs(const std::vector< int > &_arrayIDs)
vtkSmartPointer< vtkPolyData > getGaussMesh() const
std::vector< pntDataPair > pntDataPairVec
vtkQuadratureSchemeDefinition ** getDict() const
vtkSmartPointer< vtkDataSet > dataSet
int getTotalComponents() const
std::vector< int > getNumComponents() const
vtkSmartPointer< vtkPolyData > gaussMesh
std::vector< int > arrayIDs
vtkQuadratureSchemeDefinition ** dict