diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h index 18d2478e8db3a72d2698bb4ec50d9ab74244490a..f79e1721477e228f3bea8b410c458b22611db324 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h @@ -115,6 +115,8 @@ void SmallDeformationLocalAssemblerMatrix<ShapeFunction, DisplacementDim>:: ParameterLib::SpatialPosition x_position; x_position.setElementID(_element.getID()); + auto const B_dil_bar = getDilatationalBBarMatrix(); + for (unsigned ip = 0; ip < n_integration_points; ip++) { x_position.setIntegrationPoint(ip); @@ -125,11 +127,11 @@ void SmallDeformationLocalAssemblerMatrix<ShapeFunction, DisplacementDim>:: auto const x_coord = NumLib::interpolateXCoordinate<ShapeFunction, ShapeMatricesType>( _element, N); - auto const B = - LinearBMatrix::computeBMatrix<DisplacementDim, - ShapeFunction::NPOINTS, - typename BMatricesType::BMatrixType>( - dNdx, N, x_coord, _is_axially_symmetric); + + auto const B = LinearBMatrix::computeBMatrixPossiblyWithBbar< + DisplacementDim, ShapeFunction::NPOINTS, BBarMatrixType, + typename BMatricesType::BMatrixType>(dNdx, N, B_dil_bar, x_coord, + this->_is_axially_symmetric); auto const& eps_prev = _ip_data[ip]._eps_prev; auto const& sigma_prev = _ip_data[ip]._sigma_prev; diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix.h index 9ea94d6e3153d2aca058138a81299a073f29132e..f50175d38fe393fafb6abf50807462fd388a5940 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix.h @@ -10,6 +10,7 @@ #pragma once +#include <optional> #include <vector> #include "IntegrationPointDataMatrix.h" @@ -41,6 +42,7 @@ public: using NodalVectorType = typename ShapeMatricesType::NodalVectorType; using ShapeMatrices = typename ShapeMatricesType::ShapeMatrices; using BMatricesType = BMatrixPolicyType<ShapeFunction, DisplacementDim>; + using BBarMatrixType = typename BMatricesType::BBarMatrixType; using StiffnessMatrixType = typename BMatricesType::StiffnessMatrixType; using NodalForceVectorType = typename BMatricesType::NodalForceVectorType; @@ -148,6 +150,20 @@ private: MeshLib::Element const& _element; bool const _is_axially_symmetric; SecondaryData<typename ShapeMatrices::ShapeType> _secondary_data; + + std::optional<BBarMatrixType> getDilatationalBBarMatrix() const + { + if (!(_process_data.use_b_bar)) + { + return std::nullopt; + } + + return LinearBMatrix::computeDilatationalBbar< + DisplacementDim, ShapeFunction::NPOINTS, ShapeFunction, + BBarMatrixType, ShapeMatricesType, IntegrationPointDataType>( + _ip_data, this->_element, this->_integration_method, + this->_is_axially_symmetric); + } }; } // namespace SmallDeformation diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h index d5a037d0207429b2924bb60c8127d45e5f2f49e4..6e10cacb439207117a32580bb6b20e3f4ab6101b 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h @@ -201,6 +201,8 @@ void SmallDeformationLocalAssemblerMatrixNearFracture< ParameterLib::SpatialPosition x_position; x_position.setElementID(_element.getID()); + auto const B_dil_bar = getDilatationalBBarMatrix(); + for (unsigned ip = 0; ip < n_integration_points; ip++) { x_position.setIntegrationPoint(ip); @@ -229,11 +231,10 @@ void SmallDeformationLocalAssemblerMatrixNearFracture< auto const x_coord = NumLib::interpolateXCoordinate<ShapeFunction, ShapeMatricesType>( _element, N); - auto const B = - LinearBMatrix::computeBMatrix<DisplacementDim, - ShapeFunction::NPOINTS, - typename BMatricesType::BMatrixType>( - dNdx, N, x_coord, _is_axially_symmetric); + auto const B = LinearBMatrix::computeBMatrixPossiblyWithBbar< + DisplacementDim, ShapeFunction::NPOINTS, BBarMatrixType, + typename BMatricesType::BMatrixType>(dNdx, N, B_dil_bar, x_coord, + this->_is_axially_symmetric); // strain, stress auto const& eps_prev = ip_data._eps_prev; diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture.h index 0d1e76f817572a14c28b3d77830ad54b4f86eba0..099ac8814cdba785ff5951545c48a95371e2a287 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture.h @@ -44,6 +44,7 @@ public: using NodalVectorType = typename ShapeMatricesType::NodalVectorType; using ShapeMatrices = typename ShapeMatricesType::ShapeMatrices; using BMatricesType = BMatrixPolicyType<ShapeFunction, DisplacementDim>; + using BBarMatrixType = typename BMatricesType::BBarMatrixType; using BMatrixType = typename BMatricesType::BMatrixType; using StiffnessMatrixType = typename BMatricesType::StiffnessMatrixType; @@ -158,6 +159,20 @@ private: MeshLib::Element const& _element; bool const _is_axially_symmetric; SecondaryData<typename ShapeMatrices::ShapeType> _secondary_data; + + std::optional<BBarMatrixType> getDilatationalBBarMatrix() const + { + if (!(_process_data.use_b_bar)) + { + return std::nullopt; + } + + return LinearBMatrix::computeDilatationalBbar< + DisplacementDim, ShapeFunction::NPOINTS, ShapeFunction, + BBarMatrixType, ShapeMatricesType, IntegrationPointDataType>( + _ip_data, this->_element, this->_integration_method, + this->_is_axially_symmetric); + } }; } // namespace SmallDeformation