diff --git a/MaterialLib/MPL/Properties/EmbeddedFracturePermeability.h b/MaterialLib/MPL/Properties/EmbeddedFracturePermeability.h index ba0fc208dbebce01c1e45af4e672b569f07f7291..29da1b50a4db2556586d144139a8c9cd33755bce 100644 --- a/MaterialLib/MPL/Properties/EmbeddedFracturePermeability.h +++ b/MaterialLib/MPL/Properties/EmbeddedFracturePermeability.h @@ -68,7 +68,7 @@ public: double const threshold_strain); static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using SymmetricTensor = Eigen::Matrix<double, KelvinVectorSize, 1>; void checkScale() const override; diff --git a/MaterialLib/MPL/Utils/GetSymmetricTensor.h b/MaterialLib/MPL/Utils/GetSymmetricTensor.h index 556fc3b4884e6336a3222b65fa5595c92c0ad15a..aefcee5ea3aa658ffdc47e89034a13e8c93f379d 100644 --- a/MaterialLib/MPL/Utils/GetSymmetricTensor.h +++ b/MaterialLib/MPL/Utils/GetSymmetricTensor.h @@ -20,7 +20,7 @@ namespace MaterialPropertyLib { template <int GlobalDim> constexpr int symmetric_tensor_size = - MathLib::KelvinVector::KelvinVectorDimensions<GlobalDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(GlobalDim); template <int GlobalDim> using SymmetricTensor = diff --git a/MaterialLib/SolidModels/Ehlers.cpp b/MaterialLib/SolidModels/Ehlers.cpp index a517486aa3067538ccab914db369c5251fe72418..08aed7d4c742a90be37b102c3c9de471b95e6a02 100644 --- a/MaterialLib/SolidModels/Ehlers.cpp +++ b/MaterialLib/SolidModels/Ehlers.cpp @@ -66,7 +66,7 @@ template <int DisplacementDim> struct PhysicalStressWithInvariants final { static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>; using KelvinVector = MathLib::KelvinVector::KelvinVectorType<DisplacementDim>; @@ -163,7 +163,7 @@ calculatePlasticResidual( MaterialProperties const& mp) { static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>; using KelvinVector = MathLib::KelvinVector::KelvinVectorType<DisplacementDim>; @@ -221,7 +221,7 @@ typename SolidEhlers<DisplacementDim>::JacobianMatrix calculatePlasticJacobian( MaterialProperties const& mp) { static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>; using KelvinVector = MathLib::KelvinVector::KelvinVectorType<DisplacementDim>; @@ -416,7 +416,7 @@ MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> calculateDResidualDEps( double const K, double const G) { static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>; auto const& P_dev = Invariants::deviatoric_projection; @@ -443,7 +443,7 @@ typename SolidEhlers<DisplacementDim>::KelvinVector predict_sigma( double const eps_V) { static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>; auto const& P_dev = Invariants::deviatoric_projection; @@ -577,8 +577,8 @@ SolidEhlers<DisplacementDim>::integrateStress( { static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim); using KelvinVector = MathLib::KelvinVector::KelvinVectorType<DisplacementDim>; using ResidualVectorType = diff --git a/MaterialLib/SolidModels/Ehlers.h b/MaterialLib/SolidModels/Ehlers.h index 8cbc59da90f9530aeba3fe3ec99614085cd0f240..cddd1c104f5e4955606420248ff34b250168c217 100644 --- a/MaterialLib/SolidModels/Ehlers.h +++ b/MaterialLib/SolidModels/Ehlers.h @@ -235,7 +235,7 @@ struct StateVariables double getEquivalentPlasticStrain() const override; static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>; using KelvinVector = MathLib::KelvinVector::KelvinVectorType<DisplacementDim>; @@ -273,7 +273,7 @@ class SolidEhlers final : public MechanicsBase<DisplacementDim> { public: static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); static int const JacobianResidualSize = 2 * KelvinVectorSize + 3; // 2 is the number of components in the // jacobian/residual, not the space diff --git a/MaterialLib/SolidModels/LinearElasticIsotropic.h b/MaterialLib/SolidModels/LinearElasticIsotropic.h index 6fd6ea345a29446d9a8415aed88a0488a0368c30..f38644708762316f24fc82d115acfaaae19e61be 100644 --- a/MaterialLib/SolidModels/LinearElasticIsotropic.h +++ b/MaterialLib/SolidModels/LinearElasticIsotropic.h @@ -61,7 +61,7 @@ public: public: static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using KelvinVector = MathLib::KelvinVector::KelvinVectorType<DisplacementDim>; using KelvinMatrix = diff --git a/MaterialLib/SolidModels/LinearElasticIsotropicPhaseField.h b/MaterialLib/SolidModels/LinearElasticIsotropicPhaseField.h index d354db8131f61775d4a13f2257dea225a3c4e3f0..6d884334b007bfb36f1d3b8ba8213769e4c855c3 100644 --- a/MaterialLib/SolidModels/LinearElasticIsotropicPhaseField.h +++ b/MaterialLib/SolidModels/LinearElasticIsotropicPhaseField.h @@ -42,7 +42,7 @@ calculateDegradedStress( MathLib::KelvinVector::KelvinVectorType<DisplacementDim> const& eps) { static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using KelvinVector = MathLib::KelvinVector::KelvinVectorType<DisplacementDim>; using KelvinMatrix = diff --git a/MaterialLib/SolidModels/LinearElasticOrthotropic.cpp b/MaterialLib/SolidModels/LinearElasticOrthotropic.cpp index 728470bf16cf51c3dab660efe74951b8209ae60f..fdad7c08d90f2ecd43ccd7889db7c11640677dc6 100644 --- a/MaterialLib/SolidModels/LinearElasticOrthotropic.cpp +++ b/MaterialLib/SolidModels/LinearElasticOrthotropic.cpp @@ -94,9 +94,8 @@ LinearElasticOrthotropic<DisplacementDim>::getElasticTensor( // return the top left corner block of size 4x4 for two-dimensional case or // the full 6x6 matrix is returned in the three-dimensional case. return (Q * C_ortho * Q.transpose()) - .template topLeftCorner< - KelvinVectorDimensions<DisplacementDim>::value, - KelvinVectorDimensions<DisplacementDim>::value>(); + .template topLeftCorner<kelvin_vector_dimensions(DisplacementDim), + kelvin_vector_dimensions(DisplacementDim)>(); } template class LinearElasticOrthotropic<2>; diff --git a/MaterialLib/SolidModels/LinearElasticOrthotropic.h b/MaterialLib/SolidModels/LinearElasticOrthotropic.h index dd721fc0a10a820b399fff3d0538e751b2e07c2a..d9b92c9b788f4cf877f7fb263673680de2e27152 100644 --- a/MaterialLib/SolidModels/LinearElasticOrthotropic.h +++ b/MaterialLib/SolidModels/LinearElasticOrthotropic.h @@ -124,7 +124,7 @@ public: public: static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using KelvinVector = MathLib::KelvinVector::KelvinVectorType<DisplacementDim>; using KelvinMatrix = diff --git a/MaterialLib/SolidModels/Lubby2.cpp b/MaterialLib/SolidModels/Lubby2.cpp index 9899357ff3899857ab26882ec9956e0518860093..829b464c072fbfdc1e4fad984bcbe4c29ac2f7bd 100644 --- a/MaterialLib/SolidModels/Lubby2.cpp +++ b/MaterialLib/SolidModels/Lubby2.cpp @@ -49,7 +49,7 @@ MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> tangentStiffnessA( // functionals. // Only the upper left block is relevant for the global tangent. static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using KelvinMatrix = MathLib::KelvinVector::KelvinMatrixType<DisplacementDim>; diff --git a/MaterialLib/SolidModels/Lubby2.h b/MaterialLib/SolidModels/Lubby2.h index 6327bf8f9280cf0c5bf55c99213e4da1aace0c14..87ef0fda95e24fc0698135afdad28d1bbc0cfb0e 100644 --- a/MaterialLib/SolidModels/Lubby2.h +++ b/MaterialLib/SolidModels/Lubby2.h @@ -157,7 +157,7 @@ public: public: static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using KelvinVector = MathLib::KelvinVector::KelvinVectorType<DisplacementDim>; using KelvinMatrix = diff --git a/MaterialLib/SolidModels/MFront/MFront.cpp b/MaterialLib/SolidModels/MFront/MFront.cpp index 4476181ef2fc73681fe20921b948fcab8476a615..0d6881ef40fe57145e936359f1c7c4f08ada1e2f 100644 --- a/MaterialLib/SolidModels/MFront/MFront.cpp +++ b/MaterialLib/SolidModels/MFront/MFront.cpp @@ -324,34 +324,34 @@ MFront<DisplacementDim>::integrateStress( auto const& eps_m_prev = std::get<MPL::SymmetricTensor<DisplacementDim>>( variable_array_prev[static_cast<int>( MPL::Variable::mechanical_strain)]); - auto const eps_prev_MFront = - OGSToMFront(Q.transpose() - .template topLeftCorner< - KelvinVectorDimensions<DisplacementDim>::value, - KelvinVectorDimensions<DisplacementDim>::value>() * - eps_m_prev); + auto const eps_prev_MFront = OGSToMFront( + Q.transpose() + .template topLeftCorner<kelvin_vector_dimensions(DisplacementDim), + kelvin_vector_dimensions( + DisplacementDim)>() * + eps_m_prev); std::copy_n(eps_prev_MFront.data(), KelvinVector::SizeAtCompileTime, behaviour_data.s0.gradients.data()); auto const& eps = std::get<MPL::SymmetricTensor<DisplacementDim>>( variable_array[static_cast<int>(MPL::Variable::mechanical_strain)]); - auto const eps_MFront = - OGSToMFront(Q.transpose() - .template topLeftCorner< - KelvinVectorDimensions<DisplacementDim>::value, - KelvinVectorDimensions<DisplacementDim>::value>() * - eps); + auto const eps_MFront = OGSToMFront( + Q.transpose() + .template topLeftCorner<kelvin_vector_dimensions(DisplacementDim), + kelvin_vector_dimensions( + DisplacementDim)>() * + eps); std::copy_n(eps_MFront.data(), KelvinVector::SizeAtCompileTime, behaviour_data.s1.gradients.data()); auto const& sigma_prev = std::get<MPL::SymmetricTensor<DisplacementDim>>( variable_array_prev[static_cast<int>(MPL::Variable::stress)]); - auto const sigma_prev_MFront = - OGSToMFront(Q.transpose() - .template topLeftCorner< - KelvinVectorDimensions<DisplacementDim>::value, - KelvinVectorDimensions<DisplacementDim>::value>() * - sigma_prev); + auto const sigma_prev_MFront = OGSToMFront( + Q.transpose() + .template topLeftCorner<kelvin_vector_dimensions(DisplacementDim), + kelvin_vector_dimensions( + DisplacementDim)>() * + sigma_prev); std::copy_n(sigma_prev_MFront.data(), KelvinVector::SizeAtCompileTime, behaviour_data.s0.thermodynamic_forces.data()); std::copy_n(sigma_prev_MFront.data(), KelvinVector::SizeAtCompileTime, @@ -368,10 +368,10 @@ MFront<DisplacementDim>::integrateStress( KelvinVector sigma; std::copy_n(behaviour_data.s1.thermodynamic_forces.data(), KelvinVector::SizeAtCompileTime, sigma.data()); - sigma = Q.template topLeftCorner< - KelvinVectorDimensions<DisplacementDim>::value, - KelvinVectorDimensions<DisplacementDim>::value>() * - MFrontToOGS(sigma); + sigma = + Q.template topLeftCorner<kelvin_vector_dimensions(DisplacementDim), + kelvin_vector_dimensions(DisplacementDim)>() * + MFrontToOGS(sigma); // TODO row- vs. column-major storage order. This should only matter for // anisotropic materials. @@ -382,9 +382,9 @@ MFront<DisplacementDim>::integrateStress( KelvinMatrix C = Q * MFrontToOGS(Eigen::Map<KelvinMatrix>(behaviour_data.K.data())) * Q.transpose() - .template topLeftCorner< - KelvinVectorDimensions<DisplacementDim>::value, - KelvinVectorDimensions<DisplacementDim>::value>(); + .template topLeftCorner<kelvin_vector_dimensions(DisplacementDim), + kelvin_vector_dimensions( + DisplacementDim)>(); return std::make_optional( std::make_tuple<typename MFront<DisplacementDim>::KelvinVector, @@ -450,8 +450,8 @@ double MFront<DisplacementDim>::getBulkModulus( "argument to be valid."); } auto const& identity2 = MathLib::KelvinVector::Invariants< - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value>:: - identity2; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)>::identity2; return 1. / 9. * identity2.transpose() * *C * identity2; } diff --git a/MathLib/KelvinVector.h b/MathLib/KelvinVector.h index 6c31d6321a6407e45671a8f16df140337b288183..c120e74ecd4ba61a9168265b0663572b8b5e287b 100644 --- a/MathLib/KelvinVector.h +++ b/MathLib/KelvinVector.h @@ -20,20 +20,20 @@ namespace MathLib namespace KelvinVector { /// Kelvin vector dimensions for given displacement dimension. -template <int DisplacementDim> -struct KelvinVectorDimensions; - -template <> -struct KelvinVectorDimensions<2> -{ - static int const value = 4; -}; - -template <> -struct KelvinVectorDimensions<3> +constexpr int kelvin_vector_dimensions(int const displacement_dim) { - static int const value = 6; -}; + if (displacement_dim == 2) + { + return 4; + } + else if (displacement_dim == 3) + { + return 6; + } + OGS_FATAL( + "Cannot convert displacement dimension {} to kelvin vector dimension.", + displacement_dim); +} // // Kelvin vector and matrix templates for given displacement dimension. @@ -44,9 +44,7 @@ struct KelvinVectorDimensions<3> /// matrix policy types like BMatrixPolicyType::KelvinVectorType. template <int DisplacementDim> using KelvinVectorType = - Eigen::Matrix<double, - KelvinVectorDimensions<DisplacementDim>::value, - 1, + Eigen::Matrix<double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor>; /// Kelvin matrix type for given displacement dimension. @@ -54,10 +52,8 @@ using KelvinVectorType = /// matrix policy types like BMatrixPolicyType::KelvinMatrixType. template <int DisplacementDim> using KelvinMatrixType = - Eigen::Matrix<double, - KelvinVectorDimensions<DisplacementDim>::value, - KelvinVectorDimensions<DisplacementDim>::value, - Eigen::RowMajor>; + Eigen::Matrix<double, kelvin_vector_dimensions(DisplacementDim), + kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor>; /// Invariants used in mechanics, based on Kelvin representation of the vectors /// and matrices. @@ -216,7 +212,7 @@ KelvinVectorType<DisplacementDim> symmetricTensorToKelvinVector( std::vector<double> const& values) { constexpr int kelvin_vector_size = - KelvinVectorDimensions<DisplacementDim>::value; + kelvin_vector_dimensions(DisplacementDim); if (values.size() != kelvin_vector_size) { @@ -229,10 +225,7 @@ KelvinVectorType<DisplacementDim> symmetricTensorToKelvinVector( return symmetricTensorToKelvinVector( Eigen::Map<typename MathLib::KelvinVector::KelvinVectorType< DisplacementDim> const>( - values.data(), - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value, - 1)); + values.data(), kelvin_vector_dimensions(DisplacementDim), 1)); } /// Rotation tensor for Kelvin mapped vectors and tensors. It is meant to be diff --git a/ProcessLib/Deformation/BMatrixPolicy.h b/ProcessLib/Deformation/BMatrixPolicy.h index be4ac76f7e5a04923321f295a940c47ccc34a271..aa6f46d8c92236267cd212e9b9bed80908ec76a8 100644 --- a/ProcessLib/Deformation/BMatrixPolicy.h +++ b/ProcessLib/Deformation/BMatrixPolicy.h @@ -35,7 +35,7 @@ private: // Dimensions of specific b-matrix for n-points and displacement dimension. static int const _number_of_dof = ShapeFunction::NPOINTS * DisplacementDim; static int const _kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); public: using StiffnessMatrixType = MatrixType<_number_of_dof, _number_of_dof>; diff --git a/ProcessLib/Deformation/LinearBMatrix.h b/ProcessLib/Deformation/LinearBMatrix.h index 96600bc99eeef828be2beedafd36f1406aa8a9b5..34a1f8e6282408a34c3bb56becc758fdf2cac183 100644 --- a/ProcessLib/Deformation/LinearBMatrix.h +++ b/ProcessLib/Deformation/LinearBMatrix.h @@ -49,7 +49,7 @@ BMatrixType computeBMatrix(DNDX_Type const& dNdx, "range [1,3]."); BMatrixType B = BMatrixType::Zero( - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value, + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim), NPOINTS * DisplacementDim); switch (DisplacementDim) diff --git a/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp b/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp index f221ba85e98a7aa18625ba6eb834c9b3e48aab68..86f2b7547cb29d19baa36aa9ef4c9b650415f73b 100644 --- a/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp +++ b/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp @@ -168,7 +168,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS__initial_stress} config, "initial_stress", parameters, // Symmetric tensor size, 4 or 6, not a Kelvin vector. - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value, + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim), &mesh); HydroMechanicsProcessData<DisplacementDim> process_data{ diff --git a/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h b/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h index b2dacc8bfb33583e3d877be873bfa05167a6a36a..0314b9ef73ecb93c14f689158d708e80294ae846 100644 --- a/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h +++ b/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h @@ -76,8 +76,7 @@ HydroMechanicsLocalAssembler<ShapeFunctionDisplacement, ShapeFunctionPressure, // Initialize current time step values static const int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); ip_data.sigma_eff.setZero(kelvin_vector_size); ip_data.eps.setZero(kelvin_vector_size); @@ -689,8 +688,8 @@ void HydroMechanicsLocalAssembler<ShapeFunctionDisplacement, auto const& b = _process_data.specific_body_force; auto const& identity2 = MathLib::KelvinVector::Invariants< - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value>::identity2; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)>::identity2; eps.noalias() = B * u; vars[static_cast<int>(MPL::Variable::mechanical_strain)] @@ -874,7 +873,7 @@ std::vector<double> HydroMechanicsLocalAssembler< DisplacementDim>::getEpsilon() const { auto const kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); unsigned const n_integration_points = _integration_method.getNumberOfPoints(); diff --git a/ProcessLib/HydroMechanics/HydroMechanicsFEM.h b/ProcessLib/HydroMechanics/HydroMechanicsFEM.h index e9e1dc3329022f298d9a2f684cca867cd1a34762..fba65348d8df28948e4cae57470adb9d66320069 100644 --- a/ProcessLib/HydroMechanics/HydroMechanicsFEM.h +++ b/ProcessLib/HydroMechanics/HydroMechanicsFEM.h @@ -134,7 +134,7 @@ public: ShapeMatrixPolicyType<ShapeFunctionPressure, DisplacementDim>; static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>; using SymmetricTensor = Eigen::Matrix<double, KelvinVectorSize, 1>; diff --git a/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp b/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp index 54319e9377c9b83eb2130c864e848d38d7b0657d..f51e137eef9ee3fa37fb0c76a724069e2ae6fe5f 100644 --- a/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp +++ b/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp @@ -267,7 +267,7 @@ void HydroMechanicsProcess<DisplacementDim>::initializeConcreteProcess( _process_data.permeability = MeshLib::getOrCreateMeshProperty<double>( const_cast<MeshLib::Mesh&>(mesh), "permeability", MeshLib::MeshItemType::Cell, - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value); + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim)); // Set initial conditions for integration point data. for (auto const& ip_writer : _integration_point_writer) diff --git a/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp b/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp index f799b842a7f312218cbcc17f2d55cb75c7314007..466082801e3759e546e77d9cb625898b211ea05a 100644 --- a/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp +++ b/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp @@ -293,7 +293,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( config, //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__initial_effective_stress} "initial_effective_stress", parameters, - MathLib::KelvinVector::KelvinVectorDimensions<GlobalDim>::value, &mesh); + MathLib::KelvinVector::kelvin_vector_dimensions(GlobalDim), &mesh); DBUG("Use '{:s}' as initial effective stress parameter.", initial_effective_stress.name); diff --git a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix.h b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix.h index a0bf27720906eef592866fe502870711d47c045c..8c86cfa1aac50935ecf19f5ba547f7b281c74390 100644 --- a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix.h +++ b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix.h @@ -119,7 +119,7 @@ protected: static const int displacement_size = ShapeFunctionDisplacement::NPOINTS * GlobalDim; static const int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<GlobalDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(GlobalDim); }; } // namespace HydroMechanics diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h index 339da0d8eba9e25a71ffe5d5400294ab2cff5997..02b122784c34d6c4fddb542b505394a78946b835 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h @@ -75,8 +75,7 @@ SmallDeformationLocalAssemblerMatrix<ShapeFunction, IntegrationMethod, // Initialize current time step values static const int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); ip_data._sigma.setZero(kelvin_vector_size); ip_data._eps.setZero(kelvin_vector_size); diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h index 67b7aab5d7577b94d2baf901dc01eb1bfa285090..866b3720a4c402b7e73e0f80b661c5139eba1982 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h @@ -88,8 +88,7 @@ SmallDeformationLocalAssemblerMatrixNearFracture<ShapeFunction, // Initialize current time step values static const int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); ip_data._sigma.setZero(kelvin_vector_size); ip_data._eps.setZero(kelvin_vector_size); diff --git a/ProcessLib/PhaseField/PhaseFieldFEM.h b/ProcessLib/PhaseField/PhaseFieldFEM.h index 53ec9632876ed4d1934792c443ed637bef182f98..dca0a650106044977b6ceae855890ebe90ad9a53 100644 --- a/ProcessLib/PhaseField/PhaseFieldFEM.h +++ b/ProcessLib/PhaseField/PhaseFieldFEM.h @@ -92,7 +92,7 @@ struct IntegrationPointData final EIGEN_MAKE_ALIGNED_OPERATOR_NEW; static constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); }; /// Used for the extrapolation of the integration point values. It is ordered @@ -185,8 +185,8 @@ public: shape_matrices[ip].integralMeasure * shape_matrices[ip].detJ; static const int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim); ip_data.eps.setZero(kelvin_vector_size); ip_data.eps_prev.resize(kelvin_vector_size); ip_data.C_tensile.setZero(kelvin_vector_size, kelvin_vector_size); diff --git a/ProcessLib/RichardsMechanics/ComputeMicroPorosity.h b/ProcessLib/RichardsMechanics/ComputeMicroPorosity.h index 79ecf3d9c3200a946659f83f34ce8ef43805967c..621a820308f4bcfd7ca6c0f18423587444dcd0c1 100644 --- a/ProcessLib/RichardsMechanics/ComputeMicroPorosity.h +++ b/ProcessLib/RichardsMechanics/ComputeMicroPorosity.h @@ -76,7 +76,7 @@ MicroPorosityStateSpace<DisplacementDim> computeMicroPorosity( { namespace MPL = MaterialPropertyLib; static constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); // phi_m, e_sw, p_L_m, sigma_sw static constexpr int nls_size = 1 + 1 + 1 + kelvin_vector_size; diff --git a/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp b/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp index 9095d1b4cf933a28be4bd57c8b6e3ae8f8ed6064..3fe0730a5f89ccd0dee5462de120186db519db9c 100644 --- a/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp +++ b/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp @@ -168,7 +168,7 @@ std::unique_ptr<Process> createRichardsMechanicsProcess( //! \ogs_file_param_special{prj__processes__process__RICHARDS_MECHANICS__initial_stress} config, "initial_stress", parameters, // Symmetric tensor size, 4 or 6, not a Kelvin vector. - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value, + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim), &mesh); std::optional<MicroPorosityParameters> micro_porosity_parameters; diff --git a/ProcessLib/RichardsMechanics/IntegrationPointData.h b/ProcessLib/RichardsMechanics/IntegrationPointData.h index 4a0a2f7ac2f29c80f7227f1b40ff9e15ee764631..4390d50a4ee92be37f05ffab801b604fb708f714 100644 --- a/ProcessLib/RichardsMechanics/IntegrationPointData.h +++ b/ProcessLib/RichardsMechanics/IntegrationPointData.h @@ -31,8 +31,7 @@ struct IntegrationPointData final { // Initialize current time step values static const int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); sigma_eff.setZero(kelvin_vector_size); sigma_sw.setZero(kelvin_vector_size); eps.setZero(kelvin_vector_size); diff --git a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h index ad200b0860d8f48a5fb9c47af140c7d5c0908517..9298114bcd6f0c78cf8c9facc1e02c9766f420b0 100644 --- a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h +++ b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h @@ -309,8 +309,8 @@ void RichardsMechanicsLocalAssembler< local_rhs_data, displacement_size + pressure_size); auto const& identity2 = MathLib::KelvinVector::Invariants< - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value>:: - identity2; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)>::identity2; auto const& medium = _process_data.media_map->getMedium(_element.getID()); auto const& liquid_phase = medium->phase("AqueousLiquid"); @@ -651,8 +651,8 @@ void RichardsMechanicsLocalAssembler<ShapeFunctionDisplacement, local_rhs_data, displacement_size + pressure_size); auto const& identity2 = MathLib::KelvinVector::Invariants< - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value>:: - identity2; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)>::identity2; typename ShapeMatricesTypePressure::NodalMatrixType laplace_p = ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size, @@ -1188,7 +1188,7 @@ std::vector<double> RichardsMechanicsLocalAssembler< DisplacementDim>::getSigma() const { constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); return transposeInPlace<kelvin_vector_size>( [this](std::vector<double>& values) { @@ -1218,7 +1218,7 @@ std::vector<double> RichardsMechanicsLocalAssembler< DisplacementDim>::getSwellingStress() const { constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); return transposeInPlace<kelvin_vector_size>( [this](std::vector<double>& values) { @@ -1238,7 +1238,7 @@ std::vector<double> const& RichardsMechanicsLocalAssembler< std::vector<double>& cache) const { constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); auto const n_integration_points = _ip_data.size(); cache.clear(); @@ -1263,7 +1263,7 @@ std::vector<double> RichardsMechanicsLocalAssembler< DisplacementDim>::getEpsilon() const { constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); return transposeInPlace<kelvin_vector_size>( [this](std::vector<double>& values) { @@ -1536,8 +1536,8 @@ void RichardsMechanicsLocalAssembler<ShapeFunctionDisplacement, local_x_dot.template segment<displacement_size>(displacement_index); auto const& identity2 = MathLib::KelvinVector::Invariants< - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value>:: - identity2; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)>::identity2; auto const& medium = _process_data.media_map->getMedium(_element.getID()); auto const& liquid_phase = medium->phase("AqueousLiquid"); diff --git a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h index 5d9c3b56e4e3ff073dd5bf27af7f27eca2d9c3a2..447532c28fd3e67f3774fc6f1080dbb97dccb186 100644 --- a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h +++ b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h @@ -66,7 +66,7 @@ public: ShapeFunctionDisplacement::NPOINTS>; static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>; using SymmetricTensor = Eigen::Matrix<double, KelvinVectorSize, 1>; diff --git a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp index bd724f9eac045cd7e6f1378bc676f391703fc010..108b3cded52ca20707eed9ceecc7528127a31ab0 100644 --- a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp +++ b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp @@ -108,7 +108,7 @@ std::unique_ptr<Process> createSmallDeformationProcess( //! \ogs_file_param_special{prj__processes__process__SMALL_DEFORMATION__initial_stress} config, "initial_stress", parameters, // Symmetric tensor size, 4 or 6, not a Kelvin vector. - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value, + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim), &mesh); SmallDeformationProcessData<DisplacementDim> process_data{ diff --git a/ProcessLib/SmallDeformation/SmallDeformationFEM.h b/ProcessLib/SmallDeformation/SmallDeformationFEM.h index 5ac7d11edc965ec22d86956c3f03983d321a2ea4..c8467a8753531cb4b3c371ae48b45a23ed83e6a2 100644 --- a/ProcessLib/SmallDeformation/SmallDeformationFEM.h +++ b/ProcessLib/SmallDeformation/SmallDeformationFEM.h @@ -150,8 +150,8 @@ public: ip_data.dNdx = sm.dNdx; static const int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim); // Initialize current time step values ip_data.sigma.setZero(kelvin_vector_size); ip_data.eps.setZero(kelvin_vector_size); diff --git a/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h b/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h index 12d5b6de0787f556add3e1d9f779fa12e473083f..7a87531428b2dc1a60beafbcc7936b8bf1b7c13c 100644 --- a/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h +++ b/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h @@ -126,18 +126,19 @@ public: ip_data.dNdx = sm.dNdx; // Initialize current time step values - ip_data.sigma.setZero(MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value); - ip_data.eps.setZero(MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value); + ip_data.sigma.setZero( + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)); + ip_data.eps.setZero(MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)); // Previous time step values are not initialized and are set later. ip_data.sigma_prev.resize( - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value); + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)); ip_data.eps_prev.resize( - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value); + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)); _secondary_data.N[ip] = shape_matrices[ip].N; diff --git a/ProcessLib/ThermoHydroMechanics/IntegrationPointData.h b/ProcessLib/ThermoHydroMechanics/IntegrationPointData.h index 9b61665a25b536dcb7ea7a0d1875eadc8b779f36..8f52ed028d2a1eeff5c7f1695d9fb0f61afcc39c 100644 --- a/ProcessLib/ThermoHydroMechanics/IntegrationPointData.h +++ b/ProcessLib/ThermoHydroMechanics/IntegrationPointData.h @@ -34,8 +34,7 @@ struct IntegrationPointData final { // Initialize current time step values static const int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); sigma_eff.setZero(kelvin_vector_size); eps.setZero(kelvin_vector_size); eps_m.setZero(kelvin_vector_size); diff --git a/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM.h b/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM.h index 55908105b12109e2e97b2592e6fbe27fc734023d..fe534aa867b15513e4865303698e6707415e6473 100644 --- a/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM.h +++ b/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM.h @@ -62,7 +62,7 @@ public: typename ShapeMatricesTypePressure::GlobalDimVectorType; static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>; using SymmetricTensor = Eigen::Matrix<double, KelvinVectorSize, 1>; diff --git a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM-impl.h b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM-impl.h index fed6a5d67e7a18edb9189c45df56cbce3c543159..8eff355d4c7fd06e0dd62d620f876fc15bc7e8ee 100644 --- a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM-impl.h +++ b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM-impl.h @@ -204,8 +204,7 @@ void ThermoMechanicalPhaseFieldLocalAssembler<ShapeFunction, IntegrationMethod, d_ip * d_ip * lambda + (1 - d_ip) * (1 - d_ip) * lambda_res; using Invariants = MathLib::KelvinVector::Invariants< - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value>; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim)>; double const eps_m_trace = Invariants::trace(eps_m); if (eps_m_trace >= 0) diff --git a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h index e016464b92f016c95743baacc05b4f43319330f4..a39bed37619104ed1e22d3a5e6a1aa6e115ab16c 100644 --- a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h +++ b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h @@ -69,7 +69,7 @@ struct IntegrationPointData final } using Invariants = MathLib::KelvinVector::Invariants< - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value>; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim)>; template <typename DisplacementVectorType> void updateConstitutiveRelation(double const t, @@ -201,8 +201,8 @@ public: shape_matrices[ip].integralMeasure * shape_matrices[ip].detJ; static const int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim); ip_data.eps.setZero(kelvin_vector_size); ip_data.eps_prev.resize(kelvin_vector_size); ip_data.eps_m.setZero(kelvin_vector_size); diff --git a/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp b/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp index b1b94a700ab16f6033779ce81fd4ff67eec77b51..70448dcd42322d405e88d3a663e9dd33b928eac7 100644 --- a/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp +++ b/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp @@ -158,7 +158,7 @@ std::unique_ptr<Process> createThermoMechanicsProcess( //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICS__initial_stress} config, "initial_stress", parameters, // Symmetric tensor size, 4 or 6, not a Kelvin vector. - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value, + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim), &mesh); auto media_map = diff --git a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h index 0428ec2cc559573e41ca9baed0f7bd4f7c57e1b7..749777d1f19d25862e2b48be27d3de255c63b5a5 100644 --- a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h +++ b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h @@ -60,8 +60,7 @@ ThermoMechanicsLocalAssembler<ShapeFunction, IntegrationMethod, shape_matrices[ip].integralMeasure * shape_matrices[ip].detJ; static const int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); // Initialize current time step values ip_data.sigma.setZero(kelvin_vector_size); ip_data.eps.setZero(kelvin_vector_size); @@ -638,7 +637,7 @@ std::size_t ThermoMechanicsLocalAssembler< DisplacementDim>::setEpsilonMechanical(double const* values) { auto const kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); unsigned const n_integration_points = _integration_method.getNumberOfPoints(); @@ -663,7 +662,7 @@ ThermoMechanicsLocalAssembler<ShapeFunction, IntegrationMethod, DisplacementDim>::getEpsilonMechanical() const { auto const kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); unsigned const n_integration_points = _integration_method.getNumberOfPoints(); diff --git a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h index 1520ffc7a831073779a7e14bb99d64776e24e43d..b0cc1b777335d5d5c082bb43159bf82d834db8ce 100644 --- a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h +++ b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h @@ -138,7 +138,7 @@ public: using BMatricesType = BMatrixPolicyType<ShapeFunction, DisplacementDim>; static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>; using NodalForceVectorType = typename BMatricesType::NodalForceVectorType; diff --git a/ProcessLib/ThermoRichardsMechanics/CreateThermoRichardsMechanicsProcess.cpp b/ProcessLib/ThermoRichardsMechanics/CreateThermoRichardsMechanicsProcess.cpp index a5b1f2c019d3b923cbb36646f781e69bb37f0828..59631a74865fb2a7c3d7f121c2da24fed20b782a 100644 --- a/ProcessLib/ThermoRichardsMechanics/CreateThermoRichardsMechanicsProcess.cpp +++ b/ProcessLib/ThermoRichardsMechanics/CreateThermoRichardsMechanicsProcess.cpp @@ -164,7 +164,7 @@ std::unique_ptr<Process> createThermoRichardsMechanicsProcess( //! \ogs_file_param_special{prj__processes__process__THERMO_RICHARDS_MECHANICS__initial_stress} config, "initial_stress", parameters, // Symmetric tensor size, 4 or 6, not a Kelvin vector. - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value, + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim), &mesh); bool mass_lumping = false; diff --git a/ProcessLib/ThermoRichardsMechanics/IntegrationPointData.h b/ProcessLib/ThermoRichardsMechanics/IntegrationPointData.h index caad48f6f7cd6507e305c9ddb3757be6f69d4da8..89df44eb03fb6c87e428b00b03398a291a26db76 100644 --- a/ProcessLib/ThermoRichardsMechanics/IntegrationPointData.h +++ b/ProcessLib/ThermoRichardsMechanics/IntegrationPointData.h @@ -35,8 +35,7 @@ struct IntegrationPointData final { // Initialize current time step values static const int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions< - DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); sigma_eff.setZero(kelvin_vector_size); sigma_sw.setZero(kelvin_vector_size); eps.setZero(kelvin_vector_size); diff --git a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h index 27ef674841af4b74e2ed4868982ab409cd97cdc8..dbdb60867af54fe0c5e7db93fcc5592d89b8cab7 100644 --- a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h +++ b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h @@ -299,8 +299,8 @@ void ThermoRichardsMechanicsLocalAssembler<ShapeFunctionDisplacement, local_rhs_data, local_matrix_dim); auto const& identity2 = MathLib::KelvinVector::Invariants< - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value>:: - identity2; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)>::identity2; typename ShapeMatricesType::NodalMatrixType M_TT = ShapeMatricesType::NodalMatrixType::Zero(temperature_size, @@ -869,7 +869,7 @@ std::vector<double> ThermoRichardsMechanicsLocalAssembler< DisplacementDim>::getSigma() const { constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); return transposeInPlace<kelvin_vector_size>( [this](std::vector<double>& values) { @@ -899,7 +899,7 @@ std::vector<double> ThermoRichardsMechanicsLocalAssembler< DisplacementDim>::getSwellingStress() const { constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); return transposeInPlace<kelvin_vector_size>( [this](std::vector<double>& values) { @@ -919,7 +919,7 @@ ThermoRichardsMechanicsLocalAssembler<ShapeFunctionDisplacement, ShapeFunction, std::vector<double>& cache) const { constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); auto const n_integration_points = ip_data_.size(); cache.clear(); @@ -944,7 +944,7 @@ std::vector<double> ThermoRichardsMechanicsLocalAssembler< DisplacementDim>::getEpsilon() const { constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); return transposeInPlace<kelvin_vector_size>( [this](std::vector<double>& values) { @@ -1110,8 +1110,8 @@ void ThermoRichardsMechanicsLocalAssembler<ShapeFunctionDisplacement, local_x_dot.template segment<displacement_size>(displacement_index); auto const& identity2 = MathLib::KelvinVector::Invariants< - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value>:: - identity2; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)>::identity2; auto const& medium = process_data_.media_map->getMedium(element_.getID()); auto const& liquid_phase = medium->phase("AqueousLiquid"); diff --git a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM.h b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM.h index 3ae5241ab5374c974ee06368e2e19ec59f53f652..3dc66a746c5e0e3312b785a54170c0f5f25865d9 100644 --- a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM.h +++ b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM.h @@ -67,7 +67,7 @@ public: ShapeFunctionDisplacement::NPOINTS>; static int const KelvinVectorSize = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>; using SymmetricTensor = Eigen::Matrix<double, KelvinVectorSize, 1>; diff --git a/ProcessLib/Utils/SetOrGetIntegrationPointData.h b/ProcessLib/Utils/SetOrGetIntegrationPointData.h index 91ab09cb5aeb4aca95ac790f5e6f30bd5103063e..cb7ef021920512152d58c98d85702aa44a5d4aa0 100644 --- a/ProcessLib/Utils/SetOrGetIntegrationPointData.h +++ b/ProcessLib/Utils/SetOrGetIntegrationPointData.h @@ -28,7 +28,7 @@ std::vector<double> const& getIntegrationPointKelvinVectorData( MemberType member, std::vector<double>& cache) { constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); auto const n_integration_points = ip_data.size(); cache.clear(); @@ -54,7 +54,7 @@ std::vector<double> getIntegrationPointKelvinVectorData( MemberType member) { constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); auto const n_integration_points = ip_data.size(); std::vector<double> ip_kelvin_vector_values; @@ -81,7 +81,7 @@ std::size_t setIntegrationPointKelvinVectorData( MemberType member) { constexpr int kelvin_vector_size = - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value; + MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim); auto const n_integration_points = ip_data.size(); auto kelvin_vector_values = diff --git a/Tests/ProcessLib/RichardsMechanics/MicroporosityComputation.cpp b/Tests/ProcessLib/RichardsMechanics/MicroporosityComputation.cpp index 94bad847b9261be2ddc90acf73bf9b99f9962a6b..62145face6053c469d7ce1ce5200911fd272903d 100644 --- a/Tests/ProcessLib/RichardsMechanics/MicroporosityComputation.cpp +++ b/Tests/ProcessLib/RichardsMechanics/MicroporosityComputation.cpp @@ -114,8 +114,8 @@ TEST(RichardsMechanics, computeMicroPorosity) double const T = 293.15; auto const& identity2 = MathLib::KelvinVector::Invariants< - MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value>:: - identity2; + MathLib::KelvinVector::kelvin_vector_dimensions( + DisplacementDim)>::identity2; auto const C_el = computeElasticTangentStiffness(solid_material, t0, pos, dt, T); MathLib::KelvinVector::KelvinVectorType<DisplacementDim> const&