diff --git a/ProcessLib/RichardsMechanics/LocalAssemblerInterface.h b/ProcessLib/RichardsMechanics/LocalAssemblerInterface.h index 20cd029406390a99795c3d8a05ba08a17e11ad3c..658dc73a23ed6708e7ef5cabe33aeb15859c08f1 100644 --- a/ProcessLib/RichardsMechanics/LocalAssemblerInterface.h +++ b/ProcessLib/RichardsMechanics/LocalAssemblerInterface.h @@ -28,6 +28,12 @@ struct LocalAssemblerInterface : public ProcessLib::LocalAssemblerInterface, std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table, std::vector<double>& cache) const = 0; + virtual std::vector<double> const& getIntPtSwellingStress( + const double t, + std::vector<GlobalVector*> const& x, + std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table, + std::vector<double>& cache) const = 0; + virtual std::vector<double> const& getIntPtEpsilon( const double t, std::vector<GlobalVector*> const& x, diff --git a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h index 6b11108f6bef3b78d0286fb2d24267b4394e116b..58dc2dfbfa594975ce208a88f5925db964c65aee 100644 --- a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h +++ b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h @@ -775,6 +775,36 @@ std::vector<double> const& RichardsMechanicsLocalAssembler< return cache; } +template <typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, + typename IntegrationMethod, int DisplacementDim> +std::vector<double> const& RichardsMechanicsLocalAssembler< + ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, + DisplacementDim>:: + getIntPtSwellingStress( + const double /*t*/, + std::vector<GlobalVector*> const& /*x*/, + std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/, + std::vector<double>& cache) const +{ + static const int kelvin_vector_size = + MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + auto const num_intpts = _ip_data.size(); + + cache.clear(); + auto cache_mat = MathLib::createZeroedMatrix<Eigen::Matrix< + double, kelvin_vector_size, Eigen::Dynamic, Eigen::RowMajor>>( + cache, kelvin_vector_size, num_intpts); + + for (unsigned ip = 0; ip < num_intpts; ++ip) + { + auto const& sigma_sw = _ip_data[ip].sigma_sw; + cache_mat.col(ip) = + MathLib::KelvinVector::kelvinVectorToSymmetricTensor(sigma_sw); + } + + return cache; +} + template <typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, typename IntegrationMethod, int DisplacementDim> std::vector<double> const& RichardsMechanicsLocalAssembler< diff --git a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h index 6cb28893e8251e0602798a35dbf2ce67b681b68b..eca8d9d21841c29d9e4bc6e1d44af2b61f0774ca 100644 --- a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h +++ b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h @@ -182,6 +182,12 @@ public: std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table, std::vector<double>& cache) const override; + std::vector<double> const& getIntPtSwellingStress( + const double t, + std::vector<GlobalVector*> const& x, + std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table, + std::vector<double>& cache) const override; + std::vector<double> const& getIntPtEpsilon( const double t, std::vector<GlobalVector*> const& x, diff --git a/ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp b/ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp index 91dd47834630f29e0c8238f16903f06558b3fd0d..d93f02027994fee3943e04a8f46d38494874b4c6 100644 --- a/ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp +++ b/ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp @@ -183,6 +183,11 @@ void RichardsMechanicsProcess<DisplacementDim>::initializeConcreteProcess( DisplacementDim>::RowsAtCompileTime, &LocalAssemblerIF::getIntPtSigma); + add_secondary_variable("swelling_stress", + MathLib::KelvinVector::KelvinVectorType< + DisplacementDim>::RowsAtCompileTime, + &LocalAssemblerIF::getIntPtSwellingStress); + add_secondary_variable("epsilon", MathLib::KelvinVector::KelvinVectorType< DisplacementDim>::RowsAtCompileTime,