diff --git a/ProcessLib/LIE/Common/FractureProperty.h b/ProcessLib/LIE/Common/FractureProperty.h index 865f51130a908150c2bb7142b56fb92f40d5a189..f33125b6a91aff2f517e21b1f30895b58bf5a650 100644 --- a/ProcessLib/LIE/Common/FractureProperty.h +++ b/ProcessLib/LIE/Common/FractureProperty.h @@ -10,19 +10,15 @@ #pragma once -#include <memory> #include <Eigen/Eigen> - -#include "MaterialLib/FractureModels/Permeability/Permeability.h" +#include <memory> #include "BranchProperty.h" #include "JunctionProperty.h" -#include "Utils.h" +#include "MaterialLib/FractureModels/Permeability/Permeability.h" +#include "MeshLib/ElementCoordinatesMappingLocal.h" +#include "MeshLib/Elements/Element.h" -namespace MeshLib -{ -class Element; -} namespace ParameterLib { template <typename T> @@ -87,9 +83,16 @@ inline void setFractureProperty(int const dim, MeshLib::Element const& e, { frac_prop.point_on_fracture[j] = getCenterOfGravity(e).getCoords()[j]; } - computeNormalVector(e, dim, n); - frac_prop.R.resize(dim, dim); - computeRotationMatrix(e, n, dim, frac_prop.R); + + const MeshLib::ElementCoordinatesMappingLocal ele_local_coord(e, dim); + + // Global to local rotation matrix: + Eigen::MatrixXd const global2local_rotation = + ele_local_coord.getRotationMatrixToGlobal().transpose(); + n = global2local_rotation.row(dim - 1); + + frac_prop.R = global2local_rotation.topLeftCorner(dim, dim); + DBUG("Normal vector of the fracture element {:d}: [{:g}, {:g}, {:g}]", e.getID(), n[0], n[1], n[2]); } diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h index 9290c46e4890823f35491ae01122eed2403f6cfa..575ef44985635ce74bcf40b3b2a8f865b3e051d6 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h @@ -15,6 +15,7 @@ #include "MathLib/LinAlg/Eigen/EigenMapTools.h" #include "NumLib/Fem/InitShapeMatrices.h" #include "ProcessLib/LIE/Common/LevelSetFunction.h" +#include "ProcessLib/LIE/Common/Utils.h" #include "SmallDeformationLocalAssemblerFracture.h" namespace ProcessLib