diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index e384c1d0e5c..32e5a412824 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -16,6 +16,7 @@ set( common_headers GEOS_RAJA_Interface.hpp GeosxMacros.hpp MemoryInfos.hpp + logger/Logger.hpp MpiWrapper.hpp Path.hpp Span.hpp diff --git a/src/coreComponents/common/logger/Logger.hpp b/src/coreComponents/common/logger/Logger.hpp index e966df9e9f8..a10c5330b19 100644 --- a/src/coreComponents/common/logger/Logger.hpp +++ b/src/coreComponents/common/logger/Logger.hpp @@ -79,6 +79,21 @@ } \ } while( false ) +/** + * @brief Conditionally log a message on screen on rank 0 without line breaking. + * @param EXP an expression that will be evaluated as a predicate + * @param msg a message to log (any expression that can be stream inserted) + */ +#define GEOS_LOG_RANK_0_IF_NLR( EXP, msg ) \ + do { \ + if( ::geos::logger::internal::rank == 0 && EXP ) \ + { \ + std::ostringstream oss; \ + oss << msg; \ + std::cout << oss.str(); \ + } \ + } while( false ) + /** * @brief Log a message on screen on rank 0. * @param msg a message to log (any expression that can be stream inserted) @@ -456,6 +471,7 @@ * @brief Output messages based on current Group's log level. * @param[in] minLevel minimum log level * @param[in] msg a message to log (any expression that can be stream inserted) + * @deprecated Will be replaced by GEOS_LOG_LEVEL_INFO */ #define GEOS_LOG_LEVEL( minLevel, msg ) GEOS_LOG_IF( this->getLogLevel() >= minLevel, msg ); @@ -463,6 +479,7 @@ * @brief Output messages (only on rank 0) based on current Group's log level. * @param[in] minLevel minimum log level * @param[in] msg a message to log (any expression that can be stream inserted) + * @deprecated Will be replaced by GEOS_LOG_LEVEL_INFO_RANK_0 */ #define GEOS_LOG_LEVEL_RANK_0( minLevel, msg ) GEOS_LOG_RANK_0_IF( this->getLogLevel() >= minLevel, msg ) @@ -470,6 +487,7 @@ * @brief Output messages (with one line per rank) based on current Group's log level. * @param[in] minLevel minimum log level * @param[in] msg a message to log (any expression that can be stream inserted) + * @deprecated Will be replaced by GEOS_LOG_LEVEL_INFO_BY_RANK */ #define GEOS_LOG_LEVEL_BY_RANK( minLevel, msg ) GEOS_LOG_RANK_IF( this->getLogLevel() >= minLevel, msg ) diff --git a/src/coreComponents/dataRepository/CMakeLists.txt b/src/coreComponents/dataRepository/CMakeLists.txt index 70c8a9bf97e..f3e4e82628e 100644 --- a/src/coreComponents/dataRepository/CMakeLists.txt +++ b/src/coreComponents/dataRepository/CMakeLists.txt @@ -11,6 +11,8 @@ set( dataRepository_headers InputFlags.hpp KeyIndexT.hpp KeyNames.hpp + LogLevelsInfo.hpp + LogLevelsRegistry.hpp MappedVector.hpp ObjectCatalog.hpp ReferenceWrapper.hpp @@ -35,6 +37,7 @@ set( dataRepository_sources xmlWrapper.cpp DataContext.cpp GroupContext.cpp + LogLevelsRegistry.cpp WrapperContext.cpp ) set( dependencyList ${parallelDeps} codingUtilities ) diff --git a/src/coreComponents/dataRepository/Group.cpp b/src/coreComponents/dataRepository/Group.cpp index c45758eb659..abbf6379fa9 100644 --- a/src/coreComponents/dataRepository/Group.cpp +++ b/src/coreComponents/dataRepository/Group.cpp @@ -50,6 +50,7 @@ Group::Group( string const & name, m_restart_flags( RestartFlags::WRITE_AND_READ ), m_input_flags( InputFlags::INVALID ), m_conduitNode( rootNode[ name ] ), + m_logLevelsRegistry( std::make_unique< LogLevelsRegistry >() ), m_dataContext( std::make_unique< GroupContext >( *this ) ) {} @@ -80,7 +81,6 @@ void Group::deregisterWrapper( string const & name ) m_conduitNode.remove( name ); } - void Group::resize( indexType const newSize ) { forWrappers( [newSize] ( WrapperBase & wrapper ) @@ -245,6 +245,7 @@ void Group::processInputFile( xmlWrapper::xmlNode const & targetNode, void Group::postInputInitializationRecursive() { + m_logLevelsRegistry = nullptr; for( auto const & subGroupIter : m_subGroups ) { subGroupIter.second->postInputInitializationRecursive(); diff --git a/src/coreComponents/dataRepository/Group.hpp b/src/coreComponents/dataRepository/Group.hpp index 1a8cb2358cc..3741580fbbb 100644 --- a/src/coreComponents/dataRepository/Group.hpp +++ b/src/coreComponents/dataRepository/Group.hpp @@ -27,6 +27,8 @@ #include "RestartFlags.hpp" #include "Wrapper.hpp" #include "xmlWrapper.hpp" +#include "LogLevelsInfo.hpp" +#include "LogLevelsRegistry.hpp" #include @@ -863,6 +865,16 @@ class Group ///@} //END_SPHINX_INCLUDE_REGISTER_WRAPPER + /** + * @brief Append a levelCondition and a log description to the description of the wrapped object given a log info struct. + * Must be called in constructor. + * @tparam LOG_LEVEL_INFO The log documentation to add. + * @return void if the trait is verified. + */ + template< typename LOG_LEVEL_INFO > + std::enable_if_t< geos::is_log_level_info< LOG_LEVEL_INFO >, void > + addLogLevel(); + /** * @name Schema generation methods */ @@ -1478,7 +1490,9 @@ class Group */ void loadFromConduit(); - /// Enable verbosity input for object + /** + * @deprecated will be remove and replace by addLogLevel + */ void enableLogLevelInput(); /** @@ -1615,6 +1629,8 @@ class Group /// Verbosity flag for group logs integer m_logLevel; + + //END_SPHINX_INCLUDE_02 /// Restart flag for this group... and subsequently all wrappers in this group. @@ -1626,6 +1642,9 @@ class Group /// Reference to the conduit::Node that mirrors this group conduit::Node & m_conduitNode; + // Keep track of log levels & descriptions + std::unique_ptr< LogLevelsRegistry > m_logLevelsRegistry; + /// A DataContext object used to provide contextual information on this Group, /// if it is created from an input XML file, the line or offset in that file. std::unique_ptr< DataContext > m_dataContext; @@ -1712,6 +1731,24 @@ Wrapper< T > & Group::registerWrapper( string const & name, return rval; } +template< typename LOG_LEVEL_INFO > +std::enable_if_t< geos::is_log_level_info< LOG_LEVEL_INFO >, void > +Group::addLogLevel() +{ + GEOS_ERROR_IF( m_logLevelsRegistry == nullptr, "You cannot call addLogLevel after schema generation" ); + + Wrapper< integer > * wrapper = getWrapperPointer< integer >( viewKeyStruct::logLevelString() ); + if( wrapper == nullptr ) + { + wrapper = ®isterWrapper( viewKeyStruct::logLevelString(), &m_logLevel ); + wrapper->setApplyDefaultValue( 0 ); + wrapper->setInputFlag( InputFlags::OPTIONAL ); + } + m_logLevelsRegistry->addEntry( LOG_LEVEL_INFO::getMinLogLevel(), + LOG_LEVEL_INFO::getDescription() ); + wrapper->setDescription( m_logLevelsRegistry->buildLogLevelDescription()); +} + } /* end namespace dataRepository */ } /* end namespace geos */ diff --git a/src/coreComponents/dataRepository/LogLevelsInfo.hpp b/src/coreComponents/dataRepository/LogLevelsInfo.hpp new file mode 100644 index 00000000000..d0b0ee1817d --- /dev/null +++ b/src/coreComponents/dataRepository/LogLevelsInfo.hpp @@ -0,0 +1,90 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file LogLevelsInfo.hpp + * This file contains log level information infrastructure and the mecanism to ensure LOG_LEVEL_INFO structure is valid + */ +#ifndef GEOS_COMMON_LOGLEVELSINFO_HPP +#define GEOS_COMMON_LOGLEVELSINFO_HPP + +#include "common/DataTypes.hpp" +#include "common/format/Format.hpp" + +namespace geos +{ + +/** + * @brief Trait used to check whether a LOG_LEVEL_INFO structure is valid. + * @tparam LOG_LEVEL_INFO The log level structure to check. + * + * A log level structure must have this following + * struct LogName + * { + * static constexpr int getMinLogLevel() { return 1; } + * static constexpr std::string_view getDescription() { return "Log level description"; } + * }; + */ +template< typename LOG_LEVEL_INFO > +static constexpr bool is_log_level_info = + std::is_same_v< integer, decltype(LOG_LEVEL_INFO::getMinLogLevel()) > && + std::is_same_v< std::string_view, decltype(LOG_LEVEL_INFO::getDescription()) >; + +/** + * @brief Verify if a log level is active + * @tparam LOG_LEVEL_INFO The structure containing log level information. + * @param level Log level to be checked. + * @return `true` if the log level is active, `false` otherwise. + * @pre `LOG_LEVEL_INFO` must satisfy `logInfo::is_log_level_info`. + * + */ +template< typename LOG_LEVEL_INFO > +std::enable_if_t< is_log_level_info< LOG_LEVEL_INFO >, bool > +isLogLevelActive( integer level ) +{ + return level >= LOG_LEVEL_INFO::getMinLogLevel(); +} + +/** ThOSE 3 macros would replace the ones in Logger.hpp */ +/** + * @brief Output messages based on current Group's log level. + * @param[in] logInfoStruct Strut containing log level desscription + * @param[in] msg a message to log (any expression that can be stream inserted) + */ +#define GEOS_LOG_LEVEL_INFO( logInfoStruct, msg ) GEOS_LOG_IF( isLogLevelActive< logInfoStruct >( this->getLogLevel() ), msg ); + +/** + * @brief Output messages (only on rank 0) based on current Group's log level. + * @param[in] logInfoStruct Strut containing log level desscription + * @param[in] msg a message to log (any expression that can be stream inserted) + */ +#define GEOS_LOG_LEVEL_INFO_RANK_0( logInfoStruct, msg ) GEOS_LOG_RANK_0_IF( isLogLevelActive< logInfoStruct >( this->getLogLevel() ), msg ); + +/** + * @brief Output messages (with one line per rank) based on current Group's log level. + * @param[in] logInfoStruct Strut containing log level desscription + * @param[in] msg a message to log (any expression that can be stream inserted) + */ +#define GEOS_LOG_LEVEL_INFO_BY_RANK( logInfoStruct, msg ) GEOS_LOG_RANK_IF( isLogLevelActive< logInfoStruct >( this->getLogLevel() ), msg ); + +/** + * @brief Output messages (only on rank 0) based on current Group's log level without the line return. + * @param[in] logInfoStruct Strut containing log level desscription + * @param[in] msg a message to log (any expression that can be stream inserted) + */ +#define GEOS_LOG_LEVEL_INFO_RANK_0_NLR( logInfoStruct, msg ) GEOS_LOG_RANK_0_IF_NLR( isLogLevelActive< logInfoStruct >( this->getLogLevel() ), msg ); + +} + +#endif // GEOS_COMMON_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/dataRepository/LogLevelsRegistry.cpp b/src/coreComponents/dataRepository/LogLevelsRegistry.cpp new file mode 100644 index 00000000000..ae3e48ccd72 --- /dev/null +++ b/src/coreComponents/dataRepository/LogLevelsRegistry.cpp @@ -0,0 +1,43 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +#include "LogLevelsRegistry.hpp" + +namespace geos +{ + +void LogLevelsRegistry::addEntry( integer condition, std::string_view description ) +{ + m_logLevelsDescriptions[condition].push_back( string( description ) ); +} + +string LogLevelsRegistry::buildLogLevelDescription() const +{ + std::ostringstream description; + description << "Sets the level of information to write in the standard output (the console typically).\n" + "Level 0 outputs no specific information for this solver. Higher levels require more outputs."; + for( auto const & [logLevel, logDescriptions] : m_logLevelsDescriptions ) + { + description << GEOS_FMT( "\n{}\n", logLevel ); + for( size_t idxDesc = 0; idxDesc < logDescriptions.size(); idxDesc++ ) + { + description << " - " << logDescriptions[idxDesc]; + if( idxDesc != logDescriptions.size() - 1 ) + description << '\n'; + } + } + return description.str(); +} + +} diff --git a/src/coreComponents/dataRepository/LogLevelsRegistry.hpp b/src/coreComponents/dataRepository/LogLevelsRegistry.hpp new file mode 100644 index 00000000000..88b38224cdc --- /dev/null +++ b/src/coreComponents/dataRepository/LogLevelsRegistry.hpp @@ -0,0 +1,60 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file LogLevelsRegistry.hpp + */ + +#ifndef GEOS_COMMON_LOGLEVELSREGISTRY_HPP +#define GEOS_COMMON_LOGLEVELSREGISTRY_HPP + +#include "common/DataTypes.hpp" +#include "common/format/Format.hpp" + +namespace geos +{ + +/** + * @brief Keep track of log level documention for a group + */ +class LogLevelsRegistry +{ +public: + + /** + * @brief Add a log description for a wrapper + * @param level The minimum log level + * @param description The description for the log level + */ + void addEntry( integer level, std::string_view description ); + + /** + * @brief Construct the log level string description for a wrapper + * @return The log level string description + */ + string buildLogLevelDescription() const; + +private: + + /** + * @brief Map for building the log level string for each wrapper. + * key : a logLevel condition, values : a set of description for a corresponding loglevel. + */ + std::map< integer, std::vector< std::string > > m_logLevelsDescriptions; + +}; + +} + +#endif diff --git a/src/coreComponents/physicsSolvers/CMakeLists.txt b/src/coreComponents/physicsSolvers/CMakeLists.txt index ed3ea6de356..6bc42626602 100644 --- a/src/coreComponents/physicsSolvers/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/CMakeLists.txt @@ -6,7 +6,8 @@ set( physicsSolvers_headers SolverBase.hpp SolverBaseKernels.hpp SolverStatistics.hpp - FieldStatisticsBase.hpp ) + FieldStatisticsBase.hpp + LogLevelsInfo.hpp ) # Specify solver sources set( physicsSolvers_sources diff --git a/src/coreComponents/physicsSolvers/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/LogLevelsInfo.hpp new file mode 100644 index 00000000000..a6c75d3e1c6 --- /dev/null +++ b/src/coreComponents/physicsSolvers/LogLevelsInfo.hpp @@ -0,0 +1,99 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file LogLevelsInfo.hpp + * This file contains common log level informations for physics solvers + */ + +#ifndef GEOS_PHYSICSSOLVERS_LOGLEVELSINFO_HPP +#define GEOS_PHYSICSSOLVERS_LOGLEVELSINFO_HPP + +#include "common/DataTypes.hpp" + +namespace geos +{ + +namespace logInfo +{ + +/** + * @name Common LogLevels info structures. They must comply with the `is_log_level_info` trait. + */ +///@{ + +/// @cond DO_NOT_DOCUMENT + +struct Fields +{ + static constexpr int getMinLogLevel() { return 2; } + static constexpr std::string_view getDescription() { return "The summary of declared fields and coupling"; } +}; + +struct LineSearch +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Line search information"; } +}; + +struct Solution +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Solution information (scaling, maximum changes, quality check)"; } +}; + +struct Convergence +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Convergence information"; } +}; + +struct TimeStep +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Time step information"; } +}; + +struct LinearSolver +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Linear solver information"; } +}; + +struct NonlinearSolver +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Nonlinear solver information"; } +}; + +struct Timers +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Solver timers information"; } +}; + +struct Initialization +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Initialization information"; } +}; + +/// @endcond +///@} + +} + +} + +#endif // GEOS_PHYSICSSOLVERS_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/physicsSolvers/SolverBase.cpp b/src/coreComponents/physicsSolvers/SolverBase.cpp index 47212daed32..a41d2fb0401 100644 --- a/src/coreComponents/physicsSolvers/SolverBase.cpp +++ b/src/coreComponents/physicsSolvers/SolverBase.cpp @@ -22,6 +22,7 @@ #include "math/interpolation/Interpolation.hpp" #include "common/Timer.hpp" #include "common/Units.hpp" +#include "dataRepository/LogLevelsInfo.hpp" #if defined(GEOS_USE_PYGEOSX) #include "python/PySolverType.hpp" @@ -48,9 +49,6 @@ SolverBase::SolverBase( string const & name, { setInputFlags( InputFlags::OPTIONAL_NONUNIQUE ); - // This enables logLevel filtering - enableLogLevelInput(); - // This sets a flag to indicate that this object is going to select the time step size this->setTimesteppingBehavior( ExecutableGroup::TimesteppingBehavior::DeterminesTimeStepSize ); @@ -98,6 +96,15 @@ SolverBase::SolverBase( string const & name, setRestartFlags( RestartFlags::WRITE_AND_READ ). setDescription( "Write matrix, rhs, solution to screen ( = 1) or file ( = 2)." ); + addLogLevel< logInfo::Fields >(); + addLogLevel< logInfo::LineSearch >(); + addLogLevel< logInfo::Solution >(); + addLogLevel< logInfo::Convergence >(); + addLogLevel< logInfo::TimeStep >(); + addLogLevel< logInfo::LinearSolver >(); + addLogLevel< logInfo::NonlinearSolver >(); + addLogLevel< logInfo::Timers >(); + registerGroup( groupKeyStruct::linearSolverParametersString(), &m_linearSolverParameters ); registerGroup( groupKeyStruct::nonlinearSolverParametersString(), &m_nonlinearSolverParameters ); registerGroup( groupKeyStruct::solverStatisticsString(), &m_solverStatistics ); @@ -227,6 +234,10 @@ real64 SolverBase::solverStep( real64 const & time_n, { setupSystem( domain, m_dofManager, m_localMatrix, m_rhs, m_solution ); setSystemSetupTimestamp( meshModificationTimestamp ); + + std::ostringstream oss; + m_dofManager.printFieldInfo( oss ); + GEOS_LOG_LEVEL_INFO( logInfo::Fields, oss.str()) } implicitStepSetup( time_n, dt, domain ); @@ -310,9 +321,10 @@ bool SolverBase::execute( real64 const time_n, } } - if( getLogLevel() >= 1 && dtRemaining > 0.0 ) + if( dtRemaining > 0.0 ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: sub-step = {}, accepted dt = {}, next dt = {}, remaining dt = {}", getName(), subStep, dtAccepted, nextDt, dtRemaining ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, + GEOS_FMT( "{}: sub-step = {}, accepted dt = {}, next dt = {}, remaining dt = {}", getName(), subStep, dtAccepted, nextDt, dtRemaining ) ); } } @@ -364,8 +376,8 @@ real64 SolverBase::setNextDt( real64 const & currentDt, if( ( m_numTimestepsSinceLastDtCut >= 0 ) && ( m_numTimestepsSinceLastDtCut < minTimeStepIncreaseInterval ) ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: time-step size will be kept the same since it's been {} cycles since last cut.", - getName(), m_numTimestepsSinceLastDtCut ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: time-step size will be kept the same since it's been {} cycles since last cut.", + getName(), m_numTimestepsSinceLastDtCut ) ); return currentDt; } @@ -373,36 +385,36 @@ real64 SolverBase::setNextDt( real64 const & currentDt, { if( nextDtNewton > currentDt ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: time-step required will be increased based on number of iterations.", - getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: time-step required will be increased based on number of iterations.", + getName() ) ); } else if( nextDtNewton < currentDt ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: time-step required will be decreased based on number of iterations.", - getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: time-step required will be decreased based on number of iterations.", + getName() ) ); } else { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: time-step required will be kept the same based on number of iterations.", - getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: time-step required will be kept the same based on number of iterations.", + getName() ) ); } } else // time step size decided based on state change { if( nextDtStateChange > currentDt ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: time-step required will be increased based on state change.", - getName())); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: time-step required will be increased based on state change.", + getName())); } else if( nextDtStateChange < currentDt ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: time-step required will be decreased based on state change.", - getName())); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: time-step required will be decreased based on state change.", + getName())); } else { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: time-step required will be kept the same based on state change.", - getName())); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: time-step required will be kept the same based on state change.", + getName())); } } @@ -588,7 +600,7 @@ bool SolverBase::lineSearch( real64 const & time_n, if( !checkSystemSolution( domain, dofManager, solution.values(), localScaleFactor ) ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " Line search {}, solution check failed", lineSearchIteration ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LineSearch, GEOS_FMT( " Line search {}, solution check failed", lineSearchIteration ) ); continue; } @@ -606,14 +618,11 @@ bool SolverBase::lineSearch( real64 const & time_n, applyBoundaryConditions( time_n, dt, domain, dofManager, localMatrix, localRhs ); rhs.close(); - if( getLogLevel() >= 1 && logger::internal::rank==0 ) - { - std::cout << GEOS_FMT( " Line search @ {:0.3f}: ", cumulativeScale ); - } + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LineSearch, GEOS_FMT( " Line search @ {:0.3f}: ", cumulativeScale )); // get residual norm residualNorm = calculateResidualNorm( time_n, dt, domain, dofManager, rhs.values() ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " ( R ) = ( {:4.2e} )", residualNorm ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LineSearch, GEOS_FMT( " ( R ) = ( {:4.2e} )", residualNorm ) ); // if the residual norm is less than the last residual, we can proceed to the // solution step @@ -680,7 +689,7 @@ bool SolverBase::lineSearchWithParabolicInterpolation( real64 const & time_n, if( !checkSystemSolution( domain, dofManager, solution.values(), deltaLocalScaleFactor ) ) { - GEOS_LOG_LEVEL_RANK_0( 1, " Line search " << lineSearchIteration << ", solution check failed" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LineSearch, GEOS_FMT( " Line search {}, solution check failed", lineSearchIteration ) ); continue; } @@ -703,14 +712,15 @@ bool SolverBase::lineSearchWithParabolicInterpolation( real64 const & time_n, applyBoundaryConditions( time_n, dt, domain, dofManager, localMatrix, localRhs ); rhs.close(); - if( getLogLevel() >= 1 && logger::internal::rank==0 ) + if( logger::internal::rank==0 ) { - std::cout << GEOS_FMT( " Line search @ {:0.3f}: ", cumulativeScale ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LineSearch, GEOS_FMT( " Line search @ {:0.3f}: ", cumulativeScale ) ); } // get residual norm residualNormT = calculateResidualNorm( time_n, dt, domain, dofManager, rhs.values() ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " ( R ) = ( {:4.2e} )", residualNormT ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LineSearch, GEOS_FMT( " ( R ) = ( {:4.2e} )", residualNormT ) ); + ffm = ffT; ffT = residualNormT*residualNormT; @@ -731,8 +741,7 @@ bool SolverBase::lineSearchWithParabolicInterpolation( real64 const & time_n, real64 SolverBase::eisenstatWalker( real64 const newNewtonNorm, real64 const oldNewtonNorm, - LinearSolverParameters::Krylov const & krylovParams, - integer const logLevel ) + LinearSolverParameters::Krylov const & krylovParams ) { real64 normRatio = std::min( newNewtonNorm / oldNewtonNorm, 1.0 ); real64 newKrylovTol = krylovParams.adaptiveGamma * std::pow( normRatio, krylovParams.adaptiveExponent ); @@ -744,11 +753,9 @@ real64 SolverBase::eisenstatWalker( real64 const newNewtonNorm, krylovTol = std::min( krylovTol, krylovParams.weakestTol ); krylovTol = std::max( krylovTol, krylovParams.strongestTol ); - if( logLevel > 0 ) - { - GEOS_LOG_RANK_0( GEOS_FMT( " Adaptive linear tolerance = {:4.2e} (norm ratio = {:4.2e}, old tolerance = {:4.2e}, new tolerance = {:4.2e}, safeguard = {:4.2e})", - krylovTol, normRatio, krylovParams.relTolerance, newKrylovTol, altKrylovTol ) ); - } + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolver, + GEOS_FMT( " Adaptive linear tolerance = {:4.2e} (norm ratio = {:4.2e}, old tolerance = {:4.2e}, new tolerance = {:4.2e}, safeguard = {:4.2e})", + krylovTol, normRatio, krylovParams.relTolerance, newKrylovTol, altKrylovTol ) ); return krylovTol; } @@ -813,8 +820,7 @@ real64 SolverBase::nonlinearImplicitStep( real64 const & time_n, { // increment the solver statistics for reporting purposes m_solverStatistics.logOuterLoopIteration(); - - GEOS_LOG_LEVEL_RANK_0( 1, "---------- Configuration did not converge. Testing new configuration. ----------" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::NonlinearSolver, "---------- Configuration did not converge. Testing new configuration. ----------" ); } } else if( !attemptedSimplestConfiguration ) @@ -844,7 +850,7 @@ real64 SolverBase::nonlinearImplicitStep( real64 const & time_n, // cut timestep, go back to beginning of step and restart the Newton loop stepDt *= dtCutFactor; m_numTimestepsSinceLastDtCut = 0; - GEOS_LOG_LEVEL_RANK_0 ( 1, GEOS_FMT( "New dt = {}", stepDt ) ); + GEOS_LOG_LEVEL_INFO_RANK_0 ( logInfo::TimeStep, GEOS_FMT( "New dt = {}", stepDt ) ); // notify the solver statistics counter that this is a time step cut m_solverStatistics.logTimeStepCut(); @@ -889,7 +895,9 @@ bool SolverBase::solveNonlinearSystem( real64 const & time_n, for( newtonIter = 0; newtonIter < maxNewtonIter; ++newtonIter ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " Attempt: {:2}, ConfigurationIter: {:2}, NewtonIter: {:2}", dtAttempt, configurationLoopIter, newtonIter ) ); + + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::NonlinearSolver, + GEOS_FMT( " Attempt: {:2}, ConfigurationIter: {:2}, NewtonIter: {:2}", dtAttempt, configurationLoopIter, newtonIter ) ); { Timer timer( m_timers["assemble"] ); @@ -938,7 +946,7 @@ bool SolverBase::solveNonlinearSystem( real64 const & time_n, // get residual norm residualNorm = calculateResidualNorm( time_n, stepDt, domain, m_dofManager, m_rhs.values() ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " ( R ) = ( {:4.2e} )", residualNorm ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Convergence, GEOS_FMT( " ( R ) = ( {:4.2e} )", residualNorm ) ); } // if the residual norm is less than the Newton tolerance we denote that we have @@ -954,9 +962,9 @@ bool SolverBase::solveNonlinearSystem( real64 const & time_n, if( residualNorm > m_nonlinearSolverParameters.m_maxAllowedResidualNorm ) { string const maxAllowedResidualNormString = NonlinearSolverParameters::viewKeysStruct::maxAllowedResidualNormString(); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " The residual norm is above the {} of {}. Newton loop terminated.", - maxAllowedResidualNormString, - m_nonlinearSolverParameters.m_maxAllowedResidualNorm ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Convergence, GEOS_FMT( " The residual norm is above the {} of {}. Newton loop terminated.", + maxAllowedResidualNormString, + m_nonlinearSolverParameters.m_maxAllowedResidualNorm ) ); isNewtonConverged = false; break; } @@ -1000,12 +1008,12 @@ bool SolverBase::solveNonlinearSystem( real64 const & time_n, { if( m_nonlinearSolverParameters.m_lineSearchAction == NonlinearSolverParameters::LineSearchAction::Attempt ) { - GEOS_LOG_LEVEL_RANK_0( 1, " Line search failed to produce reduced residual. Accepting iteration." ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LineSearch, " Line search failed to produce reduced residual. Accepting iteration." ); } else if( m_nonlinearSolverParameters.m_lineSearchAction == NonlinearSolverParameters::LineSearchAction::Require ) { // if line search failed, then break out of the main Newton loop. Timestep will be cut. - GEOS_LOG_LEVEL_RANK_0( 1, " Line search failed to produce reduced residual. Exiting Newton Loop." ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LineSearch, " Line search failed to produce reduced residual. Exiting Newton Loop." ); break; } } @@ -1018,7 +1026,7 @@ bool SolverBase::solveNonlinearSystem( real64 const & time_n, LinearSolverParameters::Krylov & krylovParams = m_linearSolverParameters.get().krylov; if( krylovParams.useAdaptiveTol ) { - krylovParams.relTolerance = newtonIter > 0 ? eisenstatWalker( residualNorm, lastResidual, krylovParams, m_linearSolverParameters.getLogLevel() ) : krylovParams.weakestTol; + krylovParams.relTolerance = newtonIter > 0 ? eisenstatWalker( residualNorm, lastResidual, krylovParams ) : krylovParams.weakestTol; } // TODO: Trilinos currently requires this, re-evaluate after moving to Tpetra-based solvers @@ -1054,10 +1062,7 @@ bool SolverBase::solveNonlinearSystem( real64 const & time_n, // Compute the scaling factor for the Newton update scaleFactor = scalingForSystemSolution( domain, m_dofManager, m_solution.values() ); - if( getLogLevel() >= 1 ) - { - GEOS_LOG_RANK_0( GEOS_FMT( " {}: Global solution scaling factor = {}", getName(), scaleFactor ) ); - } + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Global solution scaling factor = {}", getName(), scaleFactor ) ); if( !checkSystemSolution( domain, m_dofManager, m_solution.values(), scaleFactor ) ) { @@ -1294,9 +1299,9 @@ void SolverBase::solveLinearSystem( DofManager const & dofManager, m_linearSolverResult = solver->result(); } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " Last LinSolve(iter,res) = ( {:3}, {:4.2e} )", - m_linearSolverResult.numIterations, - m_linearSolverResult.residualReduction ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolver, GEOS_FMT( " Last LinSolve(iter,res) = ( {:3}, {:4.2e} )", + m_linearSolverResult.numIterations, + m_linearSolverResult.residualReduction ) ); if( params.stopIfError ) { @@ -1378,19 +1383,17 @@ void SolverBase::cleanup( real64 const GEOS_UNUSED_PARAM( time_n ), { m_solverStatistics.outputStatistics(); - if( getLogLevel() > 0 ) + for( auto & timer : m_timers ) { - for( auto & timer : m_timers ) + real64 const time = std::chrono::duration< double >( timer.second ).count(); + real64 const minTime = MpiWrapper::min( time ); + real64 const maxTime = MpiWrapper::max( time ); + if( maxTime > 0 ) { - real64 const time = std::chrono::duration< double >( timer.second ).count(); - real64 const minTime = MpiWrapper::min( time ); - real64 const maxTime = MpiWrapper::max( time ); - if( maxTime > 0 ) - { - GEOS_LOG_RANK_0( GEOS_FMT( "{}: {} time = {} s (min), {} s (max)", getName(), timer.first, minTime, maxTime ) ); - } + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Timers, GEOS_FMT( "{}: {} time = {} s (min), {} s (max)", getName(), timer.first, minTime, maxTime ) ); } } + } Timestamp SolverBase::getMeshModificationTimestamp( DomainPartition & domain ) const diff --git a/src/coreComponents/physicsSolvers/SolverBase.hpp b/src/coreComponents/physicsSolvers/SolverBase.hpp index 3003bab3cde..98bd390ef9c 100644 --- a/src/coreComponents/physicsSolvers/SolverBase.hpp +++ b/src/coreComponents/physicsSolvers/SolverBase.hpp @@ -30,6 +30,7 @@ #include "physicsSolvers/NonlinearSolverParameters.hpp" #include "physicsSolvers/LinearSolverParameters.hpp" #include "physicsSolvers/SolverStatistics.hpp" +#include "physicsSolvers/LogLevelsInfo.hpp" #include @@ -935,13 +936,11 @@ class SolverBase : public ExecutableGroup * @param newNewtonNorm Residual norm at current iteration * @param oldNewtonNorm Residual norm at previous iteration * @param krylovParams Linear solver parameters - * @param logLevel Log level * @return Adaptive tolerance recommendation */ - static real64 eisenstatWalker( real64 const newNewtonNorm, - real64 const oldNewtonNorm, - LinearSolverParameters::Krylov const & krylovParams, - integer const logLevel ); + real64 eisenstatWalker( real64 const newNewtonNorm, + real64 const oldNewtonNorm, + LinearSolverParameters::Krylov const & krylovParams ); /** * @brief Get the Constitutive Name object diff --git a/src/coreComponents/physicsSolvers/contact/CMakeLists.txt b/src/coreComponents/physicsSolvers/contact/CMakeLists.txt index 23c4693cedd..c9bf75bec3e 100644 --- a/src/coreComponents/physicsSolvers/contact/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/contact/CMakeLists.txt @@ -15,6 +15,7 @@ set( physicsSolvers_headers contact/SolidMechanicsALMKernelsHelper.hpp contact/SolidMechanicsALMJumpUpdateKernels.hpp contact/SolidMechanicsALMBubbleKernels.hpp + contact/LogLevelsInfo.hpp PARENT_SCOPE ) diff --git a/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp b/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp index 185a4c798c9..11d40de0558 100644 --- a/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp @@ -23,6 +23,7 @@ #include "constitutive/contact/FrictionBase.hpp" #include "mesh/DomainPartition.hpp" #include "mesh/SurfaceElementRegion.hpp" +#include "physicsSolvers/contact/LogLevelsInfo.hpp" #include "physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp" #include "common/GEOS_RAJA_Interface.hpp" diff --git a/src/coreComponents/physicsSolvers/contact/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/contact/LogLevelsInfo.hpp new file mode 100644 index 00000000000..f58f9494b0d --- /dev/null +++ b/src/coreComponents/physicsSolvers/contact/LogLevelsInfo.hpp @@ -0,0 +1,51 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file LogLevelsInfo.hpp + * This file contains log level informations for contact solvers + */ + +#ifndef GEOS_PHYSICSSOLVERS_CONTACT_LOGLEVELSINFO_HPP +#define GEOS_PHYSICSSOLVERS_CONTACT_LOGLEVELSINFO_HPP + +#include "common/DataTypes.hpp" + +namespace geos +{ + +namespace logInfo +{ + +/** + * @name Wells LogLevels info structures. They must comply with the `is_log_level_info` trait. + */ +///@{ + +/// @cond DO_NOT_DOCUMENT + +struct Configuration +{ + static constexpr int getMinLogLevel() { return 2; } + static constexpr std::string_view getDescription() { return "Configuration information"; } +}; + +/// @endcond +///@} + +} + +} + +#endif // GEOS_PHYSICSSOLVERS_CONTACT_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/physicsSolvers/contact/SolidMechanicsAugmentedLagrangianContact.cpp b/src/coreComponents/physicsSolvers/contact/SolidMechanicsAugmentedLagrangianContact.cpp index eb9fc81049e..c9e13392126 100644 --- a/src/coreComponents/physicsSolvers/contact/SolidMechanicsAugmentedLagrangianContact.cpp +++ b/src/coreComponents/physicsSolvers/contact/SolidMechanicsAugmentedLagrangianContact.cpp @@ -24,6 +24,7 @@ #include "physicsSolvers/contact/SolidMechanicsALMSimultaneousKernels.hpp" #include "physicsSolvers/contact/SolidMechanicsALMJumpUpdateKernels.hpp" #include "physicsSolvers/contact/SolidMechanicsALMBubbleKernels.hpp" +#include "physicsSolvers/contact/LogLevelsInfo.hpp" #include "constitutive/ConstitutiveManager.hpp" #include "constitutive/contact/FrictionSelector.hpp" @@ -43,6 +44,8 @@ SolidMechanicsAugmentedLagrangianContact::SolidMechanicsAugmentedLagrangianConta m_faceTypeToFiniteElements["Quadrilateral"] = std::make_unique< finiteElement::H1_QuadrilateralFace_Lagrange1_GaussLegendre2 >(); m_faceTypeToFiniteElements["Triangle"] = std::make_unique< finiteElement::H1_TriangleFace_Lagrange1_Gauss1 >(); + addLogLevel< logInfo::Configuration >(); + // TODO Implement the MGR strategy // Set the default linear solver parameters @@ -903,10 +906,11 @@ bool SolidMechanicsAugmentedLagrangianContact::updateConfiguration( DomainPartit int hasConfigurationConvergedGlobally = (totCondNotConv == 0) ? true : false; - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " ALM convergence summary:" - " converged: {:6} | stick & gn>0: {:6} | compenetration: {:6} | stick & gt>lim: {:6} | tau>tauLim: {:6}\n", - globalCondConv[0], globalCondConv[1], globalCondConv[2], - globalCondConv[3], globalCondConv[4] )); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Convergence, + GEOS_FMT( " ALM convergence summary:" + " converged: {:6} | stick & gn>0: {:6} | compenetration: {:6} | stick & gt>lim: {:6} | tau>tauLim: {:6}\n", + globalCondConv[0], globalCondConv[1], globalCondConv[2], + globalCondConv[3], globalCondConv[4] )); if( hasConfigurationConvergedGlobally ) { @@ -1089,8 +1093,7 @@ void SolidMechanicsAugmentedLagrangianContact::updateStickSlipList( DomainPartit this->m_faceTypesToFaceElementsStick[meshName][finiteElementName] = stickList; this->m_faceTypesToFaceElementsSlip[meshName][finiteElementName] = slipList; - GEOS_LOG_LEVEL( 2, - GEOS_FMT( "# stick elements: {}, # slip elements: {}", nStick, nSlip )) + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Configuration, GEOS_FMT( "# stick elements: {}, # slip elements: {}", nStick, nSlip )) } ); } ); diff --git a/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp b/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp index 2b66ae59da0..bdb83a14ed6 100644 --- a/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp +++ b/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp @@ -35,6 +35,7 @@ #include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp" // needed to register pressure(_n) #include "physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp" #include "physicsSolvers/contact/ContactFields.hpp" +#include "physicsSolvers/contact/LogLevelsInfo.hpp" #include "common/GEOS_RAJA_Interface.hpp" #include "linearAlgebra/utilities/LAIHelperFunctions.hpp" #include "linearAlgebra/solvers/PreconditionerJacobi.hpp" @@ -71,6 +72,8 @@ SolidMechanicsLagrangeContact::SolidMechanicsLagrangeContact( const string & nam setApplyDefaultValue( 1.0 ). 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 >(); + LinearSolverParameters & linSolParams = m_linearSolverParameters.get(); linSolParams.mgr.strategy = LinearSolverParameters::MGR::StrategyType::lagrangianContactMechanics; linSolParams.mgr.separateComponents = true; @@ -426,10 +429,11 @@ void SolidMechanicsLagrangeContact::computeTolerances( DomainPartition & domain } ); } ); - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{}: normal displacement tolerance = [{}, {}], sliding tolerance = [{}, {}], normal traction tolerance = [{}, {}]", - this->getName(), minNormalDisplacementTolerance, maxNormalDisplacementTolerance, - minSlidingTolerance, maxSlidingTolerance, - minNormalTractionTolerance, maxNormalTractionTolerance ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Configuration, + GEOS_FMT( "{}: normal displacement tolerance = [{}, {}], sliding tolerance = [{}, {}], normal traction tolerance = [{}, {}]", + this->getName(), minNormalDisplacementTolerance, maxNormalDisplacementTolerance, + minSlidingTolerance, maxSlidingTolerance, + minNormalTractionTolerance, maxNormalTractionTolerance ) ); } void SolidMechanicsLagrangeContact::resetStateToBeginningOfStep( DomainPartition & domain ) @@ -2333,7 +2337,7 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai // and total area of fracture elements totalArea = MpiWrapper::sum( totalArea ); - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( " {}: changed area {} out of {}", getName(), changedArea, totalArea ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Configuration, GEOS_FMT( " {}: changed area {} out of {}", getName(), changedArea, totalArea ) ); // Assume converged if changed area is below certain fraction of total area return changedArea <= m_nonlinearSolverParameters.m_configurationTolerance * totalArea; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CMakeLists.txt b/src/coreComponents/physicsSolvers/fluidFlow/CMakeLists.txt index 37b41360330..0f9bb90d40e 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/fluidFlow/CMakeLists.txt @@ -42,6 +42,7 @@ set( physicsSolvers_headers fluidFlow/StencilDataCollection.hpp fluidFlow/ThermalSinglePhaseBaseKernels.hpp fluidFlow/ThermalSinglePhaseFVMKernels.hpp + fluidFlow/LogLevelsInfo.hpp fluidFlow/wells/CompositionalMultiphaseWell.hpp fluidFlow/wells/CompositionalMultiphaseWellFields.hpp fluidFlow/wells/CompositionalMultiphaseWellKernels.hpp @@ -52,6 +53,7 @@ set( physicsSolvers_headers fluidFlow/wells/WellControls.hpp fluidFlow/wells/WellSolverBase.hpp fluidFlow/wells/WellSolverBaseFields.hpp + fluidFlow/wells/LogLevelsInfo.hpp PARENT_SCOPE ) # Specify solver sources diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp index a8d6f99ecec..24bfc0dbff0 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp @@ -2152,23 +2152,23 @@ real64 CompositionalMultiphaseBase::setNextDtBasedOnStateChange( real64 const & maxRelativePresChange = MpiWrapper::max( maxRelativePresChange ); maxAbsolutePhaseVolFracChange = MpiWrapper::max( maxAbsolutePhaseVolFracChange ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: max relative pressure change during time step = {} %", - getName(), GEOS_FMT( "{:.{}f}", 100*maxRelativePresChange, 3 ) ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: max absolute phase volume fraction change during time step = {}", - getName(), GEOS_FMT( "{:.{}f}", maxAbsolutePhaseVolFracChange, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: max relative pressure change during time step = {} %", + getName(), GEOS_FMT( "{:.{}f}", 100*maxRelativePresChange, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: max absolute phase volume fraction change during time step = {}", + getName(), GEOS_FMT( "{:.{}f}", maxAbsolutePhaseVolFracChange, 3 ) ) ); if( m_targetRelativeCompDensChange < LvArray::NumericLimits< real64 >::max ) { maxRelativeCompDensChange = MpiWrapper::max( maxRelativeCompDensChange ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: max relative component density change during time step = {} %", - getName(), GEOS_FMT( "{:.{}f}", 100*maxRelativeCompDensChange, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: max relative component density change during time step = {} %", + getName(), GEOS_FMT( "{:.{}f}", 100*maxRelativeCompDensChange, 3 ) ) ); } if( m_isThermal ) { maxRelativeTempChange = MpiWrapper::max( maxRelativeTempChange ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: max relative temperature change during time step = {} %", - getName(), GEOS_FMT( "{:.{}f}", 100*maxRelativeTempChange, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: max relative temperature change during time step = {} %", + getName(), GEOS_FMT( "{:.{}f}", 100*maxRelativeTempChange, 3 ) ) ); } real64 const eps = LvArray::NumericLimits< real64 >::epsilon; @@ -2208,8 +2208,8 @@ real64 CompositionalMultiphaseBase::setNextDtBasedOnCFL( const geos::real64 & cu computeCFLNumbers( domain, currentDt, maxPhaseCFL, maxCompCFL ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: max phase CFL number = {}", getName(), maxPhaseCFL ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: max component CFL number = {} ", getName(), maxCompCFL ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: max phase CFL number = {}", getName(), maxPhaseCFL ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "{}: max component CFL number = {} ", getName(), maxCompCFL ) ); return std::min( m_targetFlowCFL * currentDt / maxCompCFL, m_targetFlowCFL * currentDt / maxPhaseCFL ); @@ -2611,7 +2611,8 @@ void CompositionalMultiphaseBase::updateState( DomainPartition & domain ) maxDeltaPhaseVolFrac = MpiWrapper::max( maxDeltaPhaseVolFrac ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max phase volume fraction change = {}", getName(), fmt::format( "{:.{}f}", maxDeltaPhaseVolFrac, 4 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, + GEOS_FMT( " {}: Max phase volume fraction change = {}", getName(), fmt::format( "{:.{}f}", maxDeltaPhaseVolFrac, 4 ) ) ); } bool CompositionalMultiphaseBase::checkSequentialSolutionIncrements( DomainPartition & domain ) const @@ -2619,8 +2620,8 @@ bool CompositionalMultiphaseBase::checkSequentialSolutionIncrements( DomainParti bool isConverged = FlowSolverBase::checkSequentialSolutionIncrements( domain ); string const unit = m_useMass ? "kg/m3" : "mol/m3"; - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max component density change during outer iteration: {} {}", - getName(), fmt::format( "{:.{}f}", m_sequentialCompDensChange, 3 ), unit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Convergence, GEOS_FMT( " {}: Max component density change during outer iteration: {} {}", + getName(), fmt::format( "{:.{}f}", m_sequentialCompDensChange, 3 ), unit ) ); return isConverged && (m_sequentialCompDensChange < m_maxSequentialCompDensChange); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp index 7e65c07d4aa..d85079eb757 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp @@ -438,11 +438,8 @@ real64 CompositionalMultiphaseFVM::calculateResidualNorm( real64 const & GEOS_UN } residualNorm = sqrt( globalResidualNorm[0] * globalResidualNorm[0] + globalResidualNorm[1] * globalResidualNorm[1] + globalResidualNorm[2] * globalResidualNorm[2] ); - if( getLogLevel() >= 1 && logger::internal::rank == 0 ) - { - std::cout << GEOS_FMT( " ( Rmass Rvol ) = ( {:4.2e} {:4.2e} ) ( Renergy ) = ( {:4.2e} )", - globalResidualNorm[0], globalResidualNorm[1], globalResidualNorm[2] ); - } + GEOS_LOG_LEVEL_INFO_RANK_0_NLR( logInfo::Convergence, GEOS_FMT( " ( Rmass Rvol ) = ( {:4.2e} {:4.2e} ) ( Renergy ) = ( {:4.2e} )", + globalResidualNorm[0], globalResidualNorm[1], globalResidualNorm[2] )); } else { @@ -535,26 +532,26 @@ real64 CompositionalMultiphaseFVM::scalingForSystemSolution( DomainPartition & d minCompDensScalingFactor = MpiWrapper::min( minCompDensScalingFactor ); string const massUnit = m_useMass ? "kg/m3" : "mol/m3"; - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max pressure change = {} Pa (before scaling)", - getName(), GEOS_FMT( "{:.{}f}", maxDeltaPres, 3 ) ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max component density change = {} {} (before scaling)", - getName(), GEOS_FMT( "{:.{}f}", maxDeltaCompDens, 3 ), massUnit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Max pressure change = {} Pa (before scaling)", + getName(), GEOS_FMT( "{:.{}f}", maxDeltaPres, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Max component density change = {} {} (before scaling)", + getName(), GEOS_FMT( "{:.{}f}", maxDeltaCompDens, 3 ), massUnit ) ); if( m_isThermal ) { maxDeltaTemp = MpiWrapper::max( maxDeltaTemp ); minTempScalingFactor = MpiWrapper::min( minTempScalingFactor ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max temperature change = {} K (before scaling)", - getName(), GEOS_FMT( "{:.{}f}", maxDeltaTemp, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Max temperature change = {} K (before scaling)", + getName(), GEOS_FMT( "{:.{}f}", maxDeltaTemp, 3 ) ) ); } if( m_scalingType == ScalingType::Local ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Min pressure scaling factor = {}", getName(), minPresScalingFactor ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Min component density scaling factor = {}", getName(), minCompDensScalingFactor ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Min pressure scaling factor = {}", getName(), minPresScalingFactor ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Min component density scaling factor = {}", getName(), minCompDensScalingFactor ) ); if( m_isThermal ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Min temperature scaling factor = {}", getName(), minTempScalingFactor ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Min temperature scaling factor = {}", getName(), minTempScalingFactor ) ); } } @@ -627,15 +624,15 @@ bool CompositionalMultiphaseFVM::checkSystemSolution( DomainPartition & domain, numNegTotalDens = MpiWrapper::sum( numNegTotalDens ); if( numNegPres > 0 ) - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Number of negative pressure values: {}, minimum value: {} Pa", - getName(), numNegPres, fmt::format( "{:.{}f}", minPres, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Number of negative pressure values: {}, minimum value: {} Pa", + getName(), numNegPres, fmt::format( "{:.{}f}", minPres, 3 ) ) ); string const massUnit = m_useMass ? "kg/m3" : "mol/m3"; if( numNegDens > 0 ) - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Number of negative component density values: {}, minimum value: {} {}}", - getName(), numNegDens, fmt::format( "{:.{}f}", minDens, 3 ), massUnit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Number of negative component density values: {}, minimum value: {} {}}", + getName(), numNegDens, fmt::format( "{:.{}f}", minDens, 3 ), massUnit ) ); if( minTotalDens > 0 ) - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Number of negative total density values: {}, minimum value: {} {}}", - getName(), minTotalDens, fmt::format( "{:.{}f}", minDens, 3 ), massUnit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Number of negative total density values: {}, minimum value: {} {}}", + getName(), minTotalDens, fmt::format( "{:.{}f}", minDens, 3 ), massUnit ) ); return MpiWrapper::min( localCheck ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp index 8240c9b3eaf..c40cd769f20 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp @@ -32,6 +32,7 @@ #include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp" #include "physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseBaseKernels.hpp" #include "physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernels.hpp" +#include "physicsSolvers/fluidFlow/LogLevelsInfo.hpp" namespace geos @@ -60,6 +61,9 @@ CompositionalMultiphaseStatistics::CompositionalMultiphaseStatistics( const stri setApplyDefaultValue( 1e-6 ). setInputFlag( InputFlags::OPTIONAL ). setDescription( "Flag to decide whether a phase is considered mobile (when the relperm is above the threshold) or immobile (when the relperm is below the threshold) in metric 2" ); + + addLogLevel< logInfo::CFL >(); + addLogLevel< logInfo::Statistics >(); } void CompositionalMultiphaseStatistics::postInputInitialization() @@ -391,8 +395,8 @@ void CompositionalMultiphaseStatistics::computeRegionStatistics( real64 const ti { regionStatistics.averagePressure = 0.0; regionStatistics.averageTemperature = 0.0; - GEOS_LOG_LEVEL_RANK_0( 1, getName() << ", " << regionNames[i] - << ": Cannot compute average pressure because region pore volume is zero." ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{}, {}: Cannot compute average pressure because region pore volume is zero.", getName(), regionNames[i] ) ); } @@ -406,34 +410,46 @@ void CompositionalMultiphaseStatistics::computeRegionStatistics( real64 const ti } string_view massUnit = units::getSymbol( m_solver->getMassUnit() ); - - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Pressure (min, average, max): {}, {}, {} Pa", - getName(), regionNames[i], time, regionStatistics.minPressure, regionStatistics.averagePressure, regionStatistics.maxPressure ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Delta pressure (min, max): {}, {} Pa", - getName(), regionNames[i], time, regionStatistics.minDeltaPressure, regionStatistics.maxDeltaPressure ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Temperature (min, average, max): {}, {}, {} K", - getName(), regionNames[i], time, regionStatistics.minTemperature, regionStatistics.averageTemperature, regionStatistics.maxTemperature ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Total dynamic pore volume: {} rm^3", - getName(), regionNames[i], time, regionStatistics.totalPoreVolume ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Phase dynamic pore volume: {} rm^3", - getName(), regionNames[i], time, regionStatistics.phasePoreVolume ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Phase mass: {} {}", - getName(), regionNames[i], time, regionStatistics.phaseMass, massUnit ) ); + string statPrefix = GEOS_FMT( "{}, {} (time {} s):", getName(), regionNames[i], time ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Pressure (min, average, max): {}, {}, {} Pa", + statPrefix, regionStatistics.minPressure, regionStatistics.averagePressure, regionStatistics.maxPressure ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Delta pressure (min, max): {}, {} Pa", + statPrefix, regionStatistics.minDeltaPressure, regionStatistics.maxDeltaPressure ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Temperature (min, average, max): {}, {}, {} K", + statPrefix, regionStatistics.minTemperature, regionStatistics.averageTemperature, + regionStatistics.maxTemperature ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Total dynamic pore volume: {} rm^3", + statPrefix, regionStatistics.totalPoreVolume ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Phase dynamic pore volume: {} rm^3", + statPrefix, regionStatistics.phasePoreVolume ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Phase mass: {} {}", + statPrefix, regionStatistics.phaseMass, massUnit ) ); // metric 1: trapping computed with the Land trapping coefficient (similar to Eclipse) - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Trapped phase mass (metric 1): {} {}", - getName(), regionNames[i], time, regionStatistics.trappedPhaseMass, massUnit ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Non-trapped phase mass (metric 1): {} {}", - getName(), regionNames[i], time, nonTrappedPhaseMass, massUnit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Trapped phase mass (metric 1): {} {}", + statPrefix, regionStatistics.trappedPhaseMass, massUnit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Non-trapped phase mass (metric 1): {} {}", + statPrefix, nonTrappedPhaseMass, massUnit ) ); // metric 2: immobile phase mass computed with a threshold on relative permeability - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Immobile phase mass (metric 2): {} {}", - getName(), regionNames[i], time, regionStatistics.immobilePhaseMass, massUnit ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Mobile phase mass (metric 2): {} {}", - getName(), regionNames[i], time, mobilePhaseMass, massUnit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Immobile phase mass (metric 2): {} {}", + statPrefix, regionStatistics.immobilePhaseMass, massUnit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Mobile phase mass (metric 2): {} {}", + statPrefix, mobilePhaseMass, massUnit ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Component mass: {} {}", - getName(), regionNames[i], time, regionStatistics.componentMass, massUnit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Component mass: {} {}", + statPrefix, regionStatistics.componentMass, massUnit ) ); if( m_writeCSV > 0 && MpiWrapper::commRank() == 0 ) { @@ -472,8 +488,8 @@ void CompositionalMultiphaseStatistics::computeCFLNumbers( real64 const time, real64 maxPhaseCFL, maxCompCFL; m_solver->computeCFLNumbers( domain, dt, maxPhaseCFL, maxCompCFL ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{} (time {} s): Max phase CFL number: {}", getName(), time, maxPhaseCFL ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{} (time {} s): Max component CFL number: {}", getName(), time, maxCompCFL ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::CFL, GEOS_FMT( "{} (time {} s): Max phase CFL number: {}", getName(), time, maxPhaseCFL ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::CFL, GEOS_FMT( "{} (time {} s): Max component CFL number: {}", getName(), time, maxCompCFL ) ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp index 5c54deae9b5..041b30899e8 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp @@ -795,13 +795,13 @@ void FlowSolverBase::updateStencilWeights( DomainPartition & domain ) const bool FlowSolverBase::checkSequentialSolutionIncrements( DomainPartition & GEOS_UNUSED_PARAM( domain ) ) const { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max pressure change during outer iteration: {} Pa", - getName(), fmt::format( "{:.{}f}", m_sequentialPresChange, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Convergence, GEOS_FMT( " {}: Max pressure change during outer iteration: {} Pa", + getName(), fmt::format( "{:.{}f}", m_sequentialPresChange, 3 ) ) ); if( m_isThermal ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max temperature change during outer iteration: {} K", - getName(), fmt::format( "{:.{}f}", m_sequentialTempChange, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Convergence, GEOS_FMT( " {}: Max temperature change during outer iteration: {} K", + getName(), fmt::format( "{:.{}f}", m_sequentialTempChange, 3 ) ) ); } return (m_sequentialPresChange < m_maxSequentialPresChange) && (m_sequentialTempChange < m_maxSequentialTempChange); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/fluidFlow/LogLevelsInfo.hpp new file mode 100644 index 00000000000..cd9f3eb5322 --- /dev/null +++ b/src/coreComponents/physicsSolvers/fluidFlow/LogLevelsInfo.hpp @@ -0,0 +1,57 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file LogLevelsInfo.hpp + * This file contains log level informations for flow solvers + */ + +#ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_LOGLEVELSINFO_HPP +#define GEOS_PHYSICSSOLVERS_FLUIDFLOW_LOGLEVELSINFO_HPP + +#include "common/DataTypes.hpp" + +namespace geos +{ + +namespace logInfo +{ + +/** + * @name Wells LogLevels info structures. They must comply with the `is_log_level_info` trait. + */ +///@{ + +/// @cond DO_NOT_DOCUMENT + +struct CFL +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "CFL information"; } +}; + +struct Statistics +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Print statistics"; } +}; + +/// @endcond +///@} + +} + +} + +#endif // GEOS_PHYSICSSOLVERS_FLUIDFLOW_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp index 9442496dc2c..4e7e14b7ac0 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp @@ -367,10 +367,7 @@ real64 ReactiveCompositionalMultiphaseOBL::calculateResidualNorm( real64 const & real64 const residual = m_useDARTSL2Norm ? MpiWrapper::max( localResidualNorm ) : std::sqrt( MpiWrapper::sum( localResidualNorm ) ); - if( getLogLevel() >= 1 && logger::internal::rank==0 ) - { - std::cout << GEOS_FMT( " ( Rflow ) = ( {:4.2e} )", residual ); - } + GEOS_LOG_LEVEL_INFO_RANK_0_NLR( logInfo::Convergence, GEOS_FMT( " ( Rflow ) = ( {:4.2e} )", residual ) ); return residual; } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp index 05dbc006843..29bb60d7ad2 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp @@ -1339,8 +1339,8 @@ real64 SinglePhaseBase::scalingForSystemSolution( DomainPartition & domain, scalingFactor = MpiWrapper::min( scalingFactor ); maxDeltaPres = MpiWrapper::max( maxDeltaPres ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max pressure change = {} Pa (before scaling)", - getName(), fmt::format( "{:.{}f}", maxDeltaPres, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Max pressure change = {} Pa (before scaling)", + getName(), fmt::format( "{:.{}f}", maxDeltaPres, 3 ) ) ); return scalingFactor; } @@ -1381,8 +1381,8 @@ bool SinglePhaseBase::checkSystemSolution( DomainPartition & domain, numNegativePressures = MpiWrapper::sum( numNegativePressures ); if( numNegativePressures > 0 ) - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Number of negative pressure values: {}, minimum value: {} Pa", - getName(), numNegativePressures, fmt::format( "{:.{}f}", minPressure, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Number of negative pressure values: {}, minimum value: {} Pa", + getName(), numNegativePressures, fmt::format( "{:.{}f}", minPressure, 3 ) ) ); return (m_allowNegativePressure || numNegativePressures == 0) ? 1 : 0; } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp index d76de134fd8..c5f10cd5f7f 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp @@ -228,11 +228,8 @@ real64 SinglePhaseFVM< BASE >::calculateResidualNorm( real64 const & GEOS_UNUSED } residualNorm = sqrt( globalResidualNorm[0] * globalResidualNorm[0] + globalResidualNorm[1] * globalResidualNorm[1] ); - if( getLogLevel() >= 1 && logger::internal::rank == 0 ) - { - std::cout << GEOS_FMT( " ( R{} ) = ( {:4.2e} ) ( Renergy ) = ( {:4.2e} )", - FlowSolverBase::coupledSolverAttributePrefix(), globalResidualNorm[0], globalResidualNorm[1] ); - } + GEOS_LOG_LEVEL_INFO_RANK_0_NLR( logInfo::Convergence, GEOS_FMT( " ( R{} ) = ( {:4.2e} ) ( Renergy ) = ( {:4.2e} )", + FlowSolverBase::coupledSolverAttributePrefix(), globalResidualNorm[0], globalResidualNorm[1] )); } else { @@ -246,10 +243,8 @@ real64 SinglePhaseFVM< BASE >::calculateResidualNorm( real64 const & GEOS_UNUSED solverBaseKernels::L2ResidualNormHelper::computeGlobalNorm( localResidualNorm[0], localResidualNormalizer[0], residualNorm ); } - if( getLogLevel() >= 1 && logger::internal::rank == 0 ) - { - std::cout << GEOS_FMT( " ( R{} ) = ( {:4.2e} )", FlowSolverBase::coupledSolverAttributePrefix(), residualNorm ); - } + GEOS_LOG_LEVEL_INFO_RANK_0_NLR( logInfo::Convergence, + GEOS_FMT( " ( R{} ) = ( {:4.2e} )", FlowSolverBase::coupledSolverAttributePrefix(), residualNorm )); } return residualNorm; } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp index 4a54f7f3ab1..44be8ac53ac 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp @@ -25,6 +25,7 @@ #include "physicsSolvers/fluidFlow/SinglePhaseBaseFields.hpp" #include "physicsSolvers/fluidFlow/SinglePhaseBaseKernels.hpp" #include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp" +#include "physicsSolvers/fluidFlow/LogLevelsInfo.hpp" namespace geos { @@ -35,7 +36,9 @@ using namespace dataRepository; SinglePhaseStatistics::SinglePhaseStatistics( const string & name, Group * const parent ): Base( name, parent ) -{} +{ + addLogLevel< logInfo::Statistics >(); +} void SinglePhaseStatistics::registerDataOnMesh( Group & meshBodies ) { @@ -247,16 +250,23 @@ void SinglePhaseStatistics::computeRegionStatistics( real64 const time, GEOS_WARNING( GEOS_FMT( "{}, {}: Cannot compute average pressure & temperature because region pore volume is zero.", getName(), regionNames[i] ) ); } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Pressure (min, average, max): {}, {}, {} Pa", - getName(), regionNames[i], time, regionStatistics.minPressure, regionStatistics.averagePressure, regionStatistics.maxPressure ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Delta pressure (min, max): {}, {} Pa", - getName(), regionNames[i], time, regionStatistics.minDeltaPressure, regionStatistics.maxDeltaPressure ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Temperature (min, average, max): {}, {}, {} K", - getName(), regionNames[i], time, regionStatistics.minTemperature, regionStatistics.averageTemperature, regionStatistics.maxTemperature ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Total dynamic pore volume: {} rm^3", - getName(), regionNames[i], time, regionStatistics.totalPoreVolume ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}, {} (time {} s): Total fluid mass: {} kg", - getName(), regionNames[i], time, regionStatistics.totalMass ) ); + string statPrefix = GEOS_FMT( "{}, {} (time {} s):", getName(), regionNames[i], time ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Pressure (min, average, max): {}, {}, {} Pa", + statPrefix, regionStatistics.minPressure, regionStatistics.averagePressure, regionStatistics.maxPressure ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Delta pressure (min, max): {}, {} Pa", + statPrefix, regionStatistics.minDeltaPressure, regionStatistics.maxDeltaPressure ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Temperature (min, average, max): {}, {}, {} K", + statPrefix, regionStatistics.minTemperature, regionStatistics.averageTemperature, + regionStatistics.maxTemperature ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Total dynamic pore volume: {} rm^3", + statPrefix, regionStatistics.totalPoreVolume ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, + GEOS_FMT( "{} Total fluid mass: {} kg", + statPrefix, regionStatistics.totalMass ) ); if( m_writeCSV > 0 && MpiWrapper::commRank() == 0 ) { diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index 2ad8b918fd7..d5787ab1b47 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -42,6 +42,7 @@ #include "physicsSolvers/fluidFlow/wells/SinglePhaseWellKernels.hpp" #include "physicsSolvers/fluidFlow/wells/WellSolverBaseFields.hpp" #include "physicsSolvers/fluidFlow/wells/WellControls.hpp" +#include "physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp" #if defined( __INTEL_COMPILER ) #pragma GCC optimize "O0" @@ -1336,8 +1337,8 @@ CompositionalMultiphaseWell::checkSystemSolution( DomainPartition & domain, if( !subRegionData.localMinVal ) { - GEOS_LOG_LEVEL( 1, "Solution is invalid in well " << subRegion.getName() - << " (either a negative pressure or a negative component density was found)." ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, + GEOS_FMT( "Solution is invalid in well {} (either a negative pressure or a negative component density was found)", subRegion.getName()) ); } localCheck = std::min( localCheck, subRegionData.localMinVal ); @@ -1596,9 +1597,9 @@ void CompositionalMultiphaseWell::assemblePressureRelations( real64 const & time { GEOS_MARK_FUNCTION; - forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, - MeshLevel const & mesh, - arrayView1d< string const > const & regionNames ) + forDiscretizationOnMeshTargets ( domain.getMeshBodies(), [&] ( string const &, + MeshLevel const & mesh, + arrayView1d< string const > const & regionNames ) { ElementRegionManager const & elemManager = mesh.getElemManager(); @@ -1641,7 +1642,7 @@ void CompositionalMultiphaseWell::assemblePressureRelations( real64 const & time subRegion.getTopWellElementIndex(), m_targetPhaseIndex, wellControls, - time_n + dt, // controls evaluated with BHP/rate of the end of step + time_n + dt, // controls evaluated with BHP/rate of the end of step wellElemDofNumber, wellElemGravCoef, nextWellElemIndex, @@ -1665,25 +1666,26 @@ void CompositionalMultiphaseWell::assemblePressureRelations( real64 const & time if( wellControls.isProducer() ) { wellControls.switchToPhaseRateControl( wellControls.getTargetPhaseRate( timeAtEndOfStep ) ); - GEOS_LOG_LEVEL( 1, "Control switch for well " << subRegion.getName() - << " from BHP constraint to phase volumetric rate constraint" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellControl, + GEOS_FMT( "Control switch for well {} from BHP constraint to phase volumetric rate constraint", subRegion.getName() ) ); } else { wellControls.switchToTotalRateControl( wellControls.getTargetTotalRate( timeAtEndOfStep ) ); - GEOS_LOG_LEVEL( 1, "Control switch for well " << subRegion.getName() - << " from BHP constraint to total volumetric rate constraint" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellControl, + GEOS_FMT( "Control switch for well {} from BHP constraint to total volumetric rate constraint", subRegion.getName()) ); } } else { wellControls.switchToBHPControl( wellControls.getTargetBHP( timeAtEndOfStep ) ); - GEOS_LOG_LEVEL( 1, "Control switch for well " << subRegion.getName() - << " from rate constraint to BHP constraint" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellControl, + GEOS_FMT( "Control switch for well {} from rate constraint to BHP constraint", subRegion.getName() ) ); } } } ); - } ); + } + ); } void CompositionalMultiphaseWell::shutDownWell( real64 const time_n, @@ -1950,4 +1952,4 @@ void CompositionalMultiphaseWell::printRates( real64 const & time_n, } REGISTER_CATALOG_ENTRY( SolverBase, CompositionalMultiphaseWell, string const &, Group * const ) -} // namespace geos +} // namespace geos diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp new file mode 100644 index 00000000000..9e9b9f20b50 --- /dev/null +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp @@ -0,0 +1,57 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file LogLevelsInfo.hpp + * This file contains log level informations for wells + */ + +#ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_WELLS_LOGLEVELSINFO_HPP +#define GEOS_PHYSICSSOLVERS_FLUIDFLOW_WELLS_LOGLEVELSINFO_HPP + +#include "common/DataTypes.hpp" + +namespace geos +{ + +namespace logInfo +{ + +/** + * @name Wells LogLevels info structures. They must comply with the `is_log_level_info` trait. + */ +///@{ + +/// @cond DO_NOT_DOCUMENT + +struct WellControl +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Well control information"; } +}; + +struct Crossflow +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Crossflow information"; } +}; + +/// @endcond +///@} + +} + +} + +#endif // GEOS_PHYSICSSOLVERS_FLUIDFLOW_WELLS_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp index 59c73f57eb9..78a700dcd91 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp @@ -35,6 +35,7 @@ #include "physicsSolvers/fluidFlow/wells/SinglePhaseWellFields.hpp" #include "physicsSolvers/fluidFlow/wells/SinglePhaseWellKernels.hpp" #include "physicsSolvers/fluidFlow/wells/WellControls.hpp" +#include "physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp" namespace geos { @@ -521,14 +522,12 @@ void SinglePhaseWell::assemblePressureRelations( real64 const & time_n, if( wellControls.getControl() == WellControls::Control::BHP ) { wellControls.switchToTotalRateControl( wellControls.getTargetTotalRate( timeAtEndOfStep ) ); - GEOS_LOG_LEVEL( 1, "Control switch for well " << subRegion.getName() - << " from BHP constraint to rate constraint" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellControl, GEOS_FMT( "Control switch for well {} from BHP constraint to rate constraint", subRegion.getName()) ); } else { wellControls.switchToBHPControl( wellControls.getTargetBHP( timeAtEndOfStep ) ); - GEOS_LOG_LEVEL( 1, "Control switch for well " << subRegion.getName() - << " from rate constraint to BHP constraint" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellControl, GEOS_FMT( "Control switch for well {} from rate constraint to BHP constraint", subRegion.getName()) ); } } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp index a71969ca029..5030a951dd1 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp @@ -21,6 +21,8 @@ #include "WellConstants.hpp" #include "dataRepository/InputFlags.hpp" #include "functions/FunctionManager.hpp" +#include "physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp" + namespace geos { @@ -340,8 +342,8 @@ void WellControls::postInputInitialization() else if( m_targetBHP <= 0.0 && m_targetBHPTableName.empty() ) { m_targetBHP = isProducer() ? WellConstants::defaultProducerBHP : WellConstants::defaultInjectorBHP; - GEOS_LOG_LEVEL_RANK_0( 1, "WellControls " << getDataContext() << ": Setting " << viewKeyStruct::targetBHPString() << " to default value " - << m_targetBHP << "." ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellControl, + GEOS_FMT( "WellControls {}: Setting {} to default value {}", getDataContext(), viewKeyStruct::targetBHPString(), m_targetBHP )); } // 6.2) Check incoherent information diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp index e600b55eb35..2b114b13f70 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp @@ -27,6 +27,7 @@ #include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp" #include "physicsSolvers/fluidFlow/wells/WellControls.hpp" #include "physicsSolvers/fluidFlow/wells/WellSolverBaseFields.hpp" +#include "physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp" #include "fileIO/Outputs/OutputBase.hpp" namespace geos @@ -49,6 +50,9 @@ WellSolverBase::WellSolverBase( string const & name, setApplyDefaultValue( 0 ). setInputFlag( dataRepository::InputFlags::OPTIONAL ). setDescription( "Write rates into a CSV file" ); + + addLogLevel< logInfo::WellControl >(); + addLogLevel< logInfo::Crossflow >(); } Group * WellSolverBase::createChild( string const & childKey, string const & childName ) diff --git a/src/coreComponents/physicsSolvers/multiphysics/CMakeLists.txt b/src/coreComponents/physicsSolvers/multiphysics/CMakeLists.txt index 60408e700ec..89a34cbc276 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/multiphysics/CMakeLists.txt @@ -13,6 +13,7 @@ set( physicsSolvers_headers multiphysics/PoromechanicsInitialization.hpp multiphysics/PoromechanicsFields.hpp multiphysics/PoromechanicsInitialization.hpp + multiphysics/LogLevelsInfo.hpp multiphysics/poromechanicsKernels/MultiphasePoromechanics.hpp multiphysics/poromechanicsKernels/MultiphasePoromechanics_impl.hpp multiphysics/poromechanicsKernels/PoromechanicsBase.hpp diff --git a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp index c01984e2908..5853f513231 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp @@ -21,6 +21,7 @@ #include "CompositionalMultiphaseReservoirAndWells.hpp" #include "common/TimingMacros.hpp" +#include "dataRepository/LogLevelsInfo.hpp" #include "constitutive/fluid/multifluid/MultiFluidBase.hpp" #include "mesh/PerforationFields.hpp" #include "physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.hpp" @@ -30,6 +31,7 @@ #include "physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellFields.hpp" #include "physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.hpp" #include "physicsSolvers/fluidFlow/wells/WellControls.hpp" +#include "physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp" #include "physicsSolvers/multiphysics/MultiphasePoromechanics.hpp" namespace geos @@ -43,7 +45,9 @@ CompositionalMultiphaseReservoirAndWells< RESERVOIR_SOLVER >:: CompositionalMultiphaseReservoirAndWells( const string & name, Group * const parent ) : Base( name, parent ) -{} +{ + Base::template addLogLevel< logInfo::Crossflow >(); +} template< typename RESERVOIR_SOLVER > CompositionalMultiphaseReservoirAndWells< RESERVOIR_SOLVER >:: @@ -91,7 +95,7 @@ setMGRStrategy() // flow solver here is indeed flow solver, not poromechanics solver if( flowSolver()->getLinearSolverParameters().mgr.strategy == LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseHybridFVM ) { - GEOS_LOG_RANK_0( "The poromechanics MGR strategy for hybrid FVM is not implemented" ); + GEOS_ERROR( "The poromechanics MGR strategy for hybrid FVM is not implemented" ); } else { @@ -412,10 +416,10 @@ assembleCouplingTerms( real64 const time_n, globalIndex const totalNumCrossflowPerforations = MpiWrapper::sum( numCrossflowPerforations.get() ); if( totalNumCrossflowPerforations > 0 ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "CompositionalMultiphaseReservoir '{}': Warning! Crossflow detected at {} perforations in well {}" - "To disable crossflow for injectors, you can use the field '{}' in the WellControls '{}' section", - this->getName(), totalNumCrossflowPerforations, subRegion.getName(), - WellControls::viewKeyStruct::enableCrossflowString(), wellControls.getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Crossflow, GEOS_FMT( "CompositionalMultiphaseReservoir '{}': Warning! Crossflow detected at {} perforations in well {}" + "To disable crossflow for injectors, you can use the field '{}' in the WellControls '{}' section", + this->getName(), totalNumCrossflowPerforations, subRegion.getName(), + WellControls::viewKeyStruct::enableCrossflowString(), wellControls.getName() )); } } } ); diff --git a/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp b/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp index 93a5d49c243..ea28f7b8b30 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp @@ -22,6 +22,7 @@ #define GEOS_PHYSICSSOLVERS_MULTIPHYSICS_COUPLEDSOLVER_HPP_ #include "physicsSolvers/SolverBase.hpp" +#include "physicsSolvers/multiphysics/LogLevelsInfo.hpp" #include @@ -55,6 +56,8 @@ class CoupledSolver : public SolverBase this->getWrapper< string >( SolverBase::viewKeyStruct::discretizationString() ). setInputFlag( dataRepository::InputFlags::FALSE ); + + addLogLevel< logInfo::Coupling >(); } /// deleted copy constructor @@ -88,7 +91,7 @@ class CoupledSolver : public SolverBase getDataContext(), solverName, solverType ), InputError ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: found {} solver named {}", getName(), solver->getCatalogName(), solverName ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Coupling, GEOS_FMT( "{}: found {} solver named {}", getName(), solver->getCatalogName(), solverName ) ); } ); } @@ -479,7 +482,7 @@ class CoupledSolver : public SolverBase // Solve the subproblems nonlinearly forEachArgInTuple( m_solvers, [&]( auto & solver, auto idx ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " Iteration {:2}: {}", iter + 1, solver->getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::NonlinearSolver, GEOS_FMT( " Iteration {:2}: {}", iter + 1, solver->getName() ) ); real64 solverDt = solver->nonlinearImplicitStep( time_n, stepDt, cycleNumber, @@ -530,7 +533,7 @@ class CoupledSolver : public SolverBase { // cut timestep, go back to beginning of step and restart the Newton loop stepDt *= dtCutFactor; - GEOS_LOG_LEVEL_RANK_0 ( 1, GEOS_FMT( "New dt = {}", stepDt ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "New dt = {}", stepDt ) ); // notify the solver statistics counter that this is a time step cut m_solverStatistics.logTimeStepCut(); @@ -582,11 +585,11 @@ class CoupledSolver : public SolverBase if( params.m_subcyclingOption == 0 ) { - GEOS_LOG_LEVEL_RANK_0( 1, "***** Single Pass solver, no subcycling *****" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Convergence, "***** Single Pass solver, no subcycling *****" ); } else { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " Iteration {:2}: outer-loop convergence check", iter + 1 ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Convergence, GEOS_FMT( " Iteration {:2}: outer-loop convergence check", iter + 1 ) ); if( params.sequentialConvergenceCriterion() == NonlinearSolverParameters::SequentialConvergenceCriterion::ResidualNorm ) { @@ -627,7 +630,7 @@ class CoupledSolver : public SolverBase // finally, we perform the convergence check on the multiphysics residual residualNorm = sqrt( residualNorm ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " ( R ) = ( {:4.2e} )", residualNorm ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Convergence, GEOS_FMT( " ( R ) = ( {:4.2e} )", residualNorm ) ); isConverged = ( residualNorm < params.m_newtonTol ); } @@ -654,7 +657,7 @@ class CoupledSolver : public SolverBase if( isConverged ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "***** The iterative coupling has converged in {} iteration(s) *****", iter + 1 ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Convergence, GEOS_FMT( "***** The iterative coupling has converged in {} iteration(s) *****", iter + 1 ) ); } } return isConverged; diff --git a/src/coreComponents/physicsSolvers/multiphysics/FlowProppantTransportSolver.cpp b/src/coreComponents/physicsSolvers/multiphysics/FlowProppantTransportSolver.cpp index 6102c209659..b0b07f0c2b0 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/FlowProppantTransportSolver.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/FlowProppantTransportSolver.cpp @@ -102,7 +102,7 @@ real64 FlowProppantTransportSolver::sequentiallyCoupledSolverStep( real64 const resetStateToBeginningOfStep( domain ); } - GEOS_LOG_LEVEL_RANK_0( 1, " Iteration: " << iter+1 << ", FlowSolver: " ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::NonlinearSolver, GEOS_FMT( " Iteration: {}, FlowSolver: ", iter+1 ) ); dtReturnTemporary = flowSolver()->nonlinearImplicitStep( time_n, dtReturn, cycleNumber, domain ); @@ -117,11 +117,11 @@ real64 FlowProppantTransportSolver::sequentiallyCoupledSolverStep( real64 const if( fluidNonLinearParams.m_numNewtonIterations <= this->m_nonlinearSolverParameters.m_minIterNewton && iter > 0 ) { m_solverStatistics.logNonlinearIteration(); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "***** The iterative coupling has converged in {} iterations *****", iter ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Convergence, GEOS_FMT( "***** The iterative coupling has converged in {} iterations *****", iter ) ); break; } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " Iteration: {}, Proppant Solver: ", iter+1 ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::NonlinearSolver, GEOS_FMT( " Iteration: {}, Proppant Solver: ", iter+1 ) ); dtReturnTemporary = proppantTransportSolver()->nonlinearImplicitStep( time_n, dtReturn, cycleNumber, domain ); diff --git a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp index 301eb93de28..dfb47daebbe 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp @@ -26,6 +26,8 @@ #include "physicsSolvers/multiphysics/SinglePhasePoromechanics.hpp" #include "physicsSolvers/multiphysics/MultiphasePoromechanics.hpp" #include "physicsSolvers/fluidFlow/SinglePhaseBase.hpp" +#include "physicsSolvers/surfaceGeneration/LogLevelsInfo.hpp" +#include "dataRepository/LogLevelsInfo.hpp" #include "mesh/MeshFields.hpp" #include "constitutive/fluid/singlefluid/SingleFluidFields.hpp" @@ -70,6 +72,8 @@ HydrofractureSolver< POROMECHANICS_SOLVER >::HydrofractureSolver( const string & setApplyDefaultValue( 0 ). setInputFlag( InputFlags::OPTIONAL ); + Base::template addLogLevel< logInfo::SurfaceGenerator >(); + registerWrapper( viewKeyStruct::isLaggingFractureStencilWeightsUpdateString(), &m_isLaggingFractureStencilWeightsUpdate ). setApplyDefaultValue( 0 ). setInputFlag( InputFlags::OPTIONAL ). @@ -362,13 +366,12 @@ void HydrofractureSolver< POROMECHANICS_SOLVER >::updateHydraulicApertureAndFrac minHydraulicAperture = MpiWrapper::min( minHydraulicAperture ); maxHydraulicAperture = MpiWrapper::max( maxHydraulicAperture ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max aperture change: {} m, max hydraulic aperture change: {} m", - this->getName(), fmt::format( "{:.{}f}", maxApertureChange, 6 ), fmt::format( "{:.{}f}", maxHydraulicApertureChange, 6 ) ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Min aperture: {} m, max aperture: {} m", - this->getName(), fmt::format( "{:.{}f}", minAperture, 6 ), fmt::format( "{:.{}f}", maxAperture, 6 ) ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Min hydraulic aperture: {} m, max hydraulic aperture: {} m", - this->getName(), fmt::format( "{:.{}f}", minHydraulicAperture, 6 ), fmt::format( "{:.{}f}", maxHydraulicAperture, 6 ) ) ); - + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Max aperture change: {} m, max hydraulic aperture change: {} m", + this->getName(), fmt::format( "{:.{}f}", maxApertureChange, 6 ), fmt::format( "{:.{}f}", maxHydraulicApertureChange, 6 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Min aperture: {} m, max aperture: {} m", + this->getName(), fmt::format( "{:.{}f}", minAperture, 6 ), fmt::format( "{:.{}f}", maxAperture, 6 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, GEOS_FMT( " {}: Min hydraulic aperture: {} m, max hydraulic aperture: {} m", + this->getName(), fmt::format( "{:.{}f}", minHydraulicAperture, 6 ), fmt::format( "{:.{}f}", maxHydraulicAperture, 6 ) ) ); } template< typename POROMECHANICS_SOLVER > void HydrofractureSolver< POROMECHANICS_SOLVER >::setupCoupling( DomainPartition const & domain, @@ -918,7 +921,6 @@ real64 HydrofractureSolver< POROMECHANICS_SOLVER >::setNextDt( real64 const & cu nextDt = m_surfaceGenerator->getTimestepRequest() < 1e99 ? m_surfaceGenerator->getTimestepRequest() : currentDt; } - GEOS_LOG_LEVEL_RANK_0( 3, this->getName() << ": nextDt request is " << nextDt ); return nextDt; } template< typename POROMECHANICS_SOLVER > @@ -1110,8 +1112,9 @@ void HydrofractureSolver< POROMECHANICS_SOLVER >::initializeNewFractureFields( D aperture[newElemIndex] = 0; } } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "New elem index = {:4d} , init aper = {:4.2e}, init press = {:4.2e} ", - newElemIndex, aperture[newElemIndex], fluidPressure[newElemIndex] ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::SurfaceGenerator, + GEOS_FMT( "New elem index = {:4d} , init aper = {:4.2e}, init press = {:4.2e} ", + newElemIndex, aperture[newElemIndex], fluidPressure[newElemIndex] ) ); } ); if( m_newFractureInitializationType == InitializationType::Displacement ) diff --git a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.hpp b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.hpp index fd850f65b5f..952415312d7 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.hpp @@ -24,6 +24,7 @@ #include "physicsSolvers/surfaceGeneration/SurfaceGenerator.hpp" #include "physicsSolvers/multiphysics/SinglePhasePoromechanics.hpp" #include "physicsSolvers/fluidFlow/SinglePhaseBase.hpp" +#include "dataRepository/LogLevelsInfo.hpp" namespace geos { diff --git a/src/coreComponents/physicsSolvers/multiphysics/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/multiphysics/LogLevelsInfo.hpp new file mode 100644 index 00000000000..fb9322e1021 --- /dev/null +++ b/src/coreComponents/physicsSolvers/multiphysics/LogLevelsInfo.hpp @@ -0,0 +1,51 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file LogLevelsInfo.hpp + * This file contains log level informations for coupled multiphysics solvers + */ + +#ifndef GEOS_PHYSICSSOLVERS_MULTIPHYSICS_LOGLEVELSINFO_HPP +#define GEOS_PHYSICSSOLVERS_MULTIPHYSICS_LOGLEVELSINFO_HPP + +#include "common/DataTypes.hpp" + +namespace geos +{ + +namespace logInfo +{ + +/** + * @name Wells LogLevels info structures. They must comply with the `is_log_level_info` trait. + */ +///@{ + +/// @cond DO_NOT_DOCUMENT + +struct Coupling +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Coupling information"; } +}; + +/// @endcond +///@} + +} + +} + +#endif // GEOS_PHYSICSSOLVERS_MULTIPHYSICS_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp b/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp index 476ebc35a94..1f4f06d0db3 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp @@ -21,6 +21,7 @@ #include "MultiphasePoromechanics.hpp" +#include "dataRepository/LogLevelsInfo.hpp" #include "constitutive/fluid/multifluid/MultiFluidBase.hpp" #include "constitutive/solid/PorousSolid.hpp" #include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp" @@ -45,7 +46,6 @@ MultiphasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::MultiphasePoromechanic Group * const parent ) : Base( name, parent ) { - LinearSolverParameters & linearSolverParameters = this->m_linearSolverParameters.get(); linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanics; linearSolverParameters.mgr.separateComponents = true; @@ -245,8 +245,9 @@ void MultiphasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::updateState( Doma maxDeltaPhaseVolFrac = MpiWrapper::max( maxDeltaPhaseVolFrac ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max phase volume fraction change = {}", - this->getName(), GEOS_FMT( "{:.{}f}", maxDeltaPhaseVolFrac, 4 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Solution, + GEOS_FMT( " {}: Max phase volume fraction change = {}", + this->getName(), GEOS_FMT( "{:.{}f}", maxDeltaPhaseVolFrac, 4 ) ) ); } template< typename FLOW_SOLVER, typename MECHANICS_SOLVER > diff --git a/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.hpp b/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.hpp index faba8e1b6b0..578df76e3cf 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.hpp @@ -41,6 +41,7 @@ class MultiphasePoromechanics : public PoromechanicsSolver< FLOW_SOLVER, MECHANI using Base::m_stabilizationType; using Base::m_stabilizationRegionNames; using Base::m_stabilizationMultiplier; + using Base::getLogLevel; /** * @brief main constructor for MultiphasePoromechanics Objects diff --git a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp index e86c9553544..e3849c64519 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp @@ -19,17 +19,18 @@ #include "PoromechanicsInitialization.hpp" +#include "events/tasks/TasksManager.hpp" #include "physicsSolvers/PhysicsSolverManager.hpp" +#include "physicsSolvers/fluidFlow/SinglePhaseBase.hpp" +#include "physicsSolvers/solidMechanics/SolidMechanicsStatistics.hpp" #include "physicsSolvers/multiphysics/MultiphasePoromechanics.hpp" #include "physicsSolvers/multiphysics/SinglePhasePoromechanics.hpp" #include "physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.hpp" #include "physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.hpp" #include "physicsSolvers/multiphysics/HydrofractureSolver.hpp" -#include "physicsSolvers/fluidFlow/SinglePhaseBase.hpp" #include "physicsSolvers/multiphysics/SinglePhaseReservoirAndWells.hpp" #include "physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.hpp" -#include "physicsSolvers/solidMechanics/SolidMechanicsStatistics.hpp" -#include "events/tasks/TasksManager.hpp" +#include "physicsSolvers/multiphysics/LogLevelsInfo.hpp" namespace geos { @@ -57,6 +58,8 @@ PoromechanicsInitialization( const string & name, setInputFlag( InputFlags::OPTIONAL ). setApplyDefaultValue( "" ). setDescription( "Name of the solid mechanics statistics" ); + + addLogLevel< logInfo::Initialization >(); } template< typename POROMECHANICS_SOLVER > @@ -107,16 +110,16 @@ execute( real64 const time_n, real64 const eventProgress, DomainPartition & domain ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "Task `{}`: at time {}s, physics solver `{}` is set to perform stress initialization during the next time step(s)", - getName(), time_n, m_poromechanicsSolverName ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Initialization, GEOS_FMT( "Task `{}`: at time {}s, physics solver `{}` is set to perform stress initialization during the next time step(s)", + getName(), time_n, m_poromechanicsSolverName ) ); m_poromechanicsSolver->setStressInitialization( true ); m_solidMechanicsStateResetTask.execute( time_n, dt, cycleNumber, eventCounter, eventProgress, domain ); m_poromechanicsSolver->execute( time_n, dt, cycleNumber, eventCounter, eventProgress, domain ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "Task `{}`: at time {}s, physics solver `{}` has completed stress initialization", - getName(), time_n + dt, m_poromechanicsSolverName ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Initialization, GEOS_FMT( "Task `{}`: at time {}s, physics solver `{}` has completed stress initialization", + getName(), time_n + dt, m_poromechanicsSolverName ) ); m_poromechanicsSolver->setStressInitialization( false ); if( m_solidMechanicsStatistics != nullptr ) diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp index 32f5980986e..5991b0fb3b1 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp @@ -19,6 +19,7 @@ #include "SinglePhasePoromechanicsConformingFractures.hpp" +#include "dataRepository/LogLevelsInfo.hpp" #include "constitutive/solid/PorousSolid.hpp" #include "constitutive/fluid/singlefluid/SingleFluidBase.hpp" #include "linearAlgebra/solvers/BlockPreconditioner.hpp" @@ -81,11 +82,6 @@ void SinglePhasePoromechanicsConformingFractures< FLOW_SOLVER >::setupSystem( Do this->setupDofs( domain, dofManager ); dofManager.reorderByRank(); - if( this->getLogLevel() > 2 ) - { - dofManager.printFieldInfo(); - } - /// 2. Add coupling terms not added by the DofManager. localIndex const numLocalRows = dofManager.numLocalDofs(); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt b/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt index ba9d4709fb5..2b0cfeb2233 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt @@ -1,6 +1,7 @@ # Specify solver headers set( physicsSolvers_headers ${physicsSolvers_headers} + solidMechanics/LogLevelsInfo.hpp solidMechanics/SolidMechanicsFields.hpp solidMechanics/SolidMechanicsLagrangianFEM.hpp solidMechanics/SolidMechanicsLagrangianFEM.hpp @@ -33,4 +34,4 @@ set( physicsSolvers_sources solidMechanics/SolidMechanicsStatistics.cpp PARENT_SCOPE ) -#include( solidMechanics/kernels/SolidMechanicsKernels.cmake) \ No newline at end of file +#include( solidMechanics/kernels/SolidMechanicsKernels.cmake) diff --git a/src/coreComponents/physicsSolvers/solidMechanics/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/solidMechanics/LogLevelsInfo.hpp new file mode 100644 index 00000000000..c70c238f6a9 --- /dev/null +++ b/src/coreComponents/physicsSolvers/solidMechanics/LogLevelsInfo.hpp @@ -0,0 +1,51 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file LogLevelsInfo.hpp + * This file contains log level informations for flow solvers + */ + +#ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_LOGLEVELSINFO_HPP +#define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_LOGLEVELSINFO_HPP + +#include "common/DataTypes.hpp" + +namespace geos +{ + +namespace logInfo +{ + +/** + * @name Wells LogLevels info structures. They must comply with the `is_log_level_info` trait. + */ +///@{ + +/// @cond DO_NOT_DOCUMENT + +struct Statistics +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Print statistics"; } +}; + +/// @endcond +///@} + +} + +} + +#endif // GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp index 8df7ee28d80..6c35edca982 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp @@ -21,6 +21,7 @@ #include "physicsSolvers/PhysicsSolverManager.hpp" #include "physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp" +#include "physicsSolvers/LogLevelsInfo.hpp" #include "mesh/DomainPartition.hpp" namespace geos @@ -51,6 +52,8 @@ SolidMechanicsStateReset::SolidMechanicsStateReset( const string & name, setApplyDefaultValue( false ). setInputFlag( InputFlags::OPTIONAL ). setDescription( "Flag to enable/disable inelastic behavior" ); + + addLogLevel< logInfo::Initialization >(); } SolidMechanicsStateReset::~SolidMechanicsStateReset() @@ -83,8 +86,9 @@ bool SolidMechanicsStateReset::execute( real64 const time_n, // Option 1: zero out velocity, incremental displacement, and displacement if( m_resetDisplacements ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "Task `{}`: at time {}s, physics solver `{}` is resetting total displacement and velocity to zero", - getName(), time_n, m_solidSolverName ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Initialization, + GEOS_FMT( "Task `{}`: at time {}s, physics solver `{}` is resetting total displacement and velocity to zero", + getName(), time_n, m_solidSolverName ) ); NodeManager & nodeManager = mesh.getNodeManager(); @@ -105,10 +109,10 @@ bool SolidMechanicsStateReset::execute( real64 const time_n, string const & solidMaterialName = subRegion.getReference< string >( SolidMechanicsLagrangianFEM::viewKeyStruct::solidMaterialNamesString() ); Group & constitutiveModels = subRegion.getGroup( ElementSubRegionBase::groupKeyStruct::constitutiveModelsString() ); - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "Task `{}`: at time {}s, solid model `{}` is setting inelastic behavior to `{}` on subRegion `{}`. ", - getName(), time_n, solidMaterialName, - m_disableInelasticity ? "OFF" : "ON", - subRegion.getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Initialization, GEOS_FMT( "Task `{}`: at time {}s, solid model `{}` is setting inelastic behavior to `{}` on subRegion `{}`. ", + getName(), time_n, solidMaterialName, + m_disableInelasticity ? "OFF" : "ON", + subRegion.getName() ) ); SolidBase & constitutiveRelation = constitutiveModels.getGroup< SolidBase >( solidMaterialName ); constitutiveRelation.disableInelasticity( m_disableInelasticity ); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStatistics.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStatistics.cpp index 578c9c82ee6..01b0073205f 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStatistics.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStatistics.cpp @@ -25,6 +25,7 @@ #include "physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp" #include "fileIO/Outputs/OutputBase.hpp" #include "mesh/DomainPartition.hpp" +#include "physicsSolvers/solidMechanics/LogLevelsInfo.hpp" namespace geos { @@ -36,7 +37,9 @@ using namespace fields; SolidMechanicsStatistics::SolidMechanicsStatistics( const string & name, Group * const parent ): Base( name, parent ) -{} +{ + addLogLevel< logInfo::Statistics >(); +} void SolidMechanicsStatistics::registerDataOnMesh( Group & meshBodies ) { @@ -152,12 +155,12 @@ void SolidMechanicsStatistics::computeNodeStatistics( MeshLevel & mesh, real64 c MpiWrapper::getMpiOp( MpiWrapper::Reduction::Min ), MPI_COMM_GEOS ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{} (time {} s): Min displacement (X, Y, Z): {}, {}, {} m", - getName(), time, nodeStatistics.minDisplacement[0], - nodeStatistics.minDisplacement[1], nodeStatistics.minDisplacement[2] ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{} (time {} s): Max displacement (X, Y, Z): {}, {}, {} m", - getName(), time, nodeStatistics.maxDisplacement[0], - nodeStatistics.maxDisplacement[1], nodeStatistics.maxDisplacement[2] ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, GEOS_FMT( "{} (time {} s): Min displacement (X, Y, Z): {}, {}, {} m", + getName(), time, nodeStatistics.minDisplacement[0], + nodeStatistics.minDisplacement[1], nodeStatistics.minDisplacement[2] ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::Statistics, GEOS_FMT( "{} (time {} s): Max displacement (X, Y, Z): {}, {}, {} m", + getName(), time, nodeStatistics.maxDisplacement[0], + nodeStatistics.maxDisplacement[1], nodeStatistics.maxDisplacement[2] ) ); if( m_writeCSV > 0 && MpiWrapper::commRank() == 0 ) { diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/CMakeLists.txt b/src/coreComponents/physicsSolvers/surfaceGeneration/CMakeLists.txt index ede9eacf734..9bcfd8fdc9b 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/CMakeLists.txt @@ -6,6 +6,7 @@ set( physicsSolvers_headers surfaceGeneration/ParallelTopologyChange.hpp surfaceGeneration/SurfaceGenerator.hpp surfaceGeneration/SurfaceGeneratorFields.hpp + surfaceGeneration/LogLevelsInfo.hpp surfaceGeneration/kernels/surfaceGenerationKernels.hpp surfaceGeneration/kernels/surfaceGenerationKernelsHelpers.hpp PARENT_SCOPE ) diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp index 0bc16f129e0..7b13c4618d5 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp @@ -36,7 +36,7 @@ #include "mesh/simpleGeometricObjects/GeometricObjectManager.hpp" #include "mesh/simpleGeometricObjects/Rectangle.hpp" #include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp" - +#include "physicsSolvers/surfaceGeneration/LogLevelsInfo.hpp" namespace geos @@ -191,7 +191,7 @@ void EmbeddedSurfaceGenerator::initializePostSubGroups() if( added ) { - GEOS_LOG_LEVEL_RANK_0( 2, "Element " << cellIndex << " is fractured" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::SurfaceGenerator, "Element " << cellIndex << " is fractured" ); // Add the information to the CellElementSubRegion subRegion.addFracturedElement( cellIndex, localNumberOfSurfaceElems ); @@ -353,7 +353,7 @@ void EmbeddedSurfaceGenerator::setGlobalIndices( ElementRegionManager & elemMana totalNumberOfSurfaceElements += numberOfSurfaceElemsPerRank[rank]; } - GEOS_LOG_LEVEL_RANK_0( 1, "Number of embedded surface elements: " << totalNumberOfSurfaceElements ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::SurfaceGenerator, "Number of embedded surface elements: " << totalNumberOfSurfaceElements ); arrayView1d< globalIndex > const & elemLocalToGlobal = embeddedSurfaceSubRegion.localToGlobalMap(); diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/surfaceGeneration/LogLevelsInfo.hpp new file mode 100644 index 00000000000..a3be90fff02 --- /dev/null +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/LogLevelsInfo.hpp @@ -0,0 +1,63 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file LogLevelsInfo.hpp + * This file contains log level informations for surface generators + */ + +#ifndef GEOS_PHYSICSSOLVERS_SURFACEGENERATION_LOGLEVELSINFO_HPP +#define GEOS_PHYSICSSOLVERS_SURFACEGENERATION_LOGLEVELSINFO_HPP + +#include "common/DataTypes.hpp" + +namespace geos +{ + +namespace logInfo +{ + +/** + * @name Wells LogLevels info structures. They must comply with the `is_log_level_info` trait. + */ +///@{ + +/// @cond DO_NOT_DOCUMENT + +struct SurfaceGenerator +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Fracture generation information"; } +}; + +struct Mapping +{ + static constexpr int getMinLogLevel() { return 2; } + static constexpr std::string_view getDescription() { return "Mapping information"; } +}; + +struct RuptureRate +{ + static constexpr int getMinLogLevel() { return 3; } + static constexpr std::string_view getDescription() { return "Rupture rate information"; } +}; + +/// @endcond +///@} + +} + +} + +#endif // GEOS_PHYSICSSOLVERS_SURFACEGENERATION_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp index 9bcce6125f0..1c8aed78104 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp @@ -32,6 +32,7 @@ #include "physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp" #include "physicsSolvers/solidMechanics/kernels/SolidMechanicsLagrangianFEMKernels.hpp" #include "physicsSolvers/surfaceGeneration/SurfaceGeneratorFields.hpp" +#include "physicsSolvers/surfaceGeneration/LogLevelsInfo.hpp" #include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp" #include "kernels/surfaceGenerationKernels.hpp" @@ -220,6 +221,10 @@ SurfaceGenerator::SurfaceGenerator( const string & name, this->getWrapper< string >( viewKeyStruct::discretizationString() ). setInputFlag( InputFlags::FALSE ); + + addLogLevel< logInfo::SurfaceGenerator >(); + addLogLevel< logInfo::Mapping >(); + addLogLevel< logInfo::RuptureRate >(); } void SurfaceGenerator::postInputInitialization() @@ -745,7 +750,7 @@ int SurfaceGenerator::separationDriver( DomainPartition & domain, real64 ruptureRate = calculateRuptureRate( elementManager.getRegion< SurfaceElementRegion >( this->m_fractureRegionName ) ); - GEOS_LOG_LEVEL_RANK_0( 3, "rupture rate is " << ruptureRate ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::RuptureRate, GEOS_FMT( "Rupture rate = {}", ruptureRate ) ); if( ruptureRate > 0 ) m_nextDt = ruptureRate < 1e99 ? m_cflFactor / ruptureRate : 1e99; @@ -1724,14 +1729,13 @@ void SurfaceGenerator::performFracture( const localIndex nodeID, // Split the node into two, using the original index, and a new one. localIndex newNodeIndex; - if( getLogLevel() > 0 ) { std::ostringstream s; for( std::set< localIndex >::const_iterator i=separationPathFaces.begin(); i!=separationPathFaces.end(); ++i ) { s << *i << " "; } - GEOS_LOG_RANK( GEOS_FMT( "Splitting node {} along separation plane faces: {}", nodeID, s.str() ) ); + GEOS_LOG_LEVEL_INFO_BY_RANK( logInfo::SurfaceGenerator, GEOS_FMT( "Splitting node {} along separation plane faces: {}", nodeID, s.str() ) ); } @@ -1770,11 +1774,7 @@ void SurfaceGenerator::performFracture( const localIndex nodeID, // >("usedFaces")[newNodeIndex]; // usedFacesNew = usedFaces[nodeID]; - - if( getLogLevel() > 0 ) - { - GEOS_LOG_RANK( GEOS_FMT( "Done splitting node {} into nodes {} and {}", nodeID, nodeID, newNodeIndex ) ); - } + GEOS_LOG_LEVEL_INFO_BY_RANK( logInfo::SurfaceGenerator, GEOS_FMT( "Done splitting node {} into nodes {} and {}", nodeID, nodeID, newNodeIndex ) ); // split edges map< localIndex, localIndex > splitEdges; @@ -1795,10 +1795,7 @@ void SurfaceGenerator::performFracture( const localIndex nodeID, edgeToFaceMap.clearSet( newEdgeIndex ); - if( getLogLevel() > 0 ) - { - GEOS_LOG_RANK( GEOS_FMT ( "Split edge {} into edges {} and {}", parentEdgeIndex, parentEdgeIndex, newEdgeIndex ) ); - } + GEOS_LOG_LEVEL_INFO_BY_RANK( logInfo::SurfaceGenerator, GEOS_FMT ( "Split edge {} into edges {} and {}", parentEdgeIndex, parentEdgeIndex, newEdgeIndex ) ); splitEdges[parentEdgeIndex] = newEdgeIndex; modifiedObjects.newEdges.insert( newEdgeIndex ); @@ -1854,11 +1851,7 @@ void SurfaceGenerator::performFracture( const localIndex nodeID, if( faceManager.splitObject( faceIndex, rank, newFaceIndex ) ) { - - if( getLogLevel() > 0 ) - { - GEOS_LOG_RANK( GEOS_FMT ( "Split face {} into faces {} and {}", faceIndex, faceIndex, newFaceIndex ) ); - } + GEOS_LOG_LEVEL_INFO_BY_RANK( logInfo::SurfaceGenerator, GEOS_FMT ( "Split face {} into faces {} and {}", faceIndex, faceIndex, newFaceIndex ) ); splitFaces[faceIndex] = newFaceIndex; modifiedObjects.newFaces.insert( newFaceIndex ); @@ -2125,23 +2118,19 @@ void SurfaceGenerator::performFracture( const localIndex nodeID, faceToElementMap[faceIndex][1] = -1; } - if( getLogLevel() > 1 ) - { - GEOS_LOG( " faceToRegionMap["< - + @@ -2267,7 +2278,18 @@ the relative residual norm satisfies: - + @@ -2337,7 +2359,18 @@ the relative residual norm satisfies: - + @@ -2397,7 +2430,18 @@ the relative residual norm satisfies: - + @@ -2451,7 +2495,18 @@ the relative residual norm satisfies: - + @@ -2537,7 +2592,18 @@ the relative residual norm satisfies: - + @@ -2597,7 +2663,20 @@ the relative residual norm satisfies: - + @@ -2619,7 +2698,19 @@ the relative residual norm satisfies: - + @@ -2658,7 +2749,20 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -2779,7 +2883,18 @@ Equal to 1 for surface conditions, and to 0 for reservoir conditions--> - + @@ -2839,7 +2954,18 @@ Equal to 1 for surface conditions, and to 0 for reservoir conditions--> - + @@ -2889,7 +3015,18 @@ Equal to 1 for surface conditions, and to 0 for reservoir conditions--> - + @@ -2913,7 +3050,19 @@ Equal to 1 for surface conditions, and to 0 for reservoir conditions--> - + @@ -2941,12 +3090,25 @@ Equal to 1 for surface conditions, and to 0 for reservoir conditions--> - + - + @@ -2969,7 +3131,7 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -2987,7 +3149,18 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3018,7 +3191,19 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3047,7 +3232,20 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3079,7 +3277,18 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3111,7 +3320,19 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3143,7 +3364,18 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3189,7 +3421,18 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3233,7 +3476,18 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3263,7 +3517,18 @@ SourceFluxes application if isThermal is enabled : - positive value (production): both the mass balance and the energy balance equations are modified to considered the additional source term. For the energy balance equation, the mass flux is multipied by the enthalpy in the cell from which the fluid is being produced.--> - + @@ -3299,7 +3564,18 @@ SourceFluxes application if isThermal is enabled : - positive value (production): both the mass balance and the energy balance equations are modified to considered the additional source term. For the energy balance equation, the mass flux is multipied by the enthalpy in the cell from which the fluid is being produced.--> - + @@ -3329,7 +3605,19 @@ For the energy balance equation, the mass flux is multipied by the enthalpy in t - + @@ -3362,7 +3650,19 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3391,7 +3691,19 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3417,7 +3729,19 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3446,7 +3770,19 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3478,7 +3814,18 @@ SourceFluxes application if isThermal is enabled : - positive value (production): both the mass balance and the energy balance equations are modified to considered the additional source term. For the energy balance equation, the mass flux is multipied by the enthalpy in the cell from which the fluid is being produced.--> - + @@ -3506,7 +3853,19 @@ For the energy balance equation, the mass flux is multipied by the enthalpy in t - + @@ -3528,7 +3887,19 @@ For the energy balance equation, the mass flux is multipied by the enthalpy in t - + @@ -3560,7 +3931,20 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3584,7 +3968,19 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3630,7 +4026,18 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3673,7 +4080,19 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3720,7 +4139,18 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3765,7 +4195,18 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3824,7 +4265,18 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3878,7 +4330,22 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3926,7 +4393,10 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3942,7 +4412,11 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3952,7 +4426,10 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -3962,7 +4439,10 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -4046,7 +4526,10 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -4056,7 +4539,10 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -4066,7 +4552,10 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -4076,7 +4565,10 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -4088,7 +4580,10 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -4098,7 +4593,10 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -4108,7 +4606,10 @@ Local- Add jump stabilization on interior of macro elements--> - + diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index d59f6b947e5..215191d89f5 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -471,7 +471,7 @@ - + @@ -553,7 +553,7 @@ - + @@ -590,7 +590,7 @@ - + @@ -641,7 +641,7 @@ - + @@ -682,7 +682,7 @@ - + @@ -715,7 +715,7 @@ - + @@ -726,7 +726,7 @@ - + @@ -739,7 +739,7 @@ - + @@ -752,7 +752,7 @@ - + @@ -768,7 +768,7 @@ - + @@ -802,7 +802,7 @@ - + @@ -865,7 +865,7 @@ - + @@ -896,7 +896,7 @@ - + @@ -909,7 +909,7 @@ - + @@ -922,7 +922,7 @@ - + @@ -935,7 +935,7 @@ - + @@ -948,7 +948,7 @@ - + @@ -963,7 +963,7 @@ - + @@ -974,7 +974,7 @@ - + @@ -987,7 +987,7 @@ - + @@ -998,7 +998,7 @@ - + @@ -1009,7 +1009,7 @@ - + @@ -1022,7 +1022,7 @@ - + @@ -1033,7 +1033,7 @@ - + @@ -1044,7 +1044,7 @@ - + @@ -1057,7 +1057,7 @@ - + @@ -1072,7 +1072,7 @@ - + @@ -1087,7 +1087,7 @@ - + @@ -1100,7 +1100,7 @@ - + @@ -1115,7 +1115,7 @@ - + @@ -1126,7 +1126,7 @@ - + @@ -1139,7 +1139,7 @@ - + @@ -1152,7 +1152,7 @@ - + @@ -1168,7 +1168,7 @@ - + @@ -1183,7 +1183,7 @@ - + @@ -1200,7 +1200,7 @@ - + @@ -1217,7 +1217,7 @@ - + @@ -1232,7 +1232,7 @@ - + @@ -1245,7 +1245,7 @@ - + @@ -1284,7 +1284,7 @@ - + @@ -1313,7 +1313,7 @@ - + @@ -1404,7 +1404,7 @@ - + @@ -2958,7 +2958,7 @@ - + @@ -2986,7 +2986,7 @@ - + @@ -3005,11 +3005,11 @@ - + - + @@ -3019,7 +3019,7 @@ - + @@ -3029,11 +3029,11 @@ - + - + @@ -3043,7 +3043,7 @@ - + @@ -3053,7 +3053,7 @@ - + @@ -3063,7 +3063,7 @@ - + @@ -3087,7 +3087,7 @@ - + @@ -3105,7 +3105,7 @@ - + @@ -3117,7 +3117,7 @@ - + @@ -3129,7 +3129,7 @@ - + @@ -3137,11 +3137,11 @@ - + - + @@ -3164,7 +3164,7 @@ - + @@ -3190,7 +3190,7 @@ - + @@ -3211,7 +3211,7 @@ - + @@ -3241,7 +3241,7 @@ - + @@ -3255,7 +3255,7 @@ - + @@ -3282,7 +3282,7 @@ - + @@ -3319,7 +3319,7 @@ - +