25 #include <openbeam/config.h>
27 #include <mrpt/containers/yaml.h>
28 #include <mrpt/core/exceptions.h>
29 #include <mrpt/core/format.h>
30 #include <mrpt/math/TPoint3D.h>
31 #include <mrpt/system/CTimeLogger.h>
33 #include <Eigen/Dense>
34 #include <Eigen/StdVector>
45 #define OB_MESSAGE(VERBOSE_LEVEL) \
46 if (openbeam::getVerbosityLevel() >= VERBOSE_LEVEL) std::cout << "[" << __func__ << "] "
48 #define OB_TODO(x__) MRPT_TODO(x__)
52 inline num_t DEG2RAD(
const num_t x) {
return x * M_PI / num_t(180.0); }
53 inline num_t RAD2DEG(
const num_t x) {
return x * num_t(180.0) / M_PI; }
55 constexpr num_t UNINITIALIZED_VALUE = (std::numeric_limits<num_t>::max());
63 extern mrpt::system::CTimeLogger timelog;
68 using DynMatrix = Eigen::Matrix<num_t, Eigen::Dynamic, Eigen::Dynamic>;
69 using Matrix66 = Eigen::Matrix<num_t, 6, 6>;
70 using Matrix33 = Eigen::Matrix<num_t, 3, 3>;
71 using Vector6 = Eigen::Matrix<num_t, 6, 1>;
72 using Vector3 = Eigen::Matrix<num_t, 3, 1>;
74 using vector_string_t = std::vector<std::string>;
89 num_t operator[](
const int idx)
const
106 THROW_EXCEPTION(
"out of range");
109 num_t& operator[](
const int idx)
126 THROW_EXCEPTION(
"out of range");
130 FaceStress& operator+=(
const FaceStress& o)
142 FaceStress& operator+=(
const Eigen::MatrixBase<MAT>& o)
144 ASSERT_(o.size() == 6);
156 using ElementStress = std::vector<FaceStress>;
168 num_t
evaluate(
const mrpt::containers::yaml& proxy)
const
170 return evaluate(proxy.node().as<std::string>());
173 num_t
evaluate(
const mrpt::containers::yaml_cref& proxy)
const
175 return evaluate(proxy.node().as<std::string>());
178 std::map<std::string, double> parameters;
180 std::map<std::string, mrpt::containers::yaml> beamSectionParameters;
182 vector_string_t* err_msgs =
nullptr;
183 vector_string_t* warn_msgs =
nullptr;
184 unsigned int lin_num = 0;
187 const bool warn_unused_constraints =
true;
192 inline TRotation3D() : rot(Matrix33::Identity()), m_is_pure_identity(
true) {}
193 TRotation3D(
const num_t ang_x,
const num_t ang_y,
const num_t ang_z);
195 inline const Matrix33& getRot()
const {
return rot; }
196 inline void setRot(
const Matrix33& r)
199 m_is_pure_identity =
false;
202 static void matrix2angles(
const Matrix33& R, num_t& ang_x, num_t& ang_y, num_t& ang_z);
208 bool m_is_pure_identity;
211 using TPoint3D = mrpt::math::TPoint3D_<num_t>;
217 TRotationTrans3D(num_t x, num_t y, num_t z, num_t ang_x, num_t ang_y, num_t ang_z) :
218 t(x, y, z),
r(ang_x, ang_y, ang_z)
233 void setVerbosityLevel(
int verbose_level);
238 int getVerbosityLevel();
241 bool strCmpI(
const std::string& s1,
const std::string& s2);
245 num_t str2num(
const std::string& s);
248 using array6 = std::array<num_t, 6>;
250 using element_index_t = std::size_t;
251 using node_index_t = std::size_t;
253 struct DrawStructureOptions;
254 struct RenderInitData;
255 struct DrawElementExtraParams;
256 struct StaticSolveProblemInfo;
num_t evaluate(const std::string &sVarVal) const
num_t evaluate(const mrpt::containers::yaml_cref &proxy) const
for use with evaluate(p["K"]) on a const yaml object
Definition: types.h:173
num_t evaluate(const mrpt::containers::yaml &proxy) const
for use with evaluate(p["K"])
Definition: types.h:168
One entry per element "face".
Definition: types.h:78
num_t N
Axial.
Definition: types.h:82
num_t Mz
Moment Z.
Definition: types.h:87
num_t Vz
Shear Z.
Definition: types.h:84
num_t Vy
Shear Y.
Definition: types.h:83
num_t My
Moment Y.
Definition: types.h:86
num_t Mx
Moment X.
Definition: types.h:85
bool isIdentity() const
Test for whether this 3x3 matrix is EXACTLY the identity.
TRotation3D r
Rotation in 3D.
Definition: types.h:223
TPoint3D t
Translation vector in 3D.
Definition: types.h:222