VMTK
Loading...
Searching...
No Matches
vtkvmtkFEShapeFunctions.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: VMTK
4
5 Copyright (c) Luca Antiga, David Steinman. All rights reserved.
6 See LICENSE file for details.
7
8 Portions of this code are covered under the VTK copyright.
9 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
10 for details.
11
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
15
16=========================================================================*/
36
37#ifndef __vtkvmtkFEShapeFunctions_h
38#define __vtkvmtkFEShapeFunctions_h
39
40#include "vtkObject.h"
41#include "vtkvmtkWin32Header.h"
42
43#include "vtkCell.h"
44#include "vtkDoubleArray.h"
45
46class VTK_VMTK_DIFFERENTIAL_GEOMETRY_EXPORT vtkvmtkFEShapeFunctions : public vtkObject
47{
48public:
49 vtkTypeMacro(vtkvmtkFEShapeFunctions,vtkObject);
51
59 void Initialize(vtkCell* cell, vtkDoubleArray* pcoords);
60
65 double GetPhi(vtkIdType id, vtkIdType i)
66 { return this->Phi->GetValue(id*this->NumberOfCellPoints+i); }
67
72 double* GetDPhi(vtkIdType id, vtkIdType i)
73 { return this->DPhi->GetTuple(id*this->NumberOfCellPoints+i); }
74
79 void GetDPhi(vtkIdType id, vtkIdType i, double* dphi)
80 { this->DPhi->GetTuple(id*this->NumberOfCellPoints+i,dphi); }
81
86 double GetDPhi(vtkIdType id, vtkIdType i, int c)
87 { return this->DPhi->GetComponent(id*this->NumberOfCellPoints+i,c); }
88
93 double GetJacobian(vtkIdType i)
94 { return this->Jacobians->GetValue(i); }
95
101 static void GetInterpolationFunctions(vtkCell* cell, double* pcoords, double* sf);
102
109 static void GetInterpolationDerivs(vtkCell* cell, double* pcoords, double* derivs);
110
117 static double ComputeJacobian(vtkCell* cell, double* pcoords);
118
119protected:
122
123 static void ComputeInverseJacobianMatrix2D(vtkCell* cell, double* pcoords, double inverseJacobianMatrix[2][3]);
124 static void ComputeInverseJacobianMatrix3D(vtkCell* cell, double* pcoords, double inverseJacobianMatrix[3][3]);
125
126 vtkDoubleArray* Phi;
127 vtkDoubleArray* DPhi;
128 vtkDoubleArray* Jacobians;
130
131private:
132 vtkvmtkFEShapeFunctions(const vtkvmtkFEShapeFunctions&); // Not implemented.
133 void operator=(const vtkvmtkFEShapeFunctions&); // Not implemented.
134
135};
136
137#endif
Provides a set of common utility functions (calculate jacobian, interpolation function,...
void Initialize(vtkCell *cell, vtkDoubleArray *pcoords)
void GetDPhi(vtkIdType id, vtkIdType i, double *dphi)
double GetDPhi(vtkIdType id, vtkIdType i, int c)
static vtkvmtkFEShapeFunctions * New()
double GetPhi(vtkIdType id, vtkIdType i)
double * GetDPhi(vtkIdType id, vtkIdType i)