Skip to content
Snippets Groups Projects
Commit b3792140 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[MeL] pass global_dim explicitly

parent 464cf7f7
No related branches found
No related tags found
No related merge requests found
......@@ -68,24 +68,23 @@ namespace MeshLib
ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal(
const Element& e,
const CoordinateSystem &global_coords)
: _coords(global_coords), _matR2global(3,3)
const unsigned global_dim)
: _global_dim(global_dim), _matR2global(3,3)
{
assert(e.getDimension() <= global_coords.getDimension());
assert(e.getDimension() <= global_dim);
_points.reserve(e.getNumberOfNodes());
for(unsigned i = 0; i < e.getNumberOfNodes(); i++)
_points.emplace_back(*(e.getNode(i)));
auto const element_dimension = e.getDimension();
auto const global_dimension = global_coords.getDimension();
auto const element_dim = e.getDimension();
if (global_dimension == element_dimension)
if (global_dim == element_dim)
{
_matR2global.setIdentity();
return;
}
detail::getRotationMatrixToGlobal(element_dimension, global_dimension, _points, _matR2global);
detail::getRotationMatrixToGlobal(element_dim, global_dim, _points, _matR2global);
detail::rotateToLocal(_matR2global.transpose(), _points);
}
......
......@@ -37,10 +37,10 @@ public:
* \param e Mesh element whose node coordinates are mapped
* \param global_coord_system Global coordinate system
*/
ElementCoordinatesMappingLocal(const Element &e, const CoordinateSystem &global_coord_system);
ElementCoordinatesMappingLocal(const Element &e, const unsigned global_dim);
/// return the global coordinate system
const CoordinateSystem getGlobalCoordinateSystem() const { return _coords; }
unsigned getGlobalDimension() const { return _global_dim; }
/// return mapped coordinates of the node
MathLib::Point3d const& getMappedCoordinates(std::size_t node_id) const
......@@ -52,7 +52,7 @@ public:
const RotationMatrix& getRotationMatrixToGlobal() const {return _matR2global;}
private:
const CoordinateSystem _coords;
const unsigned _global_dim;
std::vector<MathLib::Point3d> _points;
RotationMatrix _matR2global;
};
......
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