diff --git a/kratos/includes/constitutive_law.h b/kratos/includes/constitutive_law.h index 977d9d90fda4..03d5893b96c8 100644 --- a/kratos/includes/constitutive_law.h +++ b/kratos/includes/constitutive_law.h @@ -143,14 +143,14 @@ class KRATOS_API(KRATOS_CORE) ConstitutiveLaw : public Flags * its variables will be used to check constitutive law and element compatibility * @param mOptions flags with the current constitutive law characteristics - * @param mStrainSize double with the strain vector size + * @param mStrainSize SizeType with the strain vector size * @param mStrainMeasures vector with the strain measures accepted by the constitutive law */ Flags mOptions; - double mStrainSize; - double mSpaceDimension; + SizeType mStrainSize; + SizeType mSpaceDimension; std::vector< StrainMeasure > mStrainMeasures; /** @@ -168,18 +168,18 @@ class KRATOS_API(KRATOS_CORE) ConstitutiveLaw : public Flags } // Set variables - void SetOptions (const Flags& rOptions) {mOptions=rOptions;}; - void SetStrainSize (const double StrainSize) {mStrainSize=StrainSize;}; - void SetSpaceDimension(const double SpaceDimension) {mSpaceDimension=SpaceDimension;}; - void SetStrainMeasure (const StrainMeasure Measure) {mStrainMeasures.push_back(Measure);}; + void SetOptions (const Flags& rOptions) {mOptions=rOptions;}; + void SetStrainSize (const SizeType StrainSize) {mStrainSize=StrainSize;}; + void SetSpaceDimension (const SizeType SpaceDimension) {mSpaceDimension=SpaceDimension;}; + void SetStrainMeasure (const StrainMeasure Measure) {mStrainMeasures.push_back(Measure);}; void SetStrainMeasures (const std::vector MeasuresVector) {mStrainMeasures = MeasuresVector;}; // Get variables const Flags& GetOptions () {return mOptions;}; - const double& GetStrainSize() {return mStrainSize;}; - const double& GetSpaceDimension() {return mSpaceDimension;}; + const SizeType& GetStrainSize() {return mStrainSize;}; + const SizeType& GetSpaceDimension() {return mSpaceDimension;}; std::vector& GetStrainMeasures() {return mStrainMeasures;}; }; diff --git a/kratos/python/add_constitutive_law_to_python.cpp b/kratos/python/add_constitutive_law_to_python.cpp index 66089984ba11..b4d6ffe56bd3 100644 --- a/kratos/python/add_constitutive_law_to_python.cpp +++ b/kratos/python/add_constitutive_law_to_python.cpp @@ -28,6 +28,7 @@ namespace Kratos::Python { namespace py = pybind11; +using SizeType = std::size_t; typedef ConstitutiveLaw ConstitutiveLawBaseType; template bool ConstitutiveLawHas(ConstitutiveLaw& rThisConstitutiveLaw, TVariableType const& rThisVariable) { return rThisConstitutiveLaw.Has(rThisVariable); } @@ -58,8 +59,8 @@ void NewInterfaceCalculateMaterialResponse(ConstitutiveLaw& rThisConstitutiveLaw {rThisConstitutiveLaw.CalculateMaterialResponse (rValues,rStressMeasure);} Flags GetFeaturesOptions(ConstitutiveLaw::Features& rThisFeatures){ return rThisFeatures.GetOptions();} -double GetStrainSizeFeatures(ConstitutiveLaw::Features& rThisFeatures){ return rThisFeatures.GetStrainSize();} -double GetSpaceDimensionFeatures(ConstitutiveLaw::Features& rThisFeatures){ return rThisFeatures.GetSpaceDimension();} +SizeType GetStrainSizeFeatures(ConstitutiveLaw::Features& rThisFeatures){ return rThisFeatures.GetStrainSize();} +SizeType GetSpaceDimensionFeatures(ConstitutiveLaw::Features& rThisFeatures){ return rThisFeatures.GetSpaceDimension();} std::vector& GetStrainMeasuresFeatures(ConstitutiveLaw::Features& rThisFeatures){ return rThisFeatures.GetStrainMeasures(); } Flags GetLawOptions(ConstitutiveLaw::Parameters& rThisParameters){ return rThisParameters.GetOptions();} @@ -162,7 +163,6 @@ void AddConstitutiveLawToPython(pybind11::module& m) .def("GetStressMeasure",&ConstitutiveLaw::GetStressMeasure) .def("IsIncremental",&ConstitutiveLaw::IsIncremental) .def("WorkingSpaceDimension",&ConstitutiveLaw::WorkingSpaceDimension) - .def("GetStrainSize",&ConstitutiveLaw::GetStrainSize) .def("Has", &ConstitutiveLawHas< Variable >) .def("Has", &ConstitutiveLawHas< Variable >) .def("Has", &ConstitutiveLawHas< Variable >)