https://mooseframework.inl.gov
Loading...
Searching...
No Matches
EulerAngles.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "MooseTypes.h"
13#include "DataIO.h"
14#include "libmesh/vector_value.h"
15// Ignore depcrecated copy warnings for this class from libmesh Eigen contrib
16#include "libmesh/ignore_warnings.h"
17#include <Eigen/Geometry>
18
19// forward declaration
20class MooseRandom;
21
26{
27public:
28 Real phi1, Phi, phi2;
29
30 // default constructor
32 // Quaternions to Euler Angles
33 EulerAngles(const Eigen::Quaternion<Real> & q);
34 // Components to Euler Angles
35 EulerAngles(const Real & v0, const Real & v1, const Real & v2);
36
37 operator RealVectorValue() const { return RealVectorValue(phi1, Phi, phi2); }
38
39 void random();
41 // Euler to Quaternions
42 Eigen::Quaternion<Real> toQuaternion();
43};
44
45template <>
46inline void
47dataStore(std::ostream & ostream, EulerAngles & v, void * ctx)
48{
49 dataStore(ostream, v.phi1, ctx);
50 dataStore(ostream, v.Phi, ctx);
51 dataStore(ostream, v.phi2, ctx);
52}
53
54template <>
55inline void
56dataLoad(std::istream & ostream, EulerAngles & v, void * ctx)
57{
58 dataLoad(ostream, v.phi1, ctx);
59 dataLoad(ostream, v.Phi, ctx);
60 dataLoad(ostream, v.phi2, ctx);
61}
62
63// Restore warnings for other classes
64#include "libmesh/restore_warnings.h"
void dataLoad(std::istream &ostream, EulerAngles &v, void *ctx)
Definition EulerAngles.h:56
void dataStore(std::ostream &ostream, EulerAngles &v, void *ctx)
Definition EulerAngles.h:47
const double v
Euler angle triplet.
Definition EulerAngles.h:26
void random()
Definition EulerAngles.C:84
Eigen::Quaternion< Real > toQuaternion()
Definition EulerAngles.C:55