Skip to content
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

feat: MGR Strategy for ALM - Face Bubble Functions for Wedge Elements - Multipoint Integration Rules for Tetrahedra and Triangles #3395

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

matteofrigo5
Copy link
Contributor

@matteofrigo5 matteofrigo5 commented Oct 11, 2024

This PR introduces the following enhancements:

  • - Two solving strategies for ALM: one utilizing MGR and the other employing AMG on the full system.
  • - Implementation of face bubble functions for wedge elements.
  • - An optional feature to utilize Multipoint Integration Rules for both tetrahedra and triangles.

@matteofrigo5 matteofrigo5 self-assigned this Oct 11, 2024
@matteofrigo5 matteofrigo5 added type: feature New feature or request flag: no rebaseline Does not require rebaseline labels Oct 11, 2024
@matteofrigo5 matteofrigo5 changed the title feat: linear solving strategy for ALM and face bubble functions for wedge elements feat: MGR Strategy for ALM - Face Bubble Functions for Wedge Elements - Multipoint Integration Rules for Tetrahedra and Triangle Jan 9, 2025
@matteofrigo5 matteofrigo5 changed the title feat: MGR Strategy for ALM - Face Bubble Functions for Wedge Elements - Multipoint Integration Rules for Tetrahedra and Triangle feat: MGR Strategy for ALM - Face Bubble Functions for Wedge Elements - Multipoint Integration Rules for Tetrahedra and Triangles Jan 9, 2025
@matteofrigo5 matteofrigo5 added flag: ready for review flag: requires rebaseline Requires rebaseline branch in integratedTests and removed flag: no rebaseline Does not require rebaseline labels Jan 9, 2025
Copy link
Member

@rrsettgast rrsettgast left a comment

Choose a reason for hiding this comment

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

just a few questions

tractionTrial[ 0 ] = traction[0] + penalty[0] * dispJump[0] * faceArea;
tractionTrial[ 1 ] = traction[1] + penalty[1] * (dispJump[1] - oldDispJump[1]) * faceArea;
tractionTrial[ 2 ] = traction[2] + penalty[1] * (dispJump[2] - oldDispJump[2]) * faceArea;
tractionTrial[ 0 ] = traction[0] + penalty[0] * dispJump[0];
Copy link
Member

Choose a reason for hiding this comment

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

so this "traction" is now a "traction"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is . Actually, it has always been a "traction". In the previous implementation, dispJump was multiplied by faceArea. Now that dispJump is as it should be, it is used in its original form.

@@ -134,7 +133,7 @@ class FrictionBaseUpdates
real64 ( & tractionNew )[3],
integer & fractureState ) const
{
GEOS_UNUSED_VAR( oldDispJump, dispJump, penalty, traction, faceArea, symmetric, fixedLimitTau,
GEOS_UNUSED_VAR( oldDispJump, dispJump, penalty, traction, symmetric, fixedLimitTau,
Copy link
Member

Choose a reason for hiding this comment

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

why is this function defined?

arraySlice1d< real64 > const & tractionNew ) const
{ GEOS_UNUSED_VAR( dispJump, deltaDispJump, penalty, traction, faceArea, tractionNew ); }
{ GEOS_UNUSED_VAR( dispJump, deltaDispJump, penalty, traction, tractionNew ); }
Copy link
Member

Choose a reason for hiding this comment

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

or this one? why not a pure virtual?

Copy link
Collaborator

Choose a reason for hiding this comment

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

because these are device functions. I am pretty sure that nvcc throws an error if we use a pure virtual. We do this a lot in our kernelWrapper objects (probably with the idea of getting nicer compilation errors) but, tbh, I start thinking that it would be better not to use virtual at all for these.

Comment on lines 68 to 72
#if TETRAHEDRON_QUADRATURE_POINTS == 14
constexpr static localIndex numQuadraturePoints = 14;
#elif TETRAHEDRON_QUADRATURE_POINTS == 5
constexpr static localIndex numQuadraturePoints = 5;
#elif TETRAHEDRON_QUADRATURE_POINTS == 1
Copy link
Member

Choose a reason for hiding this comment

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

This is pretty clunky. There should be separate class for the different integration rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. It was just a temporary implementation before discussing the creation of a separate class. Would you like to implement it in this PR, or should we open a specific one for this purpose?

Copy link
Member

Choose a reason for hiding this comment

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

We should redefine this class

template< int NUM_Q_POINTS >
class H1_Tetrahedron_Lagrange1_Gauss final : public FiniteElementBase
{
...
};


using H1_Tetrahedron_Lagrange1_Gauss1 = H1_Tetrahedron_Lagrange1_Gauss<1>;
...
using H1_Tetrahedron_Lagrange1_Gauss14 = H1_Tetrahedron_Lagrange1_Gauss<14>;

@@ -29,6 +29,8 @@ namespace geos
namespace finiteElement
{

#define TRIANGLE_QUADRATURE_POINTS 4
Copy link
Member

Choose a reason for hiding this comment

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

same comment here about a separate class.

WRITE_AND_READ,
"Slip" );

DECLARE_FIELD( tangentialTraction,
Copy link
Member

Choose a reason for hiding this comment

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

Are we storing a "traction" and a "tangentialTraction"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was just for output purposes. Having the absolute value of tangential traction is convenient without needing two separate tangential components.


constexpr static char const * iterativePenaltyTFacString() { return "iterPenaltyT"; }

constexpr static char const * tolJumpDispNFacString() { return "tolJumpN"; }
Copy link
Member

Choose a reason for hiding this comment

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

should these be dependent on the contact parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as the default values are concerned, I would say yes. However, it is convenient to have these tolerances to fine-tune the physics solver for the specific problem.


for( int i=0; i<numTdofs; ++i )
{
stack.tLocal[i] = m_traction( k, i );
stack.dispJumpLocal[i] = m_dispJump( k, i );
stack.oldDispJumpLocal[i] = m_oldDispJump( k, i );
stack.dispJumpLocal[i] = m_dispJump( k, i )*m_faceArea[k];
Copy link
Member

Choose a reason for hiding this comment

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

this seems odd to me that you would need to multiply by an area here.

dispJump[0] = stack.dispJumpLocal[0] * m_faceArea[k];
dispJump[1] = ( stack.dispJumpLocal[1] - stack.oldDispJumpLocal[1] ) * m_faceArea[k];
dispJump[2] = ( stack.dispJumpLocal[2] - stack.oldDispJumpLocal[2] ) * m_faceArea[k];
dispJump[0] = stack.dispJumpLocal[0];
Copy link
Member

Choose a reason for hiding this comment

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

and here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See comment below.

* | +__ \_ | s 2 0 1 0
* | /2 \__ \_ | / 3 0 0 1
* |/ \__\ | / ===== == == ==
* +------------+ *------r
* 0 1
*
*/
class H1_Tetrahedron_Lagrange1_Gauss1 final : public FiniteElementBase
template< int NUM_Q_POINTS >
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
template< int NUM_Q_POINTS >
template< typename NUM_Q_POINTS >

and then NUM_Q_POINTS::value to use it andH1_Tetrahedron_Lagrange1_Gauss< std::integral_constant< int, 1 > >

else
{
GEOS_UNUSED_VAR( q );
GEOS_ERROR( "NUM_Q_POINTS not available for this element type" );
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know if we need this. I guess ideally we would like it not to compile at all.

Copy link
Collaborator

@CusiniM CusiniM Jan 14, 2025

Choose a reason for hiding this comment

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

Maybe we can add at the top of the class:

static_assert(NUM_Q_POINTS::value == 1 || NUM_Q_POINTS::value == 5 |NUM_Q_POINTS::value == 14,
"NUM_Q_POINTS::value must be 1, 5, or 14!");

@matteofrigo5 matteofrigo5 added ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run code coverage enables running of the code coverage CI jobs labels Jan 15, 2025
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 19.17808% with 177 lines in your changes missing coverage. Please review.

Project coverage is 56.47%. Comparing base (8f9126c) to head (4f46983).

Files with missing lines Patch % Lines
...ntact/SolidMechanicsAugmentedLagrangianContact.cpp 0.00% 60 Missing ⚠️
...entFormulations/H1_Tetrahedron_Lagrange1_Gauss.hpp 44.89% 27 Missing ⚠️
.../elementFormulations/H1_Wedge_Lagrange1_Gauss6.hpp 0.00% 27 Missing ⚠️
...Strategies/AugmentedLagrangianContactMechanics.hpp 0.00% 15 Missing ⚠️
...t/kernels/SolidMechanicsALMSimultaneousKernels.hpp 0.00% 9 Missing ⚠️
...ntFormulations/H1_TriangleFace_Lagrange1_Gauss.hpp 65.21% 8 Missing ⚠️
...ntact/SolidMechanicsAugmentedLagrangianContact.hpp 0.00% 8 Missing ⚠️
...ents/finiteElement/FiniteElementDiscretization.cpp 36.36% 7 Missing ⚠️
...omponents/constitutive/contact/CoulombFriction.hpp 0.00% 6 Missing ⚠️
...onents/linearAlgebra/interfaces/hypre/HypreMGR.cpp 0.00% 3 Missing ⚠️
... and 5 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3395      +/-   ##
===========================================
- Coverage    56.53%   56.47%   -0.06%     
===========================================
  Files         1157     1158       +1     
  Lines       100617   100760     +143     
===========================================
+ Hits         56880    56909      +29     
- Misses       43737    43851     +114     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matteofrigo5 matteofrigo5 added ci: run integrated tests Allows to run the integrated tests in GEOS CI and removed flag: requires rebaseline Requires rebaseline branch in integratedTests labels Jan 15, 2025
registerWrapper( viewKeyStruct::useHighOrderQuadratureRuleString(), &m_useHighOrderQuadratureRule ).
setInputFlag( InputFlags::OPTIONAL ).
setApplyDefaultValue( 0 ).
setDescription( "Specifier to indicate whether to use a high order quadrature rule" );
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
setDescription( "Specifier to indicate whether to use a high order quadrature rule" );
setDescription( "Flag to indicate whether to use a high order quadrature rule or not." );

@matteofrigo5 matteofrigo5 added the flag: no rebaseline Does not require rebaseline label Jan 16, 2025
@matteofrigo5 matteofrigo5 added flag: requires rebaseline Requires rebaseline branch in integratedTests and removed flag: no rebaseline Does not require rebaseline labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: run code coverage enables running of the code coverage CI jobs ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: ready for review flag: requires rebaseline Requires rebaseline branch in integratedTests type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants