Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
piola_fem_lagrange.cc
Go to the documentation of this file.
1
21#include "piola_fem_lagrange.h"
23namespace rheolef {
24
25// --------------------------------------------------------------------------
26// scalar-valued case
27// --------------------------------------------------------------------------
28template<class T>
29void
31 const piola<T>& p,
32 const T& hat_u,
33 T& u) const
34{
35 u = hat_u;
36}
37template<class T>
38void
40 const piola<T>& p,
41 const T& u,
42 T& hat_u) const
43{
44 hat_u = u;
45}
46template<class T>
47void
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// --------------------------------------------------------------------------
63template<class T>
64void
66 const piola<T>& p,
67 const point_basic<T>& hat_u,
68 point_basic<T>& u) const
69{
70 u = hat_u;
71}
72template<class T>
73void
75 const piola<T>& p,
76 const point_basic<T>& u,
77 point_basic<T>& hat_u) const
78{
79 hat_u = u;
80}
81template<class T>
82void
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// --------------------------------------------------------------------------
98template<class T>
99void
101 const piola<T>& p,
102 const tensor_basic<T>& hat_u,
103 tensor_basic<T>& u) const
104{
105 u = hat_u;
106}
107template<class T>
108void
110 const piola<T>& p,
111 const tensor_basic<T>& u,
112 tensor_basic<T>& hat_u) const
113{
114 hat_u = u;
115}
116template<class T>
117void
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) \
134template class piola_fem_lagrange<T>; \
135
137
138}// namespace rheolef
#define _RHEOLEF_instanciation(T, M, A)
Definition asr.cc:223
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
Expr1::float_type T
Definition field_expr.h:230
This file is part of Rheolef.
Definition sphere.icc:25
Definition leveque.h:25