OGS
GetElementRotationMatrices.cpp
Go to the documentation of this file.
1 
13 
14 #include "GetSpaceDimension.h"
17 #include "MeshLib/Mesh.h"
18 
19 namespace MeshLib
20 {
21 std::vector<Eigen::MatrixXd> getElementRotationMatrices(
22  int const space_dimension, int const mesh_dimension,
23  std::vector<Element*> const& elements)
24 {
25  std::vector<Eigen::MatrixXd> element_rotation_matrices;
26  element_rotation_matrices.reserve(elements.size());
27  for (auto const& element : elements)
28  {
29  int const element_dimension = static_cast<int>(element->getDimension());
30  if (element_dimension == space_dimension)
31  {
32  element_rotation_matrices.emplace_back(Eigen::MatrixXd::Identity(
33  element_dimension, element_dimension));
34  }
35  else
36  {
37  MeshLib::ElementCoordinatesMappingLocal coordinates_mapping(
38  *element, mesh_dimension);
39 
40  element_rotation_matrices.emplace_back(
41  coordinates_mapping.getRotationMatrixToGlobal().topLeftCorner(
42  space_dimension, element_dimension));
43  }
44  }
45 
46  return element_rotation_matrices;
47 }
48 } // namespace MeshLib
Definition of the Mesh class.
const RotationMatrix & getRotationMatrixToGlobal() const
return a rotation matrix converting to global coordinates
std::vector< Eigen::MatrixXd > getElementRotationMatrices(int const space_dimension, int const mesh_dimension, std::vector< Element * > const &elements)
Element rotation matrix computation.