-
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 stiffness matrix utility #12388
[GeoMechanicsApplication] extract stiffness matrix utility #12388
Conversation
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.
Thanks for extracting the calculation of the stiffness matrix to a utility function. It is a bit unfortunate that we still need to have this calculation at two levels: element level (final goal) and integration point level. However, after examining your code I understand why that is needed. As far as I can see this was the best you could do for now (considering that we'd like to keep PRs small enough to be manageable), so well done! What I like in particular is that some duplication has been removed. Much better! I only have a few minor remarks, nothing major or blocking.
|
||
// Distribute stiffness block matrix into the elemental matrix | ||
GeoElementUtilities::AssembleUUBlockMatrix(rLeftHandSideMatrix, rVariables.UUMatrix); | ||
Matrix stiffness_matrix = GeoEquationOfMotionUtilities::CalculateStiffnessMatrixGPoint( |
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.
Matrix stiffness_matrix = GeoEquationOfMotionUtilities::CalculateStiffnessMatrixGPoint( | |
const auto stiffness_matrix = GeoEquationOfMotionUtilities::CalculateStiffnessMatrixGPoint( |
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.
changed.
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.
The comment at line 1334 no longer makes sense. Please remove it.
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.
removed
Matrix StiffnessMatrix = | ||
prod(trans(rVariables.B), Matrix(prod(rVariables.ConstitutiveMatrix, rVariables.B))) * | ||
rVariables.IntegrationCoefficient; | ||
Matrix stiffness_matrix = GeoEquationOfMotionUtilities::CalculateStiffnessMatrixGPoint( |
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.
Matrix stiffness_matrix = GeoEquationOfMotionUtilities::CalculateStiffnessMatrixGPoint( | |
const auto stiffness_matrix = GeoEquationOfMotionUtilities::CalculateStiffnessMatrixGPoint( |
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.
changed
prod(trans(rVariables.B), Matrix(prod(rVariables.ConstitutiveMatrix, rVariables.B))) * | ||
rVariables.IntegrationCoefficient; | ||
Matrix stiffness_matrix = GeoEquationOfMotionUtilities::CalculateStiffnessMatrixGPoint( | ||
rVariables.B, rVariables.ConstitutiveMatrix, rVariables.IntegrationCoefficient); | ||
|
||
// Distribute stiffness block matrix into the elemental matrix |
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.
Also here, you could remove this redundant comment (like you did for the small strain element).
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.
deleted
- CalculateMassMatrix function | ||
- CalculateStiffnessMatrixGPoint provides a stiffness matrix for a specific integration point | ||
- CalculateStiffnessMatrix provides a stiffness matrix for all integration points |
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.
Perhaps rephrase this, to emphasize that this function works on element level?
- CalculateStiffnessMatrix provides a stiffness matrix for all integration points | |
- CalculateStiffnessMatrix provides a stiffness matrix for an element |
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.
Actually, it was my first option but then I made it like others. ;( Changed.
static Matrix CalculateStiffnessMatrix(const std::vector<Matrix>& b_matrices, | ||
const std::vector<Matrix>& constitutive_matrices, | ||
const std::vector<double>& integration_coefficients); |
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.
To comply with the KratosStyle Guide, we need to rename the parameters as follows:
static Matrix CalculateStiffnessMatrix(const std::vector<Matrix>& b_matrices, | |
const std::vector<Matrix>& constitutive_matrices, | |
const std::vector<double>& integration_coefficients); | |
static Matrix CalculateStiffnessMatrix(const std::vector<Matrix>& rBMatrices, | |
const std::vector<Matrix>& rConstitutiveMatrices, | |
const std::vector<double>& rIntegrationCoefficients); |
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.
Opps.
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.
Anne, many thanks for the sharp eyes. ;)
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.
removed
|
||
// Distribute stiffness block matrix into the elemental matrix | ||
GeoElementUtilities::AssembleUUBlockMatrix(rLeftHandSideMatrix, rVariables.UUMatrix); | ||
Matrix stiffness_matrix = GeoEquationOfMotionUtilities::CalculateStiffnessMatrixGPoint( |
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.
changed.
Matrix StiffnessMatrix = | ||
prod(trans(rVariables.B), Matrix(prod(rVariables.ConstitutiveMatrix, rVariables.B))) * | ||
rVariables.IntegrationCoefficient; | ||
Matrix stiffness_matrix = GeoEquationOfMotionUtilities::CalculateStiffnessMatrixGPoint( |
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.
changed
prod(trans(rVariables.B), Matrix(prod(rVariables.ConstitutiveMatrix, rVariables.B))) * | ||
rVariables.IntegrationCoefficient; | ||
Matrix stiffness_matrix = GeoEquationOfMotionUtilities::CalculateStiffnessMatrixGPoint( | ||
rVariables.B, rVariables.ConstitutiveMatrix, rVariables.IntegrationCoefficient); | ||
|
||
// Distribute stiffness block matrix into the elemental matrix |
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.
deleted
- CalculateMassMatrix function | ||
- CalculateStiffnessMatrixGPoint provides a stiffness matrix for a specific integration point | ||
- CalculateStiffnessMatrix provides a stiffness matrix for all integration points |
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.
Actually, it was my first option but then I made it like others. ;( Changed.
static Matrix CalculateStiffnessMatrix(const std::vector<Matrix>& b_matrices, | ||
const std::vector<Matrix>& constitutive_matrices, | ||
const std::vector<double>& integration_coefficients); |
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.
Opps.
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.
I think this one is ready to go.
📝 Description