Skip to content

Conversation

@rfaasse
Copy link
Contributor

@rfaasse rfaasse commented Jan 28, 2026

📝 Description
This PR adds two calculators, the UPCouplingCalculator and the PUCouplingCalculator to calculate left and right hand side contributions regarding water $\leftrightarrow$ displacement coupling. Due to overlap in the two calculations, the PUCouplingCalculator re-uses the UPCouplingCalculator.

Note that no connection is made yet to an existing element (e.g. the interface element).

🆕 Changelog

  • Added two calculator classes, UPCouplingCalculator and PUCouplingCalculator
  • Added unit tests for both
  • Added documentation for calculators in general, as well as a more detailed description of these coupling calculators

@rfaasse rfaasse changed the title [GeoMechanicsApplication] Add coupling calculator component [GeoMechanicsApplication] Add coupling calculator components Jan 28, 2026
Comment on lines 27 to 34
InputProvider(std::function<const Matrix&()> GetNpContainer,
Geo::BMatricesGetter GetBMatrices,
std::function<Vector()> GetVoigtVector,
Geo::IntegrationCoefficientsGetter GetIntegrationCoefficients,
std::function<std::vector<double>()> GetBiotCoefficients,
std::function<std::vector<double>()> GetDegreesOfSaturation,
std::function<Vector()> GetNodalVelocities,
std::function<double()> GetVelocityCoefficient)
Copy link
Contributor Author

@rfaasse rfaasse Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to add the aliases for this provider later (but let me know if you think differently). I think we should also discuss if we'd like a new alias for every type of getter, or if we'd like more generic aliases (e.g. MatrixGetter instead of having different ones for BMatricesGetter and NpContainerGetter)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been struggling with the same. For std::function<std::vector> we have Geo::IntegrationCoefficientsGetter. Using that for other coefficients ( here Biot, DegreeOfSaturation, Bishop ) looks unnatural. We could change its name to CoefficientsGetter and use it throughout the providers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also looking at Annes comment, I think it's a good idea to leave it as is for this PR, and discuss it offline first

@rfaasse rfaasse marked this pull request as ready for review January 28, 2026 13:32
@rfaasse rfaasse requested a review from a team as a code owner January 28, 2026 13:32
@rfaasse rfaasse requested review from WPK4FEM and avdg81 January 28, 2026 13:33
@rfaasse rfaasse self-assigned this Jan 28, 2026
Copy link
Contributor

@WPK4FEM WPK4FEM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear Richard,
Thank you for making these coupling calculators available. A good step towards having a complete set of calculators for elements.
Please have an in depth look at the remarks about the velocity coefficient. It's use does not align with my expectation, I think it does not belong in the calculator and causes an incorrect RHS the way it's used. Try to prove that I'm wrong off course.
Regards, Wijtze Pieter

Comment on lines 27 to 34
InputProvider(std::function<const Matrix&()> GetNpContainer,
Geo::BMatricesGetter GetBMatrices,
std::function<Vector()> GetVoigtVector,
Geo::IntegrationCoefficientsGetter GetIntegrationCoefficients,
std::function<std::vector<double>()> GetBiotCoefficients,
std::function<std::vector<double>()> GetDegreesOfSaturation,
std::function<Vector()> GetNodalVelocities,
std::function<double()> GetVelocityCoefficient)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been struggling with the same. For std::function<std::vector> we have Geo::IntegrationCoefficientsGetter. Using that for other coefficients ( here Biot, DegreeOfSaturation, Bishop ) looks unnatural. We could change its name to CoefficientsGetter and use it throughout the providers.

Comment on lines +69 to +70
typename BaseType::LHSMatrixType coupling_contribution;
GeoTransportEquationUtilities::CalculateCouplingMatrix(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it impossible to use the version where the return value is the coupling matrix contribution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not out of the box because the template arguments there are the dimension and number of nodes i.s.o number of UDof and number of PwDof.

@rfaasse rfaasse requested a review from markelov208 January 29, 2026 09:15
Copy link
Contributor

@avdg81 avdg81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Richard,
I've mostly focused on the programming aspects of this PR rather than the actual calculation of the matrices and vectors. I feel that Wijtze Pieter has way more knowledge about that than me, and I've seen he has shared some ideas on how to more cleanly separate certain concepts. My suggestions and questions are all very minor, so please focus on the feedback given by Wijtze Pieter. Thanks.

Copy link
Contributor Author

@rfaasse rfaasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Processed the first batch of comments!

Comment on lines 27 to 34
InputProvider(std::function<const Matrix&()> GetNpContainer,
Geo::BMatricesGetter GetBMatrices,
std::function<Vector()> GetVoigtVector,
Geo::IntegrationCoefficientsGetter GetIntegrationCoefficients,
std::function<std::vector<double>()> GetBiotCoefficients,
std::function<std::vector<double>()> GetDegreesOfSaturation,
std::function<Vector()> GetNodalVelocities,
std::function<double()> GetVelocityCoefficient)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also looking at Annes comment, I think it's a good idea to leave it as is for this PR, and discuss it offline first

Comment on lines +69 to +70
typename BaseType::LHSMatrixType coupling_contribution;
GeoTransportEquationUtilities::CalculateCouplingMatrix(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not out of the box because the template arguments there are the dimension and number of nodes i.s.o number of UDof and number of PwDof.

@rfaasse rfaasse requested review from WPK4FEM and avdg81 January 29, 2026 13:38
Copy link
Contributor

@markelov208 markelov208 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Richard, thank you for implementing the calculators. I have a number of minor comments. Hope it is easy to comment them.

- The Voigt-vector
- The nodal water pressures

This data is provided via the `InputProvider` and enables the calculator to compute left-hand side contribution ($Q$ as defined before) and right-hand side contributions ($Q p$, in which $p$ is the vector of nodal water pressures).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should $Q p$ be $Q_p$?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$Qp$ should depict the matrix-vector product between the $Q$ matrix and the $p$ vector (the latter containing the nodal water pressures). Let me know if it's clear enough like this, or if you'd like me to add some clarification to the doc!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the clarification. I think adding something like '(matrix-vector product $Qp$, where $p$ is the vector of ,,,)' would be perfect,

WPK4FEM
WPK4FEM previously approved these changes Jan 29, 2026
Copy link
Contributor

@WPK4FEM WPK4FEM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear Richard,
Thank you for adding the coupling calculators, lets use them in our elements.
For me it's good to go.
Wijtze Pieter

Copy link
Contributor Author

@rfaasse rfaasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you all for the reviews, processed the comments 👍

@rfaasse rfaasse requested a review from markelov208 January 29, 2026 15:36
Copy link
Contributor

@avdg81 avdg81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for processing the review suggestions. For me this PR is good to go.

@rfaasse rfaasse enabled auto-merge (squash) January 29, 2026 16:12
Copy link
Contributor

@markelov208 markelov208 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Richard, thank you for clarifications and changes. There is still comment on Qp but it is not blocking.

@rfaasse rfaasse merged commit b2cb83f into master Jan 29, 2026
10 checks passed
@rfaasse rfaasse deleted the geo/14020-add-coupling-calculator branch January 29, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GeoMechanicsApplication] Calculator for the U Pw coupling term contributions

5 participants