Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
IsoparametricMapping.h
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MoDELib is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_IsoparametricMapping_H_
9#define model_IsoparametricMapping_H_
10
11#include <Eigen/Dense>
12
13namespace model
14{
15
16 /**************************************************************************/
17 /**************************************************************************/
21 template<typename ElementType>
23 {
24
25 constexpr static int dim=ElementType::dim;
26
27 const ElementType& ele;
28
29 public:
30
31 /**********************************************************************/
32 IsoparametricMapping(const ElementType& ele_in) : ele(ele_in)
33 {
34
35 }
36
37 /**********************************************************************/
38 Eigen::Matrix<double,dim,1> position(const Eigen::Matrix<double,1,dim+1>& bary) const
39 {
42 return ele.Xe*ele.sf(bary).transpose();
43 }
44
45 /**********************************************************************/
46 Eigen::Matrix<double,dim,dim> Fs(const Eigen::Matrix<double,1,dim+1>& bary) const
47 {
50 return ele.Xe*ele.gradS(bary).transpose();
51 }
52
53 /**********************************************************************/
54 double J(const Eigen::Matrix<double,1,dim+1>& bary) const
55 {
59 return Fs(bary).determinant();
60 }
61
62 /**********************************************************************/
63 double absJ(const Eigen::Matrix<double,1,dim+1>& bary) const
64 {
68 return std::fabs(Fs(bary).determinant());
69 }
70
71 /**********************************************************************/
72 Eigen::Matrix<double,dim,dim> Gs(const Eigen::Matrix<double,1,dim+1>& bary) const
73 {
76 return Fs(bary).inverse();
77 }
78
79 /**********************************************************************/
80 Eigen::Matrix<double,dim,1> jGN(const Eigen::Matrix<double,1,dim+1>& bary, const int& n) const
81 {
82 assert(n>=0);
83 assert(n<dim+1);
84 assert(bary(n)==0.0);
85
86 return Gs(bary).transpose()*BarycentricTraits<dim>::NdA.col(n)*absJ(bary);
87 }
88
89 };
90
91} // close namespace
92#endif
double J(const Eigen::Matrix< double, 1, dim+1 > &bary) const
Eigen::Matrix< double, dim, 1 > position(const Eigen::Matrix< double, 1, dim+1 > &bary) const
Eigen::Matrix< double, dim, 1 > jGN(const Eigen::Matrix< double, 1, dim+1 > &bary, const int &n) const
Eigen::Matrix< double, dim, dim > Fs(const Eigen::Matrix< double, 1, dim+1 > &bary) const
Eigen::Matrix< double, dim, dim > Gs(const Eigen::Matrix< double, 1, dim+1 > &bary) const
IsoparametricMapping(const ElementType &ele_in)
double absJ(const Eigen::Matrix< double, 1, dim+1 > &bary) const
static const MatrixDimHigherDimD NdA