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) \
47 std::cout << "[" << __func__ << "] "
49 #define OB_TODO(x__) MRPT_TODO(x__)
53 inline num_t DEG2RAD(
const num_t x) {
return x * M_PI / num_t(180.0); }
54 inline num_t RAD2DEG(
const num_t x) {
return x * num_t(180.0) / M_PI; }
56 constexpr num_t UNINITIALIZED_VALUE = (std::numeric_limits<num_t>::max());
64 extern mrpt::system::CTimeLogger timelog;
69 using DynMatrix = Eigen::Matrix<num_t, Eigen::Dynamic, Eigen::Dynamic>;
70 using Matrix66 = Eigen::Matrix<num_t, 6, 6>;
71 using Matrix33 = Eigen::Matrix<num_t, 3, 3>;
72 using Vector6 = Eigen::Matrix<num_t, 6, 1>;
73 using Vector3 = Eigen::Matrix<num_t, 3, 1>;
75 using vector_string_t = std::vector<std::string>;
90 num_t operator[](
const int idx)
const
107 THROW_EXCEPTION(
"out of range");
110 num_t& operator[](
const int idx)
127 THROW_EXCEPTION(
"out of range");
131 FaceStress& operator+=(
const FaceStress& o)
143 FaceStress& operator+=(
const Eigen::MatrixBase<MAT>& o)
145 ASSERT_(o.size() == 6);
157 using ElementStress = std::vector<FaceStress>;
169 num_t
evaluate(
const mrpt::containers::yaml& proxy)
const
171 return evaluate(proxy.node().as<std::string>());
174 std::map<std::string, double> parameters;
176 std::map<std::string, mrpt::containers::yaml> beamSectionParameters;
178 vector_string_t* err_msgs =
nullptr;
179 vector_string_t* warn_msgs =
nullptr;
180 unsigned int lin_num = 0;
183 const bool warn_unused_constraints =
true;
188 inline TRotation3D() : rot(Matrix33::Identity()), m_is_pure_identity(
true)
191 TRotation3D(
const num_t ang_x,
const num_t ang_y,
const num_t ang_z);
193 inline const Matrix33& getRot()
const {
return rot; }
194 inline void setRot(
const Matrix33& r)
197 m_is_pure_identity =
false;
200 static void matrix2angles(
201 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>;
218 num_t x, num_t y, num_t z, num_t ang_x, num_t ang_y, num_t ang_z)
219 :
t(x, y, z),
r(ang_x, ang_y, ang_z)
228 return t.distanceTo(o.
t);
237 void setVerbosityLevel(
int verbose_level);
242 int getVerbosityLevel();
245 bool strCmpI(
const std::string& s1,
const std::string& s2);
249 num_t str2num(
const std::string& s);
252 using array6 = std::array<num_t, 6>;
254 using element_index_t = std::size_t;
255 using node_index_t = std::size_t;
257 struct DrawStructureOptions;
258 struct RenderInitData;
259 struct DrawElementExtraParams;
260 struct StaticSolveProblemInfo;
num_t evaluate(const std::string &sVarVal) const
num_t evaluate(const mrpt::containers::yaml &proxy) const
for use with evaluate(p["K"])
Definition: types.h:169
One entry per element "face".
Definition: types.h:79
num_t N
Axial.
Definition: types.h:83
num_t Mz
Moment Z.
Definition: types.h:88
num_t Vz
Shear Z.
Definition: types.h:85
num_t Vy
Shear Y.
Definition: types.h:84
num_t My
Moment Y.
Definition: types.h:87
num_t Mx
Moment X.
Definition: types.h:86
bool isIdentity() const
Test for whether this 3x3 matrix is EXACTLY the identity.
TRotation3D r
Rotation in 3D.
Definition: types.h:224
TPoint3D t
Translation vector in 3D.
Definition: types.h:223