Skip to content
Snippets Groups Projects
Commit b0f7bd43 authored by Tom Fischer's avatar Tom Fischer
Browse files

[MeL] clang format ElementCoordinatesMappingLocal.

parent f1fea438
No related branches found
No related tags found
No related merge requests found
...@@ -21,26 +21,26 @@ ...@@ -21,26 +21,26 @@
namespace detail namespace detail
{ {
/// rotate points to local coordinates /// rotate points to local coordinates
void rotateToLocal( void rotateToLocal(const MeshLib::RotationMatrix& matR2local,
const MeshLib::RotationMatrix &matR2local, std::vector<MathLib::Point3d>& points)
std::vector<MathLib::Point3d> &points)
{ {
for (auto& p : points) for (auto& p : points)
p = matR2local*p; p = matR2local * p;
} }
/// get a rotation matrix to the global coordinates /// get a rotation matrix to the global coordinates
/// it computes R in x=R*x' where x is original coordinates and x' is local coordinates /// it computes R in x=R*x' where x is original coordinates and x' is local
void getRotationMatrixToGlobal( /// coordinates
const unsigned element_dimension, void getRotationMatrixToGlobal(const unsigned element_dimension,
const unsigned global_dim, const unsigned global_dim,
const std::vector<MathLib::Point3d> &points, const std::vector<MathLib::Point3d>& points,
MeshLib::RotationMatrix &matR) MeshLib::RotationMatrix& matR)
{ {
// compute R in x=R*x' where x are original coordinates and x' are local coordinates // compute R in x=R*x' where x are original coordinates and x' are local
if (element_dimension == 1) { // coordinates
if (element_dimension == 1)
{
MathLib::Vector3 xx(points[0], points[1]); MathLib::Vector3 xx(points[0], points[1]);
xx.normalize(); xx.normalize();
if (global_dim == 2) if (global_dim == 2)
...@@ -48,7 +48,9 @@ void getRotationMatrixToGlobal( ...@@ -48,7 +48,9 @@ void getRotationMatrixToGlobal(
else else
GeoLib::compute3DRotationMatrixToX(xx, matR); GeoLib::compute3DRotationMatrixToX(xx, matR);
matR.transposeInPlace(); matR.transposeInPlace();
} else if (global_dim == 3 && element_dimension == 2) { }
else if (global_dim == 3 && element_dimension == 2)
{
// get plane normal // get plane normal
MathLib::Vector3 plane_normal; MathLib::Vector3 plane_normal;
double d; double d;
...@@ -59,17 +61,14 @@ void getRotationMatrixToGlobal( ...@@ -59,17 +61,14 @@ void getRotationMatrixToGlobal(
// set a transposed matrix // set a transposed matrix
matR.transposeInPlace(); matR.transposeInPlace();
} }
} }
} // namespace detail } // namespace detail
namespace MeshLib namespace MeshLib
{ {
ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal( ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal(
const Element& e, const Element& e, const unsigned global_dim)
const unsigned global_dim) : _global_dim(global_dim), _matR2global(3, 3)
: _global_dim(global_dim), _matR2global(3,3)
{ {
assert(e.getDimension() <= global_dim); assert(e.getDimension() <= global_dim);
_points.reserve(e.getNumberOfNodes()); _points.reserve(e.getNumberOfNodes());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment