v0.15.0
Loading...
Searching...
No Matches
LieGroups::SO3 Struct Reference

#include "src/interfaces/Lie.hpp"

Collaboration diagram for LieGroups::SO3:
[legend]

Public Member Functions

 SO3 ()=delete
 
 ~SO3 ()=delete
 

Static Public Member Functions

template<typename T >
static auto getVee (T &&w1, T &&w2, T &&w3)
 
template<typename T >
static auto getHat (T &&w1, T &&w2, T &&w3)
 
template<typename A >
static auto getVee (A &&t_w_hat)
 
template<typename A >
static auto getHat (A &&t_w_vee)
 
template<typename A , typename B >
static auto exp (A &&t_w_vee, B &&theta)
 
template<typename A , typename B >
static auto Jl (A &&t_w_vee, B &&theta)
 
template<typename A , typename B >
static auto Jr (A &&t_w_vee, B &&theta)
 
template<typename A , typename B , typename C >
static auto action (A &&t_w_vee, B &&theta, C &&t_A)
 
template<typename A , typename B >
static auto dActionJl (A &&t_w_vee, B &&t_A)
 
template<typename A , typename B >
static auto dActionJr (A &&t_w_vee, B &&t_A)
 
template<typename A , typename B >
static auto diffExp (A &&t_w_vee, B &&theta)
 
template<typename A , typename B >
static auto diffDiffExp (A &&t_w_vee, B &&theta)
 

Static Private Member Functions

static FTENSOR_INDEX (dim, i)
 
static FTENSOR_INDEX (dim, j)
 
static FTENSOR_INDEX (dim, k)
 
static FTENSOR_INDEX (dim, l)
 
static FTENSOR_INDEX (dim, m)
 
static FTENSOR_INDEX (dim, n)
 
template<typename T >
static auto getVeeImpl (FTensor::Tensor2< T, dim, dim > &t_w_hat)
 
template<typename T >
static auto getHatImpl (FTensor::Tensor1< T, dim > &t_w_vee)
 
template<typename T1 , typename T2 , typename T3 >
static auto genericFormImpl (FTensor::Tensor1< T1, dim > &t_w_vee, const T2 alpha, const T3 beta)
 
template<typename T1 , typename T2 >
static auto expImpl (FTensor::Tensor1< T1, dim > &t_w_vee, const T2 theta)
 
template<typename T1 , typename T2 >
static auto diffExpImpl (FTensor::Tensor1< T1, dim > &t_w_vee, const T2 theta)
 
template<typename T1 , typename T2 >
static auto diffDiffExpImpl (FTensor::Tensor1< T1, dim > &t_w_vee, const T2 theta)
 
template<typename T1 , typename T2 >
static auto JlImpl (FTensor::Tensor1< T1, dim > &t_w_vee, const T2 &theta)
 
template<typename T1 , typename T2 >
static auto JrImpl (FTensor::Tensor1< T1, dim > &t_w_vee, const T2 theta)
 
template<typename T1 , typename T2 , typename T3 >
static auto actionImpl (FTensor::Tensor1< T1, dim > &t_w_vee, const T2 theta, FTensor::Tensor2_symmetric< T3, dim > &t_A)
 

Static Private Attributes

static constexpr int dim = 3
 

Detailed Description

Definition at line 22 of file Lie.hpp.

Constructor & Destructor Documentation

◆ SO3()

LieGroups::SO3::SO3 ( )
delete

◆ ~SO3()

LieGroups::SO3::~SO3 ( )
delete

Member Function Documentation

◆ action()

template<typename A , typename B , typename C >
static auto LieGroups::SO3::action ( A && t_w_vee,
B && theta,
C && t_A )
inlinestatic

Definition at line 63 of file Lie.hpp.

63 {
64 return actionImpl(std::forward<A>(t_w_vee), std::forward<B>(theta),
65 std::forward<C>(t_A));
66 }
static auto actionImpl(FTensor::Tensor1< T1, dim > &t_w_vee, const T2 theta, FTensor::Tensor2_symmetric< T3, dim > &t_A)
Definition Lie.hpp:314

◆ actionImpl()

template<typename T1 , typename T2 , typename T3 >
static auto LieGroups::SO3::actionImpl ( FTensor::Tensor1< T1, dim > & t_w_vee,
const T2 theta,
FTensor::Tensor2_symmetric< T3, dim > & t_A )
inlinestaticprivate

Definition at line 314 of file Lie.hpp.

316 {
317 using D = typename TensorTypeExtractor<T3>::Type;
319 t_B(i, j) = exp(t_w_vee, theta)(i,k) * t_A(k, j);
320 return t_B;
321 }
FTensor::Index< 'i', SPACE_DIM > i
double D
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static auto exp(A &&t_w_vee, B &&theta)
Definition Lie.hpp:48
std::remove_pointer< T >::type Type
Definition Lie.hpp:16

◆ dActionJl()

template<typename A , typename B >
static auto LieGroups::SO3::dActionJl ( A && t_w_vee,
B && t_A )
inlinestatic

Definition at line 69 of file Lie.hpp.

69 {
70 return dActionJlImpl(std::forward<A>(t_w_vee), std::forward<B>(t_A));
71 }

◆ dActionJr()

template<typename A , typename B >
static auto LieGroups::SO3::dActionJr ( A && t_w_vee,
B && t_A )
inlinestatic

Definition at line 74 of file Lie.hpp.

74 {
75 return dActionJrImpl(std::forward<A>(t_w_vee), std::forward<B>(t_A));
76 }

◆ diffDiffExp()

template<typename A , typename B >
static auto LieGroups::SO3::diffDiffExp ( A && t_w_vee,
B && theta )
inlinestatic

Definition at line 84 of file Lie.hpp.

84 {
85 return diffDiffExpImpl(std::forward<A>(t_w_vee), std::forward<B>(theta));
86 }
static auto diffDiffExpImpl(FTensor::Tensor1< T1, dim > &t_w_vee, const T2 theta)
Definition Lie.hpp:191

◆ diffDiffExpImpl()

template<typename T1 , typename T2 >
static auto LieGroups::SO3::diffDiffExpImpl ( FTensor::Tensor1< T1, dim > & t_w_vee,
const T2 theta )
inlinestaticprivate

Definition at line 191 of file Lie.hpp.

192 {
193
194 auto get_tensor = [&t_w_vee](auto a, auto diff_a, auto diff_diff_a, auto b,
195 auto diff_b, auto diff_diff_b) {
196 FTENSOR_INDEX(3, i);
197 FTENSOR_INDEX(3, j);
198 FTENSOR_INDEX(3, k);
199 FTENSOR_INDEX(3, l);
200 FTENSOR_INDEX(3, m);
201
202 constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
203
204 using D = typename TensorTypeExtractor<T1>::Type;
205 FTensor::Tensor4<D, 3, 3, 3, 3> t_diff_diff_exp;
206
208 auto t_hat = getHat(t_w_vee);
209 t_diff_diff_exp(i, j, k, m) =
210
211 diff_a * FTensor::levi_civita<int>(i, j, k) * t_w_vee(m)
212
213 +
214
215 diff_a * (
216
217 t_hat(i, j) * t_kd(k, m) +
218 FTensor::levi_civita<int>(i, j, m) * t_w_vee(k)
219
220 )
221
222 +
223
224 diff_diff_a * t_hat(i, j) * t_w_vee(k) * t_w_vee(m)
225
226 +
227
232
233 +
234
235 diff_b * ((t_hat(i, l) * FTensor::levi_civita<int>(l, j, k) +
236 FTensor::levi_civita<int>(i, l, k) * t_hat(l, j)) *
237 t_w_vee(m))
238
239 +
240
241 diff_b *
242 (
243
244 t_hat(i, l) * t_hat(l, j) * t_kd(k, m)
245
246 +
247
248 FTensor::levi_civita<int>(i, l, m) * t_hat(l, j) * t_w_vee(k)
249
250 +
251
252 t_hat(i, l) * FTensor::levi_civita<int>(l, j, m) * t_w_vee(k)
253
254 )
255
256 +
257
258 diff_diff_b * t_hat(i, l) * t_hat(l, j) * t_w_vee(k) * t_w_vee(m);
259
260 return t_diff_diff_exp;
261 };
262
263 if (std::fabs(theta) < std::numeric_limits<T2>::epsilon()) {
264 return get_tensor(1., -1. / 3., 1. / 15., 0., 1. / 1.2, 1. / 90.);
265 }
266
267 const auto ss = sin(theta);
268 const auto a = ss / theta;
269
270 const auto theta2 = theta * theta;
271 const auto cc = cos(theta);
272 const auto diff_a = (theta * cc - ss) / (theta2 * theta);
273 const auto diff_diff_a =
274 -(3 * theta * cc + (-3 * theta2) * ss) / pow(theta, 5);
275
276 const auto ss_2 = sin(theta / 2.);
277 const auto cc_2 = cos(theta / 2.);
278 const auto b = 2. * ss_2 * ss_2 / theta2;
279 const auto diff_b =
280 (2. * theta * ss_2 * cc_2 - 4. * ss_2 * ss_2) / (theta2 * theta2);
281 const auto diff_diff_b =
282 (8. + (-8. + theta2) * cc - 5. * theta * ss) / (std::pow(theta, 6));
283
284 return get_tensor(a, diff_a, diff_diff_a, b, diff_b, diff_diff_b);
285 }
#define FTENSOR_INDEX(DIM, I)
constexpr double a
Kronecker Delta class.
constexpr auto t_kd
FTensor::Index< 'l', 3 > l
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
FTensor::Index< 'm', 3 > m
static auto getHat(T &&w1, T &&w2, T &&w3)
Definition Lie.hpp:35

◆ diffExp()

template<typename A , typename B >
static auto LieGroups::SO3::diffExp ( A && t_w_vee,
B && theta )
inlinestatic
Examples
EshelbianOperators.cpp.

Definition at line 79 of file Lie.hpp.

79 {
80 return diffExpImpl(std::forward<A>(t_w_vee), std::forward<B>(theta));
81 }
static auto diffExpImpl(FTensor::Tensor1< T1, dim > &t_w_vee, const T2 theta)
Definition Lie.hpp:138

◆ diffExpImpl()

template<typename T1 , typename T2 >
static auto LieGroups::SO3::diffExpImpl ( FTensor::Tensor1< T1, dim > & t_w_vee,
const T2 theta )
inlinestaticprivate

Definition at line 138 of file Lie.hpp.

139 {
140
141 auto get_tensor = [&t_w_vee](auto a, auto diff_a, auto b, auto diff_b) {
142 FTENSOR_INDEX(3, i);
143 FTENSOR_INDEX(3, j);
144 FTENSOR_INDEX(3, k);
145 FTENSOR_INDEX(3, l);
146
147 using D = typename TensorTypeExtractor<T1>::Type;
149 auto t_hat = getHat(t_w_vee);
150 t_diff_exp(i, j, k) =
151
153
154 +
155
156 diff_a * t_hat(i, j) * t_w_vee(k)
157
158 +
159
160 b * (t_hat(i, l) * FTensor::levi_civita<int>(l, j, k) +
161 FTensor::levi_civita<int>(i, l, k) * t_hat(l, j))
162
163 +
164
165 diff_b * t_hat(i, l) * t_hat(l, j) * t_w_vee(k);
166
167 return t_diff_exp;
168 };
169
170 if(std::fabs(theta) < std::numeric_limits<T2>::epsilon()){
171 return get_tensor(1., -1. / 3., 0., 1. / 1.2);
172 }
173
174 const auto ss = sin(theta);
175 const auto a = ss / theta;
176
177 const auto theta2 = theta * theta;
178 const auto cc = cos(theta);
179 const auto diff_a = (theta * cc - ss) / (theta2 * theta);
180
181 const auto ss_2 = sin(theta / 2.);
182 const auto cc_2 = cos(theta / 2.);
183 const auto b = 2. * ss_2 * ss_2 / theta2;
184 const auto diff_b =
185 (2. * theta * ss_2 * cc_2 - 4. * ss_2 * ss_2) / (theta2 * theta2);
186
187 return get_tensor(a, diff_a, b, diff_b);
188 }

◆ exp()

template<typename A , typename B >
static auto LieGroups::SO3::exp ( A && t_w_vee,
B && theta )
inlinestatic
Examples
EshelbianOperators.cpp, and EshelbianPlasticity.cpp.

Definition at line 48 of file Lie.hpp.

48 {
49 return expImpl(std::forward<A>(t_w_vee), std::forward<B>(theta));
50 }
static auto expImpl(FTensor::Tensor1< T1, dim > &t_w_vee, const T2 theta)
Definition Lie.hpp:125

◆ expImpl()

template<typename T1 , typename T2 >
static auto LieGroups::SO3::expImpl ( FTensor::Tensor1< T1, dim > & t_w_vee,
const T2 theta )
inlinestaticprivate

Definition at line 125 of file Lie.hpp.

126 {
127 if (std::fabs(theta) < std::numeric_limits<T2>::epsilon()) {
128 return genericFormImpl(t_w_vee, 1, 0.5);
129 }
130 const auto s = sin(theta);
131 const auto s_half = sin(theta / 2);
132 const auto a = s / theta;
133 const auto b = 2 * (s_half / theta) * (s_half / theta);
134 return genericFormImpl(t_w_vee, a, b);
135 }
static auto genericFormImpl(FTensor::Tensor1< T1, dim > &t_w_vee, const T2 alpha, const T3 beta)
Definition Lie.hpp:114

◆ FTENSOR_INDEX() [1/6]

static LieGroups::SO3::FTENSOR_INDEX ( dim ,
i  )
inlinestaticprivate

◆ FTENSOR_INDEX() [2/6]

static LieGroups::SO3::FTENSOR_INDEX ( dim ,
j  )
inlinestaticprivate

◆ FTENSOR_INDEX() [3/6]

static LieGroups::SO3::FTENSOR_INDEX ( dim ,
k  )
inlinestaticprivate

◆ FTENSOR_INDEX() [4/6]

static LieGroups::SO3::FTENSOR_INDEX ( dim ,
l  )
inlinestaticprivate

◆ FTENSOR_INDEX() [5/6]

static LieGroups::SO3::FTENSOR_INDEX ( dim ,
m  )
inlinestaticprivate

◆ FTENSOR_INDEX() [6/6]

static LieGroups::SO3::FTENSOR_INDEX ( dim ,
n  )
inlinestaticprivate

◆ genericFormImpl()

template<typename T1 , typename T2 , typename T3 >
static auto LieGroups::SO3::genericFormImpl ( FTensor::Tensor1< T1, dim > & t_w_vee,
const T2 alpha,
const T3 beta )
inlinestaticprivate

Definition at line 114 of file Lie.hpp.

115 {
116 using D = typename TensorTypeExtractor<T1>::Type;
118 auto t_hat = getHat(t_w_vee);
119 t_X(i, j) = FTensor::Kronecker_Delta<int>()(i, j) + alpha * t_hat(i, j) +
120 beta * (t_hat(i, k) * t_hat(k, j));
121 return t_X;
122 }

◆ getHat() [1/2]

template<typename A >
static auto LieGroups::SO3::getHat ( A && t_w_vee)
inlinestatic

Definition at line 43 of file Lie.hpp.

43 {
44 return getHatImpl(std::forward<A>(t_w_vee));
45 }
static auto getHatImpl(FTensor::Tensor1< T, dim > &t_w_vee)
Definition Lie.hpp:106

◆ getHat() [2/2]

template<typename T >
static auto LieGroups::SO3::getHat ( T && w1,
T && w2,
T && w3 )
inlinestatic

Definition at line 35 of file Lie.hpp.

35 {
36 return getHatImpl(std::forward<A>(getVee(w1, w2, w3)));
37 }
static auto getVee(T &&w1, T &&w2, T &&w3)
Definition Lie.hpp:27

◆ getHatImpl()

template<typename T >
static auto LieGroups::SO3::getHatImpl ( FTensor::Tensor1< T, dim > & t_w_vee)
inlinestaticprivate

Definition at line 106 of file Lie.hpp.

106 {
107 using D = typename TensorTypeExtractor<T>::Type;
109 t_w_hat(i, j) = levi_civita(i, j, k) * t_w_vee(k);
110 return t_w_hat;
111 }

◆ getVee() [1/2]

template<typename A >
static auto LieGroups::SO3::getVee ( A && t_w_hat)
inlinestatic

Definition at line 39 of file Lie.hpp.

39 {
40 return getVeeImpl(std::forward<A>(t_w_hat));
41 }
static auto getVeeImpl(FTensor::Tensor2< T, dim, dim > &t_w_hat)
Definition Lie.hpp:98

◆ getVee() [2/2]

template<typename T >
static auto LieGroups::SO3::getVee ( T && w1,
T && w2,
T && w3 )
inlinestatic

Definition at line 27 of file Lie.hpp.

27 {
29
30 std::forward<T>(w1), std::forward<T>(w2), std::forward<T>(w3)
31
32 );
33 }

◆ getVeeImpl()

template<typename T >
static auto LieGroups::SO3::getVeeImpl ( FTensor::Tensor2< T, dim, dim > & t_w_hat)
inlinestaticprivate

Definition at line 98 of file Lie.hpp.

98 {
99 using D = typename TensorTypeExtractor<T>::Type;
101 t_w_vee(k) = (levi_civita(i, j, k) * t_w_hat(i, j)) / 2;
102 return t_w_vee;
103 }

◆ Jl()

template<typename A , typename B >
static auto LieGroups::SO3::Jl ( A && t_w_vee,
B && theta )
inlinestatic

Definition at line 53 of file Lie.hpp.

53 {
54 return JlImpl(std::forward<A>(t_w_vee), std::forward<B>(theta));
55 }
static auto JlImpl(FTensor::Tensor1< T1, dim > &t_w_vee, const T2 &theta)
Definition Lie.hpp:288

◆ JlImpl()

template<typename T1 , typename T2 >
static auto LieGroups::SO3::JlImpl ( FTensor::Tensor1< T1, dim > & t_w_vee,
const T2 & theta )
inlinestaticprivate

Definition at line 288 of file Lie.hpp.

289 {
290 if (std::fabs(theta) < std::numeric_limits<T2>::epsilon()) {
291 return genericFormImpl(t_w_vee, 0.5, 1. / 6.);
292 }
293 const auto s = sin(theta);
294 const auto s_half = sin(theta / 2);
295 const auto a = 2 * (s_half / theta) * (s_half / theta);
296 const auto b = ((theta - s) / theta) / theta / theta;
297 return genericFormImpl(t_w_vee, a, b);
298 }

◆ Jr()

template<typename A , typename B >
static auto LieGroups::SO3::Jr ( A && t_w_vee,
B && theta )
inlinestatic

Definition at line 58 of file Lie.hpp.

58 {
59 return JrImpl(std::forward<A>(t_w_vee), std::forward<B>(theta));
60 }
static auto JrImpl(FTensor::Tensor1< T1, dim > &t_w_vee, const T2 theta)
Definition Lie.hpp:301

◆ JrImpl()

template<typename T1 , typename T2 >
static auto LieGroups::SO3::JrImpl ( FTensor::Tensor1< T1, dim > & t_w_vee,
const T2 theta )
inlinestaticprivate

Definition at line 301 of file Lie.hpp.

302 {
303 if (std::fabs(theta) < std::numeric_limits<T2>::epsilon()) {
304 return genericFormImpl(t_w_vee, -0.5, 1. / 6.);
305 }
306 const auto s = sin(theta);
307 const auto s_half = sin(theta / 2);
308 const auto a = 2 * (s_half / theta) * (s_half / theta);
309 const auto b = ((theta - s) / theta) / theta / theta;
310 return genericFormImpl(t_w_vee, -a, b);
311 }

Member Data Documentation

◆ dim

int LieGroups::SO3::dim = 3
inlinestaticconstexprprivate

Definition at line 89 of file Lie.hpp.


The documentation for this struct was generated from the following file: