Skip to content
Snippets Groups Projects
Commit e6ce2083 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Use compile time known sizes for rotations.

Follow-up of !3676 "Dropped the rotation of the shape function gradients".
parent 7e065d7d
No related branches found
No related tags found
1 merge request!3More changes in use compile time matrix sizes in LIE
......@@ -214,11 +214,10 @@ inline void computeMappingMatrices(
// J^-1, dshape/dx
shapemat.invJ.noalias() = shapemat.J.inverse();
auto const nnodes(shapemat.dNdr.cols());
auto const ele_dim(shapemat.dNdr.rows());
assert(shapemat.dNdr.rows() == ele.getDimension());
shapemat.dNdx.topLeftCorner(ele_dim, nnodes).noalias() =
shapemat.invJ * shapemat.dNdr;
shapemat.dNdx
.template topLeftCorner<T_SHAPE_FUNC::DIM, T_SHAPE_FUNC::NPOINTS>()
.noalias() = shapemat.invJ * shapemat.dNdr;
}
}
......
......@@ -21,12 +21,14 @@ namespace HeatTransportBHE
{
Eigen::Vector3d compute1Dto3DRotationMatrix(MeshLib::Element const& e)
{
assert(e.getDimension() == 1);
const int global_dim = 3;
constexpr int global_dim = 3;
constexpr int element_dim = 1;
assert(e.getDimension() == element_dim);
const MeshLib::ElementCoordinatesMappingLocal ele_local_coord(e,
global_dim);
return ele_local_coord.getRotationMatrixToGlobal().topLeftCorner(
global_dim, e.getDimension());
return ele_local_coord.getRotationMatrixToGlobal()
.template topLeftCorner<global_dim, element_dim>();
}
template <typename ShapeFunction, typename IntegrationMethod, typename BHEType>
......@@ -203,8 +205,11 @@ void HeatTransportBHELocalAssemblerBHE<ShapeFunction, IntegrationMethod,
.template block<single_bhe_unknowns_size,
single_bhe_unknowns_size>(
single_bhe_unknowns_index, single_bhe_unknowns_index)
.noalias() += advection_coefficient * N.transpose() *
dNdx.topLeftCorner(element_dim, N.size()) * A * w;
.noalias() +=
advection_coefficient * N.transpose() *
dNdx.template topLeftCorner<element_dim,
ShapeFunction::NPOINTS>() *
A * w;
}
}
......
......@@ -193,8 +193,9 @@ void HydroMechanicsLocalAssemblerFracture<ShapeFunctionDisplacement,
pressure_size);
// Projection of the body force vector at the element.
// GlobalDim-1 is the element's dimension.
Eigen::MatrixXd const global2local_rotation =
R.topLeftCorner(_element.getDimension(), GlobalDim);
R.template topLeftCorner<GlobalDim - 1, GlobalDim>();
auto const& gravity_vec =
(global2local_rotation * _process_data.specific_body_force).eval();
......
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