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

Pt/exp branch #3095

Closed
wants to merge 83 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
79b293c
this compiles
Mar 5, 2024
207212d
Merge branch 'develop' into fractures-wells-draft
paveltomin Mar 5, 2024
3fe3e96
Merge branch 'develop' into fractures-wells-draft
paveltomin Mar 12, 2024
0d04f8a
test case
Mar 13, 2024
bc06545
Merge branch 'develop' into fractures-wells-draft
paveltomin Mar 13, 2024
db2401e
wip
Mar 14, 2024
aaf0539
cleanup
Mar 15, 2024
7d28924
Update CoupledReservoirAndWellsBase.hpp
paveltomin Mar 15, 2024
de4b1bf
Update CoupledSolver.hpp
paveltomin Mar 15, 2024
a7193f2
simplify
Mar 15, 2024
73f6b21
Merge branch 'fractures-wells-draft' of https://github.com/GEOS-DEV/G…
Mar 15, 2024
8d1b40b
Delete inputFiles/poromechanicsFractures/PoroElastic_conformingFractu…
paveltomin Mar 15, 2024
94dec11
merge
Mar 15, 2024
914caf4
Merge branch 'fractures-wells-draft' of https://github.com/GEOS-DEV/G…
Mar 15, 2024
54cc129
catalogName
Mar 15, 2024
be2d4d9
Update MultiphasePoromechanics.cpp
paveltomin Mar 15, 2024
6d29251
Update PoromechanicsSolver.hpp
paveltomin Mar 15, 2024
ef39011
cleanup
Mar 15, 2024
1aea5c0
Merge branch 'develop' into fractures-wells-draft
paveltomin Mar 15, 2024
2737e29
merge
Mar 15, 2024
1c954e0
Merge branch 'develop' into fractures-wells-draft
paveltomin Mar 15, 2024
815e2e2
Merge branch 'fractures-wells-draft' of https://github.com/GEOS-DEV/G…
Mar 16, 2024
44a81b4
default template
Mar 16, 2024
dc6bf1c
Delete src/coreComponents/schema/docs/PermeabilityBase.rst
paveltomin Mar 16, 2024
0a8af2c
Delete src/coreComponents/schema/docs/PermeabilityBase_other.rst
paveltomin Mar 16, 2024
3531adf
Merge branch 'develop' into fractures-wells-draft
paveltomin Mar 18, 2024
452f7a0
small fix
Mar 18, 2024
550fe07
revert
paveltomin Mar 18, 2024
f72da12
Merge branch 'develop' into pt/hypre-fix-contact
paveltomin Mar 19, 2024
c81fd8d
Merge branch 'develop' of https://github.com/GEOS-DEV/GEOS into develop
Mar 20, 2024
258e5dc
do not set to 0
Mar 20, 2024
b5c7439
try this
Mar 20, 2024
a6e7954
Merge branch 'develop' into pt/contact-exp
paveltomin Mar 20, 2024
8704805
Merge branch 'develop' into fractures-wells-draft
paveltomin Mar 20, 2024
79da7e9
Merge branch 'develop' into pt/contact-exp
paveltomin Mar 20, 2024
45aa297
Update SolverBase.cpp
paveltomin Mar 20, 2024
791520a
Update CoupledSolver.hpp
paveltomin Mar 20, 2024
5948f38
Update CoupledSolver.hpp
paveltomin Mar 20, 2024
867acb2
Update SinglePhaseReservoirAndWells.cpp
paveltomin Mar 20, 2024
c3c935d
Update CompositionalMultiphaseReservoirAndWells.cpp
paveltomin Mar 20, 2024
7d35a83
Update SinglePhaseReservoirAndWells.cpp
paveltomin Mar 21, 2024
79895ea
remove debug
Mar 21, 2024
06dda37
let's try this
Mar 21, 2024
78b47b6
revert and try another way
Mar 21, 2024
23620b8
Update SinglePhasePoromechanicsConformingFractures.cpp
paveltomin Mar 22, 2024
2da35af
simplify poromechanics initialization setup
Mar 26, 2024
fbdafe8
Update PoroElastic_staircase_co2_3d_fim.xml
paveltomin Mar 26, 2024
ad6947c
Update PoroElastic_staircase_co2_3d_sequential.xml
paveltomin Mar 26, 2024
f2851af
Update PoromechanicsInitialization.cpp
paveltomin Mar 27, 2024
439cd63
separate and try to normalize
Mar 27, 2024
cc17bb3
Merge branch 'pt/contact-exp' into contact-norm
paveltomin Mar 27, 2024
3c24821
code style
Mar 28, 2024
32b1f88
build fix
Mar 28, 2024
9cd13be
Merge branch 'contact-norm' of https://github.com/GEOS-DEV/GEOS into …
Mar 28, 2024
4b4af0b
try this
Mar 28, 2024
cd9b3f5
Merge branch 'develop' into fractures-wells-draft
paveltomin Mar 29, 2024
36a4ac3
Merge branch 'develop' into pt/contact-exp
paveltomin Mar 29, 2024
291b1ab
Merge branch 'develop' into simplify-poromech-init
paveltomin Mar 29, 2024
d6a97b1
Merge branch 'pt/contact-exp' into contact-norm
paveltomin Mar 29, 2024
fcffbdc
Update PoromechanicsSolver.hpp
paveltomin Apr 2, 2024
322cf4a
Merge branch 'develop' into simplify-poromech-init
paveltomin Apr 2, 2024
36a031e
Update src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbedd…
paveltomin Apr 2, 2024
90a3bef
Update src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbedd…
paveltomin Apr 2, 2024
112e416
Update NonlinearSolverParameters.cpp
paveltomin Apr 2, 2024
e6640fe
Merge branch 'develop' into pt/contact-exp
paveltomin Apr 2, 2024
f39c22b
Merge branch 'pt/contact-exp' into contact-norm
paveltomin Apr 2, 2024
27dafd5
Merge branch 'develop' into fractures-wells-draft
paveltomin Apr 2, 2024
6a976e5
code style
Apr 2, 2024
b9b76e8
cuda build
paveltomin Apr 3, 2024
84941b8
add an option to print out statistics after init
Apr 3, 2024
267ce24
Update src/coreComponents/physicsSolvers/contact/SolidMechanicsLagran…
paveltomin Apr 3, 2024
3c9a6c8
Update src/coreComponents/physicsSolvers/contact/SolidMechanicsLagran…
paveltomin Apr 3, 2024
3d66d47
Merge branch 'develop' into pt/contact-exp
paveltomin Apr 9, 2024
b6436c4
Merge branch 'pt/contact-exp' into contact-norm
paveltomin Apr 9, 2024
b2bcdd4
Merge branch 'develop' into pt/contact-exp
paveltomin Apr 10, 2024
fac90bf
Merge branch 'pt/contact-exp' into contact-norm
paveltomin Apr 10, 2024
986669e
Merge remote-tracking branch 'origin/pt/contact-exp' into pt/conf-tol
Apr 11, 2024
022e02b
Merge remote-tracking branch 'origin/contact-norm' into pt/conf-tol
Apr 11, 2024
55659b0
Merge branch 'fractures-wells-draft' into pt/conf-tol
Apr 15, 2024
276afe9
debug
Apr 18, 2024
0d8daf8
merge
Apr 23, 2024
0f87bce
merge
Apr 24, 2024
6ef28b9
merge again
Apr 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
zCoords="{ 0, 1 }"
nx="{ 5, 52, 5 }"
ny="{ 5, 52, 5 }"
nz="{ 2 }"
nz="{ 3 }"
cellBlockNames="{ cb1 }"/>
</Mesh>
<!-- SPHINX_MESH_END -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::checkTablesParameters( real64 const
template< typename PHASE1, typename PHASE2, typename FLASH >
void CO2BrineFluid< PHASE1, PHASE2, FLASH >::initializePreSubGroups()
{
GEOS_THROW_IF( this->catalogName() == CO2BrineEzrokhiThermalFluid::catalogName(),
GEOS_THROW_IF( this->getCatalogName() == CO2BrineEzrokhiThermalFluid::catalogName(),
GEOS_FMT( "The `{}` model is disabled for now. Please use the other thermal CO2-brine model instead: `{}`",
CO2BrineEzrokhiThermalFluid::catalogName(),
CO2BrinePhillipsThermalFluid::catalogName() ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,5 @@ void PermeabilityBase::allocateConstitutiveData( dataRepository::Group & parent,
ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex );
}

REGISTER_CATALOG_ENTRY( ConstitutiveBase, PermeabilityBase, string const &, Group * const )
}
} /* namespace geos */
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ class PermeabilityBase : public ConstitutiveBase
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

static string catalogName() { return "PermeabilityBase"; }

virtual string getCatalogName() const override { return catalogName(); }

/**
* @brief Const/non-mutable accessor for permeability.
* @return Accessor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ class PorosityBase : public ConstitutiveBase
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

static string catalogName() { return "PorosityBase"; }

virtual string getCatalogName() const override { return catalogName(); }

struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct
{
static constexpr char const * defaultReferencePorosityString() { return "defaultReferencePorosity"; }
Expand Down
6 changes: 0 additions & 6 deletions src/coreComponents/events/EventBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ class EventBase : public ExecutableGroup
/// Destructor
virtual ~EventBase() override;

/**
* @brief Catalog name interface.
* @return This type's catalog name.
**/
static string catalogName() { return "EventBase"; }

/**
* @brief If the event forecast is equal to 1, then signal the targets to prepare for execution
* during the next cycle.
Expand Down
6 changes: 0 additions & 6 deletions src/coreComponents/events/tasks/TaskBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ class TaskBase : public ExecutableGroup
Group * const parent );
virtual ~TaskBase( ) override;

/**
* @brief Catalog name interface
* @return This type's catalog name
*/
static string catalogName() { return "TaskBase"; }

/// The catalog interface type for TaskBase
using CatalogInterface = dataRepository::CatalogInterface< TaskBase, string const &, Group * const >;
/**
Expand Down
6 changes: 0 additions & 6 deletions src/coreComponents/fileIO/Outputs/OutputBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ class OutputBase : public ExecutableGroup
/// Destructor
virtual ~OutputBase() override;

/**
* @brief Catalog name interface.
* @return This type's catalog name.
**/
static string catalogName() { return "OutputBase"; }

/**
* @brief Setter for the output directory
* @param outputDir The output directory
Expand Down
6 changes: 0 additions & 6 deletions src/coreComponents/functions/FunctionBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ class FunctionBase : public dataRepository::Group
*/
virtual ~FunctionBase() override = default;

/**
* @brief Static Factory Catalog Functions
* @return the catalog name
*/
static string catalogName() { return "FunctionBase"; }

/**
* @brief Function initialization
*/
Expand Down
6 changes: 0 additions & 6 deletions src/coreComponents/mesh/generators/MeshGeneratorBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ class MeshGeneratorBase : public dataRepository::Group
explicit MeshGeneratorBase( string const & name,
Group * const parent );

/**
* @brief Return the name of the MeshGenerator in object catalog.
* @return string that contains the catalog name of the MeshGenerator
*/
static string catalogName() { return "MeshGeneratorBase"; }

/// This function is used to expand any catalogs in the data structure
virtual void expandObjectCatalogs() override;

Expand Down
6 changes: 0 additions & 6 deletions src/coreComponents/mesh/generators/WellGeneratorBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ class WellGeneratorBase : public WellGeneratorABC
WellGeneratorBase( const string & name,
Group * const parent );

/**
* @brief Get the catalog name.
* @return the name of this type in the catalog
*/
static string catalogName() { return "WellGeneratorBase"; }

/// This function is used to expand any catalogs in the data structure
virtual void expandObjectCatalogs() override;

Expand Down
12 changes: 11 additions & 1 deletion src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ NonlinearSolverParameters::NonlinearSolverParameters( string const & name,
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Iteration when line search starts." );

registerWrapper( viewKeysStruct::lineSearchResidualFactorString(), &m_lineSearchResidualFactor ).
setApplyDefaultValue( 1.0 ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Factor to determine residual increase (recommended values: 1.1 (conservative), 2.0 (relaxed), 10.0 (aggressive))." );

registerWrapper( viewKeysStruct::normTypeString(), &m_normType ).
setInputFlag( InputFlags::FALSE ).
setApplyDefaultValue( solverBaseKernels::NormType::Linf ).
Expand Down Expand Up @@ -165,7 +170,7 @@ NonlinearSolverParameters::NonlinearSolverParameters( string const & name,
setApplyDefaultValue( 0 ).
setDescription( "Flag to decide whether to iterate between sequentially coupled solvers or not." );

this->registerWrapper( viewKeysStruct::nonlinearAccelerationTypeString(), &m_nonlinearAccelerationType ).
registerWrapper( viewKeysStruct::nonlinearAccelerationTypeString(), &m_nonlinearAccelerationType ).
setApplyDefaultValue( NonlinearAccelerationType::None ).
setInputFlag( dataRepository::InputFlags::OPTIONAL ).
setDescription( "Nonlinear acceleration type for sequential solver." );
Expand All @@ -178,6 +183,9 @@ void NonlinearSolverParameters::postProcessInput()
getWrapperDataContext( viewKeysStruct::timeStepIncreaseIterLimString() ) <<
": should be smaller than " << viewKeysStruct::timeStepDecreaseIterLimString() );

GEOS_ERROR_IF_LE_MSG( m_lineSearchResidualFactor, 0.0,
getWrapperDataContext( viewKeysStruct::lineSearchResidualFactorString() ) << ": should be positive" );

if( getLogLevel() > 0 )
{
GEOS_LOG_RANK_0( "Nonlinear solver parameters:" );
Expand All @@ -187,6 +195,8 @@ void NonlinearSolverParameters::postProcessInput()
GEOS_LOG_RANK_0( GEOS_FMT( " Line search interpolation type = {}", EnumStrings< LineSearchInterpolationType >::toString( m_lineSearchInterpType ) ) );
GEOS_LOG_RANK_0( GEOS_FMT( " Line search maximum number of cuts = {}", m_lineSearchMaxCuts ) );
GEOS_LOG_RANK_0( GEOS_FMT( " Line search cut factor = {}", m_lineSearchCutFactor ) );
GEOS_LOG_RANK_0( GEOS_FMT( " Line starting iteration = {}", m_lineSearchStartingIteration ) );
GEOS_LOG_RANK_0( GEOS_FMT( " Line residual increase factor = {}", m_lineSearchResidualFactor ) );
}
GEOS_LOG_RANK_0( GEOS_FMT( " Norm type (flow solver) = {}", EnumStrings< solverBaseKernels::NormType >::toString( m_normType ) ) );
GEOS_LOG_RANK_0( GEOS_FMT( " Minimum residual normalizer = {}", m_minNormalizer ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class NonlinearSolverParameters : public dataRepository::Group
m_lineSearchMaxCuts = params.m_lineSearchMaxCuts;
m_lineSearchCutFactor = params.m_lineSearchCutFactor;
m_lineSearchStartingIteration = params.m_lineSearchStartingIteration;
m_lineSearchResidualFactor = params.m_lineSearchResidualFactor;

m_newtonTol = params.m_newtonTol;
m_maxIterNewton = params.m_maxIterNewton;
Expand Down Expand Up @@ -104,6 +105,7 @@ class NonlinearSolverParameters : public dataRepository::Group
static constexpr char const * lineSearchCutFactorString() { return "lineSearchCutFactor"; }
static constexpr char const * lineSearchInterpolationTypeString() { return "lineSearchInterpolationType"; }
static constexpr char const * lineSearchStartingIterationString() { return "lineSearchStartingIteration"; }
static constexpr char const * lineSearchResidualFactorString() { return "lineSearchResidualFactor"; }

static constexpr char const * normTypeString() { return "normType"; }
static constexpr char const * minNormalizerString() { return "minNormalizer"; }
Expand Down Expand Up @@ -261,6 +263,9 @@ class NonlinearSolverParameters : public dataRepository::Group
/// Iteration when line search starts
integer m_lineSearchStartingIteration;

/// Factor to determine residual increase
real64 m_lineSearchResidualFactor;

/// Norm used to check the nonlinear loop convergence
solverBaseKernels::NormType m_normType;

Expand Down
3 changes: 2 additions & 1 deletion src/coreComponents/physicsSolvers/SolverBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,8 @@ bool SolverBase::solveNonlinearSystem( real64 const & time_n,

// do line search in case residual has increased
if( m_nonlinearSolverParameters.m_lineSearchAction != NonlinearSolverParameters::LineSearchAction::None
&& residualNorm > lastResidual && newtonIter >= m_nonlinearSolverParameters.m_lineSearchStartingIteration )
&& residualNorm > lastResidual * m_nonlinearSolverParameters.m_lineSearchResidualFactor
&& newtonIter >= m_nonlinearSolverParameters.m_lineSearchStartingIteration )
{
bool lineSearchSuccess = false;
if( m_nonlinearSolverParameters.m_lineSearchInterpType == NonlinearSolverParameters::LineSearchInterpolationType::Linear )
Expand Down
2 changes: 0 additions & 2 deletions src/coreComponents/physicsSolvers/SolverBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class SolverBase : public ExecutableGroup
SolverBase & operator=( SolverBase const & ) = delete;
SolverBase & operator=( SolverBase && ) = delete;

static string catalogName() { return "SolverBase"; }

/**
* @return Get the final class Catalog name
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,83 +537,90 @@ real64 SolidMechanicsEmbeddedFractures::calculateResidualNorm( real64 const & ti

if( !m_useStaticCondensation )
{
real64 const fractureResidualNorm = calculateFractureResidualNorm( domain, dofManager, localRhs );

string const jumpDofKey = dofManager.getKey( contact::dispJump::key() );
return sqrt( solidResidualNorm * solidResidualNorm + fractureResidualNorm * fractureResidualNorm );
}
else
{
return solidResidualNorm;
}
}

globalIndex const rankOffset = dofManager.rankOffset();
real64 SolidMechanicsEmbeddedFractures::calculateFractureResidualNorm( DomainPartition const & domain,
DofManager const & dofManager,
arrayView1d< real64 const > const & localRhs ) const
{
string const jumpDofKey = dofManager.getKey( contact::dispJump::key() );

globalIndex const rankOffset = dofManager.rankOffset();

RAJA::ReduceSum< parallelDeviceReduce, real64 > localSum( 0.0 );
RAJA::ReduceSum< parallelDeviceReduce, real64 > localSum( 0.0 );

// globalResidualNorm[0]: the sum of all the local sum(rhs^2).
// globalResidualNorm[1]: max of max force of each rank. Basically max force globally
real64 globalResidualNorm[2] = {0, 0};
// globalResidualNorm[0]: the sum of all the local sum(rhs^2).
// globalResidualNorm[1]: max of max force of each rank. Basically max force globally
real64 globalResidualNorm[2] = {0.0, 0.0};

// Fracture residual
forFractureRegionOnMeshTargets( domain.getMeshBodies(), [&] ( SurfaceElementRegion const & fractureRegion )
// Fracture residual
forFractureRegionOnMeshTargets( domain.getMeshBodies(), [&] ( SurfaceElementRegion const & fractureRegion )
{
fractureRegion.forElementSubRegions< SurfaceElementSubRegion >( [&]( SurfaceElementSubRegion const & subRegion )
{
fractureRegion.forElementSubRegions< SurfaceElementSubRegion >( [&]( SurfaceElementSubRegion const & subRegion )
{
arrayView1d< globalIndex const > const &
dofNumber = subRegion.getReference< array1d< globalIndex > >( jumpDofKey );
arrayView1d< integer const > const & ghostRank = subRegion.ghostRank();
arrayView1d< globalIndex const > const &
dofNumber = subRegion.getReference< array1d< globalIndex > >( jumpDofKey );
arrayView1d< integer const > const & ghostRank = subRegion.ghostRank();

forAll< parallelDevicePolicy<> >( subRegion.size(),
[localRhs, localSum, dofNumber, rankOffset, ghostRank] GEOS_HOST_DEVICE ( localIndex const k )
forAll< parallelDevicePolicy<> >( subRegion.size(),
[localRhs, localSum, dofNumber, rankOffset, ghostRank] GEOS_HOST_DEVICE ( localIndex const k )
{
if( ghostRank[k] < 0 )
{
if( ghostRank[k] < 0 )
localIndex const localRow = LvArray::integerConversion< localIndex >( dofNumber[k] - rankOffset );
for( int i = 0; i < 3; ++i )
{
localIndex const localRow = LvArray::integerConversion< localIndex >( dofNumber[k] - rankOffset );
for( localIndex i = 0; i < 3; ++i )
{
localSum += localRhs[localRow + i] * localRhs[localRow + i];
}
localSum += localRhs[localRow + i] * localRhs[localRow + i];
}
} );

}
} );

real64 const localResidualNorm[2] = { localSum.get(), SolidMechanicsLagrangianFEM::getMaxForce() };
} );

real64 const localResidualNorm[2] = { localSum.get(), SolidMechanicsLagrangianFEM::getMaxForce() };

int const rank = MpiWrapper::commRank( MPI_COMM_GEOSX );
int const numRanks = MpiWrapper::commSize( MPI_COMM_GEOSX );
array1d< real64 > globalValues( numRanks * 2 );
int const rank = MpiWrapper::commRank( MPI_COMM_GEOSX );
int const numRanks = MpiWrapper::commSize( MPI_COMM_GEOSX );
array1d< real64 > globalValues( numRanks * 2 );

// Everything is done on rank 0
MpiWrapper::gather( localResidualNorm,
2,
globalValues.data(),
2,
0,
MPI_COMM_GEOSX );
// Everything is done on rank 0
MpiWrapper::gather( localResidualNorm,
2,
globalValues.data(),
2,
0,
MPI_COMM_GEOSX );

if( rank==0 )
if( rank==0 )
{
for( int r=0; r<numRanks; ++r )
{
for( int r=0; r<numRanks; ++r )
{
// sum/max across all ranks
globalResidualNorm[0] += globalValues[r*2];
globalResidualNorm[1] = std::max( globalResidualNorm[1], globalValues[r*2+1] );
}
// sum/max across all ranks
globalResidualNorm[0] += globalValues[r*2];
globalResidualNorm[1] = std::max( globalResidualNorm[1], globalValues[r*2+1] );
}
}

MpiWrapper::bcast( globalResidualNorm, 2, 0, MPI_COMM_GEOSX );
} );

real64 const fractureResidualNorm = sqrt( globalResidualNorm[0] )/(globalResidualNorm[1]+1); // the + 1 is for the first
// time-step when maxForce = 0;
MpiWrapper::bcast( globalResidualNorm, 2, 0, MPI_COMM_GEOSX );
} );

if( getLogLevel() >= 1 && logger::internal::rank==0 )
{
std::cout << GEOS_FMT( " ( RFracture ) = ( {:4.2e} )", fractureResidualNorm );
}
real64 const fractureResidualNorm = sqrt( globalResidualNorm[0] )/(globalResidualNorm[1]+1); // the + 1 is for the first
// time-step when maxForce = 0;

return sqrt( solidResidualNorm * solidResidualNorm + fractureResidualNorm * fractureResidualNorm );
}
else
if( getLogLevel() >= 1 && logger::internal::rank==0 )
{
return solidResidualNorm;
std::cout << GEOS_FMT( " ( RFracture ) = ( {:4.2e} )", fractureResidualNorm );
}

return fractureResidualNorm;
}

void SolidMechanicsEmbeddedFractures::applySystemSolution( DofManager const & dofManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class SolidMechanicsEmbeddedFractures : public ContactSolverBase
DofManager const & dofManager,
arrayView1d< real64 const > const & localRhs ) override;

real64 calculateFractureResidualNorm( DomainPartition const & domain,
DofManager const & dofManager,
arrayView1d< real64 const > const & localRhs ) const;

virtual void
applySystemSolution( DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution,
Expand Down
Loading
Loading