-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GeoMechanicsApplication] Extract biot modulus inverse list #12402
Changes from 10 commits
4d36bb7
8f9a230
e98bb12
9cfb3e7
688279b
b578e71
c0ddbe1
e6449a2
8596047
e41be53
d94aab2
f723c2b
b0b6ba0
56c4d94
82e1dc5
c04d7fa
e772c29
ff2db9c
0f30211
5f1e343
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -456,6 +456,13 @@ void UPwSmallStrainFICElement<TDim, TNumNodes>::CalculateAll(MatrixType& rLeftHa | |
strain_vectors, mStressVector, constitutive_matrices); | ||
const auto biot_coefficients = | ||
GeoTransportEquationUtilities::CalculateBiotCoefficients(constitutive_matrices, Prop); | ||
const auto fluid_pressures = GeoTransportEquationUtilities::CalculateFluidPressures( | ||
Variables.NContainer, Variables.PressureVector); | ||
const auto degrees_of_saturation = this->CalculateDegreesOfSaturation(fluid_pressures, RetentionParameters); | ||
const auto derivatives_of_saturation = | ||
this->CalculateDerivativesOfSaturation(fluid_pressures, RetentionParameters); | ||
const auto biot_moduli_inverse = GeoTransportEquationUtilities::CalculateInverseBiotModuli( | ||
biot_coefficients, degrees_of_saturation, derivatives_of_saturation, Prop); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part is duplicated several times. It has to be shifted to a utilility. I think it can be done in a seperate PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, but as discussed it's better to do it in a separate PR (same for the other comments) |
||
for (unsigned int GPoint = 0; GPoint < NumGPoints; ++GPoint) { | ||
this->CalculateKinematics(Variables, GPoint); | ||
|
@@ -474,8 +481,8 @@ void UPwSmallStrainFICElement<TDim, TNumNodes>::CalculateAll(MatrixType& rLeftHa | |
FICVariables.ShearModulus = CalculateShearModulus(Variables.ConstitutiveMatrix); | ||
|
||
Variables.BiotCoefficient = biot_coefficients[GPoint]; | ||
Variables.BiotModulusInverse = GeoTransportEquationUtilities::CalculateBiotModulusInverse( | ||
Variables.BiotCoefficient, Variables.DegreeOfSaturation, Variables.DerivativeOfSaturation, Prop); | ||
Variables.BiotModulusInverse = biot_moduli_inverse[GPoint]; | ||
Variables.DegreeOfSaturation = degrees_of_saturation[GPoint]; | ||
rfaasse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Variables.IntegrationCoefficient = integration_coefficients[GPoint]; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -978,6 +978,13 @@ void UPwSmallStrainElement<TDim, TNumNodes>::CalculateAll(MatrixType& rLe | |
strain_vectors, mStressVector, constitutive_matrices); | ||
const auto biot_coefficients = GeoTransportEquationUtilities::CalculateBiotCoefficients( | ||
constitutive_matrices, this->GetProperties()); | ||
const auto fluid_pressures = GeoTransportEquationUtilities::CalculateFluidPressures( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also here the calculated |
||
Variables.NContainer, Variables.PressureVector); | ||
const auto degrees_of_saturation = CalculateDegreesOfSaturation(fluid_pressures, RetentionParameters); | ||
const auto derivatives_of_saturation = | ||
CalculateDerivativesOfSaturation(fluid_pressures, RetentionParameters); | ||
const auto biot_moduli_inverse = GeoTransportEquationUtilities::CalculateInverseBiotModuli( | ||
biot_coefficients, degrees_of_saturation, derivatives_of_saturation, rProp); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above comment. Can be shifted to utility. |
||
for (unsigned int GPoint = 0; GPoint < NumGPoints; ++GPoint) { | ||
this->CalculateKinematics(Variables, GPoint); | ||
|
@@ -994,9 +1001,8 @@ void UPwSmallStrainElement<TDim, TNumNodes>::CalculateAll(MatrixType& rLe | |
CalculateRetentionResponse(Variables, RetentionParameters, GPoint); | ||
|
||
Variables.BiotCoefficient = biot_coefficients[GPoint]; | ||
Variables.BiotModulusInverse = GeoTransportEquationUtilities::CalculateBiotModulusInverse( | ||
Variables.BiotCoefficient, Variables.DegreeOfSaturation, | ||
Variables.DerivativeOfSaturation, this->GetProperties()); | ||
Variables.BiotModulusInverse = biot_moduli_inverse[GPoint]; | ||
Variables.DegreeOfSaturation = degrees_of_saturation[GPoint]; | ||
Variables.PermeabilityUpdateFactor = this->CalculatePermeabilityUpdateFactor(Variables.StrainVector); | ||
|
||
Variables.IntegrationCoefficient = integration_coefficients[GPoint]; | ||
|
@@ -1015,6 +1021,36 @@ void UPwSmallStrainElement<TDim, TNumNodes>::CalculateAll(MatrixType& rLe | |
KRATOS_CATCH("") | ||
} | ||
|
||
template <unsigned int TDim, unsigned int TNumNodes> | ||
std::vector<double> UPwSmallStrainElement<TDim, TNumNodes>::CalculateDerivativesOfSaturation( | ||
const std::vector<double>& fluid_pressures, RetentionLaw::Parameters& RetentionParameters) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest to make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
{ | ||
std::vector<double> result; | ||
std::transform(fluid_pressures.begin(), fluid_pressures.end(), mRetentionLawVector.begin(), | ||
std::back_inserter(result), | ||
[&RetentionParameters](double fluid_pressure, RetentionLaw::Pointer pRetentionLaw) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clang-tidy complains about this because it thinks the retention law is copied (it doesn't recognize this is a pointer). I could make it const auto&, but not sure if that makes it more clear. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Used auto to remove the clang-tidy issue |
||
RetentionParameters.SetFluidPressure(fluid_pressure); | ||
return pRetentionLaw->CalculateDerivativeOfSaturation(RetentionParameters); | ||
}); | ||
|
||
return result; | ||
} | ||
|
||
template <unsigned int TDim, unsigned int TNumNodes> | ||
std::vector<double> UPwSmallStrainElement<TDim, TNumNodes>::CalculateDegreesOfSaturation( | ||
const std::vector<double>& fluid_pressures, RetentionLaw::Parameters& RetentionParameters) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also here, I would suggest to change Also, please be aware that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, as per your suggestion I removed the FYI @markelov208 since you separated out the utility. Please let me know if you have any reservations with this approach |
||
{ | ||
std::vector<double> result; | ||
std::transform(fluid_pressures.begin(), fluid_pressures.end(), mRetentionLawVector.begin(), | ||
std::back_inserter(result), | ||
[&RetentionParameters](double fluid_pressure, RetentionLaw::Pointer pRetentionLaw) { | ||
RetentionParameters.SetFluidPressure(fluid_pressure); | ||
return pRetentionLaw->CalculateSaturation(RetentionParameters); | ||
}); | ||
|
||
return result; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a shame this is a 100% duplication with diff order. We could extract a utility, but we'd need to supply the vector of retention laws. It's still open for discussion though, I'm doubting between the two possibilities There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've had the exact same struggle for the calculation of the relative permeability values. I have also opted for keeping the calculation in the element itself, since you need some information that is maintained by the element. Since our intention is to ultimately remove the different branches in the element hierarchy, I'm willing to accept the technical debt that arises from the code duplication. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As you mentioned, this part is also duplication, and it has to be shifted to a utility. |
||
|
||
template <unsigned int TDim, unsigned int TNumNodes> | ||
std::vector<array_1d<double, TDim>> UPwSmallStrainElement<TDim, TNumNodes>::CalculateFluidFluxes( | ||
const std::vector<double>& rPermeabilityUpdateFactors, const ProcessInfo& rCurrentProcessInfo) | ||
|
@@ -1129,10 +1165,9 @@ void UPwSmallStrainElement<TDim, TNumNodes>::InitializeElementVariables(ElementV | |
rVariables.UVoigtMatrix.resize(TNumNodes * TDim, VoigtSize, false); | ||
|
||
// Retention law | ||
rVariables.DegreeOfSaturation = 1.0; | ||
rVariables.DerivativeOfSaturation = 0.0; | ||
rVariables.RelativePermeability = 1.0; | ||
rVariables.BishopCoefficient = 1.0; | ||
rVariables.DegreeOfSaturation = 1.0; | ||
rVariables.RelativePermeability = 1.0; | ||
rVariables.BishopCoefficient = 1.0; | ||
|
||
KRATOS_CATCH("") | ||
} | ||
|
@@ -1570,9 +1605,6 @@ void UPwSmallStrainElement<TDim, TNumNodes>::CalculateRetentionResponse(ElementV | |
rRetentionParameters.SetFluidPressure(GeoTransportEquationUtilities::CalculateFluidPressure( | ||
rVariables.Np, rVariables.PressureVector)); | ||
|
||
rVariables.DegreeOfSaturation = mRetentionLawVector[GPoint]->CalculateSaturation(rRetentionParameters); | ||
rVariables.DerivativeOfSaturation = | ||
mRetentionLawVector[GPoint]->CalculateDerivativeOfSaturation(rRetentionParameters); | ||
rVariables.RelativePermeability = | ||
mRetentionLawVector[GPoint]->CalculateRelativePermeability(rRetentionParameters); | ||
rVariables.BishopCoefficient = mRetentionLawVector[GPoint]->CalculateBishopCoefficient(rRetentionParameters); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,13 @@ void UPwUpdatedLagrangianFICElement<TDim, TNumNodes>::CalculateAll(MatrixType& r | |
strain_vectors, mStressVector, constitutive_matrices); | ||
const auto biot_coefficients = | ||
GeoTransportEquationUtilities::CalculateBiotCoefficients(constitutive_matrices, Prop); | ||
const auto fluid_pressures = GeoTransportEquationUtilities::CalculateFluidPressures( | ||
Variables.NContainer, Variables.PressureVector); | ||
const auto degrees_of_saturation = this->CalculateDegreesOfSaturation(fluid_pressures, RetentionParameters); | ||
const auto derivatives_of_saturation = | ||
this->CalculateDerivativesOfSaturation(fluid_pressures, RetentionParameters); | ||
const auto biot_moduli_inverse = GeoTransportEquationUtilities::CalculateInverseBiotModuli( | ||
biot_coefficients, degrees_of_saturation, derivatives_of_saturation, Prop); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplication, as mentioned above |
||
// Computing in all integrations points | ||
for (IndexType GPoint = 0; GPoint < IntegrationPoints.size(); ++GPoint) { | ||
|
@@ -113,9 +120,8 @@ void UPwUpdatedLagrangianFICElement<TDim, TNumNodes>::CalculateAll(MatrixType& r | |
FICVariables.ShearModulus = CalculateShearModulus(Variables.ConstitutiveMatrix); | ||
|
||
Variables.BiotCoefficient = biot_coefficients[GPoint]; | ||
Variables.BiotModulusInverse = GeoTransportEquationUtilities::CalculateBiotModulusInverse( | ||
Variables.BiotCoefficient, Variables.DegreeOfSaturation, | ||
Variables.DerivativeOfSaturation, this->GetProperties()); | ||
Variables.BiotModulusInverse = biot_moduli_inverse[GPoint]; | ||
Variables.DegreeOfSaturation = degrees_of_saturation[GPoint]; | ||
|
||
Variables.IntegrationCoefficient = integration_coefficients[GPoint]; | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -327,18 +327,14 @@ void SmallStrainUPwDiffOrderElement::InitializeSolutionStep(const ProcessInfo& r | |||||
|
||||||
// Loop over integration points | ||||||
for (unsigned int GPoint = 0; GPoint < mConstitutiveLawVector.size(); ++GPoint) { | ||||||
// compute element kinematics (Np, gradNpT, |J|, B, strains) | ||||||
this->CalculateKinematics(Variables, GPoint); | ||||||
Variables.B = b_matrices[GPoint]; | ||||||
Variables.F = deformation_gradients[GPoint]; | ||||||
|
||||||
// Compute infinitesimal strain | ||||||
Variables.detF = determinants_of_deformation_gradients[GPoint]; | ||||||
Variables.B = b_matrices[GPoint]; | ||||||
Variables.F = deformation_gradients[GPoint]; | ||||||
Variables.StrainVector = strain_vectors[GPoint]; | ||||||
|
||||||
ConstitutiveLawUtilities::SetConstitutiveParameters( | ||||||
ConstitutiveParameters, Variables.StrainVector, Variables.ConstitutiveMatrix, | ||||||
Variables.Nu, Variables.DNu_DX, Variables.F, Variables.detF); | ||||||
ConstitutiveParameters, Variables.StrainVector, Variables.ConstitutiveMatrix, Variables.Nu, | ||||||
Variables.DNu_DX, Variables.F, determinants_of_deformation_gradients[GPoint]); | ||||||
|
||||||
// compute constitutive tensor and/or stresses | ||||||
noalias(Variables.StressVector) = mStressVector[GPoint]; | ||||||
|
@@ -550,12 +546,11 @@ void SmallStrainUPwDiffOrderElement::FinalizeSolutionStep(const ProcessInfo& rCu | |||||
|
||||||
// Compute infinitesimal strain | ||||||
Variables.F = deformation_gradients[GPoint]; | ||||||
Variables.detF = determinants_of_deformation_gradients[GPoint]; | ||||||
Variables.StrainVector = strain_vectors[GPoint]; | ||||||
|
||||||
ConstitutiveLawUtilities::SetConstitutiveParameters( | ||||||
ConstitutiveParameters, Variables.StrainVector, Variables.ConstitutiveMatrix, | ||||||
Variables.Nu, Variables.DNu_DX, Variables.F, Variables.detF); | ||||||
ConstitutiveParameters, Variables.StrainVector, Variables.ConstitutiveMatrix, Variables.Nu, | ||||||
Variables.DNu_DX, Variables.F, determinants_of_deformation_gradients[GPoint]); | ||||||
|
||||||
// compute constitutive tensor and/or stresses | ||||||
noalias(Variables.StressVector) = mStressVector[GPoint]; | ||||||
|
@@ -1278,8 +1273,16 @@ void SmallStrainUPwDiffOrderElement::CalculateAll(MatrixType& rLeftHandSi | |||||
this->CalculateAnyOfMaterialResponse(deformation_gradients, ConstitutiveParameters, | ||||||
Variables.NuContainer, Variables.DNu_DXContainer, | ||||||
strain_vectors, mStressVector, constitutive_matrices); | ||||||
|
||||||
const auto biot_coefficients = GeoTransportEquationUtilities::CalculateBiotCoefficients( | ||||||
constitutive_matrices, this->GetProperties()); | ||||||
const auto fluid_pressures = GeoTransportEquationUtilities::CalculateFluidPressures( | ||||||
Variables.NpContainer, Variables.PressureVector); | ||||||
const auto degrees_of_saturation = CalculateDegreesOfSaturation(fluid_pressures, RetentionParameters); | ||||||
const auto derivatives_of_saturation = | ||||||
CalculateDerivativesOfSaturation(fluid_pressures, RetentionParameters); | ||||||
const auto biot_moduli_inverse = GeoTransportEquationUtilities::CalculateInverseBiotModuli( | ||||||
biot_coefficients, degrees_of_saturation, derivatives_of_saturation, rProp); | ||||||
|
||||||
for (unsigned int GPoint = 0; GPoint < IntegrationPoints.size(); ++GPoint) { | ||||||
this->CalculateKinematics(Variables, GPoint); | ||||||
|
@@ -1291,11 +1294,9 @@ void SmallStrainUPwDiffOrderElement::CalculateAll(MatrixType& rLeftHandSi | |||||
CalculateRetentionResponse(Variables, RetentionParameters, GPoint); | ||||||
|
||||||
Variables.BiotCoefficient = biot_coefficients[GPoint]; | ||||||
Variables.BiotModulusInverse = GeoTransportEquationUtilities::CalculateBiotModulusInverse( | ||||||
Variables.BiotCoefficient, Variables.DegreeOfSaturation, | ||||||
Variables.DerivativeOfSaturation, this->GetProperties()); | ||||||
Variables.BiotModulusInverse = biot_moduli_inverse[GPoint]; | ||||||
Variables.PermeabilityUpdateFactor = this->CalculatePermeabilityUpdateFactor(Variables.StrainVector); | ||||||
|
||||||
Variables.DegreeOfSaturation = degrees_of_saturation[GPoint]; | ||||||
Variables.IntegrationCoefficient = integration_coefficients[GPoint]; | ||||||
|
||||||
Variables.IntegrationCoefficientInitialConfiguration = this->CalculateIntegrationCoefficient( | ||||||
|
@@ -1312,6 +1313,34 @@ void SmallStrainUPwDiffOrderElement::CalculateAll(MatrixType& rLeftHandSi | |||||
KRATOS_CATCH("") | ||||||
} | ||||||
|
||||||
std::vector<double> SmallStrainUPwDiffOrderElement::CalculateDerivativesOfSaturation( | ||||||
const std::vector<double>& fluid_pressures, RetentionLaw::Parameters& RetentionParameters) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To comply with the Kratos Style Guide, we need to rename the first parameter:
Suggested change
And as mentioned before, I would make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||||
{ | ||||||
std::vector<double> result; | ||||||
std::transform(fluid_pressures.begin(), fluid_pressures.end(), mRetentionLawVector.begin(), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might consider to raise an error when the number of fluid pressure values does not match the number of constitutive law pointers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||||
std::back_inserter(result), | ||||||
[&RetentionParameters](double fluid_pressure, RetentionLaw::Pointer pRetentionLaw) { | ||||||
RetentionParameters.SetFluidPressure(fluid_pressure); | ||||||
return pRetentionLaw->CalculateDerivativeOfSaturation(RetentionParameters); | ||||||
}); | ||||||
|
||||||
return result; | ||||||
} | ||||||
|
||||||
std::vector<double> SmallStrainUPwDiffOrderElement::CalculateDegreesOfSaturation( | ||||||
const std::vector<double>& fluid_pressures, RetentionLaw::Parameters& RetentionParameters) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The above comments also apply to this member function. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||||
{ | ||||||
std::vector<double> result; | ||||||
std::transform(fluid_pressures.begin(), fluid_pressures.end(), mRetentionLawVector.begin(), | ||||||
std::back_inserter(result), | ||||||
[&RetentionParameters](double fluid_pressure, RetentionLaw::Pointer pRetentionLaw) { | ||||||
RetentionParameters.SetFluidPressure(fluid_pressure); | ||||||
return pRetentionLaw->CalculateSaturation(RetentionParameters); | ||||||
}); | ||||||
|
||||||
return result; | ||||||
} | ||||||
|
||||||
void SmallStrainUPwDiffOrderElement::CalculateMaterialStiffnessMatrix(MatrixType& rStiffnessMatrix, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplication, as mentioned |
||||||
const ProcessInfo& rCurrentProcessInfo) | ||||||
{ | ||||||
|
@@ -1428,7 +1457,6 @@ void SmallStrainUPwDiffOrderElement::InitializeElementVariables(ElementVariables | |||||
rVariables.StressVector.resize(VoigtSize, false); | ||||||
|
||||||
// Needed parameters for consistency with the general constitutive law | ||||||
rVariables.detF = 1.0; | ||||||
rVariables.F.resize(Dim, Dim, false); | ||||||
noalias(rVariables.F) = identity_matrix<double>(Dim); | ||||||
|
||||||
|
@@ -1443,10 +1471,9 @@ void SmallStrainUPwDiffOrderElement::InitializeElementVariables(ElementVariables | |||||
rVariables.DtPressureCoefficient = rCurrentProcessInfo[DT_PRESSURE_COEFFICIENT]; | ||||||
|
||||||
// Retention law | ||||||
rVariables.DegreeOfSaturation = 1.0; | ||||||
rVariables.DerivativeOfSaturation = 0.0; | ||||||
rVariables.RelativePermeability = 1.0; | ||||||
rVariables.BishopCoefficient = 1.0; | ||||||
rVariables.DegreeOfSaturation = 1.0; | ||||||
rVariables.RelativePermeability = 1.0; | ||||||
rVariables.BishopCoefficient = 1.0; | ||||||
|
||||||
// permeability change | ||||||
rVariables.PermeabilityUpdateFactor = 1.0; | ||||||
|
@@ -1987,9 +2014,6 @@ void SmallStrainUPwDiffOrderElement::CalculateRetentionResponse(ElementVariables | |||||
rRetentionParameters.SetFluidPressure(GeoTransportEquationUtilities::CalculateFluidPressure( | ||||||
rVariables.Np, rVariables.PressureVector)); | ||||||
|
||||||
rVariables.DegreeOfSaturation = mRetentionLawVector[GPoint]->CalculateSaturation(rRetentionParameters); | ||||||
rVariables.DerivativeOfSaturation = | ||||||
mRetentionLawVector[GPoint]->CalculateDerivativeOfSaturation(rRetentionParameters); | ||||||
rVariables.RelativePermeability = | ||||||
mRetentionLawVector[GPoint]->CalculateRelativePermeability(rRetentionParameters); | ||||||
rVariables.BishopCoefficient = mRetentionLawVector[GPoint]->CalculateBishopCoefficient(rRetentionParameters); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe you may now also be able to remove data member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,7 +177,6 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) SmallStrainUPwDiffOrderElement : pub | |
Matrix ConstitutiveMatrix; | ||
|
||
// Variables needed for consistency with the general constitutive law | ||
double detF; | ||
Matrix F; | ||
|
||
// needed for updated Lagrangian: | ||
|
@@ -314,6 +313,11 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) SmallStrainUPwDiffOrderElement : pub | |
|
||
Vector GetPressureSolutionVector(); | ||
|
||
std::vector<double> CalculateDegreesOfSaturation(const std::vector<double>& fluid_pressures, | ||
RetentionLaw::Parameters& RetentionParameters); | ||
std::vector<double> CalculateDerivativesOfSaturation(const std::vector<double>& fluid_pressures, | ||
RetentionLaw::Parameters& RetentionParameters); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any reason why these member functions can't be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the function calls in retention law that we call in these are not const. Since that's a member, I assumed we couldn't make this one const. Turns out these members are ::Pointers, meaning we can do it. However, I think it's quite confusing to have a const function which calls a non-const function on an object that this element has ownership over. What do you think in this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But indeed we can add [[nodiscard]] regardless |
||
|
||
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
|
||
private: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very minor thing, which we can also do later: if you would move the calculation of the fluid pressures one line up, you could also pass it to
CalculateRelativePermeabilityValues
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do in the next PR