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.

@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.

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.

The velocity coefficient is more part of the time integration scheme than of the fill in of the matrix. I wonder if we can keep it outside the calculator.


typename BaseType::RHSVectorType RHSContribution() override
{
return prod(CalculateCouplingMatrix(), mInputProvider.GetNodalVelocities());
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the velocity coefficient should not be part of the RHS computation. Here it is because it is included in CalculateCouplingMatrix.

const auto biot_coefficients = mInputProvider.GetBiotCoefficients();
const auto bishop_coefficients = mInputProvider.GetBishopCoefficients();
const auto np_container = mInputProvider.GetNpContainer();
for (std::size_t i = 0; i < mInputProvider.GetBMatrices().size(); ++i) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We are looping over integration points here. There should be as many integration_coefficients as B matrices, Biot coefficients, Bishop coefficients and shape function values in the NpContainer. For me the loop control reads more naturally as:

Suggested change
for (std::size_t i = 0; i < mInputProvider.GetBMatrices().size(); ++i) {
for ( auto i = std::size_t{0}; i < mInputProvider.GetIntegrationCoefficients().size(); ++i) {

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?

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

3 participants