diff --git a/src/coreComponents/events/CMakeLists.txt b/src/coreComponents/events/CMakeLists.txt index a8e2e2ba71..181434d3ce 100644 --- a/src/coreComponents/events/CMakeLists.txt +++ b/src/coreComponents/events/CMakeLists.txt @@ -27,6 +27,7 @@ set( events_headers HaltEvent.hpp PeriodicEvent.hpp SoloEvent.hpp + LogLevelsInfo.hpp tasks/TaskBase.hpp tasks/TasksManager.hpp ) diff --git a/src/coreComponents/events/EventBase.cpp b/src/coreComponents/events/EventBase.cpp index 6212dc89d6..8f3635e0cd 100644 --- a/src/coreComponents/events/EventBase.cpp +++ b/src/coreComponents/events/EventBase.cpp @@ -20,6 +20,7 @@ #include "EventBase.hpp" #include +#include "events/LogLevelsInfo.hpp" #include "common/DataTypes.hpp" #include "common/TimingMacros.hpp" @@ -243,9 +244,9 @@ bool EventBase::execute( real64 const time_n, EventBase * subEvent = static_cast< EventBase * >( this->getSubGroups()[m_currentSubEvent] ); // Print debug information for logLevel >= 1 - GEOS_LOG_LEVEL_RANK_0( 1, - " SubEvent: " << m_currentSubEvent << " (" << subEvent->getName() << "), dt_request=" << subEvent->getCurrentEventDtRequest() << ", forecast=" << - subEvent->getForecast() ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::EventExecution, + " SubEvent: " << m_currentSubEvent << " (" << subEvent->getName() << "), dt_request=" << subEvent->getCurrentEventDtRequest() << ", forecast=" << + subEvent->getForecast() ); if( subEvent->isReadyForExec() ) { diff --git a/src/coreComponents/events/EventManager.cpp b/src/coreComponents/events/EventManager.cpp index 69c3a46dd9..f73cf41dec 100644 --- a/src/coreComponents/events/EventManager.cpp +++ b/src/coreComponents/events/EventManager.cpp @@ -23,6 +23,7 @@ #include "events/EventBase.hpp" #include "common/MpiWrapper.hpp" #include "common/Units.hpp" +#include "events/LogLevelsInfo.hpp" namespace geos { @@ -182,8 +183,8 @@ bool EventManager::run( DomainPartition & domain ) subEvent->checkEvents( m_time, m_dt, m_cycle, domain ); // Print debug information for logLevel >= 1 - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "Event: {} ({}), dt_request={}, forecast={}", - m_currentSubEvent, subEvent->getName(), subEvent->getCurrentEventDtRequest(), subEvent->getForecast() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::EventExecution, GEOS_FMT( "Event: {} ({}), dt_request={}, forecast={}", + m_currentSubEvent, subEvent->getName(), subEvent->getCurrentEventDtRequest(), subEvent->getForecast() ) ); // Execute, signal events bool earlyReturn = false; diff --git a/src/coreComponents/events/LogLevelsInfo.hpp b/src/coreComponents/events/LogLevelsInfo.hpp new file mode 100644 index 0000000000..86cafb422b --- /dev/null +++ b/src/coreComponents/events/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 common log level informations for physics solvers + */ + +#ifndef GEOS_EVENTS_LOGLEVELSINFO_HPP +#define GEOS_EVENTS_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 Initialization +{ + static constexpr int getMinLogLevel() { return 3; } + static constexpr std::string_view getDescription() { return "Information on Initialization"; } +}; + +struct EventExecution +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Informations on events executed"; } +}; + +/// @endcond +///@} + +} + +} + +#endif // GEOS_EVENTS_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/events/tasks/TaskBase.cpp b/src/coreComponents/events/tasks/TaskBase.cpp index 6020534f18..01a98c1924 100644 --- a/src/coreComponents/events/tasks/TaskBase.cpp +++ b/src/coreComponents/events/tasks/TaskBase.cpp @@ -29,6 +29,9 @@ TaskBase::TaskBase( string const & name, ExecutableGroup( name, parent ) { setInputFlags( InputFlags::OPTIONAL_NONUNIQUE ); + + addLogLevel< logInfo::Initialization >(); + addLogLevel< logInfo::EventExecution >(); } TaskBase::~TaskBase() diff --git a/src/coreComponents/events/tasks/TaskBase.hpp b/src/coreComponents/events/tasks/TaskBase.hpp index dfe0393fe8..d9cbc3db95 100644 --- a/src/coreComponents/events/tasks/TaskBase.hpp +++ b/src/coreComponents/events/tasks/TaskBase.hpp @@ -22,7 +22,7 @@ #include - +#include "events/LogLevelsInfo.hpp" #include "dataRepository/ExecutableGroup.hpp" #include "common/DataTypes.hpp" namespace geos diff --git a/src/coreComponents/fileIO/CMakeLists.txt b/src/coreComponents/fileIO/CMakeLists.txt index a53eda4945..0f8d9ff1ca 100644 --- a/src/coreComponents/fileIO/CMakeLists.txt +++ b/src/coreComponents/fileIO/CMakeLists.txt @@ -23,6 +23,7 @@ Contains: # Specify all headers # set( fileIO_headers + LogLevelsInfo.hpp Outputs/BlueprintOutput.hpp Outputs/OutputBase.hpp Outputs/OutputManager.hpp diff --git a/src/coreComponents/fileIO/LogLevelsInfo.hpp b/src/coreComponents/fileIO/LogLevelsInfo.hpp new file mode 100644 index 0000000000..e0c87161a1 --- /dev/null +++ b/src/coreComponents/fileIO/LogLevelsInfo.hpp @@ -0,0 +1,58 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * 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_FILEIO_LOGLEVELSINFO_HPP +#define GEOS_FILEIO_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 OutputEvents +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Information on output events, VTK/ChomboIO"; } +}; + + +struct Writing +{ + static constexpr int getMinLogLevel() { return 3; } + static constexpr std::string_view getDescription() { return "Information on buffered data in an HDF5 file "; } +}; + +/// @endcond +///@} + +} + +} + +#endif // GEOS_FILEIO_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/fileIO/Outputs/ChomboIO.cpp b/src/coreComponents/fileIO/Outputs/ChomboIO.cpp index ea2a16da38..9a0a732f89 100644 --- a/src/coreComponents/fileIO/Outputs/ChomboIO.cpp +++ b/src/coreComponents/fileIO/Outputs/ChomboIO.cpp @@ -20,6 +20,7 @@ #include "ChomboIO.hpp" #include "mesh/MeshLevel.hpp" #include "mesh/DomainPartition.hpp" +#include "fileIO/LogLevelsInfo.hpp" #include "fileIO/coupling/ChomboCoupler.hpp" #include @@ -75,6 +76,8 @@ ChomboIO::ChomboIO( string const & name, Group * const parent ): setInputFlag( InputFlags::OPTIONAL ). setDefaultValue( 0 ). setDescription( "True iff geos should use the pressures chombo writes out." ); + + addLogLevel< logInfo::OutputEvents >(); } ChomboIO::~ChomboIO() @@ -100,7 +103,7 @@ bool ChomboIO::execute( real64 const GEOS_UNUSED_PARAM( time_n ), { GEOS_ERROR_IF( m_waitForInput && m_inputPath == "/INVALID_INPUT_PATH", "Waiting for input but no input path was specified." ); - GEOS_LOG_LEVEL_RANK_0( 1, "Initializing chombo coupling" ); + GEOS_LOG_LEVEL_INFO( logInfo::OutputEvents, "Initializing chombo coupling" ); m_coupler = new ChomboCoupler( MPI_COMM_GEOS, m_outputPath, m_inputPath, domain.getMeshBody( 0 ).getBaseDiscretization() ); diff --git a/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp b/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp index 7f03e7cc2f..cbccbb86a1 100644 --- a/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp +++ b/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp @@ -16,6 +16,7 @@ #include "TimeHistoryOutput.hpp" #include "fileIO/timeHistory/HDFFile.hpp" +#include "fileIO/LogLevelsInfo.hpp" #if defined(GEOS_USE_PYGEOSX) #include "fileIO/python/PyHistoryOutputType.hpp" @@ -71,6 +72,7 @@ TimeHistoryOutput::TimeHistoryOutput( string const & name, setRestartFlags( RestartFlags::WRITE_AND_READ ). setDescription( "The current history record to be written, on restart from an earlier time allows use to remove invalid future history." ); + addLogLevel< logInfo::Initialization >(); } void TimeHistoryOutput::initCollectorParallel( DomainPartition const & domain, HistoryCollection & collector ) @@ -143,7 +145,7 @@ void TimeHistoryOutput::initializePostInitialConditionsPostSubGroups() } DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); - GEOS_LOG_LEVEL_BY_RANK( 3, GEOS_FMT( "TimeHistory: '{}' initializing data collectors.", this->getName() ) ); + GEOS_LOG_LEVEL_INFO_BY_RANK( logInfo::Initialization, GEOS_FMT( "TimeHistory: '{}' initializing data collectors.", this->getName() ) ); for( auto collectorPath : m_collectorPaths ) { try diff --git a/src/coreComponents/fileIO/Outputs/VTKOutput.cpp b/src/coreComponents/fileIO/Outputs/VTKOutput.cpp index 01168c319f..f4b4e14818 100644 --- a/src/coreComponents/fileIO/Outputs/VTKOutput.cpp +++ b/src/coreComponents/fileIO/Outputs/VTKOutput.cpp @@ -18,6 +18,7 @@ */ #include "VTKOutput.hpp" +#include "fileIO/LogLevelsInfo.hpp" #include "common/MpiWrapper.hpp" #if defined(GEOS_USE_PYGEOSX) @@ -109,6 +110,8 @@ VTKOutput::VTKOutput( string const & name, setApplyDefaultValue( m_outputRegionType ). setInputFlag( InputFlags::OPTIONAL ). setDescription( "Output region types. Valid options: ``" + EnumStrings< vtk::VTKRegionTypes >::concat( "``, ``" ) + "``" ); + + addLogLevel< logInfo::OutputEvents >(); } VTKOutput::~VTKOutput() @@ -173,11 +176,8 @@ bool VTKOutput::execute( real64 const time_n, real64 const GEOS_UNUSED_PARAM ( eventProgress ), DomainPartition & domain ) { - GEOS_MARK_FUNCTION; - - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{}: writing {} at time {} s (cycle number {})", getName(), m_fieldNames, time_n + dt, cycleNumber )); - { + GEOS_LOG_LEVEL_INFO( logInfo::OutputEvents, GEOS_FMT( "{}: writing {} at time {} s (cycle number {})", getName(), m_fieldNames, time_n + dt, cycleNumber )); Timer timer( m_outputTimer ); m_writer.setWriteGhostCells( m_writeGhostCells ); diff --git a/src/coreComponents/mesh/CMakeLists.txt b/src/coreComponents/mesh/CMakeLists.txt index 05f09e22dc..9850623616 100644 --- a/src/coreComponents/mesh/CMakeLists.txt +++ b/src/coreComponents/mesh/CMakeLists.txt @@ -39,6 +39,7 @@ set( mesh_headers ExternalDataSourceManager.hpp EmbeddedSurfaceNodeManager.hpp EmbeddedSurfaceSubRegion.hpp + LogLevelsInfo.hpp MeshFields.hpp FaceElementSubRegion.hpp FaceManager.hpp diff --git a/src/coreComponents/mesh/DomainPartition.cpp b/src/coreComponents/mesh/DomainPartition.cpp index befc10b485..3527f17e75 100644 --- a/src/coreComponents/mesh/DomainPartition.cpp +++ b/src/coreComponents/mesh/DomainPartition.cpp @@ -25,6 +25,7 @@ #include "mesh/ObjectManagerBase.hpp" #include "mesh/mpiCommunications/CommunicationTools.hpp" #include "mesh/mpiCommunications/SpatialPartition.hpp" +#include "mesh/LogLevelsInfo.hpp" namespace geos @@ -45,6 +46,8 @@ DomainPartition::DomainPartition( string const & name, registerGroup( groupKeys.meshBodies ); registerGroup< constitutive::ConstitutiveManager >( groupKeys.constitutiveManager ); + + addLogLevel< logInfo::PartitionCommunication >(); } @@ -262,7 +265,7 @@ void DomainPartition::setupCommunications( bool use_nonblocking ) } else { - GEOS_LOG_LEVEL_RANK_0( 3, "No communication setup is needed since it is a shallow copy of the base discretization." ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::PartitionCommunication, "No communication setup is needed since it is a shallow copy of the base discretization." ); } } } ); diff --git a/src/coreComponents/mesh/LogLevelsInfo.hpp b/src/coreComponents/mesh/LogLevelsInfo.hpp new file mode 100644 index 0000000000..9e4a0dc6da --- /dev/null +++ b/src/coreComponents/mesh/LogLevelsInfo.hpp @@ -0,0 +1,70 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * 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 MeshState +{ + static constexpr int getMinLogLevel() { return 2; } + static constexpr std::string_view getDescription() { return "Well phase volume fraction change information"; } +}; + +struct Statistics +{ + static constexpr int getMinLogLevel() { return 2; } + static constexpr std::string_view getDescription() { return "well statistics information"; } +}; + +struct PartitionCommunication +{ + static constexpr int getMinLogLevel() { return 3; } + static constexpr std::string_view getDescription() { return "Domain partition setup communication"; } +}; + +struct VTKSteps +{ + static constexpr int getMinLogLevel() { return 2; } + static constexpr std::string_view getDescription() { return "Display VTK mesh generator steps"; } +}; + + +/// @endcond +///@} + +} + +} + +#endif // GEOS_PHYSICSSOLVERS_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp index 6d791068df..acdbdc0def 100644 --- a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp +++ b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp @@ -84,6 +84,8 @@ VTKMeshGenerator::VTKMeshGenerator( string const & name, " If set to a negative value, the GlobalId arrays in the input mesh are not used, and generated global Ids are automatically generated." " If set to a positive value, the GlobalId arrays in the input mesh are used and required, and the simulation aborts if they are not available" ); + addLogLevel< logInfo::VTKSteps >(); + registerWrapper( viewKeyStruct::dataSourceString(), &m_dataSourceName ). setInputFlag( InputFlags::OPTIONAL ). setDescription( "Name of the VTK data source" ); @@ -122,10 +124,11 @@ void VTKMeshGenerator::fillCellBlockManager( CellBlockManager & cellBlockManager vtkSmartPointer< vtkMultiProcessController > controller = vtk::getController(); vtkMultiProcessController::SetGlobalController( controller ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, " redistributing mesh..." ); { vtk::AllMeshes allMeshes; - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{} '{}': reading the dataset...", catalogName(), getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, GEOS_FMT( "{} '{}': reading the dataset...", catalogName(), getName() ) ); if( !m_filePath.empty()) { @@ -183,33 +186,34 @@ void VTKMeshGenerator::fillCellBlockManager( CellBlockManager & cellBlockManager } } - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{} '{}': redistributing mesh...", catalogName(), getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, + GEOS_FMT( "{} '{}': redistributing mesh...", catalogName(), getName() ) ); vtk::AllMeshes redistributedMeshes = vtk::redistributeMeshes( getLogLevel(), allMeshes.getMainMesh(), allMeshes.getFaceBlocks(), comm, m_partitionMethod, m_partitionRefinement, m_useGlobalIds ); m_vtkMesh = redistributedMeshes.getMainMesh(); m_faceBlockMeshes = redistributedMeshes.getFaceBlocks(); - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{} '{}': finding neighbor ranks...", catalogName(), getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, GEOS_FMT( "{} '{}': finding neighbor ranks...", catalogName(), getName() ) ); std::vector< vtkBoundingBox > boxes = vtk::exchangeBoundingBoxes( *m_vtkMesh, comm ); std::vector< int > const neighbors = vtk::findNeighborRanks( std::move( boxes ) ); partition.setMetisNeighborList( std::move( neighbors ) ); - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{} '{}': done!", catalogName(), getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, GEOS_FMT( "{} '{}': done!", catalogName(), getName() ) ); } GEOS_LOG_RANK_0( GEOS_FMT( "{} '{}': generating GEOS mesh data structure", catalogName(), getName() ) ); - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{} '{}': preprocessing...", catalogName(), getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, GEOS_FMT( "{} '{}': preprocessing...", catalogName(), getName() ) ); m_cellMap = vtk::buildCellMap( *m_vtkMesh, m_attributeName ); - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{} '{}': writing nodes...", catalogName(), getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, GEOS_FMT( "{} '{}': writing nodes...", catalogName(), getName() ) ); cellBlockManager.setGlobalLength( writeNodes( getLogLevel(), *m_vtkMesh, m_nodesetNames, cellBlockManager, this->m_translate, this->m_scale ) ); - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{} '{}': writing cells...", catalogName(), getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, GEOS_FMT( "{} '{}': writing cells...", catalogName(), getName() ) ); writeCells( getLogLevel(), *m_vtkMesh, m_cellMap, cellBlockManager ); - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{} '{}': writing surfaces...", catalogName(), getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, GEOS_FMT( "{} '{}': writing surfaces...", catalogName(), getName() ) ); writeSurfaces( getLogLevel(), *m_vtkMesh, m_cellMap, cellBlockManager ); - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{} '{}': building connectivity maps...", catalogName(), getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, GEOS_FMT( "{} '{}': building connectivity maps...", catalogName(), getName() ) ); cellBlockManager.buildMaps(); for( auto const & [name, mesh]: m_faceBlockMeshes ) @@ -217,7 +221,7 @@ void VTKMeshGenerator::fillCellBlockManager( CellBlockManager & cellBlockManager vtk::importFractureNetwork( name, mesh, m_vtkMesh, cellBlockManager ); } - GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{} '{}': done!", catalogName(), getName() ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, GEOS_FMT( "{} '{}': done!", catalogName(), getName() ) ); vtk::printMeshStatistics( *m_vtkMesh, m_cellMap, comm ); } diff --git a/src/coreComponents/mesh/generators/VTKWellGenerator.cpp b/src/coreComponents/mesh/generators/VTKWellGenerator.cpp index b52409d3f6..16ab018d08 100644 --- a/src/coreComponents/mesh/generators/VTKWellGenerator.cpp +++ b/src/coreComponents/mesh/generators/VTKWellGenerator.cpp @@ -38,6 +38,7 @@ VTKWellGenerator::VTKWellGenerator( string const & name, Group * const parent ): setRestartFlags( RestartFlags::NO_WRITE ). setDescription( "Path to the well file" ); + addLogLevel< logInfo::VTKSteps >(); } void VTKWellGenerator::fillPolylineDataStructure( ) @@ -49,7 +50,7 @@ void VTKWellGenerator::fillPolylineDataStructure( ) GEOS_LOG_RANK_0( GEOS_FMT( "{} '{}': reading well from {}", catalogName(), getName(), m_filePath ) ); { - GEOS_LOG_LEVEL_RANK_0( 2, " reading the dataset..." ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::VTKSteps, " reading the dataset..." ); vtk::AllMeshes allMeshes = vtk::loadAllMeshes( m_filePath, "main", array1d< string >()); vtkSmartPointer< vtkDataSet > loadedMesh = allMeshes.getMainMesh(); controller->Broadcast( loadedMesh, 0 ); diff --git a/src/coreComponents/mesh/generators/WellGeneratorBase.cpp b/src/coreComponents/mesh/generators/WellGeneratorBase.cpp index f64e0e9b7d..b084101aca 100644 --- a/src/coreComponents/mesh/generators/WellGeneratorBase.cpp +++ b/src/coreComponents/mesh/generators/WellGeneratorBase.cpp @@ -70,6 +70,8 @@ WellGeneratorBase::WellGeneratorBase( string const & name, Group * const parent setInputFlag( InputFlags::REQUIRED ). setSizedFromParent( 0 ). setDescription( "Name of the set of constraints associated with this well" ); + + addLogLevel< logInfo::VTKSteps >(); } Group * WellGeneratorBase::createChild( string const & childKey, string const & childName ) diff --git a/src/coreComponents/mesh/generators/WellGeneratorBase.hpp b/src/coreComponents/mesh/generators/WellGeneratorBase.hpp index fbe05157d6..e29d51abc5 100644 --- a/src/coreComponents/mesh/generators/WellGeneratorBase.hpp +++ b/src/coreComponents/mesh/generators/WellGeneratorBase.hpp @@ -25,6 +25,7 @@ #include "dataRepository/Group.hpp" #include "codingUtilities/Utilities.hpp" #include "common/DataTypes.hpp" +#include "mesh/LogLevelsInfo.hpp" namespace geos diff --git a/src/coreComponents/physicsSolvers/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/LogLevelsInfo.hpp index 85f1712041..7881c7a47f 100644 --- a/src/coreComponents/physicsSolvers/LogLevelsInfo.hpp +++ b/src/coreComponents/physicsSolvers/LogLevelsInfo.hpp @@ -84,10 +84,10 @@ struct Timers static constexpr std::string_view getDescription() { return "Solver timers information"; } }; -struct Initialization +struct LinearSolverConfiguration { static constexpr int getMinLogLevel() { return 1; } - static constexpr std::string_view getDescription() { return "Initialization information"; } + static constexpr std::string_view getDescription() { return "Print linear solver configuration"; } }; /// @endcond diff --git a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp index 14ec3cbfd4..6aa67fecd3 100644 --- a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp @@ -104,6 +104,7 @@ PhysicsSolverBase::PhysicsSolverBase( string const & name, addLogLevel< logInfo::LinearSolver >(); addLogLevel< logInfo::NonlinearSolver >(); addLogLevel< logInfo::Timers >(); + addLogLevel< logInfo::LinearSolverConfiguration >(); registerGroup( groupKeyStruct::linearSolverParametersString(), &m_linearSolverParameters ); registerGroup( groupKeyStruct::nonlinearSolverParametersString(), &m_nonlinearSolverParameters ); diff --git a/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp b/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp index 6fecd60e93..482fb6c8e9 100644 --- a/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp @@ -23,8 +23,8 @@ #include "constitutive/contact/FrictionBase.hpp" #include "mesh/DomainPartition.hpp" #include "mesh/SurfaceElementRegion.hpp" -#include "physicsSolvers/contact/LogLevelsInfo.hpp" #include "physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp" +#include "physicsSolvers/contact/LogLevelsInfo.hpp" #include "common/GEOS_RAJA_Interface.hpp" namespace geos diff --git a/src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp b/src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp index b78afce691..a8ead01898 100644 --- a/src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp +++ b/src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp @@ -90,9 +90,10 @@ void SolidMechanicsEmbeddedFractures::setMGRStrategy() linearSolverParameters.mgr.separateComponents = true; linearSolverParameters.dofsPerNode = 3; - linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::solidMechanicsEmbeddedFractures; - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::solidMechanicsEmbeddedFractures; "linear solver settings" + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration, + GEOS_FMT( "{}: MGR strategy set to {}", getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } void SolidMechanicsEmbeddedFractures::registerDataOnMesh( dataRepository::Group & meshBodies ) diff --git a/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp b/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp index 9a76b95632..ce3557ba65 100644 --- a/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp +++ b/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp @@ -35,7 +35,6 @@ #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" @@ -93,8 +92,9 @@ void SolidMechanicsLagrangeContact::setMGRStrategy() linearSolverParameters.dofsPerNode = 3; linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::lagrangianContactMechanics; - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration, + GEOS_FMT( "{}: MGR strategy set to {}", getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } void SolidMechanicsLagrangeContact::registerDataOnMesh( Group & meshBodies ) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CMakeLists.txt b/src/coreComponents/physicsSolvers/fluidFlow/CMakeLists.txt index 651d9135e0..9578159989 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/fluidFlow/CMakeLists.txt @@ -1,6 +1,7 @@ # Specify solver headers set( physicsSolvers_headers ${physicsSolvers_headers} + fluidFlow/LogLevelsInfo.hpp fluidFlow/FlowSolverBase.hpp fluidFlow/FlowSolverBaseFields.hpp fluidFlow/CompositionalMultiphaseBase.hpp @@ -20,7 +21,6 @@ set( physicsSolvers_headers fluidFlow/SinglePhaseProppantBase.hpp fluidFlow/StencilAccessors.hpp fluidFlow/StencilDataCollection.hpp - fluidFlow/LogLevelsInfo.hpp fluidFlow/kernels/MinPoreVolumeMaxPorosityKernel.hpp fluidFlow/kernels/StencilWeightsUpdateKernel.hpp fluidFlow/kernels/HybridFVMHelperKernels.hpp @@ -89,13 +89,14 @@ set( physicsSolvers_headers fluidFlow/kernels/compositional/ThermalSolutionScalingKernel.hpp fluidFlow/wells/CompositionalMultiphaseWell.hpp fluidFlow/wells/CompositionalMultiphaseWellFields.hpp + fluidFlow/wells/kernels/CompositionalMultiphaseWellKernels.hpp + fluidFlow/wells/LogLevelsInfo.hpp fluidFlow/wells/SinglePhaseWell.hpp fluidFlow/wells/SinglePhaseWellFields.hpp fluidFlow/wells/WellConstants.hpp fluidFlow/wells/WellControls.hpp fluidFlow/wells/WellSolverBase.hpp fluidFlow/wells/WellSolverBaseFields.hpp - fluidFlow/wells/LogLevelsInfo.hpp fluidFlow/wells/kernels/SinglePhaseWellKernels.hpp fluidFlow/wells/kernels/CompositionalMultiphaseWellKernels.hpp fluidFlow/proppantTransport/ProppantTransport.hpp diff --git a/src/coreComponents/physicsSolvers/fluidFlow/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/fluidFlow/LogLevelsInfo.hpp index c42ac62038..0472011151 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/LogLevelsInfo.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/LogLevelsInfo.hpp @@ -36,6 +36,12 @@ namespace logInfo /// @cond DO_NOT_DOCUMENT +struct Crossflow +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Crossflow information"; } +}; + struct CFL { static constexpr int getMinLogLevel() { return 1; } @@ -48,6 +54,12 @@ struct Statistics static constexpr std::string_view getDescription() { return "Print statistics"; } }; +struct StencilConnection +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Log strencil stored connection"; } +}; + /// @endcond ///@} diff --git a/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp b/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp index 4b0adc25b2..41d6140710 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp @@ -25,6 +25,7 @@ #include "constitutive/permeability/PermeabilityBase.hpp" #include "constitutive/permeability/PermeabilityFields.hpp" #include "physicsSolvers/fluidFlow/StencilAccessors.hpp" +#include "physicsSolvers/fluidFlow/LogLevelsInfo.hpp" #include "physicsSolvers/PhysicsSolverManager.hpp" #include "common/format/table/TableFormatter.hpp" @@ -57,6 +58,8 @@ StencilDataCollection::StencilDataCollection( const string & name, registerWrapper( viewKeyStruct::cellBGlobalIdString(), &m_cellBGlobalId ); registerWrapper( viewKeyStruct::transmissibilityABString(), &m_transmissibilityAB ); registerWrapper( viewKeyStruct::transmissibilityBAString(), &m_transmissibilityBA ); + + addLogLevel< logInfo::StencilConnection >(); } void StencilDataCollection::postInputInitialization() @@ -107,8 +110,8 @@ void StencilDataCollection::initializePostInitialConditionsPostSubGroups() m_cellBGlobalId.resize( connCount ); m_transmissibilityAB.resize( connCount ); m_transmissibilityBA.resize( connCount ); - GEOS_LOG_LEVEL_BY_RANK( 1, GEOS_FMT( "{}: initialized {} connection buffer for '{}'.", - getName(), connCount, m_discretization->getName() ) ); + GEOS_LOG_LEVEL_INFO_BY_RANK( logInfo::Initialization, GEOS_FMT( "{}: initialized {} connection buffer for '{}'.", + getName(), connCount, m_discretization->getName() ) ); ++supportedStencilCount; } ); GEOS_ERROR_IF( supportedStencilCount == 0, GEOS_FMT( "{}: No compatible discretization was found.", getDataContext() ) ); @@ -284,8 +287,8 @@ void StencilDataCollection::storeConnectionData( string_view stencilName, void StencilDataCollection::logStoredConnections( string_view stencilName ) { integer const connCount = MpiWrapper::sum( m_cellAGlobalId.size() ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: {} connections stored for '{}'.", - getName(), connCount, stencilName ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::StencilConnection, GEOS_FMT( "{}: {} connections stored for '{}'.", + getName(), connCount, stencilName ) ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index 1f13044d87..94d7581a3e 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -34,11 +34,11 @@ #include "mesh/PerforationFields.hpp" #include "mesh/WellElementSubRegion.hpp" #include "mesh/mpiCommunications/CommunicationTools.hpp" +#include "physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp" #include "physicsSolvers/fluidFlow/wells/WellSolverBaseFields.hpp" #include "physicsSolvers/fluidFlow/wells/WellFields.hpp" #include "physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellFields.hpp" #include "physicsSolvers/fluidFlow/wells/WellControls.hpp" -#include "physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp" #include "physicsSolvers/fluidFlow/wells/kernels/CompositionalMultiphaseWellKernels.hpp" #include "physicsSolvers/fluidFlow/wells/kernels/ThermalCompositionalMultiphaseWellKernels.hpp" #include "physicsSolvers/fluidFlow/wells/kernels/PerforationFluxKernels.hpp" @@ -119,6 +119,9 @@ CompositionalMultiphaseWell::CompositionalMultiphaseWell( const string & name, setInputFlag( InputFlags::OPTIONAL ). setApplyDefaultValue( 1 ). setDescription( "Flag indicating whether local (cell-wise) chopping of negative compositions is allowed" ); + + addLogLevel< logInfo::WellComponents >(); + addLogLevel< logInfo::WellValidity >(); } void CompositionalMultiphaseWell::postInputInitialization() @@ -934,7 +937,7 @@ void CompositionalMultiphaseWell::updateState( DomainPartition & domain ) } ); maxPhaseVolFrac = MpiWrapper::max( maxPhaseVolFrac ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max well phase volume fraction change = {}", getName(), fmt::format( "{:.{}f}", maxPhaseVolFrac, 4 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellComponents, GEOS_FMT( " {}: Max well phase volume fraction change = {}", getName(), fmt::format( "{:.{}f}", maxPhaseVolFrac, 4 ) ) ); } @@ -1448,25 +1451,25 @@ CompositionalMultiphaseWell::scalingForSystemSolution( DomainPartition & domain, minCompDensScalingFactor = MpiWrapper::min( minCompDensScalingFactor ); string const massUnit = m_useMass ? "kg/m3" : "mol/m3"; - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max well pressure change: {} Pa (before scaling)", - getName(), GEOS_FMT( "{:.{}f}", maxDeltaPres, 3 ) ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Max well component density change: {} {} (before scaling)", - getName(), GEOS_FMT( "{:.{}f}", maxDeltaCompDens, 3 ), massUnit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellComponents, GEOS_FMT( " {}: Max well pressure change: {} Pa (before scaling)", + getName(), GEOS_FMT( "{:.{}f}", maxDeltaPres, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellComponents, GEOS_FMT( " {}: Max well 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 well temperature change: {} K (before scaling)", - getName(), GEOS_FMT( "{:.{}f}", maxDeltaTemp, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellComponents, GEOS_FMT( " {}: Max well temperature change: {} K (before scaling)", + getName(), GEOS_FMT( "{:.{}f}", maxDeltaTemp, 3 ) ) ); } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Min well pressure scaling factor: {}", getName(), minPresScalingFactor ) ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Min well component density scaling factor: {}", getName(), minCompDensScalingFactor ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellComponents, GEOS_FMT( " {}: Min well pressure scaling factor: {}", getName(), minPresScalingFactor ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellComponents, GEOS_FMT( " {}: Min well component density scaling factor: {}", getName(), minCompDensScalingFactor ) ); if( m_isThermal ) { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Min well temperature scaling factor: {}", getName(), minTempScalingFactor ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellComponents, GEOS_FMT( " {}: Min well temperature scaling factor: {}", getName(), minTempScalingFactor ) ); } @@ -1613,15 +1616,15 @@ CompositionalMultiphaseWell::checkSystemSolution( DomainPartition & domain, numNegTotalDens = MpiWrapper::sum( numNegTotalDens ); if( numNegPres > 0 ) - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( " {}: Number of negative well pressure values: {}, minimum value: {} Pa", - getName(), numNegPres, fmt::format( "{:.{}f}", minPres, 3 ) ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellValidity, GEOS_FMT( " {}: Number of negative well 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 well component density values: {}, minimum value: {} {} ", - getName(), numNegDens, fmt::format( "{:.{}f}", minDens, 3 ), massUnit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellValidity, GEOS_FMT( " {}: Number of negative well 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 well density values: {}, minimum value: {} {} ", - getName(), minTotalDens, fmt::format( "{:.{}f}", minDens, 3 ), massUnit ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::WellValidity, GEOS_FMT( " {}: Number of negative total well density values: {}, minimum value: {} {} ", + getName(), minTotalDens, fmt::format( "{:.{}f}", minDens, 3 ), massUnit ) ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp index 43120e4b77..12165c3860 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp @@ -36,16 +36,34 @@ namespace logInfo /// @cond DO_NOT_DOCUMENT +struct Crossflow +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Crossflow information"; } +}; + +struct WellComponents +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Well components information"; } +}; + struct WellControl { static constexpr int getMinLogLevel() { return 1; } static constexpr std::string_view getDescription() { return "Well control information"; } }; -struct Crossflow +struct WellValidity +{ + static constexpr int getMinLogLevel() { return 2; } + static constexpr std::string_view getDescription() { return "Well validity information"; } +}; + +struct SystemSolution { static constexpr int getMinLogLevel() { return 1; } - static constexpr std::string_view getDescription() { return "Crossflow information"; } + static constexpr std::string_view getDescription() { return "Log single phase well system solution"; } }; /// @endcond diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp index 75797a3490..d7ec497fa1 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp @@ -31,6 +31,7 @@ #include "mesh/PerforationFields.hpp" #include "mesh/mpiCommunications/CommunicationTools.hpp" #include "physicsSolvers/fluidFlow/SinglePhaseBase.hpp" +#include "physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp" #include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp" #include "physicsSolvers/fluidFlow/wells/WellSolverBaseFields.hpp" #include "physicsSolvers/fluidFlow/wells/SinglePhaseWellFields.hpp" @@ -38,7 +39,6 @@ #include "physicsSolvers/fluidFlow/wells/kernels/SinglePhaseWellKernels.hpp" #include "physicsSolvers/fluidFlow/kernels/singlePhase/FluidUpdateKernel.hpp" #include "physicsSolvers/fluidFlow/kernels/singlePhase/SolutionCheckKernel.hpp" -#include "physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp" namespace geos { @@ -60,6 +60,8 @@ SinglePhaseWell::SinglePhaseWell( const string & name, setApplyDefaultValue( 1 ). // negative pressure is allowed by default setInputFlag( InputFlags::OPTIONAL ). setDescription( "Flag indicating if negative pressure is allowed" ); + + addLogLevel< logInfo::SystemSolution >(); } void SinglePhaseWell::registerDataOnMesh( Group & meshBodies ) @@ -811,8 +813,11 @@ bool SinglePhaseWell::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::SystemSolution, + 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/wells/WellControls.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp index 7ce65b6cbe..6e0a8563bf 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp @@ -165,6 +165,8 @@ WellControls::WellControls( string const & name, Group * const parent ) setInputFlag( InputFlags::OPTIONAL ). setDescription( "Name of the well status table when the status of the well is a time dependent function. \n" "If the status function evaluates to a positive value at the current time, the well will be open otherwise the well will be shut." ); + + addLogLevel< logInfo::WellControl >(); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp index e7496035ec..a0647dc4d1 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp @@ -25,9 +25,9 @@ #include "mesh/WellElementSubRegion.hpp" #include "physicsSolvers/fluidFlow/FlowSolverBase.hpp" #include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp" +#include "physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp" #include "physicsSolvers/fluidFlow/wells/WellControls.hpp" #include "physicsSolvers/fluidFlow/wells/WellSolverBaseFields.hpp" -#include "physicsSolvers/fluidFlow/wells/LogLevelsInfo.hpp" #include "physicsSolvers/fluidFlow/wells/kernels/ThermalCompositionalMultiphaseWellKernels.hpp" #include "fileIO/Outputs/OutputBase.hpp" @@ -62,7 +62,6 @@ WellSolverBase::WellSolverBase( string const & name, 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/inducedSeismicity/CMakeLists.txt b/src/coreComponents/physicsSolvers/inducedSeismicity/CMakeLists.txt index c8f23c5532..abeb788926 100644 --- a/src/coreComponents/physicsSolvers/inducedSeismicity/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/inducedSeismicity/CMakeLists.txt @@ -1,6 +1,7 @@ # Specify solver headers set( physicsSolvers_headers ${physicsSolvers_headers} + inducedSeismicity/LogLevelsInfo.hpp inducedSeismicity/inducedSeismicityFields.hpp inducedSeismicity/rateAndStateFields.hpp inducedSeismicity/QuasiDynamicEQ.hpp diff --git a/src/coreComponents/physicsSolvers/inducedSeismicity/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/inducedSeismicity/LogLevelsInfo.hpp new file mode 100644 index 0000000000..1c96e71cd4 --- /dev/null +++ b/src/coreComponents/physicsSolvers/inducedSeismicity/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 common log level informations for physics solvers + */ + +#ifndef GEOS_PHYSICSSOLVERS_INDUCEDSEISMICITY_INDUCEDSEISMICITYFIELDS_HPP_ +#define GEOS_PHYSICSSOLVERS_INDUCEDSEISMICITY_INDUCEDSEISMICITYFIELDS_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 SolverSteps +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Solver step Information"; } +}; + +/// @endcond +///@} + +} + +} + +#endif // GEOS_PHYSICSSOLVERS_INDUCEDSEISMICITY_INDUCEDSEISMICITYFIELDS_HPP_ diff --git a/src/coreComponents/physicsSolvers/inducedSeismicity/QuasiDynamicEQ.cpp b/src/coreComponents/physicsSolvers/inducedSeismicity/QuasiDynamicEQ.cpp index 3ddf5fc149..3b834575df 100644 --- a/src/coreComponents/physicsSolvers/inducedSeismicity/QuasiDynamicEQ.cpp +++ b/src/coreComponents/physicsSolvers/inducedSeismicity/QuasiDynamicEQ.cpp @@ -23,6 +23,8 @@ #include "mesh/DomainPartition.hpp" #include "kernels/RateAndStateKernels.hpp" #include "rateAndStateFields.hpp" +#include "LogLevelsInfo.hpp" +#include "physicsSolvers/inducedSeismicity/LogLevelsInfo.hpp" #include "physicsSolvers/contact/ContactFields.hpp" #include "fieldSpecification/FieldSpecificationManager.hpp" @@ -54,6 +56,8 @@ QuasiDynamicEQ::QuasiDynamicEQ( const string & name, setInputFlag( InputFlags::OPTIONAL ). setApplyDefaultValue( 1.0e-7 ). setDescription( "Target slip incrmeent for timestep size selction" ); + + addLogLevel< logInfo::SolverSteps >(); } void QuasiDynamicEQ::postInputInitialization() @@ -144,12 +148,12 @@ real64 QuasiDynamicEQ::solverStep( real64 const & time_n, } /// 1. Compute shear and normal tractions - GEOS_LOG_LEVEL_RANK_0( 1, "Stress solver" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::SolverSteps, "Stress solver" ); real64 const dtStress = updateStresses( time_n, dt, cycleNumber, domain ); /// 2. Solve for slip rate and state variable and, compute slip - GEOS_LOG_LEVEL_RANK_0( 1, "Rate and State solver" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::SolverSteps, "Rate and State solver" ); integer const maxIterNewton = m_nonlinearSolverParameters.m_maxIterNewton; real64 const newtonTol = m_nonlinearSolverParameters.m_newtonTol; forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &, @@ -277,7 +281,7 @@ real64 QuasiDynamicEQ::setNextDt( real64 const & currentDt, DomainPartition & do real64 const nextDt = m_targetSlipIncrement / maxSlipRate; - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "The next dt will be {:.2e} s", nextDt )); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::TimeStep, GEOS_FMT( "The next dt will be {:.2e} s", nextDt )); return nextDt; } diff --git a/src/coreComponents/physicsSolvers/inducedSeismicity/QuasiDynamicEQRK32.cpp b/src/coreComponents/physicsSolvers/inducedSeismicity/QuasiDynamicEQRK32.cpp index 28ff8f5ff1..d0e0f76a48 100644 --- a/src/coreComponents/physicsSolvers/inducedSeismicity/QuasiDynamicEQRK32.cpp +++ b/src/coreComponents/physicsSolvers/inducedSeismicity/QuasiDynamicEQRK32.cpp @@ -52,6 +52,8 @@ QuasiDynamicEQRK32::QuasiDynamicEQRK32( const string & name, this->registerWrapper( viewKeyStruct::stressSolverNameString(), &m_stressSolverName ). setInputFlag( InputFlags::OPTIONAL ). setDescription( "Name of solver for computing stress. If empty, the spring-slider model is run." ); + + addLogLevel< logInfo::SolverSteps >(); } void QuasiDynamicEQRK32::postInputInitialization() @@ -162,7 +164,7 @@ real64 QuasiDynamicEQRK32::solverStep( real64 const & time_n, real64 dtAdaptive = dt; - GEOS_LOG_LEVEL_RANK_0( 1, "Begin adaptive time step" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::SolverSteps, "Begin adaptive time step" ); while( true ) // Adaptive time step loop. Performs a Runge-Kutta time stepping with error control on state and slip { real64 dtStress; GEOS_UNUSED_VAR( dtStress ); @@ -321,7 +323,7 @@ real64 QuasiDynamicEQRK32::updateStresses( real64 const & time_n, const int cycleNumber, DomainPartition & domain ) const { - GEOS_LOG_LEVEL_RANK_0( 1, "Stress solver" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::SolverSteps, "Stress solver" ); // Call member variable stress solver to update the stress state if( m_stressSolver ) { @@ -375,7 +377,7 @@ void QuasiDynamicEQRK32::updateSlipVelocity( real64 const & time_n, real64 const & dt, DomainPartition & domain ) const { - GEOS_LOG_LEVEL_RANK_0( 1, "Rate and State solver" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::SolverSteps, "Rate and State solver" ); integer const maxIterNewton = m_nonlinearSolverParameters.m_maxIterNewton; real64 const newtonTol = m_nonlinearSolverParameters.m_newtonTol; forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &, @@ -463,11 +465,13 @@ real64 QuasiDynamicEQRK32::setNextDt( real64 const & currentDt, DomainPartition { m_controller.errors[2] = m_controller.errors[1]; m_controller.errors[1] = m_controller.errors[0]; - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "Adaptive time step successful. The next dt will be {:.2e} s", nextDt )); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::SolverSteps, + GEOS_FMT( "Adaptive time step successful. The next dt will be {:.2e} s", nextDt )); } else { - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "Adaptive time step failed. The next dt will be {:.2e} s", nextDt )); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::SolverSteps, + GEOS_FMT( "Adaptive time step failed. The next dt will be {:.2e} s", nextDt )); } return nextDt; diff --git a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp index ea2c6f34b3..9b8d109b92 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp @@ -108,8 +108,9 @@ setMGRStrategy() linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseReservoirFVM; } } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration + , GEOS_FMT( "{}: MGR strategy set to {}", getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } template<> @@ -134,8 +135,9 @@ setMGRStrategy() { linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanicsReservoirFVM; } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration, + GEOS_FMT( "{}: MGR strategy set to {}", getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } template< typename RESERVOIR_SOLVER > diff --git a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp index c11d99f3fa..2c0fa5d6e9 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp @@ -96,8 +96,9 @@ void HydrofractureSolver< POROMECHANICS_SOLVER >::setMGRStrategy() // This may need to be different depending on whether poroelasticity is on or not. linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::hydrofracture; - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", this->getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration + , GEOS_FMT( "{}: MGR strategy set to {}", this->getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } template< typename POROMECHANICS_SOLVER > diff --git a/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp b/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp index 6b01f872f5..415a4195fe 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp @@ -310,8 +310,9 @@ void MultiphasePoromechanics<>::setMGRStrategy() linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanics; } } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration + , GEOS_FMT( "{}: MGR strategy set to {}", getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } template<> @@ -336,8 +337,9 @@ void MultiphasePoromechanics< CompositionalMultiphaseReservoirAndWells<>, SolidM { linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanicsReservoirFVM; } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration, + GEOS_FMT( "{}: MGR strategy set to {}", getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } template< typename FLOW_SOLVER, typename MECHANICS_SOLVER > diff --git a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp index 02fa02be59..0e140a7bae 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp @@ -58,8 +58,6 @@ PoromechanicsInitialization( const string & name, setInputFlag( InputFlags::OPTIONAL ). setApplyDefaultValue( "" ). setDescription( "Name of the solid mechanics statistics" ); - - addLogLevel< logInfo::Initialization >(); } template< typename POROMECHANICS_SOLVER > diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp index 0bfa9146a2..b58f975550 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp @@ -140,8 +140,9 @@ void SinglePhasePoromechanics<>::setMGRStrategy() linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanics; } } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration, + GEOS_FMT( "{}: MGR strategy set to {}", getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } template<> @@ -166,8 +167,9 @@ void SinglePhasePoromechanics< SinglePhaseReservoirAndWells<>, SolidMechanicsLag { linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanicsReservoirFVM; } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", this->getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration, + GEOS_FMT( "{}: MGR strategy set to {}", this->getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } template< typename FLOW_SOLVER, typename MECHANICS_SOLVER > diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp index 51fef65a2d..f9004e4529 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp @@ -58,8 +58,9 @@ void SinglePhasePoromechanicsConformingFractures<>::setMGRStrategy() linearSolverParameters.dofsPerNode = 3; linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanicsConformingFractures; - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration, + GEOS_FMT( "{}: MGR strategy set to {}", getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } template< typename FLOW_SOLVER > diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp index 6c6e2be5bc..b78093bb2f 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp @@ -57,8 +57,9 @@ void SinglePhasePoromechanicsEmbeddedFractures::setMGRStrategy() linearSolverParameters.dofsPerNode = 3; linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanicsEmbeddedFractures; - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration, + GEOS_FMT( "{}: MGR strategy set to {}", getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } void SinglePhasePoromechanicsEmbeddedFractures::postInputInitialization() diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhaseReservoirAndWells.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhaseReservoirAndWells.cpp index f83652d745..4017faf66e 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhaseReservoirAndWells.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhaseReservoirAndWells.cpp @@ -86,8 +86,9 @@ setMGRStrategy() { linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhaseReservoirFVM; } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration, + GEOS_FMT( "{}: MGR strategy set to {}", getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } template<> @@ -112,8 +113,9 @@ setMGRStrategy() { linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanicsReservoirFVM; } - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", this->getName(), - EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::LinearSolverConfiguration, + GEOS_FMT( "{}: MGR strategy set to {}", this->getName(), + EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy ))); } template< typename RESERVOIR_SOLVER > diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp index 764d86d8f3..275ac176f8 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp @@ -52,8 +52,6 @@ SolidMechanicsStateReset::SolidMechanicsStateReset( const string & name, setApplyDefaultValue( false ). setInputFlag( InputFlags::OPTIONAL ). setDescription( "Flag to enable/disable inelastic behavior" ); - - addLogLevel< logInfo::Initialization >(); } SolidMechanicsStateReset::~SolidMechanicsStateReset() diff --git a/src/coreComponents/physicsSolvers/wavePropagation/CMakeLists.txt b/src/coreComponents/physicsSolvers/wavePropagation/CMakeLists.txt index 54fe46da9f..cfb502c9b1 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/wavePropagation/CMakeLists.txt @@ -1,6 +1,7 @@ # Specify solver headers set( physicsSolvers_headers ${physicsSolvers_headers} + wavePropagation/LogLevelsInfo.hpp wavePropagation/shared/WaveSolverBase.hpp wavePropagation/shared/WaveSolverUtils.hpp wavePropagation/shared/PrecomputeSourcesAndReceiversKernel.hpp diff --git a/src/coreComponents/physicsSolvers/wavePropagation/LogLevelsInfo.hpp b/src/coreComponents/physicsSolvers/wavePropagation/LogLevelsInfo.hpp new file mode 100644 index 0000000000..6ce7a85803 --- /dev/null +++ b/src/coreComponents/physicsSolvers/wavePropagation/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 common log level informations for physics solvers + */ + +#ifndef GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_LOGLEVELSINFO_HPP +#define GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_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 PMLParameters +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "Information on Perfectly match layers parameters"; } +}; + +struct DASType +{ + static constexpr int getMinLogLevel() { return 1; } + static constexpr std::string_view getDescription() { return "DAS type information"; } +}; + +/// @endcond +///@} + +} + +} + +#endif // GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_LOGLEVELSINFO_HPP diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp index c47e6e83fc..aa44906392 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp @@ -34,6 +34,7 @@ #include "events/EventManager.hpp" #include "AcousticPMLSEMKernel.hpp" #include "physicsSolvers/wavePropagation/shared/PrecomputeSourcesAndReceiversKernel.hpp" +#include "physicsSolvers/wavePropagation/LogLevelsInfo.hpp" namespace geos { @@ -52,6 +53,7 @@ AcousticWaveEquationSEM::AcousticWaveEquationSEM( const std::string & name, setSizedFromParent( 0 ). setDescription( "Pressure value at each receiver for each timestep" ); + addLogLevel< logInfo::PMLParameters >(); } AcousticWaveEquationSEM::~AcousticWaveEquationSEM() @@ -754,15 +756,15 @@ void AcousticWaveEquationSEM::initializePML() /// so it can be used by the PML application indicatorPML.zero(); - GEOS_LOG_LEVEL_RANK_0( 1, - "PML parameters are: \n" - << "\t inner boundaries xMin = "<(); } WaveSolverBase::~WaveSolverBase() @@ -328,8 +330,9 @@ void WaveSolverBase::postInputInitialization() if( m_useDAS != WaveSolverUtils::DASType::none ) { - GEOS_LOG_LEVEL_RANK_0( 1, "Modeling linear DAS data is activated" ); - GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "Linear DAS formulation: {}", m_useDAS == WaveSolverUtils::DASType::strainIntegration ? "strain integration" : "displacement difference" ) ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::DASType, "Modeling linear DAS data is activated" ); + GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::DASType, + GEOS_FMT( "Linear DAS formulation: {}", m_useDAS == WaveSolverUtils::DASType::strainIntegration ? "strain integration" : "displacement difference" ) ); GEOS_ERROR_IF( m_linearDASGeometry.size( 1 ) != 3, "Invalid number of geometry parameters for the linear DAS fiber. Three parameters are required: dip, azimuth, gauge length" );