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

refactor: cleanup setMGRStrategy a bit #3386

Merged
merged 13 commits into from
Oct 31, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,34 @@

void SolidMechanicsEmbeddedFractures::postInputInitialization()
{
SolidMechanicsLagrangianFEM::postInputInitialization();

LinearSolverParameters & linParams = m_linearSolverParameters.get();
ContactSolverBase::postInputInitialization();

Check warning on line 67 in src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp#L67

Added line #L67 was not covered by tests

if( m_useStaticCondensation )
{
linParams.dofsPerNode = 3;
linParams.isSymmetric = true;
linParams.amg.separateComponents = true;
// configure AMG
LinearSolverParameters & linearSolverParameters = m_linearSolverParameters.get();
linearSolverParameters.dofsPerNode = 3;
linearSolverParameters.isSymmetric = true;
linearSolverParameters.amg.separateComponents = true;

Check warning on line 75 in src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp#L72-L75

Added lines #L72 - L75 were not covered by tests
}
else
{
linParams.mgr.strategy = LinearSolverParameters::MGR::StrategyType::solidMechanicsEmbeddedFractures;
setMGRStrategy();

Check warning on line 79 in src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp#L79

Added line #L79 was not covered by tests
}
}

void SolidMechanicsEmbeddedFractures::setMGRStrategy()

Check warning on line 83 in src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp#L83

Added line #L83 was not covered by tests
{
LinearSolverParameters & linearSolverParameters = m_linearSolverParameters.get();

Check warning on line 85 in src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp#L85

Added line #L85 was not covered by tests

if( linearSolverParameters.preconditionerType != LinearSolverParameters::PreconditionerType::mgr )
return;

Check warning on line 88 in src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp#L87-L88

Added lines #L87 - L88 were not covered by tests

linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::solidMechanicsEmbeddedFractures;
GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(),

Check warning on line 91 in src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp#L90-L91

Added lines #L90 - L91 were not covered by tests
EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy )));
}

void SolidMechanicsEmbeddedFractures::registerDataOnMesh( dataRepository::Group & meshBodies )
{
ContactSolverBase::registerDataOnMesh( meshBodies );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ class SolidMechanicsEmbeddedFractures : public ContactSolverBase

virtual void postInputInitialization() override final;

void setMGRStrategy();

private:

void updateJump( DofManager const & dofManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,27 @@
setDescription( "It be used to increase the scale of the stabilization entries. A value < 1.0 results in larger entries in the stabilization matrix." );

addLogLevel< logInfo::Configuration >();
}

Check warning on line 76 in src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp#L76

Added line #L76 was not covered by tests

void SolidMechanicsLagrangeContact::postInputInitialization()

Check warning on line 78 in src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp#L78

Added line #L78 was not covered by tests
{
ContactSolverBase::postInputInitialization();

Check warning on line 80 in src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp#L80

Added line #L80 was not covered by tests

setMGRStrategy();
}

Check warning on line 83 in src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp#L82-L83

Added lines #L82 - L83 were not covered by tests

void SolidMechanicsLagrangeContact::setMGRStrategy()

Check warning on line 85 in src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp#L85

Added line #L85 was not covered by tests
{
LinearSolverParameters & linearSolverParameters = m_linearSolverParameters.get();

Check warning on line 87 in src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp#L87

Added line #L87 was not covered by tests

if( linearSolverParameters.preconditionerType != LinearSolverParameters::PreconditionerType::mgr )
return;

Check warning on line 90 in src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp#L89-L90

Added lines #L89 - L90 were not covered by tests

LinearSolverParameters & linSolParams = m_linearSolverParameters.get();
linSolParams.mgr.strategy = LinearSolverParameters::MGR::StrategyType::lagrangianContactMechanics;
linSolParams.mgr.separateComponents = true;
linSolParams.mgr.displacementFieldName = solidMechanics::totalDisplacement::key();
linSolParams.dofsPerNode = 3;
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::lagrangianContactMechanics;
GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(),

Check warning on line 93 in src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp#L92-L93

Added lines #L92 - L93 were not covered by tests
EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy )));
linearSolverParameters.mgr.separateComponents = true;
linearSolverParameters.mgr.displacementFieldName = solidMechanics::totalDisplacement::key();

Check warning on line 96 in src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp#L95-L96

Added lines #L95 - L96 were not covered by tests
}

void SolidMechanicsLagrangeContact::registerDataOnMesh( Group & meshBodies )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class NumericalMethodsManager;
class SolidMechanicsLagrangeContact : public ContactSolverBase
{
public:

SolidMechanicsLagrangeContact( const string & name,
Group * const parent );

Expand Down Expand Up @@ -179,6 +178,10 @@ class SolidMechanicsLagrangeContact : public ContactSolverBase
DofManager const & dofManager,
arrayView1d< real64 const > const & localRhs );

virtual void postInputInitialization() override final;

void setMGRStrategy();

private:
string m_stabilizationName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,33 +75,47 @@
CompositionalMultiphaseReservoirAndWells<>::
setMGRStrategy()
{
if( flowSolver()->getLinearSolverParameters().mgr.strategy == LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseHybridFVM )
LinearSolverParameters & linearSolverParameters = m_linearSolverParameters.get();

if( linearSolverParameters.preconditionerType != LinearSolverParameters::PreconditionerType::mgr )
return;

if( dynamic_cast< CompositionalMultiphaseHybridFVM * >( flowSolver() ) )

Check warning on line 83 in src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp#L83

Added line #L83 was not covered by tests
{
// add Reservoir
m_linearSolverParameters.get().mgr.strategy = LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseReservoirHybridFVM;
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseReservoirHybridFVM;

Check warning on line 86 in src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp#L86

Added line #L86 was not covered by tests
}
else
{
// add Reservoir
m_linearSolverParameters.get().mgr.strategy = LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseReservoirFVM;
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseReservoirFVM;

Check warning on line 91 in src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp#L91

Added line #L91 was not covered by tests
}
GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(),

Check warning on line 93 in src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp#L93

Added line #L93 was not covered by tests
EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy )));
}

template<>
void
CompositionalMultiphaseReservoirAndWells< MultiphasePoromechanics<> >::
setMGRStrategy()
{
LinearSolverParameters & linearSolverParameters = m_linearSolverParameters.get();

Check warning on line 102 in src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp#L102

Added line #L102 was not covered by tests

if( linearSolverParameters.preconditionerType != LinearSolverParameters::PreconditionerType::mgr )
return;

Check warning on line 105 in src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp#L104-L105

Added lines #L104 - L105 were not covered by tests

// flow solver here is indeed flow solver, not poromechanics solver
if( flowSolver()->getLinearSolverParameters().mgr.strategy == LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseHybridFVM )
if( dynamic_cast< CompositionalMultiphaseHybridFVM * >( flowSolver() ) )

Check warning on line 108 in src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp#L108

Added line #L108 was not covered by tests
{
GEOS_ERROR( "The poromechanics MGR strategy for hybrid FVM is not implemented" );
}
else
{
// add Reservoir
m_linearSolverParameters.get().mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanicsReservoirFVM;
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanicsReservoirFVM;

Check warning on line 115 in src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp#L115

Added line #L115 was not covered by tests
}
GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(),

Check warning on line 117 in src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp#L117

Added line #L117 was not covered by tests
EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy )));
}

template< typename RESERVOIR_SOLVER >
Expand All @@ -123,15 +137,6 @@
InputError );
}

template< typename RESERVOIR_SOLVER >
void
CompositionalMultiphaseReservoirAndWells< RESERVOIR_SOLVER >::
initializePostInitialConditionsPreSubGroups()
{
Base::initializePostInitialConditionsPreSubGroups();
setMGRStrategy();
}

template< typename RESERVOIR_SOLVER >
void
CompositionalMultiphaseReservoirAndWells< RESERVOIR_SOLVER >::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,12 @@ class CompositionalMultiphaseReservoirAndWells : public CoupledReservoirAndWells

virtual void initializePreSubGroups() override;

virtual void initializePostInitialConditionsPreSubGroups() override;
virtual void setMGRStrategy() override;

private:

CompositionalMultiphaseBase * flowSolver() const;

void setMGRStrategy();

};

} /* namespace geos */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,18 @@
// Validate well perforations: Ensure that each perforation is in a region targeted by the solver
if( !validateWellPerforations( domain ))
{
return;
GEOS_ERROR( GEOS_FMT( "{}: well perforations validation failed, bad perforations found", this->getName()));

Check warning on line 204 in src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp#L204

Added line #L204 was not covered by tests
}
}

virtual void
postInputInitialization() override
{
Base::postInputInitialization();

setMGRStrategy();
}

virtual void
implicitStepSetup( real64 const & time_n,
real64 const & dt,
Expand Down Expand Up @@ -298,6 +306,12 @@
DofManager const & dofManager,
SparsityPatternView< globalIndex > const & pattern ) const = 0;

virtual void setMGRStrategy()

Check warning on line 309 in src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp#L309

Added line #L309 was not covered by tests
{
if( this->m_linearSolverParameters.get().preconditionerType == LinearSolverParameters::PreconditionerType::mgr )
GEOS_ERROR( GEOS_FMT( "{}: MGR strategy is not implemented for {}", this->getName(), this->getCatalogName()));
}

Check warning on line 313 in src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp#L311-L313

Added lines #L311 - L313 were not covered by tests

/// Flag to determine whether the well transmissibility needs to be computed
bool m_isWellTransmissibilityComputed;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,22 @@
setDescription( "Flag to determine whether or not to apply lagging update for the fracture stencil weights. " );

m_numResolves[0] = 0;
}

Check warning on line 83 in src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp#L83

Added line #L83 was not covered by tests

// This may need to be different depending on whether poroelasticity is on or not.
m_linearSolverParameters.get().mgr.strategy = LinearSolverParameters::MGR::StrategyType::hydrofracture;
m_linearSolverParameters.get().mgr.separateComponents = false;
m_linearSolverParameters.get().mgr.displacementFieldName = solidMechanics::totalDisplacement::key();
m_linearSolverParameters.get().dofsPerNode = 3;
template< typename POROMECHANICS_SOLVER >
void HydrofractureSolver< POROMECHANICS_SOLVER >::setMGRStrategy()

Check warning on line 86 in src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp#L86

Added line #L86 was not covered by tests
{
LinearSolverParameters & linearSolverParameters = this->m_linearSolverParameters.get();

Check warning on line 88 in src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp#L88

Added line #L88 was not covered by tests

if( linearSolverParameters.preconditionerType != LinearSolverParameters::PreconditionerType::mgr )
return;

Check warning on line 91 in src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp#L90-L91

Added lines #L90 - L91 were not covered by tests

// This may need to be different depending on whether poroelasticity is on or not.
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::hydrofracture;
GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", this->getName(),

Check warning on line 95 in src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp#L94-L95

Added lines #L94 - L95 were not covered by tests
EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy )));
linearSolverParameters.mgr.separateComponents = false;
linearSolverParameters.mgr.displacementFieldName = solidMechanics::totalDisplacement::key();

Check warning on line 98 in src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp#L97-L98

Added lines #L97 - L98 were not covered by tests
}

template< typename POROMECHANICS_SOLVER >
Expand Down Expand Up @@ -157,6 +166,8 @@
{
Base::postInputInitialization();

setMGRStrategy();

Check warning on line 169 in src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp#L169

Added line #L169 was not covered by tests

static const std::set< integer > binaryOptions = { 0, 1 };
GEOS_ERROR_IF( binaryOptions.count( m_isMatrixPoroelastic ) == 0, viewKeyStruct::isMatrixPoroelasticString() << " option can be either 0 (false) or 1 (true)" );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ class HydrofractureSolver : public POROMECHANICS_SOLVER
DofManager const & dofManager,
CRSMatrix< real64, globalIndex > & localMatrix );

virtual void setMGRStrategy() override;

private:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,15 @@
MultiphasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::MultiphasePoromechanics( const string & name,
Group * const parent )
: Base( name, parent )
{
LinearSolverParameters & linearSolverParameters = this->m_linearSolverParameters.get();
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanics;
linearSolverParameters.mgr.separateComponents = true;
linearSolverParameters.mgr.displacementFieldName = solidMechanics::totalDisplacement::key();
linearSolverParameters.dofsPerNode = 3;
}
{}

Check warning on line 48 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L48

Added line #L48 was not covered by tests

template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
void MultiphasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::postInputInitialization()
{
Base::postInputInitialization();

setMGRStrategy();

Check warning on line 55 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L55

Added line #L55 was not covered by tests

GEOS_ERROR_IF( this->flowSolver()->getCatalogName() == "CompositionalMultiphaseReservoir" &&
this->getNonlinearSolverParameters().couplingType() != NonlinearSolverParameters::CouplingType::Sequential,
GEOS_FMT( "{}: {} solver is only designed to work for {} = {}",
Expand Down Expand Up @@ -276,11 +272,28 @@
getCatalogName(), this->getDataContext(), poromechanicsTargetRegionNames[i], this->flowSolver()->getDataContext() ),
InputError );
}
}

Check warning on line 275 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L275

Added line #L275 was not covered by tests

template<>
void MultiphasePoromechanics<>::setMGRStrategy()

Check warning on line 278 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L278

Added line #L278 was not covered by tests
{
LinearSolverParameters & linearSolverParameters = this->m_linearSolverParameters.get();

Check warning on line 280 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L280

Added line #L280 was not covered by tests

if( linearSolverParameters.preconditionerType != LinearSolverParameters::PreconditionerType::mgr )
return;

Check warning on line 283 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L282-L283

Added lines #L282 - L283 were not covered by tests

if( this->m_isThermal )
{
this->m_linearSolverParameters.get().mgr.strategy = LinearSolverParameters::MGR::StrategyType::thermalMultiphasePoromechanics;
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::thermalMultiphasePoromechanics;

Check warning on line 287 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L287

Added line #L287 was not covered by tests
}
else
{
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanics;

Check warning on line 291 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L291

Added line #L291 was not covered by tests
}
GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(),

Check warning on line 293 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L293

Added line #L293 was not covered by tests
EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy )));
linearSolverParameters.mgr.separateComponents = true;
linearSolverParameters.mgr.displacementFieldName = solidMechanics::totalDisplacement::key();

Check warning on line 296 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L295-L296

Added lines #L295 - L296 were not covered by tests
}

template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@

virtual void initializePostInitialConditionsPreSubGroups() override;


virtual void setMGRStrategy()

Check warning on line 112 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.hpp#L112

Added line #L112 was not covered by tests
{
if( this->m_linearSolverParameters.get().preconditionerType == LinearSolverParameters::PreconditionerType::mgr )
GEOS_ERROR( GEOS_FMT( "{}: MGR strategy is not implemented for {}", this->getName(), this->getCatalogName()));
}

Check warning on line 116 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.hpp#L114-L116

Added lines #L114 - L116 were not covered by tests

private:

Expand All @@ -131,7 +135,6 @@
real64 const dt,
PARAMS && ... params );


};

template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,15 @@
SinglePhasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::SinglePhasePoromechanics( const string & name,
Group * const parent )
: Base( name, parent )
{
LinearSolverParameters & linearSolverParameters = this->m_linearSolverParameters.get();
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanics;
linearSolverParameters.mgr.separateComponents = true;
linearSolverParameters.mgr.displacementFieldName = solidMechanics::totalDisplacement::key();
linearSolverParameters.dofsPerNode = 3;
}
{}

Check warning on line 48 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L48

Added line #L48 was not covered by tests

template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
void SinglePhasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::postInputInitialization()
{
Base::postInputInitialization();

setMGRStrategy();

Check warning on line 55 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L55

Added line #L55 was not covered by tests

GEOS_ERROR_IF( this->flowSolver()->getCatalogName() == "SinglePhaseReservoir" &&
this->getNonlinearSolverParameters().couplingType() != NonlinearSolverParameters::CouplingType::Sequential,
GEOS_FMT( "{}: {} solver is only designed to work for {} = {}",
Expand Down Expand Up @@ -114,18 +110,33 @@
getCatalogName(), this->getDataContext(), poromechanicsTargetRegionNames[i], this->flowSolver()->getDataContext() ),
InputError );
}
}

Check warning on line 113 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L113

Added line #L113 was not covered by tests

template<>
void SinglePhasePoromechanics<>::setMGRStrategy()

Check warning on line 116 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L116

Added line #L116 was not covered by tests
{
LinearSolverParameters & linearSolverParameters = this->m_linearSolverParameters.get();

Check warning on line 118 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L118

Added line #L118 was not covered by tests

if( linearSolverParameters.preconditionerType != LinearSolverParameters::PreconditionerType::mgr )
return;

Check warning on line 121 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L120-L121

Added lines #L120 - L121 were not covered by tests

if( this->m_isThermal )
{
this->m_linearSolverParameters.get().mgr.strategy = LinearSolverParameters::MGR::StrategyType::thermalSinglePhasePoromechanics;
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::thermalSinglePhasePoromechanics;

Check warning on line 125 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L125

Added line #L125 was not covered by tests
}
else
{
if( this->flowSolver()->getLinearSolverParameters().mgr.strategy == LinearSolverParameters::MGR::StrategyType::singlePhaseHybridFVM )
{
this->m_linearSolverParameters.get().mgr.strategy = LinearSolverParameters::MGR::StrategyType::hybridSinglePhasePoromechanics;
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::hybridSinglePhasePoromechanics;

Check warning on line 131 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L131

Added line #L131 was not covered by tests
}
else
{
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanics;

Check warning on line 135 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L135

Added line #L135 was not covered by tests
}
}
linearSolverParameters.mgr.separateComponents = true;
linearSolverParameters.mgr.displacementFieldName = solidMechanics::totalDisplacement::key();

Check warning on line 139 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L138-L139

Added lines #L138 - L139 were not covered by tests
}

template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
Expand Down
Loading
Loading