diff --git a/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp b/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp index a20210c6dbb..2fbe18fdadc 100644 --- a/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp +++ b/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp @@ -80,7 +80,8 @@ class FieldStatisticsBase : public TaskBase m_solver = physicsSolverManager.getGroupPointer< SOLVER >( m_solverName ); GEOS_THROW_IF( m_solver == nullptr, - GEOS_FMT( "Could not find solver '{}' of type {}", + GEOS_FMT( "{}: Could not find solver '{}' of type {}", + getDataContext(), m_solverName, LvArray::system::demangleType< SOLVER >() ), InputError ); } diff --git a/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp b/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp index 2d35bd3d802..6fa15ae76e4 100644 --- a/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp +++ b/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp @@ -206,25 +206,55 @@ void LinearSolverParametersInput::postProcessInput() static const std::set< integer > binaryOptions = { 0, 1 }; - GEOS_ERROR_IF( binaryOptions.count( m_parameters.stopIfError ) == 0, viewKeyStruct::stopIfErrorString() << " option can be either 0 (false) or 1 (true)" ); - GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.checkResidual ) == 0, viewKeyStruct::directCheckResidualString() << " option can be either 0 (false) or 1 (true)" ); - GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.equilibrate ) == 0, viewKeyStruct::directEquilString() << " option can be either 0 (false) or 1 (true)" ); - GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.replaceTinyPivot ) == 0, viewKeyStruct::directReplTinyPivotString() << " option can be either 0 (false) or 1 (true)" ); - GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.iterativeRefine ) == 0, viewKeyStruct::directIterRefString() << " option can be either 0 (false) or 1 (true)" ); - GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.parallel ) == 0, viewKeyStruct::directParallelString() << " option can be either 0 (false) or 1 (true)" ); - - GEOS_ERROR_IF_LT_MSG( m_parameters.krylov.maxIterations, 0, "Invalid value of " << viewKeyStruct::krylovMaxIterString() ); - GEOS_ERROR_IF_LT_MSG( m_parameters.krylov.maxRestart, 0, "Invalid value of " << viewKeyStruct::krylovMaxRestartString() ); - - GEOS_ERROR_IF_LT_MSG( m_parameters.krylov.relTolerance, 0.0, "Invalid value of " << viewKeyStruct::krylovTolString() ); - GEOS_ERROR_IF_GT_MSG( m_parameters.krylov.relTolerance, 1.0, "Invalid value of " << viewKeyStruct::krylovTolString() ); - - GEOS_ERROR_IF_LT_MSG( m_parameters.ifact.fill, 0, "Invalid value of " << viewKeyStruct::iluFillString() ); - GEOS_ERROR_IF_LT_MSG( m_parameters.ifact.threshold, 0.0, "Invalid value of " << viewKeyStruct::iluThresholdString() ); - - GEOS_ERROR_IF_LT_MSG( m_parameters.amg.numSweeps, 0, "Invalid value of " << viewKeyStruct::amgNumSweepsString() ); - GEOS_ERROR_IF_LT_MSG( m_parameters.amg.threshold, 0.0, "Invalid value of " << viewKeyStruct::amgThresholdString() ); - GEOS_ERROR_IF_GT_MSG( m_parameters.amg.threshold, 1.0, "Invalid value of " << viewKeyStruct::amgThresholdString() ); + GEOS_ERROR_IF( binaryOptions.count( m_parameters.stopIfError ) == 0, + getWrapperDataContext( viewKeyStruct::stopIfErrorString() ) << + ": option can be either 0 (false) or 1 (true)" ); + GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.checkResidual ) == 0, + getWrapperDataContext( viewKeyStruct::directCheckResidualString() ) << + ": option can be either 0 (false) or 1 (true)" ); + GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.equilibrate ) == 0, + getWrapperDataContext( viewKeyStruct::directEquilString() ) << + ": option can be either 0 (false) or 1 (true)" ); + GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.replaceTinyPivot ) == 0, + getWrapperDataContext( viewKeyStruct::directReplTinyPivotString() ) << + ": option can be either 0 (false) or 1 (true)" ); + GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.iterativeRefine ) == 0, + getWrapperDataContext( viewKeyStruct::directIterRefString() ) << + ": option can be either 0 (false) or 1 (true)" ); + GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.parallel ) == 0, + getWrapperDataContext( viewKeyStruct::directParallelString() ) << + ": option can be either 0 (false) or 1 (true)" ); + + GEOS_ERROR_IF_LT_MSG( m_parameters.krylov.maxIterations, 0, + getWrapperDataContext( viewKeyStruct::krylovMaxIterString() ) << + ": Invalid value." ); + GEOS_ERROR_IF_LT_MSG( m_parameters.krylov.maxRestart, 0, + getWrapperDataContext( viewKeyStruct::krylovMaxRestartString() ) << + ": Invalid value." ); + + GEOS_ERROR_IF_LT_MSG( m_parameters.krylov.relTolerance, 0.0, + getWrapperDataContext( viewKeyStruct::krylovTolString() ) << + ": Invalid value." ); + GEOS_ERROR_IF_GT_MSG( m_parameters.krylov.relTolerance, 1.0, + getWrapperDataContext( viewKeyStruct::krylovTolString() ) << + ": Invalid value." ); + + GEOS_ERROR_IF_LT_MSG( m_parameters.ifact.fill, 0, + getWrapperDataContext( viewKeyStruct::iluFillString() ) << + ": Invalid value." ); + GEOS_ERROR_IF_LT_MSG( m_parameters.ifact.threshold, 0.0, + getWrapperDataContext( viewKeyStruct::iluThresholdString() ) << + ": Invalid value." ); + + GEOS_ERROR_IF_LT_MSG( m_parameters.amg.numSweeps, 0, + getWrapperDataContext( viewKeyStruct::amgNumSweepsString() ) << + ": Invalid value." ); + GEOS_ERROR_IF_LT_MSG( m_parameters.amg.threshold, 0.0, + getWrapperDataContext( viewKeyStruct::amgThresholdString() ) << + ": Invalid value." ); + GEOS_ERROR_IF_GT_MSG( m_parameters.amg.threshold, 1.0, + getWrapperDataContext( viewKeyStruct::amgThresholdString() ) << + ": Invalid value." ); // TODO input validation for other AMG parameters ? } diff --git a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp index 60a185a5979..b0928d0cb68 100644 --- a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp +++ b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp @@ -153,10 +153,9 @@ NonlinearSolverParameters::NonlinearSolverParameters( string const & name, void NonlinearSolverParameters::postProcessInput() { - if( m_timeStepDecreaseIterLimit <= m_timeStepIncreaseIterLimit ) - { - GEOS_ERROR( " timeStepIncreaseIterLimit should be smaller than timeStepDecreaseIterLimit!!" ); - } + GEOS_ERROR_IF_LE_MSG( m_timeStepDecreaseIterLimit, m_timeStepIncreaseIterLimit, + getWrapperDataContext( viewKeysStruct::timeStepIncreaseIterLimString() ) << + ": should be smaller than " << viewKeysStruct::timeStepDecreaseIterLimString() ); } diff --git a/src/coreComponents/physicsSolvers/SolverBase.cpp b/src/coreComponents/physicsSolvers/SolverBase.cpp index 35a7302d29f..e1ff500c8cc 100644 --- a/src/coreComponents/physicsSolvers/SolverBase.cpp +++ b/src/coreComponents/physicsSolvers/SolverBase.cpp @@ -115,7 +115,8 @@ void SolverBase::generateMeshTargetsFromTargetRegions( Group const & meshBodies if( targetTokens.size()==1 ) // no MeshBody or MeshLevel specified { GEOS_ERROR_IF( meshBodies.numSubGroups() != 1, - "No MeshBody information is specified in SolverBase::meshTargets, but there are multiple MeshBody objects" ); + getDataContext() << ": No MeshBody information is specified in" << + " SolverBase::meshTargets, but there are multiple MeshBody objects" ); MeshBody const & meshBody = meshBodies.getGroup< MeshBody >( 0 ); string const meshBodyName = meshBody.getName(); @@ -129,7 +130,8 @@ void SolverBase::generateMeshTargetsFromTargetRegions( Group const & meshBodies { string const meshBodyName = targetTokens[0]; GEOS_ERROR_IF( !meshBodies.hasGroup( meshBodyName ), - "MeshBody ("< 0.0, "Maximum allowed number of sub-steps reached. Consider increasing maxSubSteps." ); + GEOS_ERROR_IF( dtRemaining > 0.0, getDataContext() << ": Maximum allowed number of sub-steps" + " reached. Consider increasing maxSubSteps." ); // Decide what to do with the next Dt for the event running the solver. m_nextDt = setNextDt( nextDt, domain ); @@ -760,7 +765,7 @@ real64 SolverBase::nonlinearImplicitStep( real64 const & time_n, } else { - GEOS_ERROR( "Nonconverged solutions not allowed. Terminating..." ); + GEOS_ERROR( getDataContext() << ": Nonconverged solutions not allowed. Terminating..." ); } } @@ -1149,11 +1154,11 @@ void SolverBase::solveLinearSystem( DofManager const & dofManager, if( params.stopIfError ) { - GEOS_ERROR_IF( m_linearSolverResult.breakdown(), "Linear solution breakdown -> simulation STOP" ); + GEOS_ERROR_IF( m_linearSolverResult.breakdown(), getDataContext() << ": Linear solution breakdown -> simulation STOP" ); } else { - GEOS_WARNING_IF( !m_linearSolverResult.success(), "Linear solution failed" ); + GEOS_WARNING_IF( !m_linearSolverResult.success(), getDataContext() << ": Linear solution failed" ); } } diff --git a/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp b/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp index a7d469a6d14..38ba4618c04 100644 --- a/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp @@ -210,7 +210,7 @@ real64 ContactSolverBase::explicitStep( real64 const & GEOS_UNUSED_PARAM( time_n DomainPartition & GEOS_UNUSED_PARAM( domain ) ) { GEOS_MARK_FUNCTION; - GEOS_ERROR( "ExplicitStep non available for contact solvers." ); + GEOS_ERROR( getDataContext() << ": ExplicitStep non available for contact solvers." ); return dt; } diff --git a/src/coreComponents/physicsSolvers/contact/LagrangianContactSolver.cpp b/src/coreComponents/physicsSolvers/contact/LagrangianContactSolver.cpp index b68f8b027c0..b25e3528746 100644 --- a/src/coreComponents/physicsSolvers/contact/LagrangianContactSolver.cpp +++ b/src/coreComponents/physicsSolvers/contact/LagrangianContactSolver.cpp @@ -138,7 +138,9 @@ void LagrangianContactSolver::setConstitutiveNames( ElementSubRegionBase & subRe string & contactRelationName = subRegion.getReference< string >( viewKeyStruct::contactRelationNameString() ); contactRelationName = this->m_contactRelationName; - GEOS_ERROR_IF( contactRelationName.empty(), GEOS_FMT( "Solid model not found on subregion {}", subRegion.getName() ) ); + GEOS_ERROR_IF( contactRelationName.empty(), + GEOS_FMT( "{}: Solid model not found on subregion {}", + getDataContext(), subRegion.getName() ) ); } @@ -882,7 +884,8 @@ void LagrangianContactSolver::computeFaceNodalArea( arrayView2d< real64 const, n } else { - GEOS_ERROR( "LagrangianContactSolver: face with " << numNodesPerFace << " nodes. Only triangles and quadrilaterals are supported." ); + GEOS_ERROR( "LagrangianContactSolver " << getDataContext() << ": face with " << numNodesPerFace << + " nodes. Only triangles and quadrilaterals are supported." ); } } @@ -1287,9 +1290,11 @@ void LagrangianContactSolver::assembleStabilization( MeshLevel const & mesh, SurfaceElementRegion const & fractureRegion = elemManager.getRegion< SurfaceElementRegion >( getFractureRegionName() ); FaceElementSubRegion const & fractureSubRegion = fractureRegion.getUniqueSubRegion< FaceElementSubRegion >(); - GEOS_ERROR_IF( !fractureSubRegion.hasField< contact::traction >(), "The fracture subregion must contain traction field." ); + GEOS_ERROR_IF( !fractureSubRegion.hasField< contact::traction >(), + getDataContext() << ": The fracture subregion must contain traction field." ); arrayView2d< localIndex const > const faceMap = fractureSubRegion.faceList(); - GEOS_ERROR_IF( faceMap.size( 1 ) != 2, "A fracture face has to be shared by two cells." ); + GEOS_ERROR_IF( faceMap.size( 1 ) != 2, + getDataContext() << ": A fracture face has to be shared by two cells." ); // Get the state of fracture elements arrayView1d< integer const > const & fractureState = @@ -1375,7 +1380,8 @@ void LagrangianContactSolver::assembleStabilization( MeshLevel const & mesh, realNodes++; } } - GEOS_ERROR_IF( realNodes != 2, "An edge shared by two fracture elements must have 2 nodes." ); + GEOS_ERROR_IF( realNodes != 2, + getDataContext() << ": An edge shared by two fracture elements must have 2 nodes." ); edge.resize( realNodes ); // Compute nodal area factor diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp index 9efbe5096e4..b67a6a80805 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp @@ -123,29 +123,40 @@ void CompositionalMultiphaseBase::postProcessInput() FlowSolverBase::postProcessInput(); GEOS_ERROR_IF_GT_MSG( m_maxCompFracChange, 1.0, - "The maximum absolute change in component fraction in a Newton iteration must be smaller or equal to 1.0" ); + getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) << + ": The maximum absolute change in component fraction in a Newton iteration must be smaller or equal to 1.0" ); GEOS_ERROR_IF_LE_MSG( m_maxCompFracChange, 0.0, - "The maximum absolute change in component fraction in a Newton iteration must be larger than 0.0" ); + getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) << + ": The maximum absolute change in component fraction in a Newton iteration must be larger than 0.0" ); GEOS_ERROR_IF_GT_MSG( m_maxRelativePresChange, 1.0, - "The maximum relative change in pressure in a Newton iteration must be smaller or equal to 1.0 (i.e., 100 percent change)" ); + getWrapperDataContext( viewKeyStruct::maxRelativePresChangeString() ) << + ": The maximum relative change in pressure in a Newton iteration must be smaller or equal to 1.0 (i.e., 100 percent change)" ); GEOS_ERROR_IF_LE_MSG( m_maxRelativePresChange, 0.0, - "The maximum relative change in pressure in a Newton iteration must be larger than 0.0" ); + getWrapperDataContext( viewKeyStruct::maxRelativePresChangeString() ) << + ": The maximum relative change in pressure in a Newton iteration must be larger than 0.0" ); GEOS_ERROR_IF_GT_MSG( m_maxRelativeTempChange, 1.0, - "The maximum relative change in temperature in a Newton iteration must be smaller or equal to 1.0 (i.e., 100 percent change)" ); + getWrapperDataContext( viewKeyStruct::maxRelativeTempChangeString() ) << + ": The maximum relative change in temperature in a Newton iteration must be smaller or equal to 1.0 (i.e., 100 percent change)" ); GEOS_ERROR_IF_LE_MSG( m_maxRelativeTempChange, 0.0, - "The maximum relative change in temperature in a Newton iteration must be larger than 0.0" ); + getWrapperDataContext( viewKeyStruct::maxRelativeTempChangeString() ) << + ": The maximum relative change in temperature in a Newton iteration must be larger than 0.0" ); GEOS_ERROR_IF_LE_MSG( m_targetRelativePresChange, 0.0, - "The target relative change in pressure in a time step must be larger than 0.0" ); + getWrapperDataContext( viewKeyStruct::targetRelativePresChangeString() ) << + ": The target relative change in pressure in a time step must be larger than 0.0" ); GEOS_ERROR_IF_LE_MSG( m_targetRelativeTempChange, 0.0, - "The target relative change in temperature in a time step must be larger than to 0.0" ); + getWrapperDataContext( viewKeyStruct::targetRelativeTempChangeString() ) << + ": The target relative change in temperature in a time step must be larger than to 0.0" ); GEOS_ERROR_IF_LE_MSG( m_targetPhaseVolFracChange, 0.0, - "The target change in phase volume fraction in a time step must be larger than to 0.0" ); + getWrapperDataContext( viewKeyStruct::targetPhaseVolFracChangeString() ) << + ": The target change in phase volume fraction in a time step must be larger than to 0.0" ); GEOS_ERROR_IF_LT_MSG( m_solutionChangeScalingFactor, 0.0, - "The solution change scaling factor must be larger or equal to 0.0" ); + getWrapperDataContext( viewKeyStruct::solutionChangeScalingFactorString() ) << + ": The solution change scaling factor must be larger or equal to 0.0" ); GEOS_ERROR_IF_GT_MSG( m_solutionChangeScalingFactor, 1.0, - "The solution change scaling factor must be smaller or equal to 1.0" ); + getWrapperDataContext( viewKeyStruct::solutionChangeScalingFactorString() ) << + ": The solution change scaling factor must be smaller or equal to 1.0" ); } @@ -214,7 +225,8 @@ void CompositionalMultiphaseBase::registerDataOnMesh( Group & meshBodies ) string & capPresName = subRegion.getReference< string >( viewKeyStruct::capPressureNamesString() ); capPresName = getConstitutiveName< CapillaryPressureBase >( subRegion ); GEOS_THROW_IF( capPresName.empty(), - GEOS_FMT( "Capillary pressure model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Capillary pressure model not found on subregion {}", + getDataContext(), subRegion.getDataContext() ), InputError ); } } @@ -295,7 +307,8 @@ void CompositionalMultiphaseBase::setConstitutiveNames( ElementSubRegionBase & s string & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); fluidName = getConstitutiveName< MultiFluidBase >( subRegion ); GEOS_THROW_IF( fluidName.empty(), - GEOS_FMT( "Fluid model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Fluid model not found on subregion {}", + getDataContext(), subRegion.getDataContext() ), InputError ); string & relPermName = subRegion.registerWrapper< string >( viewKeyStruct::relPermNamesString() ). @@ -308,7 +321,8 @@ void CompositionalMultiphaseBase::setConstitutiveNames( ElementSubRegionBase & s relPermName = getConstitutiveName< RelativePermeabilityBase >( subRegion ); GEOS_THROW_IF( relPermName.empty(), - GEOS_FMT( "Relative permeability model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Relative permeability model not found on subregion {}", + getDataContext(), subRegion.getDataContext() ), InputError ); @@ -322,7 +336,8 @@ void CompositionalMultiphaseBase::setConstitutiveNames( ElementSubRegionBase & s reference(); capPressureName = getConstitutiveName< CapillaryPressureBase >( subRegion ); GEOS_THROW_IF( capPressureName.empty(), - GEOS_FMT( "Capillary pressure model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Capillary pressure model not found on subregion {}", + getDataContext(), subRegion.getDataContext() ), InputError ); } @@ -337,7 +352,8 @@ void CompositionalMultiphaseBase::setConstitutiveNames( ElementSubRegionBase & s thermalConductivityName = getConstitutiveName< MultiPhaseThermalConductivityBase >( subRegion ); GEOS_THROW_IF( thermalConductivityName.empty(), - GEOS_FMT( "Thermal conductivity model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Thermal conductivity model not found on subregion {}", + getDataContext(), subRegion.getDataContext() ), InputError ); } } @@ -350,13 +366,15 @@ template< typename MODEL1_TYPE, typename MODEL2_TYPE > void compareMultiphaseModels( MODEL1_TYPE const & lhs, MODEL2_TYPE const & rhs ) { GEOS_THROW_IF_NE_MSG( lhs.numFluidPhases(), rhs.numFluidPhases(), - GEOS_FMT( "Mismatch in number of phases between constitutive models {} and {}", lhs.getName(), rhs.getName() ), + GEOS_FMT( "Mismatch in number of phases between constitutive models {} and {}", + lhs.getDataContext(), rhs.getDataContext() ), InputError ); for( integer ip = 0; ip < lhs.numFluidPhases(); ++ip ) { GEOS_THROW_IF_NE_MSG( lhs.phaseNames()[ip], rhs.phaseNames()[ip], - GEOS_FMT( "Mismatch in phase names between constitutive models {} and {}", lhs.getName(), rhs.getName() ), + GEOS_FMT( "Mismatch in phase names between constitutive models {} and {}", + lhs.getDataContext(), rhs.getDataContext() ), InputError ); } } @@ -365,13 +383,15 @@ template< typename MODEL1_TYPE, typename MODEL2_TYPE > void compareMulticomponentModels( MODEL1_TYPE const & lhs, MODEL2_TYPE const & rhs ) { GEOS_THROW_IF_NE_MSG( lhs.numFluidComponents(), rhs.numFluidComponents(), - GEOS_FMT( "Mismatch in number of components between constitutive models {} and {}", lhs.getName(), rhs.getName() ), + GEOS_FMT( "Mismatch in number of components between constitutive models {} and {}", + lhs.getDataContext(), rhs.getDataContext() ), InputError ); for( integer ic = 0; ic < lhs.numFluidComponents(); ++ic ) { GEOS_THROW_IF_NE_MSG( lhs.componentNames()[ic], rhs.componentNames()[ic], - GEOS_FMT( "Mismatch in component names between constitutive models {} and {}", lhs.getName(), rhs.getName() ), + GEOS_FMT( "Mismatch in component names between constitutive models {} and {}", + lhs.getDataContext(), rhs.getDataContext() ), InputError ); } } @@ -398,14 +418,14 @@ void CompositionalMultiphaseBase::initializeAquiferBC( ConstitutiveManager const arrayView1d< string const > const & aquiferWaterPhaseCompNames = bc.getWaterPhaseComponentNames(); GEOS_ERROR_IF_NE_MSG( fluid0.numFluidComponents(), aquiferWaterPhaseCompFrac.size(), - "Mismatch in number of components between constitutive model " - << fluid0.getName() << " and the water phase composition in aquifer " << bc.getName() ); + getDataContext() << ": Mismatch in number of components between constitutive model " + << fluid0.getName() << " and the water phase composition in aquifer " << bc.getName() ); for( integer ic = 0; ic < fluid0.numFluidComponents(); ++ic ) { GEOS_ERROR_IF_NE_MSG( fluid0.componentNames()[ic], aquiferWaterPhaseCompNames[ic], - "Mismatch in component names between constitutive model " - << fluid0.getName() << " and the water phase components in aquifer " << bc.getName() ); + getDataContext() << ": Mismatch in component names between constitutive model " + << fluid0.getName() << " and the water phase components in aquifer " << bc.getName() ); } } ); } @@ -468,11 +488,11 @@ void CompositionalMultiphaseBase::validateConstitutiveModels( DomainPartition co bool const isFluidModelThermal = castedFluid.isThermal(); GEOS_THROW_IF( m_isThermal && !isFluidModelThermal, GEOS_FMT( "CompositionalMultiphaseBase {}: the thermal option is enabled in the solver, but the fluid model `{}` is incompatible with the thermal option", - getName(), fluid.getName() ), + getDataContext(), fluid.getDataContext() ), InputError ); GEOS_THROW_IF( !m_isThermal && isFluidModelThermal, GEOS_FMT( "CompositionalMultiphaseBase {}: the thermal option is enabled in fluid model `{}`, but the solver options are incompatible with the thermal option", - getName(), fluid.getName() ), + getDataContext(), fluid.getDataContext() ), InputError ); } ); @@ -830,10 +850,10 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium() // check that the gravity vector is aligned with the z-axis GEOS_THROW_IF( !isZero( gravVector[0] ) || !isZero( gravVector[1] ), - catalogName() << " " << getName() << + catalogName() << " " << getDataContext() << ": the gravity vector specified in this simulation (" << gravVector[0] << " " << gravVector[1] << " " << gravVector[2] << ") is not aligned with the z-axis. \n" - "This is incompatible with the " << EquilibriumInitialCondition::catalogName() << " called " << bc.getName() << + "This is incompatible with the " << EquilibriumInitialCondition::catalogName() << " " << bc.getDataContext() << "used in this simulation. To proceed, you can either: \n" << " - Use a gravityVector aligned with the z-axis, such as (0.0,0.0,-9.81)\n" << " - Remove the hydrostatic equilibrium initial condition from the XML file", @@ -894,12 +914,13 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium() real64 const eps = 0.1 * (maxElevation - minElevation); // we add a small buffer to only log in the pathological cases GEOS_LOG_RANK_0_IF( ( (datumElevation > globalMaxElevation[equilIndex]+eps) || (datumElevation < globalMinElevation[equilIndex]-eps) ), - CompositionalMultiphaseBase::catalogName() << " " << getName() - << ": By looking at the elevation of the cell centers in this model, GEOSX found that " - << "the min elevation is " << globalMinElevation[equilIndex] << " and the max elevation is " << globalMaxElevation[equilIndex] << - "\n" - << "But, a datum elevation of " << datumElevation << " was specified in the input file to equilibrate the model.\n " - << "The simulation is going to proceed with this out-of-bound datum elevation, but the initial condition may be inaccurate." ); + CompositionalMultiphaseBase::catalogName() << " " << getDataContext() << + ": By looking at the elevation of the cell centers in this model, GEOS found that " << + "the min elevation is " << globalMinElevation[equilIndex] << " and the max elevation is " << + globalMaxElevation[equilIndex] << "\nBut, a datum elevation of " << datumElevation << + " was specified in the input file to equilibrate the model.\n " << + "The simulation is going to proceed with this out-of-bound datum elevation," << + " but the initial condition may be inaccurate." ); array1d< array1d< real64 > > elevationValues; array1d< real64 > pressureValues; @@ -938,13 +959,13 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium() arrayView1d< string const > componentNames = fs.getComponentNames(); GEOS_THROW_IF( fluid.componentNames().size() != componentNames.size(), "Mismatch in number of components between constitutive model " - << fluid.getName() << " and the Equilibrium initial condition " << fs.getName(), + << fluid.getDataContext() << " and the Equilibrium initial condition " << fs.getDataContext(), InputError ); for( integer ic = 0; ic < fluid.numFluidComponents(); ++ic ) { GEOS_THROW_IF( fluid.componentNames()[ic] != componentNames[ic], "Mismatch in component names between constitutive model " - << fluid.getName() << " and the Equilibrium initial condition " << fs.getName(), + << fluid.getDataContext() << " and the Equilibrium initial condition " << fs.getDataContext(), InputError ); } @@ -952,8 +973,8 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium() arrayView1d< string const > phaseNames = fluid.phaseNames(); auto const itPhaseNames = std::find( std::begin( phaseNames ), std::end( phaseNames ), initPhaseName ); GEOS_THROW_IF( itPhaseNames == std::end( phaseNames ), - CompositionalMultiphaseBase::catalogName() << " " << getName() << ": phase name " << initPhaseName - << " not found in the phases of " << fluid.getName(), + CompositionalMultiphaseBase::catalogName() << " " << getDataContext() << ": phase name " << + initPhaseName << " not found in the phases of " << fluid.getDataContext(), InputError ); integer const ipInit = std::distance( std::begin( phaseNames ), itPhaseNames ); @@ -986,18 +1007,18 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium() pressureValues.toView() ); GEOS_THROW_IF( returnValue == isothermalCompositionalMultiphaseBaseKernels::HydrostaticPressureKernel::ReturnType::FAILED_TO_CONVERGE, - CompositionalMultiphaseBase::catalogName() << " " << getName() - << ": hydrostatic pressure initialization failed to converge in region " << region.getName() << "! \n" - << "Try to loosen the equilibration tolerance, or increase the number of equilibration iterations. \n" - << "If nothing works, something may be wrong in the fluid model, see ", + CompositionalMultiphaseBase::catalogName() << " " << getDataContext() << + ": hydrostatic pressure initialization failed to converge in region " << region.getName() << "! \n" << + "Try to loosen the equilibration tolerance, or increase the number of equilibration iterations. \n" << + "If nothing works, something may be wrong in the fluid model, see ", std::runtime_error ); GEOS_LOG_RANK_0_IF( returnValue == isothermalCompositionalMultiphaseBaseKernels::HydrostaticPressureKernel::ReturnType::DETECTED_MULTIPHASE_FLOW, - CompositionalMultiphaseBase::catalogName() << " " << getName() - << ": currently, GEOSX assumes that there is only one mobile phase when computing the hydrostatic pressure. \n" - << "We detected multiple phases using the provided datum pressure, temperature, and component fractions. \n" - << "Please make sure that only one phase is mobile at the beginning of the simulation. \n" - << "If this is not the case, the problem will not be at equilibrium when the simulation starts" ); + CompositionalMultiphaseBase::catalogName() << " " << getDataContext() << + ": currently, GEOS assumes that there is only one mobile phase when computing the hydrostatic pressure. \n" << + "We detected multiple phases using the provided datum pressure, temperature, and component fractions. \n" << + "Please make sure that only one phase is mobile at the beginning of the simulation. \n" << + "If this is not the case, the problem will not be at equilibrium when the simulation starts" ); } ); @@ -1049,8 +1070,8 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium() } ); GEOS_ERROR_IF( minPressure.get() < 0.0, - GEOS_FMT( "A negative pressure of {} Pa was found during hydrostatic initialization in region/subRegion {}/{}", - minPressure.get(), region.getName(), subRegion.getName() ) ); + GEOS_FMT( "{}: A negative pressure of {} Pa was found during hydrostatic initialization in region/subRegion {}/{}", + getDataContext(), minPressure.get(), region.getName(), subRegion.getName() ) ); } ); } ); } @@ -1568,7 +1589,7 @@ void CompositionalMultiphaseBase::applyDirichletBC( real64 const time_n, if( m_nonlinearSolverParameters.m_numNewtonIterations == 0 ) { bool const bcConsistent = validateDirichletBC( domain, time_n + dt ); - GEOS_ERROR_IF( !bcConsistent, GEOS_FMT( "CompositionalMultiphaseBase {}: inconsistent boundary conditions", getName() ) ); + GEOS_ERROR_IF( !bcConsistent, GEOS_FMT( "CompositionalMultiphaseBase {}: inconsistent boundary conditions", getDataContext() ) ); } FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp index 2034f7b3248..e7dcad91134 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp @@ -694,7 +694,7 @@ void CompositionalMultiphaseFVM::applyFaceDirichletBC( real64 const time_n, if( m_nonlinearSolverParameters.m_numNewtonIterations == 0 ) { bool const bcConsistent = validateFaceDirichletBC( domain, time_n + dt ); - GEOS_ERROR_IF( !bcConsistent, GEOS_FMT( "CompositionalMultiphaseBase {}: inconsistent boundary conditions", getName() ) ); + GEOS_ERROR_IF( !bcConsistent, GEOS_FMT( "CompositionalMultiphaseBase {}: inconsistent boundary conditions", getDataContext() ) ); } FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp index cde7df1dbbe..1f2bde7eecf 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp @@ -85,12 +85,12 @@ void CompositionalMultiphaseHybridFVM::initializePreSubGroups() FiniteVolumeManager const & fvManager = numericalMethodManager.getFiniteVolumeManager(); GEOS_THROW_IF( !fvManager.hasGroup< HybridMimeticDiscretization >( m_discretizationName ), - catalogName() << " " << getName() << + catalogName() << " " << getDataContext() << ": the HybridMimeticDiscretization must be selected with CompositionalMultiphaseHybridFVM", InputError ); GEOS_THROW_IF( m_hasCapPressure, - catalogName() << " " << getName() << + catalogName() << " " << getDataContext() << ": capillary pressure is not yet supported by CompositionalMultiphaseHybridFVM", InputError ); } @@ -110,7 +110,8 @@ void CompositionalMultiphaseHybridFVM::initializePostInitialConditionsPreSubGrou dynamicCast< QuasiTPFAInnerProduct const * >( &mimeticInnerProductBase ) || dynamicCast< SimpleInnerProduct const * >( &mimeticInnerProductBase ) ) { - GEOS_ERROR( "The QuasiRT, QuasiTPFA, and Simple inner products are only available in SinglePhaseHybridFVM" ); + GEOS_ERROR( catalogName() << " " << getDataContext() << + "The QuasiRT, QuasiTPFA, and Simple inner products are only available in SinglePhaseHybridFVM" ); } m_lengthTolerance = domain.getMeshBody( 0 ).getGlobalLengthScale() * 1e-8; @@ -142,16 +143,16 @@ void CompositionalMultiphaseHybridFVM::initializePostInitialConditionsPreSubGrou } ); GEOS_THROW_IF( minVal.get() <= 0.0, - catalogName() << " " << getName() - << ": the transmissibility multipliers used in SinglePhaseHybridFVM must strictly larger than 0.0", + catalogName() << " " << getDataContext() << + ": the transmissibility multipliers used in SinglePhaseHybridFVM must strictly larger than 0.0", std::runtime_error ); FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); fsManager.forSubGroups< AquiferBoundaryCondition >( [&] ( AquiferBoundaryCondition const & bc ) { - GEOS_LOG_RANK_0( catalogName() << " " << getName() << - "An aquifer boundary condition named " << bc.getName() << " was requested in the XML file. \n" - "This type of boundary condition is not yet supported by CompositionalMultiphaseHybridFVM and will be ignored" ); + GEOS_LOG_RANK_0( catalogName() << " " << getDataContext() << ": An aquifer boundary condition named " << + bc.getName() << " was requested in the XML file. \n" << + "This type of boundary condition is not yet supported by CompositionalMultiphaseHybridFVM and will be ignored" ); } ); } ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp index 89a44f83ab6..5890a4665e7 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp @@ -68,7 +68,7 @@ void CompositionalMultiphaseStatistics::postProcessInput() if( dynamicCast< CompositionalMultiphaseHybridFVM * >( m_solver ) && m_computeCFLNumbers != 0 ) { GEOS_THROW( GEOS_FMT( "{} {}: the option to compute CFL numbers is incompatible with CompositionalMultiphaseHybridFVM", - catalogName(), getName() ), + catalogName(), getDataContext() ), InputError ); } } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp index 4624fc0152d..cb76c975ca5 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp @@ -269,7 +269,8 @@ void FlowSolverBase::setConstitutiveNamesCallSuper( ElementSubRegionBase & subRe string & solidName = subRegion.getReference< string >( viewKeyStruct::solidNamesString() ); solidName = getConstitutiveName< CoupledSolidBase >( subRegion ); - GEOS_ERROR_IF( solidName.empty(), GEOS_FMT( "Solid model not found on subregion {}", subRegion.getName() ) ); + GEOS_ERROR_IF( solidName.empty(), GEOS_FMT( "{}: Solid model not found on subregion {}", + getDataContext(), subRegion.getName() ) ); subRegion.registerWrapper< string >( viewKeyStruct::permeabilityNamesString() ). setPlotLevel( PlotLevel::NOPLOT ). @@ -278,7 +279,8 @@ void FlowSolverBase::setConstitutiveNamesCallSuper( ElementSubRegionBase & subRe string & permName = subRegion.getReference< string >( viewKeyStruct::permeabilityNamesString() ); permName = getConstitutiveName< PermeabilityBase >( subRegion ); - GEOS_ERROR_IF( permName.empty(), GEOS_FMT( "Permeability model not found on subregion {}", subRegion.getName() ) ); + GEOS_ERROR_IF( permName.empty(), GEOS_FMT( "{}: Permeability model not found on subregion {}", + getDataContext(), subRegion.getName() ) ); if( m_isThermal ) { @@ -291,7 +293,8 @@ void FlowSolverBase::setConstitutiveNamesCallSuper( ElementSubRegionBase & subRe solidInternalEnergyName = getConstitutiveName< SolidInternalEnergy >( subRegion ); GEOS_THROW_IF( solidInternalEnergyName.empty(), - GEOS_FMT( "Solid internal energy model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Solid internal energy model not found on subregion {}", + getDataContext(), subRegion.getName() ), InputError ); } } @@ -706,7 +709,7 @@ void FlowSolverBase::saveAquiferConvergedState( real64 const & time, { GEOS_LOG_RANK_0( GEOS_FMT( string( "FlowSolverBase {}: at time {}s, " ) + string( "the <{}> boundary condition '{}' produces a flux of {} kg (or moles if useMass=0). " ), - getName(), time+dt, AquiferBoundaryCondition::catalogName(), bc.getName(), dt * globalSumFluxes[aquiferIndex] ) ); + getDataContext(), time+dt, AquiferBoundaryCondition::catalogName(), bc.getName(), dt * globalSumFluxes[aquiferIndex] ) ); } bc.saveConvergedState( dt * globalSumFluxes[aquiferIndex] ); } ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp index b3a27111a04..1c69177b41a 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp @@ -189,10 +189,12 @@ void ReactiveCompositionalMultiphaseOBL::postProcessInput() SolverBase::postProcessInput(); GEOS_THROW_IF_GT_MSG( m_maxCompFracChange, 1.0, - GEOS_FMT( "The maximum absolute change in component fraction is set to {}, while it must not be greater than 1.0", m_maxCompFracChange ), + GEOS_FMT( "{}: The maximum absolute change in component fraction is set to {}, while it must not be greater than 1.0", + getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ), m_maxCompFracChange ), InputError ); GEOS_THROW_IF_LT_MSG( m_maxCompFracChange, 0.0, - GEOS_FMT( "The maximum absolute change in component fraction is set to {}, while it must not be lesser than 0.0", m_maxCompFracChange ), + GEOS_FMT( "{}: The maximum absolute change in component fraction is set to {}, while it must not be lesser than 0.0", + getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ), m_maxCompFracChange ), InputError ); m_OBLOperatorsTable = makeOBLOperatorsTable( m_OBLOperatorsTableFile, FunctionManager::getInstance()); @@ -204,11 +206,19 @@ void ReactiveCompositionalMultiphaseOBL::postProcessInput() m_numOBLOperators = COMPUTE_NUM_OPS( m_numPhases, m_numComponents, m_enableEnergyBalance ); GEOS_THROW_IF_NE_MSG( m_numDofPerCell, m_OBLOperatorsTable->numDims(), - GEOS_FMT( "The number of degrees of freedom per element used in solver - {} - and in operator table - {} - should match", m_numDofPerCell, m_OBLOperatorsTable->numDims()), + GEOS_FMT( "The number of degrees of freedom per cell used in the solver (at {}) has a value of {}, " + "whereas it as a value of {} in the operator table (at {}).", + getWrapperDataContext( viewKeyStruct::elemDofFieldString() ), + m_numDofPerCell, m_OBLOperatorsTable->numDims(), + m_OBLOperatorsTableFile ), InputError ); GEOS_THROW_IF_NE_MSG( m_numOBLOperators, m_OBLOperatorsTable->numOps(), - GEOS_FMT( "The number of operators per element used in solver - {} - and in operator table - {} - should match", m_numOBLOperators, m_OBLOperatorsTable->numOps()), + GEOS_FMT( "The number of operators per cell used in the solver (at {}) has a value of {}, " + "whereas it as a value of {} in the operator table (at {}).", + getWrapperDataContext( viewKeyStruct::elemDofFieldString() ), + m_numDofPerCell, m_OBLOperatorsTable->numDims(), + m_OBLOperatorsTableFile ), InputError ); } @@ -1042,7 +1052,7 @@ void ReactiveCompositionalMultiphaseOBL::applyDirichletBC( real64 const time, if( m_nonlinearSolverParameters.m_numNewtonIterations == 0 ) { bool const bcConsistent = validateDirichletBC( domain, time + dt ); - GEOS_ERROR_IF( !bcConsistent, GEOS_FMT( "CompositionalMultiphaseBase {}: inconsistent boundary conditions", getName() ) ); + GEOS_ERROR_IF( !bcConsistent, GEOS_FMT( "CompositionalMultiphaseBase {}: inconsistent boundary conditions", getDataContext() ) ); } FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp index 05c2eab2ef5..10f6897529d 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp @@ -132,7 +132,8 @@ void SinglePhaseBase::setConstitutiveNames( ElementSubRegionBase & subRegion ) c { string & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); fluidName = getConstitutiveName< SingleFluidBase >( subRegion ); - GEOS_ERROR_IF( fluidName.empty(), GEOS_FMT( "Fluid model not found on subregion {}", subRegion.getName() ) ); + GEOS_ERROR_IF( fluidName.empty(), GEOS_FMT( "{}: Fluid model not found on subregion {}", + getDataContext(), subRegion.getName() ) ); if( m_isThermal ) { @@ -145,7 +146,8 @@ void SinglePhaseBase::setConstitutiveNames( ElementSubRegionBase & subRegion ) c thermalConductivityName = getConstitutiveName< SinglePhaseThermalConductivityBase >( subRegion ); GEOS_THROW_IF( thermalConductivityName.empty(), - GEOS_FMT( "Thermal conductivity model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Thermal conductivity model not found on subregion {}", + getDataContext(), subRegion.getName() ), InputError ); } } @@ -176,7 +178,8 @@ void SinglePhaseBase::validateConstitutiveModels( DomainPartition & domain ) con string & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); fluidName = getConstitutiveName< SingleFluidBase >( subRegion ); GEOS_THROW_IF( fluidName.empty(), - GEOS_FMT( "Fluid model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "SingleFluidBase {}: Fluid model not found on subregion {}", + getDataContext(), subRegion.getName() ), InputError ); SingleFluidBase const & fluid = getConstitutiveModel< SingleFluidBase >( subRegion, fluidName ); @@ -186,11 +189,11 @@ void SinglePhaseBase::validateConstitutiveModels( DomainPartition & domain ) con string const fluidModelName = castedFluid.catalogName(); GEOS_THROW_IF( m_isThermal && (fluidModelName != "ThermalCompressibleSinglePhaseFluid"), GEOS_FMT( "SingleFluidBase {}: the thermal option is enabled in the solver, but the fluid model `{}` is not for thermal fluid", - getName(), fluid.getName() ), + getDataContext(), fluid.getDataContext() ), InputError ); GEOS_THROW_IF( !m_isThermal && (fluidModelName == "ThermalCompressibleSinglePhaseFluid"), GEOS_FMT( "SingleFluidBase {}: the fluid model is for thermal fluid `{}`, but the solver option is incompatible with the fluid model", - getName(), fluid.getName() ), + getDataContext(), fluid.getDataContext() ), InputError ); } ); } ); @@ -463,10 +466,10 @@ void SinglePhaseBase::computeHydrostaticEquilibrium() // check that the gravity vector is aligned with the z-axis GEOS_THROW_IF( !isZero( gravVector[0] ) || !isZero( gravVector[1] ), - catalogName() << " " << getName() << + catalogName() << " " << getDataContext() << ": the gravity vector specified in this simulation (" << gravVector[0] << " " << gravVector[1] << " " << gravVector[2] << ") is not aligned with the z-axis. \n" - "This is incompatible with the " << EquilibriumInitialCondition::catalogName() << " called " << bc.getName() << + "This is incompatible with the " << EquilibriumInitialCondition::catalogName() << " " << bc.getDataContext() << "used in this simulation. To proceed, you can either: \n" << " - Use a gravityVector aligned with the z-axis, such as (0.0,0.0,-9.81)\n" << " - Remove the hydrostatic equilibrium initial condition from the XML file", @@ -525,11 +528,13 @@ void SinglePhaseBase::computeHydrostaticEquilibrium() real64 const eps = 0.1 * (maxElevation - minElevation); // we add a small buffer to only log in the pathological cases GEOS_LOG_RANK_0_IF( ( (datumElevation > globalMaxElevation[equilIndex]+eps) || (datumElevation < globalMinElevation[equilIndex]-eps) ), - SinglePhaseBase::catalogName() << " " << getName() - << ": By looking at the elevation of the cell centers in this model, GEOSX found that " - << "the min elevation is " << globalMinElevation[equilIndex] << " and the max elevation is " << globalMaxElevation[equilIndex] << "\n" - << "But, a datum elevation of " << datumElevation << " was specified in the input file to equilibrate the model.\n " - << "The simulation is going to proceed with this out-of-bound datum elevation, but the initial condition may be inaccurate." ); + SinglePhaseBase::catalogName() << " " << getDataContext() << + ": By looking at the elevation of the cell centers in this model, GEOS found that " << + "the min elevation is " << globalMinElevation[equilIndex] << " and the max elevation is " << + globalMaxElevation[equilIndex] << "\nBut, a datum elevation of " << datumElevation << + " was specified in the input file to equilibrate the model.\n " << + "The simulation is going to proceed with this out-of-bound datum elevation," << + " but the initial condition may be inaccurate." ); array1d< array1d< real64 > > elevationValues; array1d< real64 > pressureValues; @@ -580,8 +585,8 @@ void SinglePhaseBase::computeHydrostaticEquilibrium() pressureValues.toView() ); GEOS_THROW_IF( !equilHasConverged, - SinglePhaseBase::catalogName() << " " << getName() - << ": hydrostatic pressure initialization failed to converge in region " << region.getName() << "!", + SinglePhaseBase::catalogName() << " " << getDataContext() << + ": hydrostatic pressure initialization failed to converge in region " << region.getName() << "!", std::runtime_error ); } ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp index 557a784f50a..b37419ba688 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp @@ -77,7 +77,7 @@ void SinglePhaseHybridFVM::initializePreSubGroups() GEOS_THROW_IF( m_isThermal, GEOS_FMT( "{} {}: The thermal option is not supported by SinglePhaseHybridFVM", - catalogName(), getName() ), + catalogName(), getDataContext().toString() ), InputError ); DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); @@ -85,7 +85,7 @@ void SinglePhaseHybridFVM::initializePreSubGroups() FiniteVolumeManager const & fvManager = numericalMethodManager.getFiniteVolumeManager(); GEOS_THROW_IF( !fvManager.hasGroup< HybridMimeticDiscretization >( m_discretizationName ), - catalogName() << " " << getName() << + catalogName() << " " << getDataContext() << ": the HybridMimeticDiscretization must be selected with SinglePhaseHybridFVM", InputError ); } @@ -123,16 +123,16 @@ void SinglePhaseHybridFVM::initializePostInitialConditionsPreSubGroups() } ); GEOS_THROW_IF_LE_MSG( minVal.get(), 0.0, - catalogName() << " " << getName() << + catalogName() << " " << getDataContext() << "The transmissibility multipliers used in SinglePhaseHybridFVM must strictly larger than 0.0", std::runtime_error ); FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); fsManager.forSubGroups< AquiferBoundaryCondition >( [&] ( AquiferBoundaryCondition const & bc ) { - GEOS_LOG_RANK_0( catalogName() << " " << getName() << - "An aquifer boundary condition named " << bc.getName() << " was requested in the XML file. \n" - "This type of boundary condition is not yet supported by SinglePhaseHybridFVM and will be ignored" ); + GEOS_LOG_RANK_0( catalogName() << " " << getDataContext() << + "The aquifer boundary condition " << bc.getDataContext() << " was requested in the XML file. \n" << + "This type of boundary condition is not yet supported by SinglePhaseHybridFVM and will be ignored" ); } ); } ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseProppantBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseProppantBase.cpp index 2b9d23e1c24..e74bdc9619a 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseProppantBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseProppantBase.cpp @@ -69,7 +69,8 @@ void SinglePhaseProppantBase::setConstitutiveNames( ElementSubRegionBase & subRe { string & fluidMaterialName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); fluidMaterialName = SolverBase::getConstitutiveName< SlurryFluidBase >( subRegion ); - GEOS_ERROR_IF( fluidMaterialName.empty(), GEOS_FMT( "Fluid model not found on subregion {}", subRegion.getName() ) ); + GEOS_ERROR_IF( fluidMaterialName.empty(), GEOS_FMT( "{}: Fluid model not found on subregion {}", + getDataContext(), subRegion.getName() ) ); } void SinglePhaseProppantBase::validateConstitutiveModels( DomainPartition & domain ) const @@ -85,7 +86,8 @@ void SinglePhaseProppantBase::validateConstitutiveModels( DomainPartition & doma string & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); fluidName = getConstitutiveName< SlurryFluidBase >( subRegion ); GEOS_THROW_IF( fluidName.empty(), - GEOS_FMT( "Fluid model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Fluid model not found on subregion {}", + getDataContext(), subRegion.getName() ), InputError ); } ); } ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp index 68733710b6e..89018fb6ace 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp @@ -142,14 +142,16 @@ void ProppantTransport::setConstitutiveNames( ElementSubRegionBase & subRegion ) string & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); fluidName = getConstitutiveName< SlurryFluidBase >( subRegion ); GEOS_THROW_IF( fluidName.empty(), - GEOS_FMT( "Fluid model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Fluid model not found on subregion {}", + getDataContext(), subRegion.getName() ), InputError ); subRegion.registerWrapper< string >( viewKeyStruct::proppantNamesString() ); string & proppantName = subRegion.getReference< string >( viewKeyStruct::proppantNamesString() ); proppantName = getConstitutiveName< ParticleFluidBase >( subRegion ); GEOS_THROW_IF( proppantName.empty(), - GEOS_FMT( "Proppant model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Proppant model not found on subregion {}", + getDataContext(), subRegion.getName() ), InputError ); } @@ -726,7 +728,8 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n, { string const & subRegionName = subRegion.getName(); - GEOS_ERROR_IF( bcStatusMap[subRegionName].count( setName ) > 0, "Conflicting proppant boundary conditions on set " << setName ); + GEOS_ERROR_IF( bcStatusMap[subRegionName].count( setName ) > 0, + getDataContext() << ": Conflicting proppant boundary conditions on set " << setName ); bcStatusMap[subRegionName][setName].resize( m_numComponents ); bcStatusMap[subRegionName][setName].setValues< serialPolicy >( false ); @@ -745,8 +748,10 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n, string const & subRegionName = subRegion.getName(); localIndex const comp = fs.getComponent(); - GEOS_ERROR_IF( bcStatusMap[subRegionName].count( setName ) == 0, "Proppant boundary condition not prescribed on set '" << setName << "'" ); - GEOS_ERROR_IF( bcStatusMap[subRegionName][setName][comp], "Conflicting composition[" << comp << "] boundary conditions on set '" << setName << "'" ); + GEOS_ERROR_IF( bcStatusMap[subRegionName].count( setName ) == 0, + getDataContext() << ": Proppant boundary condition not prescribed on set '" << setName << "'" ); + GEOS_ERROR_IF( bcStatusMap[subRegionName][setName][comp], + getDataContext() << ": Conflicting composition[" << comp << "] boundary conditions on set '" << setName << "'" ); bcStatusMap[subRegionName][setName][comp] = true; fs.applyFieldValue< FieldSpecificationEqual >( targetSet, @@ -764,9 +769,10 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n, for( localIndex ic = 0; ic < m_numComponents; ++ic ) { bcConsistent &= bcStatusEntryInner.second[ic]; - GEOS_WARNING_IF( !bcConsistent, "Composition boundary condition not applied to component " << ic - << " on region '" << bcStatusEntryOuter.first << "'," - << " set '" << bcStatusEntryInner.first << "'" ); + GEOS_WARNING_IF( !bcConsistent, + getDataContext() << ": Composition boundary condition not applied to component " << + ic << " on region '" << bcStatusEntryOuter.first << "'," << + " set '" << bcStatusEntryInner.first << "'" ); } } } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index 8325f84964a..befd99201f6 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -95,10 +95,10 @@ void CompositionalMultiphaseWell::postProcessInput() WellSolverBase::postProcessInput(); GEOS_ERROR_IF_GT_MSG( m_maxCompFracChange, 1.0, - "CompositionalMultiphaseWell named " << getName() << + getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) << ": The maximum absolute change in component fraction must smaller or equal to 1.0" ); GEOS_ERROR_IF_LT_MSG( m_maxCompFracChange, 0.0, - "CompositionalMultiphaseWell named " << getName() << + getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) << ": The maximum absolute change in component fraction must larger or equal to 0.0" ); } @@ -242,7 +242,8 @@ void CompositionalMultiphaseWell::setConstitutiveNames( ElementSubRegionBase & s string & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); fluidName = getConstitutiveName< MultiFluidBase >( subRegion ); GEOS_THROW_IF( fluidName.empty(), - GEOS_FMT( "Fluid model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Fluid model not found on subregion {}", + getDataContext(), subRegion.getName() ), InputError ); string & relPermName = subRegion.registerWrapper< string >( viewKeyStruct::relPermNamesString() ). @@ -255,7 +256,8 @@ void CompositionalMultiphaseWell::setConstitutiveNames( ElementSubRegionBase & s relPermName = getConstitutiveName< RelativePermeabilityBase >( subRegion ); GEOS_THROW_IF( relPermName.empty(), - GEOS_FMT( "Relative permeability model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Relative permeability model not found on subregion {}", + getDataContext(), subRegion.getName() ), InputError ); } @@ -266,13 +268,15 @@ template< typename MODEL1_TYPE, typename MODEL2_TYPE > void compareMultiphaseModels( MODEL1_TYPE const & lhs, MODEL2_TYPE const & rhs ) { GEOS_THROW_IF_NE_MSG( lhs.numFluidPhases(), rhs.numFluidPhases(), - GEOS_FMT( "Mismatch in number of phases between constitutive models {} and {}", lhs.getName(), rhs.getName() ), + GEOS_FMT( "Mismatch in number of phases between constitutive models {} and {}", + lhs.getDataContext(), rhs.getDataContext() ), InputError ); for( integer ip = 0; ip < lhs.numFluidPhases(); ++ip ) { GEOS_THROW_IF_NE_MSG( lhs.phaseNames()[ip], rhs.phaseNames()[ip], - GEOS_FMT( "Mismatch in phase names between constitutive models {} and {}", lhs.getName(), rhs.getName() ), + GEOS_FMT( "Mismatch in phase names between constitutive models {} and {}", + lhs.getDataContext(), rhs.getDataContext() ), InputError ); } } @@ -281,13 +285,15 @@ template< typename MODEL1_TYPE, typename MODEL2_TYPE > void compareMulticomponentModels( MODEL1_TYPE const & lhs, MODEL2_TYPE const & rhs ) { GEOS_THROW_IF_NE_MSG( lhs.numFluidComponents(), rhs.numFluidComponents(), - GEOS_FMT( "Mismatch in number of components between constitutive models {} and {}", lhs.getName(), rhs.getName() ), + GEOS_FMT( "Mismatch in number of components between constitutive models {} and {}", + lhs.getDataContext(), rhs.getDataContext() ), InputError ); for( integer ic = 0; ic < lhs.numFluidComponents(); ++ic ) { GEOS_THROW_IF_NE_MSG( lhs.componentNames()[ic], rhs.componentNames()[ic], - GEOS_FMT( "Mismatch in component names between constitutive models {} and {}", lhs.getName(), rhs.getName() ), + GEOS_FMT( "Mismatch in component names between constitutive models {} and {}", + lhs.getDataContext(), rhs.getDataContext() ), InputError ); } } @@ -349,14 +355,14 @@ void CompositionalMultiphaseWell::validateInjectionStreams( WellElementSubRegion { real64 const compFrac = injectionStream[ic]; GEOS_THROW_IF( ( compFrac < 0.0 ) || ( compFrac > 1.0 ), - "WellControls '" << wellControls.getName() << "'" << + "WellControls " << wellControls.getDataContext() << ": Invalid injection stream for well " << subRegion.getName(), InputError ); compFracSum += compFrac; } GEOS_THROW_IF( ( compFracSum < 1.0 - std::numeric_limits< real64 >::epsilon() ) || ( compFracSum > 1.0 + std::numeric_limits< real64 >::epsilon() ), - "WellControls '" << wellControls.getName() << "'" << + "WellControls " << wellControls.getDataContext() << ": Invalid injection stream for well " << subRegion.getName(), InputError ); } @@ -378,35 +384,35 @@ void CompositionalMultiphaseWell::validateWellConstraints( real64 const & time_n real64 const & surfaceTemp = wellControls.getSurfaceTemperature(); GEOS_THROW_IF( wellControls.isInjector() && currentControl == WellControls::Control::PHASEVOLRATE, - "WellControls named " << wellControls.getName() << + "WellControls " << wellControls.getDataContext() << ": Phase rate control is not available for injectors", InputError ); GEOS_THROW_IF( wellControls.isProducer() && currentControl == WellControls::Control::TOTALVOLRATE, - "WellControls named " << wellControls.getName() << + "WellControls " << wellControls.getDataContext() << ": Total rate control is not available for producers", InputError ); GEOS_THROW_IF( wellControls.isInjector() && targetTotalRate < 0.0, - "WellControls named " << wellControls.getName() << + "WellControls " << wellControls.getDataContext() << ": Target total rate cannot be negative for injectors", InputError ); GEOS_THROW_IF( wellControls.isInjector() && !isZero( targetPhaseRate ), - "WellControls named " << wellControls.getName() << + "WellControls " << wellControls.getDataContext() << ": Target phase rate cannot be used for injectors", InputError ); // The user always provides positive rates, but these rates are later multiplied by -1 internally for producers GEOS_THROW_IF( wellControls.isProducer() && targetPhaseRate > 0.0, - "WellControls named " << wellControls.getName() << + "WellControls " << wellControls.getDataContext() << ": Target phase rate cannot be negative for producers", InputError ); GEOS_THROW_IF( wellControls.isProducer() && !isZero( targetTotalRate ), - "WellControls named " << wellControls.getName() << + "WellControls " << wellControls.getDataContext() << ": Target total rate cannot be used for producers", InputError ); GEOS_THROW_IF( useSurfaceConditions && surfaceTemp <= 0, - "WellControls named " << wellControls.getName() << + "WellControls " << wellControls.getDataContext() << ": Surface temperature must be set to a strictly positive value", InputError ); @@ -419,8 +425,8 @@ void CompositionalMultiphaseWell::validateWellConstraints( real64 const & time_n } } GEOS_THROW_IF( wellControls.isProducer() && m_targetPhaseIndex == -1, - "WellControls '" << wellControls.getName() << - "': Phase " << wellControls.getTargetPhaseName() << " not found for well control " << wellControls.getName(), + "WellControls " << wellControls.getDataContext() << + ": Phase " << wellControls.getTargetPhaseName() << " not found for well control " << wellControls.getName(), InputError ); } @@ -443,13 +449,15 @@ void CompositionalMultiphaseWell::initializePostSubGroups() string & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); fluidName = getConstitutiveName< MultiFluidBase >( subRegion ); GEOS_THROW_IF( fluidName.empty(), - GEOS_FMT( "Fluid model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Fluid model not found on subregion {}", + getDataContext(), subRegion.getName() ), InputError ); string & relPermName = subRegion.getReference< string >( viewKeyStruct::relPermNamesString() ); relPermName = getConstitutiveName< RelativePermeabilityBase >( subRegion ); GEOS_THROW_IF( relPermName.empty(), - GEOS_FMT( "Fluid model not found on subregion {}", subRegion.getName() ), + GEOS_FMT( "{}: Fluid model not found on subregion {}", + getDataContext(), subRegion.getName() ), InputError ); validateInjectionStreams( subRegion ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.cpp index 9a6e15e7bf2..51b2f64e73c 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.cpp @@ -1686,13 +1686,13 @@ PresTempCompFracInitializationKernel:: GEOS_THROW_IF( foundNegativePres.get() == 1, - "Invalid well initialization: negative pressure was found, please check " << wellControls.getName(), + wellControls.getDataContext() << "Invalid well initialization, negative pressure was found.", InputError ); GEOS_THROW_IF( foundNegativeTemp.get() == 1, - "Invalid well initialization: negative temperature was found, please check " << wellControls.getName(), + wellControls.getDataContext() << "Invalid well initialization, negative temperature was found.", InputError ); GEOS_THROW_IF( foundInconsistentCompFrac.get() == 1, - "Invalid well initialization: inconsistent component fractions were found, please check " << wellControls.getName(), + wellControls.getDataContext() << "Invalid well initialization, inconsistent component fractions were found.", InputError ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp index 157a3e2355a..37aaf9d81c5 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp @@ -91,7 +91,8 @@ void SinglePhaseWell::registerDataOnMesh( Group & meshBodies ) string & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); fluidName = getConstitutiveName< SingleFluidBase >( subRegion ); - GEOS_ERROR_IF( fluidName.empty(), GEOS_FMT( "Fluid model not found on subregion {}", subRegion.getName() ) ); + GEOS_ERROR_IF( fluidName.empty(), GEOS_FMT( "{}: Fluid model not found on subregion {}", + getDataContext(), subRegion.getName() ) ); } ); } ); @@ -130,17 +131,17 @@ void SinglePhaseWell::validateWellConstraints( real64 const & time_n, real64 const targetTotalRate = wellControls.getTargetTotalRate( time_n + dt ); real64 const targetPhaseRate = wellControls.getTargetPhaseRate( time_n + dt ); GEOS_THROW_IF( currentControl == WellControls::Control::PHASEVOLRATE, - "WellControls named " << wellControls.getName() << + "WellControls " << wellControls.getDataContext() << ": Phase rate control is not available for SinglePhaseWell", InputError ); // The user always provides positive rates, but these rates are later multiplied by -1 internally for producers GEOS_THROW_IF( ( ( wellControls.isInjector() && targetTotalRate < 0.0 ) || ( wellControls.isProducer() && targetTotalRate > 0.0) ), - "WellControls named " << wellControls.getName() << + "WellControls " << wellControls.getDataContext() << ": Target total rate cannot be negative", InputError ); GEOS_THROW_IF( !isZero( targetPhaseRate ), - "WellControls named " << wellControls.getName() << + "WellControls " << wellControls.getDataContext() << ": Target phase rate cannot be used for SinglePhaseWell", InputError ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWellKernels.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWellKernels.cpp index 29b9cda2103..68c108e9d6a 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWellKernels.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWellKernels.cpp @@ -658,7 +658,7 @@ PresInitializationKernel:: GEOS_THROW_IF( foundNegativePressure.get() == 1, - "Invalid well initialization: negative pressure was found", + wellControls.getDataContext() << ": Invalid well initialization, negative pressure was found.", InputError ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp index 388a05e2301..dd045d93a3f 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp @@ -199,7 +199,8 @@ void WellControls::postProcessInput() // When the simulation starts from a restart file, we don't want to use the inputControl, // because the control may have switched in the simulation that generated the restart GEOS_THROW_IF( m_inputControl == Control::UNINITIALIZED, - "WellControls '" << getName() << "': Input well control cannot be uninitialized", + getWrapperDataContext( viewKeyStruct::inputControlString() ) << + ": Input well control cannot be uninitialized", InputError ); if( m_currentControl == Control::UNINITIALIZED ) @@ -209,23 +210,24 @@ void WellControls::postProcessInput() // 1.a) check target BHP GEOS_THROW_IF( m_targetBHP < 0, - "WellControls '" << getName() << "': Target bottom-hole pressure is negative", + getWrapperDataContext( viewKeyStruct::targetBHPString() ) << + ": Target bottom-hole pressure is negative", InputError ); // 1.b) check target rates GEOS_THROW_IF( m_targetTotalRate < 0, - "WellControls '" << getName() << "': Target rate is negative", + getWrapperDataContext( viewKeyStruct::targetTotalRateString() ) << ": Target rate is negative", InputError ); GEOS_THROW_IF( m_targetPhaseRate < 0, - "WellControls '" << getName() << "': Target oil rate is negative", + getWrapperDataContext( viewKeyStruct::targetPhaseRateString() ) << ": Target oil rate is negative", InputError ); GEOS_THROW_IF( (m_injectionStream.empty() && m_injectionTemperature >= 0) || (!m_injectionStream.empty() && m_injectionTemperature < 0), - "WellControls '" << getName() << "': Both " - << viewKeyStruct::injectionStreamString() << " and " << viewKeyStruct::injectionTemperatureString() - << " must be specified for multiphase simulations", + "WellControls " << getDataContext() << ": Both " + << viewKeyStruct::injectionStreamString() << " and " << viewKeyStruct::injectionTemperatureString() + << " must be specified for multiphase simulations", InputError ); // 1.c) Set the multiplier for the rates @@ -245,28 +247,29 @@ void WellControls::postProcessInput() for( localIndex ic = 0; ic < m_injectionStream.size(); ++ic ) { GEOS_ERROR_IF( m_injectionStream[ic] < 0.0 || m_injectionStream[ic] > 1.0, - "WellControls '" << getName() << "': Invalid injection stream" ); + getWrapperDataContext( viewKeyStruct::injectionStreamString() ) << ": Invalid injection stream" ); sum += m_injectionStream[ic]; } GEOS_THROW_IF( LvArray::math::abs( 1.0 - sum ) > std::numeric_limits< real64 >::epsilon(), - "WellControls '" << getName() << "': Invalid injection stream", + getWrapperDataContext( viewKeyStruct::injectionStreamString() ) << ": Invalid injection stream", InputError ); } // 3) check the flag for surface / reservoir conditions GEOS_THROW_IF( m_useSurfaceConditions != 0 && m_useSurfaceConditions != 1, - "WellControls '" << getName() << "': The flag to select surface/reservoir conditions must be equal to 0 or 1", + getWrapperDataContext( viewKeyStruct::useSurfaceConditionsString() ) << ": The flag to select surface/reservoir conditions must be equal to 0 or 1", InputError ); // 4) check the flag for surface / reservoir conditions GEOS_THROW_IF( m_useSurfaceConditions == 1 && m_surfacePres <= 0, - "WellControls '" << getName() << "': When " << viewKeyStruct::useSurfaceConditionsString() << " == 1, the surface pressure must be defined", + "WellControls " << getDataContext() << ": When " << viewKeyStruct::useSurfaceConditionsString() << " == 1, " << + viewKeyStruct::surfacePressureString() << " must be defined", InputError ); // 5) check that at least one rate constraint has been defined GEOS_THROW_IF( ((m_targetPhaseRate <= 0.0 && m_targetPhaseRateTableName.empty()) && (m_targetTotalRate <= 0.0 && m_targetTotalRateTableName.empty())), - "WellControls '" << getName() << "': You need to specify a phase rate constraint or a total rate constraint. \n" << + "WellControls " << getDataContext() << ": You need to specify a phase rate constraint or a total rate constraint. \n" << "The phase rate constraint can be specified using " << "either " << viewKeyStruct::targetPhaseRateString() << " or " << viewKeyStruct::targetPhaseRateTableNameString() << ".\n" << @@ -277,17 +280,17 @@ void WellControls::postProcessInput() // 6) check whether redundant information has been provided GEOS_THROW_IF( ((m_targetPhaseRate > 0.0 && !m_targetPhaseRateTableName.empty())), - "WellControls '" << getName() << "': You have provided redundant information for well phase rate." << + "WellControls " << getDataContext() << ": You have provided redundant information for well phase rate." << " The keywords " << viewKeyStruct::targetPhaseRateString() << " and " << viewKeyStruct::targetPhaseRateTableNameString() << " cannot be specified together", InputError ); GEOS_THROW_IF( ((m_targetTotalRate > 0.0 && !m_targetTotalRateTableName.empty())), - "WellControls '" << getName() << "': You have provided redundant information for well total rate." << + "WellControls " << getDataContext() << ": You have provided redundant information for well total rate." << " The keywords " << viewKeyStruct::targetTotalRateString() << " and " << viewKeyStruct::targetTotalRateTableNameString() << " cannot be specified together", InputError ); GEOS_THROW_IF( ((m_targetBHP > 0.0 && !m_targetBHPTableName.empty())), - "WellControls '" << getName() << "': You have provided redundant information for well BHP." << + "WellControls " << getDataContext() << ": You have provided redundant information for well BHP." << " The keywords " << viewKeyStruct::targetBHPString() << " and " << viewKeyStruct::targetBHPTableNameString() << " cannot be specified together", InputError ); @@ -296,33 +299,35 @@ void WellControls::postProcessInput() if( m_currentControl == Control::BHP ) { GEOS_THROW_IF( ((m_targetBHP <= 0.0 && m_targetBHPTableName.empty())), - "WellControls '" << getName() << "': You have to provide well BHP by specifying either " - << viewKeyStruct::targetBHPString() << " or " << viewKeyStruct::targetBHPTableNameString(), + "WellControls " << getDataContext() << ": You have to provide well BHP by specifying either " + << viewKeyStruct::targetBHPString() << " or " << viewKeyStruct::targetBHPTableNameString(), InputError ); } else if( m_targetBHP <= 0.0 && m_targetBHPTableName.empty() ) { m_targetBHP = isProducer() ? WellConstants::defaultProducerBHP : WellConstants::defaultInjectorBHP; - GEOS_LOG_LEVEL_RANK_0( 1, "WellControls '" << getName() << "': Setting " << viewKeyStruct::targetBHPString() << " to default value " - << m_targetBHP << "." ); + GEOS_LOG_LEVEL_RANK_0( 1, "WellControls " << getDataContext() << ": Setting " << viewKeyStruct::targetBHPString() << " to default value " + << m_targetBHP << "." ); } // 6.2) Check incoherent information // An injector must be controlled by TotalVolRate GEOS_THROW_IF( (isInjector() && (m_inputControl == Control::PHASEVOLRATE)), - "WellControls '" << getName() << "': You have to control an injector with " - << EnumStrings< Control >::toString( Control::TOTALVOLRATE ), + "WellControls " << getDataContext() << ": You have to control an injector with " + << EnumStrings< Control >::toString( Control::TOTALVOLRATE ), InputError ); // 7) Make sure that the flag disabling crossflow is not used for producers GEOS_THROW_IF( isProducer() && m_isCrossflowEnabled == 0, - "WellControls '" << getName() << "': The option '" << viewKeyStruct::enableCrossflowString() << "' cannot be set to '0' for producers", + getWrapperDataContext( viewKeyStruct::enableCrossflowString() ) << + ": This option cannot be set to '0' for producers", InputError ); // 8) Make sure that the initial pressure coefficient is positive GEOS_THROW_IF( m_initialPressureCoefficient < 0, - "WellControls '" << getName() << "': The tuning coefficient " << viewKeyStruct::initialPressureCoefficientString() << " is negative", + getWrapperDataContext( viewKeyStruct::initialPressureCoefficientString() ) << + ": This tuning coefficient is negative", InputError ); @@ -338,8 +343,8 @@ void WellControls::postProcessInput() m_targetBHPTable = &(functionManager.getGroup< TableFunction const >( m_targetBHPTableName )); GEOS_THROW_IF( m_targetBHPTable->getInterpolationMethod() != TableFunction::InterpolationType::Lower, - "WellControls '" << getName() << "': The interpolation method for the time-dependent rate table " - << m_targetBHPTable->getName() << " should be TableFunction::InterpolationType::Lower", + "WellControls " << getDataContext() << ": The interpolation method for the time-dependent rate table " + << m_targetBHPTable->getName() << " should be TableFunction::InterpolationType::Lower", InputError ); } @@ -355,8 +360,8 @@ void WellControls::postProcessInput() m_targetTotalRateTable = &(functionManager.getGroup< TableFunction const >( m_targetTotalRateTableName )); GEOS_THROW_IF( m_targetTotalRateTable->getInterpolationMethod() != TableFunction::InterpolationType::Lower, - "WellControls '" << getName() << "': The interpolation method for the time-dependent rate table " - << m_targetTotalRateTable->getName() << " should be TableFunction::InterpolationType::Lower", + "WellControls " << getDataContext() << ": The interpolation method for the time-dependent rate table " + << m_targetTotalRateTable->getName() << " should be TableFunction::InterpolationType::Lower", InputError ); } @@ -372,8 +377,8 @@ void WellControls::postProcessInput() m_targetPhaseRateTable = &(functionManager.getGroup< TableFunction const >( m_targetPhaseRateTableName )); GEOS_THROW_IF( m_targetPhaseRateTable->getInterpolationMethod() != TableFunction::InterpolationType::Lower, - "WellControls '" << getName() << "': The interpolation method for the time-dependent rate table " - << m_targetPhaseRateTable->getName() << " should be TableFunction::InterpolationType::Lower", + "WellControls " << getDataContext() << ": The interpolation method for the time-dependent rate table " + << m_targetPhaseRateTable->getName() << " should be TableFunction::InterpolationType::Lower", InputError ); } @@ -395,8 +400,8 @@ void WellControls::postProcessInput() m_statusTable = &(functionManager.getGroup< TableFunction const >( m_statusTableName )); GEOS_THROW_IF( m_statusTable->getInterpolationMethod() != TableFunction::InterpolationType::Lower, - "WellControls '" << getName() << "': The interpolation method for the time-dependent rate table " - << m_targetPhaseRateTable->getName() << " should be TableFunction::InterpolationType::Lower", + "WellControls " << getDataContext() << ": The interpolation method for the time-dependent rate table " + << m_targetPhaseRateTable->getName() << " should be TableFunction::InterpolationType::Lower", InputError ); } } diff --git a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp index 95fd9905148..3c080074745 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp @@ -141,9 +141,9 @@ initializePreSubGroups() bool const useMassFlow = flowSolver->getReference< integer >( CompositionalMultiphaseBase::viewKeyStruct::useMassFlagString() );; bool const useMassWell = Base::wellSolver()->template getReference< integer >( CompositionalMultiphaseWell::viewKeyStruct::useMassFlagString() ); GEOS_THROW_IF( useMassFlow != useMassWell, - GEOS_FMT( "CompositionalMultiphaseReservoir '{}': the input flag {} must be the same in the flow and well solvers, respectively '{}' and '{}'", - this->getName(), CompositionalMultiphaseBase::viewKeyStruct::useMassFlagString(), - Base::reservoirSolver()->getName(), Base::wellSolver()->getName() ), + GEOS_FMT( "{}: the input flag {} must be the same in the flow and well solvers, respectively '{}' and '{}'", + this->getDataContext(), CompositionalMultiphaseBase::viewKeyStruct::useMassFlagString(), + Base::reservoirSolver()->getDataContext(), Base::wellSolver()->getDataContext() ), InputError ); } diff --git a/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.cpp b/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.cpp index 15e5319821d..1ca8d0b1385 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.cpp @@ -150,7 +150,8 @@ bool validateWellPerforations( SolverBase const * const reservoirSolver, localIndex const hasBadPerforations = MpiWrapper::max( badPerforation.first.empty() ? 0 : 1 ); GEOS_THROW_IF( !badPerforation.first.empty(), - GEOS_FMT( "The well {} has a connection to the region {} which is not targeted by the solver", badPerforation.first, badPerforation.second ), + GEOS_FMT( "{}: The well {} has a connection to the region {} which is not targeted by the solver", + wellSolver->getDataContext(), badPerforation.first, badPerforation.second ), std::runtime_error ); return hasBadPerforations == 0; } diff --git a/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp b/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp index cef96e603db..5f085ce6264 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp @@ -80,7 +80,8 @@ class CoupledSolver : public SolverBase using SolverType = TYPEOFPTR( SolverPtr {} ); solver = this->getParent().template getGroupPointer< SolverType >( m_names[idx()] ); GEOS_THROW_IF( solver == nullptr, - GEOS_FMT( "Could not find solver '{}' of type {}", + GEOS_FMT( "{}: Could not find solver '{}' of type {}", + getDataContext(), m_names[idx()], LvArray::system::demangleType< SolverType >() ), InputError ); } ); @@ -231,7 +232,7 @@ class CoupledSolver : public SolverBase } else { - GEOS_ERROR( "Invalid coupling type option." ); + GEOS_ERROR( getDataContext() << ": Invalid coupling type option." ); return 0; } @@ -431,7 +432,7 @@ class CoupledSolver : public SolverBase ++iter; } - GEOS_ERROR_IF( !isConverged, getName() << "::sequentiallyCoupledSolverStep did not converge!" ); + GEOS_ERROR_IF( !isConverged, getDataContext() << ": sequentiallyCoupledSolverStep did not converge!" ); implicitStepComplete( time_n, dt, domain ); @@ -520,7 +521,7 @@ class CoupledSolver : public SolverBase } else { - GEOS_ERROR( "Invalid sequential convergence criterion." ); + GEOS_ERROR( getDataContext() << ": Invalid sequential convergence criterion." ); } if( isConverged ) @@ -539,8 +540,8 @@ class CoupledSolver : public SolverBase bool const isSequential = getNonlinearSolverParameters().couplingType() == NonlinearSolverParameters::CouplingType::Sequential; bool const usesLineSearch = getNonlinearSolverParameters().m_lineSearchAction != NonlinearSolverParameters::LineSearchAction::None; GEOS_THROW_IF( isSequential && usesLineSearch, - GEOS_FMT( "`{}`: line search is not supported by the coupled solver when {} is set to `{}`. Please set {} to `{}` to remove this error", - getName(), + GEOS_FMT( "{}: line search is not supported by the coupled solver when {} is set to `{}`. Please set {} to `{}` to remove this error", + getWrapperDataContext( NonlinearSolverParameters::viewKeysStruct::couplingTypeString() ), NonlinearSolverParameters::viewKeysStruct::couplingTypeString(), EnumStrings< NonlinearSolverParameters::CouplingType >::toString( NonlinearSolverParameters::CouplingType::Sequential ), NonlinearSolverParameters::viewKeysStruct::lineSearchActionString(), diff --git a/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp b/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp index 232505c7d09..1e6f8862ca9 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp @@ -318,7 +318,8 @@ void MultiphasePoromechanics::initializePreSubGroups() SolverBase::initializePreSubGroups(); GEOS_THROW_IF( m_stabilizationType == StabilizationType::Local, - catalogName() << " " << getName() << ": Local stabilization has been disabled temporarily", + getWrapperDataContext( viewKeyStruct::stabilizationTypeString() ) << + ": Local stabilization has been disabled temporarily", InputError ); DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); @@ -334,7 +335,8 @@ void MultiphasePoromechanics::initializePreSubGroups() { string & porousName = subRegion.getReference< string >( viewKeyStruct::porousMaterialNamesString() ); porousName = getConstitutiveName< CoupledSolidBase >( subRegion ); - GEOS_ERROR_IF( porousName.empty(), GEOS_FMT( "Solid model not found on subregion {}", subRegion.getName() ) ); + GEOS_ERROR_IF( porousName.empty(), GEOS_FMT( "{}: Solid model not found on subregion {}", + getDataContext(), subRegion.getName() ) ); if( subRegion.hasField< fields::poromechanics::bulkDensity >() ) { diff --git a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp index 9200bda296a..e5173d2e6e1 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp @@ -90,8 +90,9 @@ postProcessInput() PhysicsSolverManager & physicsSolverManager = problemManager.getPhysicsSolverManager(); GEOS_THROW_IF( !physicsSolverManager.hasGroup( m_poromechanicsSolverName ), - GEOS_FMT( "Task {}: physics solver named {} not found", - getName(), m_poromechanicsSolverName ), + GEOS_FMT( "{}: physics solver named {} not found", + getWrapperDataContext( viewKeyStruct::poromechanicsSolverNameString() ), + m_poromechanicsSolverName ), InputError ); m_poromechanicsSolver = &physicsSolverManager.getGroup< POROMECHANICS_SOLVER >( m_poromechanicsSolverName ); diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp index d3f3d09ba7c..a4b2c2d48d8 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp @@ -138,7 +138,8 @@ void SinglePhasePoromechanics::initializePreSubGroups() string & porousName = subRegion.getReference< string >( viewKeyStruct::porousMaterialNamesString() ); porousName = getConstitutiveName< CoupledSolidBase >( subRegion ); GEOS_THROW_IF( porousName.empty(), - GEOS_FMT( "{} {} : Solid model not found on subregion {}", catalogName(), getName(), subRegion.getName() ), + GEOS_FMT( "{} {} : Solid model not found on subregion {}", + catalogName(), getDataContext().toString(), subRegion.getName() ), InputError ); if( subRegion.hasField< fields::poromechanics::bulkDensity >() ) @@ -202,7 +203,8 @@ void SinglePhasePoromechanics::initializePostInitialConditionsPreSubGroups() integer & isFlowThermal = flowSolver()->getReference< integer >( FlowSolverBase::viewKeyStruct::isThermalString() ); GEOS_LOG_RANK_0_IF( m_isThermal && !isFlowThermal, GEOS_FMT( "{} {}: The attribute `{}` of the flow solver `{}` is set to 1 since the poromechanics solver is thermal", - catalogName(), getName(), FlowSolverBase::viewKeyStruct::isThermalString(), flowSolver()->getName() ) ); + catalogName(), getDataContext().toString(), + FlowSolverBase::viewKeyStruct::isThermalString(), flowSolver()->getName() ) ); isFlowThermal = m_isThermal; if( m_isThermal ) diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp index 60b367fa4bb..c90015790c3 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp @@ -418,10 +418,12 @@ void SinglePhasePoromechanicsConformingFractures:: FaceElementSubRegion const & fractureSubRegion = fractureRegion.getUniqueSubRegion< FaceElementSubRegion >(); - GEOS_ERROR_IF( !fractureSubRegion.hasWrapper( flow::pressure::key() ), "The fracture subregion must contain pressure field." ); + GEOS_ERROR_IF( !fractureSubRegion.hasWrapper( flow::pressure::key() ), + getDataContext() << ": The fracture subregion must contain pressure field." ); arrayView2d< localIndex const > const faceMap = fractureSubRegion.faceList(); - GEOS_ERROR_IF( faceMap.size( 1 ) != 2, "A fracture face has to be shared by two cells." ); + GEOS_ERROR_IF( faceMap.size( 1 ) != 2, + getDataContext() << ": A fracture face has to be shared by two cells." ); arrayView1d< globalIndex const > const & presDofNumber = fractureSubRegion.getReference< globalIndex_array >( presDofKey ); diff --git a/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics_impl.hpp b/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics_impl.hpp index 2d454924791..ced2f199305 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics_impl.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics_impl.hpp @@ -74,7 +74,8 @@ MultiphasePoromechanics( NodeManager const & nodeManager, m_numPhases( numPhases ) { GEOS_ERROR_IF_GT_MSG( m_numComponents, maxNumComponents, - "MultiphasePoromechanics solver allows at most " << maxNumComponents << " components at the moment" ); + "MultiphasePoromechanics solver allows at most " << + maxNumComponents << " components at the moment" ); // extract fluid constitutive data views { diff --git a/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.cpp b/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.cpp index 402d7896c01..d13c4170f0e 100644 --- a/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.cpp +++ b/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.cpp @@ -116,7 +116,8 @@ void PhaseFieldDamageFEM::registerDataOnMesh( Group & meshBodies ) string & solidMaterialName = subRegion.getReference< string >( viewKeyStruct::solidModelNamesString() ); solidMaterialName = SolverBase::getConstitutiveName< SolidBase >( subRegion ); - GEOS_ERROR_IF( solidMaterialName.empty(), GEOS_FMT( "SolidBase model not found on subregion {}", subRegion.getName() ) ); + GEOS_ERROR_IF( solidMaterialName.empty(), GEOS_FMT( "{}: SolidBase model not found on subregion {}", + getDataContext(), subRegion.getName() ) ); } ); } ); @@ -143,12 +144,12 @@ void PhaseFieldDamageFEM::postProcessInput() } else { - GEOS_ERROR( "invalid time integration option" ); + GEOS_ERROR( getDataContext() << ": invalid time integration option" ); } if( m_localDissipationOption != "Linear" && m_localDissipationOption != "Quadratic" ) { - GEOS_ERROR( "invalid local dissipation option - must be Linear or Quadratic" ); + GEOS_ERROR( getDataContext() << ": invalid local dissipation option - must be Linear or Quadratic" ); } // Set basic parameters for solver diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp index d256ea60d9b..4ad31a975d4 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp @@ -216,7 +216,8 @@ void SolidMechanicsLagrangianFEM::setConstitutiveNamesCallSuper( ElementSubRegio string & solidMaterialName = subRegion.getReference< string >( viewKeyStruct::solidMaterialNamesString() ); solidMaterialName = SolverBase::getConstitutiveName< SolidBase >( subRegion ); - GEOS_ERROR_IF( solidMaterialName.empty(), GEOS_FMT( "SolidBase model not found on subregion {}", subRegion.getName() ) ); + GEOS_ERROR_IF( solidMaterialName.empty(), GEOS_FMT( "{}: SolidBase model not found on subregion {}", + getDataContext(), subRegion.getDataContext() ) ); } @@ -294,7 +295,8 @@ real64 SolidMechanicsLagrangianFEM::explicitKernelDispatch( MeshLevel & mesh, } else { - GEOS_ERROR( "Invalid option for strain theory (0 = infinitesimal strain, 1 = finite strain" ); + GEOS_ERROR( getWrapperDataContext( viewKeyStruct::strainTheoryString() ) << + ": Invalid option for strain theory (0 = infinitesimal strain, 1 = finite strain" ); } return rval; @@ -576,7 +578,7 @@ real64 SolidMechanicsLagrangianFEM::explicitStep( real64 const & time_n, SortedArrayView< localIndex const > const & targetSet ) { integer const component = bc.getComponent(); - GEOS_ERROR_IF_LT_MSG( component, 0, "Component index required for displacement BC " << bc.getName() ); + GEOS_ERROR_IF_LT_MSG( component, 0, getDataContext() << ": Component index required for displacement BC " << bc.getDataContext() ); forAll< parallelDevicePolicy< 1024 > >( targetSet.size(), [=] GEOS_DEVICE ( localIndex const i ) @@ -589,7 +591,7 @@ real64 SolidMechanicsLagrangianFEM::explicitStep( real64 const & time_n, SortedArrayView< localIndex const > const & targetSet ) { integer const component = bc.getComponent(); - GEOS_ERROR_IF_LT_MSG( component, 0, "Component index required for displacement BC " << bc.getName() ); + GEOS_ERROR_IF_LT_MSG( component, 0, getDataContext() << ": Component index required for displacement BC " << bc.getDataContext() ); forAll< parallelDevicePolicy< 1024 > >( targetSet.size(), [=] GEOS_DEVICE ( localIndex const i ) diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp index 8ae9c3c1496..48df2b33d56 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp @@ -61,7 +61,7 @@ void SolidMechanicsStateReset::postProcessInput() GEOS_THROW_IF( !physicsSolverManager.hasGroup( m_solidSolverName ), GEOS_FMT( "Task {}: physics solver named {} not found", - getName(), m_solidSolverName ), + getDataContext(), m_solidSolverName ), InputError ); m_solidSolver = &physicsSolverManager.getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp index 76eff5d44e8..1fd70743f0b 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp @@ -770,7 +770,7 @@ void SurfaceGenerator::synchronizeTipSets ( FaceManager & faceManager, { localIndex const parentNodeIndex = parentNodeIndices[nodeIndex]; - GEOS_ERROR_IF( parentNodeIndex == -1, "parentNodeIndex should not be -1" ); + GEOS_ERROR_IF( parentNodeIndex == -1, getDataContext() << ": parentNodeIndex should not be -1" ); m_tipNodes.remove( parentNodeIndex ); } @@ -795,7 +795,7 @@ void SurfaceGenerator::synchronizeTipSets ( FaceManager & faceManager, { localIndex const parentEdgeIndex = parentEdgeIndices[edgeIndex]; - GEOS_ERROR_IF( parentEdgeIndex == -1, "parentEdgeIndex should not be -1" ); + GEOS_ERROR_IF( parentEdgeIndex == -1, getDataContext() << ": parentEdgeIndex should not be -1" ); m_tipEdges.remove( parentEdgeIndex ); for( localIndex const faceIndex : edgeToFaceMap[ parentEdgeIndex ] ) @@ -828,7 +828,7 @@ void SurfaceGenerator::synchronizeTipSets ( FaceManager & faceManager, for( localIndex const faceIndex : receivedObjects.newFaces ) { localIndex const parentFaceIndex = parentFaceIndices[faceIndex]; - GEOS_ERROR_IF( parentFaceIndex == -1, "parentFaceIndex should not be -1" ); + GEOS_ERROR_IF( parentFaceIndex == -1, getDataContext() << ": parentFaceIndex should not be -1" ); m_trailingFaces.insert( parentFaceIndex ); m_tipFaces.remove( parentFaceIndex ); @@ -1078,7 +1078,7 @@ bool SurfaceGenerator::findFracturePlanes( localIndex const nodeID, if( edge[0] == INT_MAX || edge[1] == INT_MAX ) { - GEOS_ERROR( "SurfaceGenerator::FindFracturePlanes: invalid edge." ); + GEOS_ERROR( getDataContext() << ": invalid edge (SurfaceGenerator::findFracturePlanes)." ); } @@ -1223,15 +1223,11 @@ bool SurfaceGenerator::findFracturePlanes( localIndex const nodeID, // NOT be included in the path!!! if( nextEdge!=startingEdge && !(isEdgeExternal[nextEdge]==1 && startingEdgeExternal ) ) { - std::cout<::max()) { - GEOS_ERROR( "Error. The triangular trailing face has three tip nodes but cannot find the other trailing face containing the trailing node." ); + GEOS_ERROR( getDataContext() << ": The triangular trailing face has three tip nodes but cannot find the other trailing face containing the trailing node." ); } } else if( unpinchedNodeID.size() == 1 ) @@ -3305,7 +3301,8 @@ real64 SurfaceGenerator::calculateEdgeSif( DomainPartition const & domain, } else { - GEOS_ERROR( GEOS_FMT( "Error! Edge {} has two external faces, but the parent-child relationship is wrong.", edgeID ) ); + GEOS_ERROR( GEOS_FMT( "{}: Edge {} has two external faces, but the parent-child relationship is wrong.", + getDataContext(), edgeID ) ); } trailFaceID = faceParentIndex[faceInvolved[0]]==-1 ? faceInvolved[0] : faceParentIndex[faceInvolved[0]]; @@ -3382,7 +3379,7 @@ real64 SurfaceGenerator::calculateEdgeSif( DomainPartition const & domain, if( numSharedNodes == 4 ) { - GEOS_ERROR( "Error. The fracture face has four shared nodes with its child. This should not happen." ); + GEOS_ERROR( getDataContext() << ": The fracture face has four shared nodes with its child. This should not happen." ); } else if( numSharedNodes == 3 ) { @@ -3391,7 +3388,7 @@ real64 SurfaceGenerator::calculateEdgeSif( DomainPartition const & domain, //wu40: I think the following check is not necessary. if( lNodeFaceA.size() != 1 || lNodeFaceAp.size() != 1 ) { - GEOS_ERROR( "Error. These two faces share three nodes but the number of remaining nodes is not one. Something is wrong" ); + GEOS_ERROR( getDataContext() << ": these two faces share three nodes but the number of remaining nodes is not one." ); } else { @@ -3430,7 +3427,7 @@ real64 SurfaceGenerator::calculateEdgeSif( DomainPartition const & domain, } if( convexCorner == std::numeric_limits< localIndex >::max()) - GEOS_ERROR( "Error. This is a three-node-pinched edge but I cannot find the convex corner" ); + GEOS_ERROR( getDataContext() << ": This is a three-node-pinched edge but I cannot find the convex corner" ); } @@ -3500,7 +3497,7 @@ real64 SurfaceGenerator::calculateEdgeSif( DomainPartition const & domain, if( trailingNodes.size() > 2 || trailingNodes.size() == 0 ) { - GEOS_ERROR( "Fatal error in finding nodes behind tip edge." ); + GEOS_ERROR( getDataContext() << ": Fatal error in finding nodes behind tip edge." ); } else if( trailingNodes.size() == 1 ) // Need some work to find the other node { diff --git a/src/coreComponents/physicsSolvers/wavePropagation/AcousticFirstOrderWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/AcousticFirstOrderWaveEquationSEM.cpp index ad01f33626a..e612d7e11f6 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/AcousticFirstOrderWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/AcousticFirstOrderWaveEquationSEM.cpp @@ -209,7 +209,7 @@ void AcousticFirstOrderWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLev CellElementSubRegion & elementSubRegion ) { GEOS_THROW_IF( elementSubRegion.getElementType() != ElementType::Hexahedron, - "Invalid type of element, the acoustic solver is designed for hexahedral meshes only (C3D8) ", + getDataContext() << ": Invalid type of element, the acoustic solver is designed for hexahedral meshes only (C3D8) ", InputError ); arrayView2d< localIndex const > const elemsToFaces = elementSubRegion.faceList(); @@ -269,7 +269,7 @@ void AcousticFirstOrderWaveEquationSEM::addSourceToRightHandSide( integer const arrayView1d< localIndex const > const sourceIsAccessible = m_sourceIsAccessible.toViewConst(); arrayView2d< real32 const > const sourceValue = m_sourceValue.toViewConst(); - GEOS_THROW_IF( cycleNumber > sourceValue.size( 0 ), "Too many steps compared to array size", std::runtime_error ); + GEOS_THROW_IF( cycleNumber > sourceValue.size( 0 ), getDataContext() << ": Too many steps compared to array size", std::runtime_error ); forAll< EXEC_POLICY >( sourceConstants.size( 0 ), [=] GEOS_HOST_DEVICE ( localIndex const isrc ) { if( sourceIsAccessible[isrc] == 1 ) @@ -436,7 +436,7 @@ real64 AcousticFirstOrderWaveEquationSEM::explicitStepBackward( real64 const & t DomainPartition & domain, bool GEOS_UNUSED_PARAM( computeGradient ) ) { - GEOS_ERROR( "Backward propagation for the first-order wave propagator not yet implemented" ); + GEOS_ERROR( getDataContext() << ": Backward propagation for the first-order wave propagator not yet implemented" ); real64 dtOut = explicitStepInternal( time_n, dt, cycleNumber, domain ); return dtOut; } @@ -633,12 +633,12 @@ void AcousticFirstOrderWaveEquationSEM::compute2dVariableAllSeismoTraces( localI void AcousticFirstOrderWaveEquationSEM::initializePML() { - GEOS_ERROR( "PML for the first order acoustic wave propagator not yet implemented" ); + GEOS_ERROR( getDataContext() << ": PML for the first order acoustic wave propagator not yet implemented" ); } void AcousticFirstOrderWaveEquationSEM::applyPML( real64 const, DomainPartition & ) { - GEOS_ERROR( "PML for the first order acoustic wave propagator not yet implemented" ); + GEOS_ERROR( getDataContext() << ": PML for the first order acoustic wave propagator not yet implemented" ); } REGISTER_CATALOG_ENTRY( SolverBase, AcousticFirstOrderWaveEquationSEM, string const &, dataRepository::Group * const ) diff --git a/src/coreComponents/physicsSolvers/wavePropagation/AcousticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/AcousticWaveEquationSEM.cpp index f50c18002a2..6d8aaeb100d 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/AcousticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/AcousticWaveEquationSEM.cpp @@ -163,7 +163,7 @@ void AcousticWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLevel & mesh, CellElementSubRegion & elementSubRegion ) { GEOS_THROW_IF( elementSubRegion.getElementType() != ElementType::Hexahedron, - "Invalid type of element, the acoustic solver is designed for hexahedral meshes only (C3D8), using the SEM formulation", + getDataContext() << ": Invalid type of element, the acoustic solver is designed for hexahedral meshes only (C3D8), using the SEM formulation", InputError ); arrayView2d< localIndex const > const elemsToFaces = elementSubRegion.faceList(); @@ -219,7 +219,9 @@ void AcousticWaveEquationSEM::addSourceToRightHandSide( integer const & cycleNum arrayView1d< localIndex const > const sourceIsAccessible = m_sourceIsAccessible.toViewConst(); arrayView2d< real32 const > const sourceValue = m_sourceValue.toViewConst(); - GEOS_THROW_IF( cycleNumber > sourceValue.size( 0 ), "Too many steps compared to array size", std::runtime_error ); + GEOS_THROW_IF( cycleNumber > sourceValue.size( 0 ), + getDataContext() << ": Too many steps compared to array size", + std::runtime_error ); forAll< EXEC_POLICY >( sourceConstants.size( 0 ), [=] GEOS_HOST_DEVICE ( localIndex const isrc ) { if( sourceIsAccessible[isrc] == 1 ) @@ -820,12 +822,12 @@ real64 AcousticWaveEquationSEM::explicitStepForward( real64 const & time_n, std::ofstream wf( fileName, std::ios::out | std::ios::binary ); GEOS_THROW_IF( !wf, - "Could not open file "<< fileName << " for writting", + getDataContext() << ": Could not open file "<< fileName << " for writing", InputError ); wf.write( (char *)&p_dt2[0], p_dt2.size()*sizeof( real32 ) ); wf.close( ); GEOS_THROW_IF( !wf.good(), - "An error occured while writting "<< fileName, + getDataContext() << ": An error occured while writing "<< fileName, InputError ); } @@ -886,7 +888,7 @@ real64 AcousticWaveEquationSEM::explicitStepBackward( real64 const & time_n, std::string fileName = GEOS_FMT( "lifo/rank_{:05}/pressuredt2_{:06}_{:08}.dat", rank, m_shotIndex, cycleNumber ); std::ifstream wf( fileName, std::ios::in | std::ios::binary ); GEOS_THROW_IF( !wf, - "Could not open file "<< fileName << " for reading", + getDataContext() << ": Could not open file "<< fileName << " for reading", InputError ); //std::string fileName = GEOS_FMT( "pressuredt2_{:06}_{:08}_{:04}.dat", m_shotIndex, cycleNumber, rank ); //const int fileDesc = open( fileName.c_str(), O_RDONLY | O_DIRECT ); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/ElasticFirstOrderWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/ElasticFirstOrderWaveEquationSEM.cpp index 1eb94a47555..b3e245eb93d 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/ElasticFirstOrderWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/ElasticFirstOrderWaveEquationSEM.cpp @@ -261,7 +261,7 @@ void ElasticFirstOrderWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLeve { GEOS_THROW_IF( elementSubRegion.getElementType() != ElementType::Hexahedron, - "Invalid type of element, the elastic solver is designed for hexahedral meshes only (C3D8) ", + getDataContext() << ": Invalid type of element, the elastic solver is designed for hexahedral meshes only (C3D8) ", InputError ); arrayView2d< localIndex const > const elemsToFaces = elementSubRegion.faceList(); @@ -320,7 +320,9 @@ void ElasticFirstOrderWaveEquationSEM::addSourceToRightHandSide( integer const & arrayView1d< localIndex const > const sourceIsAccessible = m_sourceIsAccessible.toViewConst(); arrayView2d< real32 const > const sourceValue = m_sourceValue.toViewConst(); - GEOS_THROW_IF( cycleNumber > sourceValue.size( 0 ), "Too many steps compared to array size", std::runtime_error ); + GEOS_THROW_IF( cycleNumber > sourceValue.size( 0 ), + getDataContext() << ": Too many steps compared to array size", + std::runtime_error ); forAll< serialPolicy >( m_sourceConstants.size( 0 ), [=] ( localIndex const isrc ) { @@ -504,7 +506,7 @@ real64 ElasticFirstOrderWaveEquationSEM::explicitStepBackward( real64 const & ti DomainPartition & domain, bool GEOS_UNUSED_PARAM( computeGradient ) ) { - GEOS_ERROR( "Backward propagation for the first order elastic wave propagator not yet implemented" ); + GEOS_ERROR( getDataContext() << ": Backward propagation for the first order elastic wave propagator not yet implemented" ); real64 dtOut = explicitStepInternal( time_n, dt, cycleNumber, domain ); return dtOut; } @@ -777,12 +779,12 @@ void ElasticFirstOrderWaveEquationSEM::compute2dVariableAllSeismoTraces( localIn void ElasticFirstOrderWaveEquationSEM::initializePML() { - GEOS_ERROR( "PML for the first order elastic wave propagator not yet implemented" ); + GEOS_ERROR( getDataContext() << ": PML for the first order elastic wave propagator not yet implemented" ); } void ElasticFirstOrderWaveEquationSEM::applyPML( real64 const, DomainPartition & ) { - GEOS_ERROR( "PML for the first order elastic wave propagator not yet implemented" ); + GEOS_ERROR( getDataContext() << ": PML for the first order elastic wave propagator not yet implemented" ); } REGISTER_CATALOG_ENTRY( SolverBase, ElasticFirstOrderWaveEquationSEM, string const &, dataRepository::Group * const ) diff --git a/src/coreComponents/physicsSolvers/wavePropagation/ElasticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/ElasticWaveEquationSEM.cpp index 3416e82f7ef..ca71b4c7989 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/ElasticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/ElasticWaveEquationSEM.cpp @@ -126,7 +126,7 @@ localIndex ElasticWaveEquationSEM::getNumNodesPerElem() FiniteElementDiscretization const * const feDiscretization = feDiscretizationManager.getGroupPointer< FiniteElementDiscretization >( m_discretizationName ); GEOS_THROW_IF( feDiscretization == nullptr, - getName() << ": FE discretization not found: " << m_discretizationName, + getDataContext() << ": FE discretization not found: " << m_discretizationName, InputError ); localIndex numNodesPerElem = 0; @@ -231,10 +231,12 @@ void ElasticWaveEquationSEM::postProcessInput() WaveSolverBase::postProcessInput(); GEOS_ERROR_IF( m_sourceCoordinates.size( 1 ) != 3, - "Invalid number of physical coordinates for the sources" ); + getWrapperDataContext( WaveSolverBase::viewKeyStruct::sourceCoordinatesString() ) << + ": Invalid number of physical coordinates for the sources" ); GEOS_ERROR_IF( m_receiverCoordinates.size( 1 ) != 3, - "Invalid number of physical coordinates for the receivers" ); + getWrapperDataContext( WaveSolverBase::viewKeyStruct::receiverCoordinatesString() ) << + ": Invalid number of physical coordinates for the receivers" ); EventManager const & event = this->getGroupByPath< EventManager >( "/Problem/Events" ); real64 const & maxTime = event.getReference< real64 >( EventManager::viewKeyStruct::maxTimeString() ); @@ -248,7 +250,7 @@ void ElasticWaveEquationSEM::postProcessInput() } } - GEOS_THROW_IF( dt < epsilonLoc*maxTime, "Value for dt: " << dt <<" is smaller than local threshold: " << epsilonLoc, std::runtime_error ); + GEOS_THROW_IF( dt < epsilonLoc*maxTime, getDataContext() << ": Value for dt: " << dt <<" is smaller than local threshold: " << epsilonLoc, std::runtime_error ); if( m_dtSeismoTrace > 0 ) { @@ -330,7 +332,7 @@ void ElasticWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLevel & mesh, { GEOS_THROW_IF( elementSubRegion.getElementType() != ElementType::Hexahedron, - "Invalid type of element, the elastic solver is designed for hexahedral meshes only (C3D8) ", + getDataContext() << ": Invalid type of element, the elastic solver is designed for hexahedral meshes only (C3D8) ", InputError ); arrayView2d< localIndex const > const elemsToFaces = elementSubRegion.faceList(); @@ -487,7 +489,7 @@ void ElasticWaveEquationSEM::addSourceToRightHandSide( integer const & cycleNumb arrayView1d< localIndex const > const sourceIsAccessible = m_sourceIsAccessible.toViewConst(); arrayView2d< real32 const > const sourceValue = m_sourceValue.toViewConst(); - GEOS_THROW_IF( cycleNumber > sourceValue.size( 0 ), "Too many steps compared to array size", std::runtime_error ); + GEOS_THROW_IF( cycleNumber > sourceValue.size( 0 ), getDataContext() << ": Too many steps compared to array size", std::runtime_error ); forAll< EXEC_POLICY >( m_sourceConstantsx.size( 0 ), [=] GEOS_HOST_DEVICE ( localIndex const isrc ) { if( sourceIsAccessible[isrc] == 1 ) @@ -662,7 +664,7 @@ void ElasticWaveEquationSEM::applyFreeSurfaceBC( real64 const time, DomainPartit } else { - GEOS_ERROR( "This option is not supported yet" ); + GEOS_ERROR( getDataContext() << ": This option is not supported yet" ); } } ); } @@ -687,7 +689,7 @@ real64 ElasticWaveEquationSEM::explicitStepBackward( real64 const & time_n, DomainPartition & domain, bool GEOS_UNUSED_PARAM( computeGradient ) ) { - GEOS_ERROR( "Backward propagation for the elastic wave propagator not yet implemented" ); + GEOS_ERROR( getDataContext() << ": Backward propagation for the elastic wave propagator not yet implemented" ); real64 dtOut = explicitStepInternal( time_n, dt, cycleNumber, domain ); return dtOut; } @@ -884,12 +886,12 @@ void ElasticWaveEquationSEM::computeAllSeismoTraces( real64 const time_n, void ElasticWaveEquationSEM::initializePML() { - GEOS_ERROR( "PML for the elastic wave propagator not yet implemented" ); + GEOS_ERROR( getDataContext() << ": PML for the elastic wave propagator not yet implemented" ); } void ElasticWaveEquationSEM::applyPML( real64 const, DomainPartition & ) { - GEOS_ERROR( "PML for the elastic wave propagator not yet implemented" ); + GEOS_ERROR( getDataContext() << ": PML for the elastic wave propagator not yet implemented" ); } REGISTER_CATALOG_ENTRY( SolverBase, ElasticWaveEquationSEM, string const &, dataRepository::Group * const ) diff --git a/src/coreComponents/physicsSolvers/wavePropagation/WaveSolverBase.cpp b/src/coreComponents/physicsSolvers/wavePropagation/WaveSolverBase.cpp index 64b69f3c103..793d3f27bb4 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/WaveSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/WaveSolverBase.cpp @@ -230,7 +230,7 @@ void WaveSolverBase::postProcessInput() counter++; } ); GEOS_THROW_IF( counter > 1, - "One single PML field specification is allowed", + getDataContext() << ": One single PML field specification is allowed", InputError ); m_usePML = counter; @@ -245,10 +245,12 @@ void WaveSolverBase::postProcessInput() GEOS_LOG_LEVEL_RANK_0( 1, "Modeling linear DAS data is activated" ); 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" ); + getWrapperDataContext( viewKeyStruct::linearDASGeometryString() ) << + ": Invalid number of geometry parameters for the linear DAS fiber. Three parameters are required: dip, azimuth, gauge length" ); GEOS_ERROR_IF( m_linearDASGeometry.size( 0 ) != m_receiverCoordinates.size( 0 ), - "Invalid number of geometry parameters instances for the linear DAS fiber. It should match the number of receivers." ); + getWrapperDataContext( viewKeyStruct::linearDASGeometryString() ) << + ": Invalid number of geometry parameters instances for the linear DAS fiber. It should match the number of receivers." ); /// initialize DAS geometry initializeDAS(); @@ -256,11 +258,13 @@ void WaveSolverBase::postProcessInput() } GEOS_THROW_IF( m_sourceCoordinates.size( 1 ) != 3, - "Invalid number of physical coordinates for the sources", + getWrapperDataContext( viewKeyStruct::sourceCoordinatesString() ) << + ": Invalid number of physical coordinates for the sources", InputError ); GEOS_THROW_IF( m_receiverCoordinates.size( 1 ) != 3, - "Invalid number of physical coordinates for the receivers", + getWrapperDataContext( viewKeyStruct::receiverCoordinatesString() ) << + ": Invalid number of physical coordinates for the receivers", InputError ); EventManager const & event = this->getGroupByPath< EventManager >( "/Problem/Events" ); @@ -276,7 +280,7 @@ void WaveSolverBase::postProcessInput() } } - GEOS_THROW_IF( dt < epsilonLoc*maxTime, "Value for dt: " << dt <<" is smaller than local threshold: " << epsilonLoc, std::runtime_error ); + GEOS_THROW_IF( dt < epsilonLoc*maxTime, getDataContext() << ": Value for dt: " << dt <<" is smaller than local threshold: " << epsilonLoc, std::runtime_error ); if( m_dtSeismoTrace > 0 ) { @@ -358,7 +362,7 @@ localIndex WaveSolverBase::getNumNodesPerElem() FiniteElementDiscretization const * const feDiscretization = feDiscretizationManager.getGroupPointer< FiniteElementDiscretization >( m_discretizationName ); GEOS_THROW_IF( feDiscretization == nullptr, - getName() << ": FE discretization not found: " << m_discretizationName, + getDataContext() << ": FE discretization not found: " << m_discretizationName, InputError ); localIndex numNodesPerElem = 0;