VMTK
vtkvmtkFEShapeFunctions.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: VMTK
4  Module: $RCSfile: vtkvmtkFEShapeFunctions.h,v $
5  Language: C++
6 
7  Copyright (c) Luca Antiga, David Steinman. All rights reserved.
8  See LICENSE file for details.
9 
10  Portions of this code are covered under the VTK copyright.
11  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
12  for details.
13 
14  This software is distributed WITHOUT ANY WARRANTY; without even
15  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16  PURPOSE. See the above copyright notices for more information.
17 
18 =========================================================================*/
28 #ifndef __vtkvmtkFEShapeFunctions_h
29 #define __vtkvmtkFEShapeFunctions_h
30 
31 #include "vtkObject.h"
32 #include "vtkvmtkWin32Header.h"
33 
34 #include "vtkCell.h"
35 #include "vtkDoubleArray.h"
36 
37 class VTK_VMTK_DIFFERENTIAL_GEOMETRY_EXPORT vtkvmtkFEShapeFunctions : public vtkObject
38 {
39 public:
40  vtkTypeMacro(vtkvmtkFEShapeFunctions,vtkObject);
41  static vtkvmtkFEShapeFunctions* New();
42 
43  void Initialize(vtkCell* cell, vtkDoubleArray* pcoords);
44 
45  double GetPhi(vtkIdType id, vtkIdType i)
46  { return this->Phi->GetValue(id*this->NumberOfCellPoints+i); }
47 
48  double* GetDPhi(vtkIdType id, vtkIdType i)
49  { return this->DPhi->GetTuple(id*this->NumberOfCellPoints+i); }
50 
51  void GetDPhi(vtkIdType id, vtkIdType i, double* dphi)
52  { this->DPhi->GetTuple(id*this->NumberOfCellPoints+i,dphi); }
53 
54  double GetDPhi(vtkIdType id, vtkIdType i, int c)
55  { return this->DPhi->GetComponent(id*this->NumberOfCellPoints+i,c); }
56 
57  double GetJacobian(vtkIdType i)
58  { return this->Jacobians->GetValue(i); }
59 
60  static void GetInterpolationFunctions(vtkCell* cell, double* pcoords, double* sf);
61  static void GetInterpolationDerivs(vtkCell* cell, double* pcoords, double* derivs);
62 
63  static double ComputeJacobian(vtkCell* cell, double* pcoords);
64 
65 protected:
68 
69  static void ComputeInverseJacobianMatrix2D(vtkCell* cell, double* pcoords, double inverseJacobianMatrix[2][3]);
70  static void ComputeInverseJacobianMatrix3D(vtkCell* cell, double* pcoords, double inverseJacobianMatrix[3][3]);
71 
72  vtkDoubleArray* Phi;
73  vtkDoubleArray* DPhi;
74  vtkDoubleArray* Jacobians;
75  vtkIdType NumberOfCellPoints;
76 
77 private:
78  vtkvmtkFEShapeFunctions(const vtkvmtkFEShapeFunctions&); // Not implemented.
79  void operator=(const vtkvmtkFEShapeFunctions&); // Not implemented.
80 
81 };
82 
83 #endif
double GetJacobian(vtkIdType i)
Set of common utility (calculate jacobian, interpolation function, and interpolation function derivat...
double GetPhi(vtkIdType id, vtkIdType i)
double GetDPhi(vtkIdType id, vtkIdType i, int c)
void GetDPhi(vtkIdType id, vtkIdType i, double *dphi)
double * GetDPhi(vtkIdType id, vtkIdType i)