Rheolef  7.1
an efficient C++ finite element environment
piola_fem_lagrange.cc
Go to the documentation of this file.
1 #include "piola_fem_lagrange.h"
22 #include "piola_fem_grad_post.icc"
23 namespace rheolef {
24 
25 // --------------------------------------------------------------------------
26 // scalar-valued case
27 // --------------------------------------------------------------------------
28 template<class T>
29 void
31  const piola<T>& p,
32  const T& hat_u,
33  T& u) const
34 {
35  u = hat_u;
36 }
37 template<class T>
38 void
40  const piola<T>& p,
41  const T& u,
42  T& hat_u) const
43 {
44  hat_u = u;
45 }
46 template<class T>
47 void
49  const piola<T>& p,
50  const T& hat_u,
51  const point_basic<T>& hat_grad_u,
52  const details::differentiate_option& gopt,
53  point_basic<T>& grad_u) const
54 {
55  // grad_u = DF^{-T}*grad_hat_u
56  grad_u = p.invDF.trans_mult (hat_grad_u); // TODO: DVT_OPTIM_2D
57  const T& u = hat_u;
58  grad_post (p, gopt, u, grad_u);
59 }
60 // --------------------------------------------------------------------------
61 // vector-valued case
62 // --------------------------------------------------------------------------
63 template<class T>
64 void
66  const piola<T>& p,
67  const point_basic<T>& hat_u,
68  point_basic<T>& u) const
69 {
70  u = hat_u;
71 }
72 template<class T>
73 void
75  const piola<T>& p,
76  const point_basic<T>& u,
77  point_basic<T>& hat_u) const
78 {
79  hat_u = u;
80 }
81 template<class T>
82 void
84  const piola<T>& p,
85  const point_basic<T>& hat_u,
86  const tensor_basic<T>& hat_grad_u,
87  const details::differentiate_option& gopt,
88  tensor_basic<T>& grad_u) const
89 {
90  // grad_u = grad_hat_u*DF^{-1}
91  grad_u = hat_grad_u*p.invDF; // TODO: DVT_OPTIM_2D
92  const point_basic<T>& u = hat_u;
93  grad_post (p, gopt, u, grad_u);
94 }
95 // --------------------------------------------------------------------------
96 // tensor-valued case
97 // --------------------------------------------------------------------------
98 template<class T>
99 void
101  const piola<T>& p,
102  const tensor_basic<T>& hat_u,
103  tensor_basic<T>& u) const
104 {
105  u = hat_u;
106 }
107 template<class T>
108 void
110  const piola<T>& p,
111  const tensor_basic<T>& u,
112  tensor_basic<T>& hat_u) const
113 {
114  hat_u = u;
115 }
116 template<class T>
117 void
119  const piola<T>& p,
120  const tensor_basic<T>& hat_u,
121  const tensor3_basic<T>& hat_grad_u,
122  const details::differentiate_option& gopt,
123  tensor3_basic<T>& grad_u) const
124 {
125  // grad_u_{ijk} = grad_hat_u_{ijl}*DF^{-1}_{lk}
126  grad_u = hat_grad_u*p.invDF; // TODO: DVT_OPTIM_2D
127  const tensor_basic<T>& u = hat_u;
128  grad_post (p, gopt, u, grad_u);
129 }
130 // ----------------------------------------------------------------------------
131 // instanciation in library
132 // ----------------------------------------------------------------------------
133 #define _RHEOLEF_instanciation(T) \
134 template class piola_fem_lagrange<T>; \
135 
137 
138 }// namespace rheolef
see the Float page for the full documentation
virtual void transform(const piola< T > &p, const T &hat_u, T &u) const
virtual void inv_transform(const piola< T > &p, const T &u, T &hat_u) const
virtual void grad_transform(const piola< T > &p, const T &hat_u, const point_basic< T > &hat_grad_u, const details::differentiate_option &gopt, point_basic< T > &grad_u) const
tensor_basic< T > tensor3_basic< T >
Definition: piola_fem.h:137
point_basic< T >
Definition: piola_fem.h:135
Expr1::float_type T
Definition: field_expr.h:261
This file is part of Rheolef.
_RHEOLEF_instanciation(Float, sequential, std::allocator< Float >) _RHEOLEF_instanciation(Float
Definition: sphere.icc:25
Definition: leveque.h:25
Float u(const point &x)