-
Notifications
You must be signed in to change notification settings - Fork 247
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 SetConstitutiveParameters function #12382
Changes from 8 commits
d3e8619
69ed65c
ac78a56
5afd2b5
da7efa4
4fc57b8
a4cec35
14bcb8a
0e75b3c
7717dc0
ce42098
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
|
||
// Application includes | ||
#include "custom_elements/U_Pw_small_strain_element.hpp" | ||
#include "custom_utilities/constitutive_law_utilities.hpp" | ||
#include "custom_utilities/equation_of_motion_utilities.h" | ||
#include "custom_utilities/math_utilities.h" | ||
#include "custom_utilities/transport_equation_utilities.hpp" | ||
|
@@ -169,8 +170,9 @@ void UPwSmallStrainElement<TDim, TNumNodes>::InitializeSolutionStep(const Proces | |
Variables.detF = determinants_of_deformation_gradients[GPoint]; | ||
Variables.StrainVector = strain_vectors[GPoint]; | ||
|
||
// Set Gauss points variables to constitutive law parameters | ||
this->SetConstitutiveParameters(Variables, ConstitutiveParameters); | ||
ConstitutiveLawUtilities::SetConstitutiveParameters( | ||
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 call we need to retain, because the constitutive matrix was not calculated before the loop 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. Thanks. |
||
ConstitutiveParameters, Variables.StrainVector, Variables.ConstitutiveMatrix, | ||
Variables.Np, Variables.GradNpT, Variables.F, Variables.detF); | ||
|
||
// Initialize constitutive law | ||
noalias(Variables.StressVector) = mStressVector[GPoint]; | ||
|
@@ -268,6 +270,9 @@ void UPwSmallStrainElement<TDim, TNumNodes>::InitializeNonLinearIteration(const | |
this->CalculateAnyOfMaterialResponse(deformation_gradients, ConstitutiveParameters, | ||
Variables.NContainer, Variables.DN_DXContainer, | ||
strain_vectors, mStressVector, constitutive_matrices); | ||
ConstitutiveLawUtilities::SetConstitutiveParameters( | ||
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 we can also remove, because we already called 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. removed |
||
ConstitutiveParameters, Variables.StrainVector, Variables.ConstitutiveMatrix, | ||
Variables.Np, Variables.GradNpT, Variables.F, Variables.detF); | ||
|
||
KRATOS_CATCH("") | ||
} | ||
|
@@ -321,8 +326,9 @@ void UPwSmallStrainElement<TDim, TNumNodes>::FinalizeSolutionStep(const ProcessI | |
Variables.detF = determinants_of_deformation_gradients[GPoint]; | ||
Variables.StrainVector = strain_vectors[GPoint]; | ||
|
||
// Set Gauss points variables to constitutive law parameters | ||
this->SetConstitutiveParameters(Variables, ConstitutiveParameters); | ||
ConstitutiveLawUtilities::SetConstitutiveParameters( | ||
ConstitutiveParameters, Variables.StrainVector, Variables.ConstitutiveMatrix, | ||
Variables.Np, Variables.GradNpT, Variables.F, Variables.detF); | ||
|
||
// Compute constitutive tensor and/or stresses | ||
noalias(Variables.StressVector) = mStressVector[GPoint]; | ||
|
@@ -586,6 +592,9 @@ void UPwSmallStrainElement<TDim, TNumNodes>::CalculateOnIntegrationPoints(const | |
this->CalculateAnyOfMaterialResponse(deformation_gradients, ConstitutiveParameters, | ||
Variables.NContainer, Variables.DN_DXContainer, | ||
strain_vectors, mStressVector, constitutive_matrices); | ||
ConstitutiveLawUtilities::SetConstitutiveParameters( | ||
ConstitutiveParameters, Variables.StrainVector, Variables.ConstitutiveMatrix, | ||
Variables.Np, Variables.GradNpT, Variables.F, Variables.detF); | ||
|
||
std::transform(constitutive_matrices.begin(), constitutive_matrices.end(), rOutput.begin(), | ||
[variable_index](const Matrix& constitutive_matrix) { | ||
|
@@ -708,6 +717,9 @@ void UPwSmallStrainElement<TDim, TNumNodes>::CalculateOnIntegrationPoints(const | |
Variables.F = deformation_gradients[GPoint]; | ||
Variables.StrainVector = strain_vectors[GPoint]; | ||
Variables.ConstitutiveMatrix = constitutive_matrices[GPoint]; | ||
ConstitutiveLawUtilities::SetConstitutiveParameters( | ||
ConstitutiveParameters, Variables.StrainVector, Variables.ConstitutiveMatrix, | ||
Variables.Np, Variables.GradNpT, Variables.F, Variables.detF); | ||
|
||
Variables.BiotCoefficient = CalculateBiotCoefficient(Variables, hasBiotCoefficient); | ||
|
||
|
@@ -875,6 +887,9 @@ void UPwSmallStrainElement<TDim, TNumNodes>::CalculateMaterialStiffnessMatrix(Ma | |
Variables.F = deformation_gradients[GPoint]; | ||
Variables.StrainVector = strain_vectors[GPoint]; | ||
Variables.ConstitutiveMatrix = constitutive_matrices[GPoint]; | ||
ConstitutiveLawUtilities::SetConstitutiveParameters( | ||
ConstitutiveParameters, Variables.StrainVector, Variables.ConstitutiveMatrix, | ||
Variables.Np, Variables.GradNpT, Variables.F, Variables.detF); | ||
|
||
// Compute weighting coefficient for integration | ||
Variables.IntegrationCoefficient = | ||
|
@@ -995,6 +1010,9 @@ void UPwSmallStrainElement<TDim, TNumNodes>::CalculateAll(MatrixType& rLe | |
Variables.F = deformation_gradients[GPoint]; | ||
Variables.StrainVector = strain_vectors[GPoint]; | ||
Variables.ConstitutiveMatrix = constitutive_matrices[GPoint]; | ||
ConstitutiveLawUtilities::SetConstitutiveParameters( | ||
ConstitutiveParameters, Variables.StrainVector, Variables.ConstitutiveMatrix, | ||
Variables.Np, Variables.GradNpT, Variables.F, Variables.detF); | ||
|
||
// Compute Nu and BodyAcceleration | ||
GeoElementUtilities::CalculateNuMatrix<TDim, TNumNodes>(Variables.Nu, Variables.NContainer, GPoint); | ||
|
@@ -1660,22 +1678,6 @@ void UPwSmallStrainElement<TDim, TNumNodes>::CalculateKinematics(ElementVariable | |
KRATOS_CATCH("") | ||
} | ||
|
||
template <unsigned int TDim, unsigned int TNumNodes> | ||
void UPwSmallStrainElement<TDim, TNumNodes>::SetConstitutiveParameters(ElementVariables& rVariables, | ||
ConstitutiveLaw::Parameters& rConstitutiveParameters) | ||
{ | ||
KRATOS_TRY | ||
|
||
rConstitutiveParameters.SetStrainVector(rVariables.StrainVector); | ||
rConstitutiveParameters.SetConstitutiveMatrix(rVariables.ConstitutiveMatrix); | ||
rConstitutiveParameters.SetShapeFunctionsValues(rVariables.Np); | ||
rConstitutiveParameters.SetShapeFunctionsDerivatives(rVariables.GradNpT); | ||
rConstitutiveParameters.SetDeformationGradientF(rVariables.F); | ||
rConstitutiveParameters.SetDeterminantF(rVariables.detF); | ||
|
||
KRATOS_CATCH("") | ||
} | ||
|
||
template <unsigned int TDim, unsigned int TNumNodes> | ||
void UPwSmallStrainElement<TDim, TNumNodes>::CalculateRetentionResponse(ElementVariables& rVariables, | ||
RetentionLaw::Parameters& rRetentionParameters, | ||
|
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.
This function call is no longer necessary, since the constitutive matrices are already calculated (they are only retrieved here from the vector). I think there will be only a few places left now after the changes of the PR for the lists of constitutive matrices. Basically everywhere we retrieve the Constitutive Matrix from a list (i.e.
Variables.ConstitutiveMatrix = constitutive_matrices[GPoint];
) we don't need this call anymore. I think it will be there in ~3 places for diff order and ~3 places for non-diff order.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.
Thank you. Removed in many places. But not all calls. ;)