Skip to content
Snippets Groups Projects
Commit f72b6495 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by Tom Fischer
Browse files

[MeL] Pass element's dimension instead of element.

parent f925e9f4
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ void rotateToLocal( ...@@ -34,7 +34,7 @@ void rotateToLocal(
/// 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 coordinates
void getRotationMatrixToGlobal( void getRotationMatrixToGlobal(
const MeshLib::Element &e, const unsigned element_dimension,
const MeshLib::CoordinateSystem &global_coords, const MeshLib::CoordinateSystem &global_coords,
const std::vector<MathLib::Point3d> &points, const std::vector<MathLib::Point3d> &points,
MeshLib::RotationMatrix &matR) MeshLib::RotationMatrix &matR)
...@@ -42,9 +42,9 @@ void getRotationMatrixToGlobal( ...@@ -42,9 +42,9 @@ void getRotationMatrixToGlobal(
const std::size_t global_dim = global_coords.getDimension(); const std::size_t global_dim = global_coords.getDimension();
// 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 coordinates
if (global_dim == e.getDimension()) { if (global_dim == element_dimension) {
matR.setIdentity(); matR.setIdentity();
} else if (e.getDimension() == 1) { } else 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)
...@@ -52,7 +52,7 @@ void getRotationMatrixToGlobal( ...@@ -52,7 +52,7 @@ void getRotationMatrixToGlobal(
else else
GeoLib::compute3DRotationMatrixToX(xx, matR); GeoLib::compute3DRotationMatrixToX(xx, matR);
matR.transposeInPlace(); matR.transposeInPlace();
} else if (global_dim == 3 && e.getDimension() == 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;
...@@ -80,7 +80,7 @@ ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal( ...@@ -80,7 +80,7 @@ ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal(
for(unsigned i = 0; i < e.getNNodes(); i++) for(unsigned i = 0; i < e.getNNodes(); i++)
_points.emplace_back(e.getNode(i)->getCoords()); _points.emplace_back(e.getNode(i)->getCoords());
detail::getRotationMatrixToGlobal(e, global_coords, _points, _matR2global); detail::getRotationMatrixToGlobal(e.getDimension(), global_coords, _points, _matR2global);
#ifdef OGS_USE_EIGEN #ifdef OGS_USE_EIGEN
detail::rotateToLocal(_matR2global.transpose(), _points); detail::rotateToLocal(_matR2global.transpose(), _points);
#else #else
......
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