diff --git a/scripts/ci_build_and_test_in_container.sh b/scripts/ci_build_and_test_in_container.sh index 2fea08d275f..a90f2ca7848 100755 --- a/scripts/ci_build_and_test_in_container.sh +++ b/scripts/ci_build_and_test_in_container.sh @@ -282,6 +282,7 @@ if [[ "${BUILD_EXE_ONLY}" = true ]]; then or_die cmake --build . -j $NPROC --target geosx else or_die cmake --build . -j $NPROC + # TODO: for the moment, installation is disabled to save some space on the runner, but must be re-enabled in the future. #or_die cmake --install . if [[ ! -z "${DATA_BASENAME_WE}" ]]; then diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp index 26a3260374a..e9bfbdc9d12 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp @@ -120,7 +120,7 @@ void HydraulicApertureTable::validateApertureTable( TableFunction const & apertu GEOS_THROW_IF( coords.size() == 0, getFullName() << ": Empty aperture table.", - InputError ); + InputError,getDataContext() ); GEOS_THROW_IF( coords.size() > 1, getFullName() << ": Aperture limiter table cannot be greater than a 1D table.", diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp index 3a252f50c07..d8f3b118886 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp @@ -83,33 +83,27 @@ void ParticleFluid::postInputInitialization() ParticleFluidBase::postInputInitialization(); GEOS_ERROR_IF( m_proppantDensity < 500.0, - "Invalid proppantDensity in ParticleFluid " - << getDataContext() << ", which must >= 500.0 ", + "Invalid proppantDensity in ParticleFluid which must >= 500.0 ", getDataContext() ); GEOS_ERROR_IF( m_proppantDiameter < 10e-6, - "Invalid proppantDiameter in ParticleFluid " - << getDataContext() << ", which must >= 10e-6 ", + "Invalid proppantDiameter in ParticleFluid, which must >= 10e-6 ", getDataContext() ); GEOS_ERROR_IF( m_hinderedSettlingCoefficient< 0.0 || m_hinderedSettlingCoefficient > 10.0, - "Invalid hinderedSettlingCoefficient in ParticleFluid " - << getDataContext() << ", which must between 0 and 10 ", + "Invalid hinderedSettlingCoefficient in ParticleFluid, which must between 0 and 10 ", getDataContext() ); GEOS_ERROR_IF( m_collisionAlpha < 1.0, - "Invalid collisionAlpha in ParticleFluid " - << getDataContext() << ", which must >= 1 ", + "Invalid collisionAlpha in ParticleFluid , which must >= 1 ", getDataContext() ); GEOS_ERROR_IF( m_collisionBeta < 0.0, - "Invalid collisionBeta in ParticleFluid " - << getDataContext() << ", which must >= 0", + "Invalid collisionBeta in ParticleFluid , which must >= 0", getDataContext() ); GEOS_ERROR_IF( m_slipConcentration > 0.3, - "Invalid slipConcentration in ParticleFluid " - << getDataContext() << ", which must <= 0.3", + "Invalid slipConcentration in ParticleFluid, which must <= 0.3", getDataContext() ); m_packPermeabilityCoef = pow( m_sphericity * m_proppantDiameter, 2.0 ) / 180.0; diff --git a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp index ecffd7ccab0..896420ff00f 100644 --- a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp +++ b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp @@ -65,7 +65,7 @@ void PressurePermeability::postInputInitialization() for( localIndex i=0; i < 3; i++ ) { GEOS_ERROR_IF( std::abs( m_pressureDependenceConstants[i] ) < 1e-15 && m_presModelType == PressureModelType::Hyperbolic, - getDataContext() << ": the pressure dependent constant at component " << i << " is too close to zero, which is not allowed for the hyperbolic model.", + "The pressure dependent constant at component " << i << " is too close to zero, which is not allowed for the hyperbolic model.", getDataContext() ); } } diff --git a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHelpers.cpp b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHelpers.cpp index 965c9278fc1..f49396befdd 100644 --- a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHelpers.cpp +++ b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHelpers.cpp @@ -37,17 +37,14 @@ TableRelativePermeabilityHelpers::validateRelativePermeabilityTable( TableFuncti ArrayOfArraysView< real64 const > coords = relPermTable.getCoordinates(); GEOS_THROW_IF_NE_MSG( relPermTable.getInterpolationMethod(), TableFunction::InterpolationType::Linear, - GEOS_FMT( "{}: TableFunction '{}' interpolation method must be linear", - fullConstitutiveName, relPermTable.getDataContext() ), - InputError ); + GEOS_FMT( "{}: TableFunction interpolation method must be linear", fullConstitutiveName ), + InputError, relPermTable.getDataContext() ); GEOS_THROW_IF_NE_MSG( relPermTable.numDimensions(), 1, - GEOS_FMT( "{}: TableFunction '{}' must have a single independent coordinate", - fullConstitutiveName, relPermTable.getDataContext() ), - InputError ); + GEOS_FMT( "{}: TableFunction must have a single independent coordinate", fullConstitutiveName ), + InputError, relPermTable.getDataContext() ); GEOS_THROW_IF_LT_MSG( coords.sizeOfArray( 0 ), 2, - GEOS_FMT( "{}: TableFunction `{}` must contain at least two values", - fullConstitutiveName, relPermTable.getDataContext() ), - InputError ); + GEOS_FMT( "{}: TableFunction must contain at least two values", fullConstitutiveName ), + InputError, relPermTable.getDataContext() ); arraySlice1d< real64 const > phaseVolFrac = coords[0]; arrayView1d< real64 const > const relPerm = relPermTable.getValues(); @@ -59,23 +56,21 @@ TableRelativePermeabilityHelpers::validateRelativePermeabilityTable( TableFuncti // note that the TableFunction class has already checked that coords.sizeOfArray( 0 ) == relPerm.size() GEOS_THROW_IF( !isZero( relPerm[0] ), - GEOS_FMT( "{}: TableFunction '{}' first value must be equal to 0", - fullConstitutiveName, relPermTable.getDataContext() ), + GEOS_FMT( "{}: TableFunction first value must be equal to 0", fullConstitutiveName ), InputError, relPermTable.getDataContext() ); for( localIndex i = 1; i < coords.sizeOfArray( 0 ); ++i ) { // check phase volume fraction GEOS_THROW_IF( phaseVolFrac[i] < 0 || phaseVolFrac[i] > 1, - GEOS_FMT( "{}: TableFunction '{}' values must be between 0 and 1", - fullConstitutiveName, relPermTable.getDataContext() ), + GEOS_FMT( "{}: TableFunction values must be between 0 and 1", fullConstitutiveName ), InputError, relPermTable.getDataContext() ); // note that the TableFunction class has already checked that the coordinates are monotone // check phase relative permeability GEOS_THROW_IF( !isZero( relPerm[i] ) && (relPerm[i] - relPerm[i-1]) < 1e-15, - GEOS_FMT( "{}: TableFunction '{}' values must be strictly increasing (|Delta kr| > 1e-15 between two non-zero values)", - fullConstitutiveName, relPermTable.getDataContext() ), + GEOS_FMT( "{}: TableFunction values must be strictly increasing (|Delta kr| > 1e-15 between two non-zero values)", + fullConstitutiveName ), InputError, relPermTable.getDataContext() ); if( isZero( relPerm[i-1] ) && !isZero( relPerm[i] ) ) diff --git a/src/coreComponents/constitutive/solid/Damage.cpp b/src/coreComponents/constitutive/solid/Damage.cpp index 5272581c2ea..1b9e0c1e5da 100644 --- a/src/coreComponents/constitutive/solid/Damage.cpp +++ b/src/coreComponents/constitutive/solid/Damage.cpp @@ -100,20 +100,20 @@ void Damage< BASE >::postInputInitialization() BASE::postInputInitialization(); GEOS_ERROR_IF( m_extDrivingForceFlag != 0 && m_extDrivingForceFlag!= 1, - this->getDataContext() << ": invalid external driving force flag option - must" - " be 0 or 1", + "invalid external driving force flag option - must" + " be 0 or 1", this->getDataContext() ); GEOS_ERROR_IF( m_extDrivingForceFlag == 1 && m_defaultTensileStrength <= 0.0, - this->getDataContext() << ": tensile strength must be input and positive when the" - " external driving force flag is turned on", + "tensile strength must be input and positive when the" + " external driving force flag is turned on", this->getDataContext() ); GEOS_ERROR_IF( m_extDrivingForceFlag == 1 && m_defaultCompressiveStrength <= 0.0, - this->getDataContext() << ": compressive strength must be input and positive when the" - " external driving force flag is turned on", + "compressive strength must be input and positive when the" + " external driving force flag is turned on", this->getDataContext() ); GEOS_ERROR_IF( m_extDrivingForceFlag == 1 && m_defaultDeltaCoefficient < 0.0, - this->getDataContext() << ": delta coefficient must be input and non-negative when the" - " external driving force flag is turned on", + "delta coefficient must be input and non-negative when the" + " external driving force flag is turned on", this->getDataContext() ); // set results as array default values diff --git a/src/coreComponents/constitutiveDrivers/fluid/multiFluid/PVTDriver.cpp b/src/coreComponents/constitutiveDrivers/fluid/multiFluid/PVTDriver.cpp index db232e5c37d..9fe247ac176 100644 --- a/src/coreComponents/constitutiveDrivers/fluid/multiFluid/PVTDriver.cpp +++ b/src/coreComponents/constitutiveDrivers/fluid/multiFluid/PVTDriver.cpp @@ -103,18 +103,18 @@ void PVTDriver::postInputInitialization() { // Validate some inputs GEOS_ERROR_IF( m_outputMassDensity != 0 && m_outputMassDensity != 1, - getWrapperDataContext( viewKeyStruct::outputMassDensityString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::outputMassDensityString() << + "option can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::outputMassDensityString() ) ); GEOS_ERROR_IF( m_outputCompressibility != 0 && m_outputCompressibility != 1, - getWrapperDataContext( viewKeyStruct::outputCompressibilityString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::outputCompressibilityString() << + "option can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::outputCompressibilityString() ) ); GEOS_ERROR_IF( m_outputPhaseComposition != 0 && m_outputPhaseComposition != 1, - getWrapperDataContext( viewKeyStruct::outputPhaseCompositionString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::outputPhaseCompositionString() << + "option can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::outputPhaseCompositionString() ) ); GEOS_WARNING_IF( m_precision < minPrecision, diff --git a/src/coreComponents/constitutiveDrivers/solid/TriaxialDriver.cpp b/src/coreComponents/constitutiveDrivers/solid/TriaxialDriver.cpp index 73bea40106f..2dacce273a2 100644 --- a/src/coreComponents/constitutiveDrivers/solid/TriaxialDriver.cpp +++ b/src/coreComponents/constitutiveDrivers/solid/TriaxialDriver.cpp @@ -151,11 +151,11 @@ void TriaxialDriver::postInputInitialization() // may overwrite it. GEOS_THROW_IF( !isEqual( m_initialStress, m_table( 0, SIG0 ), 1e-6 ), - getDataContext() << ": Initial stress values indicated by initialStress and axialFunction(time=0) appear inconsistent", + "Initial stress values indicated by initialStress and axialFunction(time=0) appear inconsistent", InputError, getDataContext() ); GEOS_THROW_IF( !isEqual( m_initialStress, m_table( 0, SIG1 ), 1e-6 ), - getDataContext() << ": Initial stress values indicated by initialStress and radialFunction(time=0) appear inconsistent", + "Initial stress values indicated by initialStress and radialFunction(time=0) appear inconsistent", InputError, getDataContext() ); } diff --git a/src/coreComponents/dataRepository/Group.cpp b/src/coreComponents/dataRepository/Group.cpp index 409fff42c61..db514bd4dad 100644 --- a/src/coreComponents/dataRepository/Group.cpp +++ b/src/coreComponents/dataRepository/Group.cpp @@ -77,7 +77,7 @@ WrapperBase & Group::registerWrapper( std::unique_ptr< WrapperBase > wrapper ) void Group::deregisterWrapper( string const & name ) { GEOS_ERROR_IF( !hasWrapper( name ), - "Wrapper " << name << " doesn't exist in Group" << getDataContext() << '.', + "Wrapper " << name << " doesn't exist in Group.", getDataContext() ); m_wrappers.erase( name ); m_conduitNode.remove( name ); @@ -250,8 +250,7 @@ void Group::processInputFile( xmlWrapper::xmlNode const & targetNode, GEOS_FMT( "Error in {}: XML Node at '{}' contains unused attribute '{}'.\n" "Valid attributes are:\n{}\nFor more details, please refer to documentation at:\n" "http://geosx-geosx.readthedocs-hosted.com/en/latest/docs/sphinx/userGuide/Index.html", - getDataContext(), targetNode.path(), attributeName, - dumpInputOptions() ), + targetNode.path(), attributeName, dumpInputOptions() ), InputError, getDataContext() ); } } diff --git a/src/coreComponents/events/PeriodicEvent.cpp b/src/coreComponents/events/PeriodicEvent.cpp index 4a5a1c64db5..86d6c85bb81 100644 --- a/src/coreComponents/events/PeriodicEvent.cpp +++ b/src/coreComponents/events/PeriodicEvent.cpp @@ -270,18 +270,16 @@ void PeriodicEvent::validate() const constexpr auto determinesTimeStepSize = ExecutableGroup::TimesteppingBehavior::DeterminesTimeStepSize; GEOS_THROW_IF( m_timeFrequency > 0 && target->getTimesteppingBehavior() == determinesTimeStepSize, - GEOS_FMT( "`{}`: This event targets an object that automatically selects the time " + GEOS_FMT( "This event targets an object that automatically selects the time " "step size. Therefore, `{}` cannot be used here. However, forcing a " "constant time step size can still be achived with `{}`.", - getDataContext(), viewKeyStruct::timeFrequencyString(), - EventBase::viewKeyStruct::forceDtString() ), + viewKeyStruct::timeFrequencyString(), EventBase::viewKeyStruct::forceDtString() ), InputError, getDataContext() ); GEOS_THROW_IF( m_cycleFrequency != 1 && target->getTimesteppingBehavior() == determinesTimeStepSize, - GEOS_FMT( "`{}`: This event targets an object that automatically selects the time " + GEOS_FMT( "This event targets an object that automatically selects the time " "step size. Therefore, `{}` cannot be used here. However, forcing a " "constant time step size can still be achived with `{}`.", - getDataContext(), viewKeyStruct::cycleFrequencyString(), - EventBase::viewKeyStruct::forceDtString() ), + viewKeyStruct::cycleFrequencyString(), EventBase::viewKeyStruct::forceDtString() ), InputError, getDataContext() ); } diff --git a/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.cpp b/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.cpp index 667e2ecc682..1ca5de28c5c 100644 --- a/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.cpp +++ b/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.cpp @@ -115,9 +115,8 @@ AquiferBoundaryCondition::AquiferBoundaryCondition( string const & name, Group * void AquiferBoundaryCondition::postInputInitialization() { GEOS_THROW_IF_LE_MSG( m_permeability, 0.0, - getCatalogName() << " " << getDataContext() << - ": the aquifer permeability cannot be equal to zero or negative", - InputError ); + getCatalogName() << ": the aquifer permeability cannot be equal to zero or negative", + InputError, getDataContext() ); if( m_pressureInfluenceFunctionName.empty() ) { @@ -127,37 +126,34 @@ void AquiferBoundaryCondition::postInputInitialization() { FunctionManager const & functionManager = FunctionManager::getInstance(); GEOS_THROW_IF( !functionManager.hasGroup( m_pressureInfluenceFunctionName ), - getCatalogName() << " " << getDataContext() << - ": the pressure influence table " << m_pressureInfluenceFunctionName << " could not be found", + getCatalogName() << " : the pressure influence table " << m_pressureInfluenceFunctionName << " could not be found", InputError, getDataContext() ); TableFunction const & pressureInfluenceFunction = functionManager.getGroup< TableFunction >( m_pressureInfluenceFunctionName ); GEOS_THROW_IF( pressureInfluenceFunction.getInterpolationMethod() != TableFunction::InterpolationType::Linear, - getCatalogName() << " " << getDataContext() << - ": The interpolation method for the pressure influence function table " << - pressureInfluenceFunction.getDataContext() << + getCatalogName() << " : The interpolation method for the pressure influence function table " << " should be TableFunction::InterpolationType::Linear", - InputError, getDataContext() ); + InputError, pressureInfluenceFunction.getDataContext(), getDataContext() ); } computeTimeConstant(); computeInfluxConstant(); GEOS_THROW_IF_LE_MSG( m_timeConstant, 0.0, - getCatalogName() << " " << getDataContext() << - ": the aquifer time constant is equal to zero or negative, the simulation cannot procede", - InputError ); + getCatalogName() << + " : the aquifer time constant is equal to zero or negative, the simulation cannot procede", + InputError, getDataContext() ); GEOS_THROW_IF_LE_MSG( m_influxConstant, 0.0, - getCatalogName() << " " << getDataContext() << - ": the aquifer influx constant is equal to zero or negative, the simulation cannot procede", - InputError ); + getCatalogName() << + " : the aquifer influx constant is equal to zero or negative, the simulation cannot procede", + InputError, getDataContext() ); GEOS_THROW_IF_NE_MSG( m_phaseComponentFraction.size(), LvArray::integerConversion< int >( m_phaseComponentNames.size() ), - getCatalogName() << " " << getDataContext() << - ": the sizes of " << viewKeyStruct::aquiferWaterPhaseComponentFractionString() << + getCatalogName() << + " : the sizes of " << viewKeyStruct::aquiferWaterPhaseComponentFractionString() << " and " << viewKeyStruct::aquiferWaterPhaseComponentNamesString() << " are inconsistent", - InputError ); + InputError, getDataContext() ); } diff --git a/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.cpp b/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.cpp index 8316c3beacd..fb826edb809 100644 --- a/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.cpp +++ b/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.cpp @@ -98,16 +98,16 @@ void EquilibriumInitialCondition::postInputInitialization() if( !m_componentFractionVsElevationTableNames.empty() ) { GEOS_THROW_IF( m_componentFractionVsElevationTableNames.size() <= 1, - getCatalogName() << " " << getDataContext() << - ": at least two component names must be specified in " << viewKeyStruct::componentNamesString(), + getCatalogName() << + " : at least two component names must be specified in " << viewKeyStruct::componentNamesString(), InputError, getDataContext() ); GEOS_THROW_IF( m_componentFractionVsElevationTableNames.size() != m_componentNames.size(), - getCatalogName() << " " << getDataContext() << ": mismatch between the size of " << + getCatalogName() << " : mismatch between the size of " << viewKeyStruct::componentNamesString() << " and " << viewKeyStruct::componentFractionVsElevationTableNamesString(), InputError, getDataContext() ); GEOS_THROW_IF( m_componentNames.size() >= 2 && m_initPhaseName.empty(), - getCatalogName() << " " << getDataContext() << ": for now, the keyword: " << + getCatalogName() << " : for now, the keyword: " << viewKeyStruct::initPhaseNameString() << " must be filled for a multiphase simulation", InputError, getDataContext() ); @@ -115,20 +115,20 @@ void EquilibriumInitialCondition::postInputInitialization() for( size_t ic = 0; ic < m_componentNames.size(); ++ic ) { GEOS_THROW_IF( m_componentFractionVsElevationTableNames[ic].empty(), - getCatalogName() << " " << getDataContext() << - ": the component fraction vs elevation table name is missing for component " << ic, + getCatalogName() << + " : the component fraction vs elevation table name is missing for component " << ic, InputError, getDataContext() ); GEOS_THROW_IF( !m_componentFractionVsElevationTableNames[ic].empty() && !functionManager.hasGroup( m_componentFractionVsElevationTableNames[ic] ), - getCatalogName() << " " << getDataContext() << ": the component fraction vs elevation table " << + getCatalogName() << " : the component fraction vs elevation table " << m_componentFractionVsElevationTableNames[ic] << " could not be found" << " for component " << ic, InputError, getDataContext() ); TableFunction const & compFracTable = functionManager.getGroup< TableFunction >( m_componentFractionVsElevationTableNames[ic] ); GEOS_THROW_IF( compFracTable.getInterpolationMethod() != TableFunction::InterpolationType::Linear, - getCatalogName() << " " << getDataContext() << - ": the interpolation method for the component fraction vs elevation table " << + getCatalogName() << + " : the interpolation method for the component fraction vs elevation table " << compFracTable.getName() << " should be TableFunction::InterpolationType::Linear", InputError, getDataContext() ); @@ -139,14 +139,14 @@ void EquilibriumInitialCondition::postInputInitialization() { GEOS_THROW_IF( !functionManager.hasGroup( m_temperatureVsElevationTableName ), - getCatalogName() << " " << getDataContext() << ": the temperature vs elevation table " << + getCatalogName() << " : the temperature vs elevation table " << m_temperatureVsElevationTableName << " could not be found", InputError, getDataContext() ); TableFunction const & tempTable = functionManager.getGroup< TableFunction >( m_temperatureVsElevationTableName ); GEOS_THROW_IF( tempTable.getInterpolationMethod() != TableFunction::InterpolationType::Linear, - getCatalogName() << " " << getDataContext() << - ": The interpolation method for the temperature vs elevation table " << tempTable.getName() << + getCatalogName() << + " : The interpolation method for the temperature vs elevation table " << tempTable.getName() << " should be TableFunction::InterpolationType::Linear", InputError, getDataContext() ); } @@ -166,8 +166,8 @@ void EquilibriumInitialCondition::initializePreSubGroups() TableFunction const & compFracTable = functionManager.getGroup< TableFunction >( m_componentFractionVsElevationTableNames[ic] ); arrayView1d< real64 const > compFracValues = compFracTable.getValues(); GEOS_THROW_IF( compFracValues.size() <= 1, - getCatalogName() << " " << getDataContext() << - ": the component fraction vs elevation table " << compFracTable.getName() << + getCatalogName() << + " : the component fraction vs elevation table " << compFracTable.getName() << " must contain at least two values", InputError, getDataContext() ); @@ -175,8 +175,8 @@ void EquilibriumInitialCondition::initializePreSubGroups() if( ic >= 1 ) { GEOS_THROW_IF( tableSizes[ic] != tableSizes[ic-1], - getCatalogName() << " " << getDataContext() << - ": all the component fraction vs elevation tables must contain the same number of values", + getCatalogName() << + " : all the component fraction vs elevation tables must contain the same number of values", InputError, getDataContext() ); } } @@ -197,16 +197,16 @@ void EquilibriumInitialCondition::initializePreSubGroups() if( ic >= 1 ) { GEOS_THROW_IF( !isZero( elevation[ic][i] - elevation[ic-1][i] ), - getCatalogName() << " " << getDataContext() << - ": the elevation values must be the same in all the component vs elevation tables", + getCatalogName() << + " : the elevation values must be the same in all the component vs elevation tables", InputError, getDataContext() ); } if( ic == m_componentNames.size() - 1 ) { GEOS_THROW_IF( !isZero( sumCompFrac[i] - 1 ), - getCatalogName() << " " << getDataContext() << - ": at a given elevation, the component fraction sum must be equal to one", + getCatalogName() << + " : at a given elevation, the component fraction sum must be equal to one", InputError, getDataContext() ); } } diff --git a/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.cpp b/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.cpp index 11f1b683b04..977fead5657 100644 --- a/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.cpp +++ b/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.cpp @@ -79,14 +79,14 @@ PerfectlyMatchedLayer::PerfectlyMatchedLayer( string const & name, Group * const void PerfectlyMatchedLayer::postInputInitialization() { GEOS_THROW_IF( (m_xMax[0]1), - getCatalogName() << " " << getDataContext() << " " + getCatalogName() << " " << viewKeyStruct::reflectivityString() << " must satisfy 0 < reflectivity <= 1", InputError, getDataContext() ); diff --git a/src/coreComponents/fieldSpecification/TractionBoundaryCondition.cpp b/src/coreComponents/fieldSpecification/TractionBoundaryCondition.cpp index a355dcdae42..b62d84a5de7 100644 --- a/src/coreComponents/fieldSpecification/TractionBoundaryCondition.cpp +++ b/src/coreComponents/fieldSpecification/TractionBoundaryCondition.cpp @@ -78,15 +78,17 @@ void TractionBoundaryCondition::postInputInitialization() if( m_tractionType == TractionType::vector ) { GEOS_ERROR_IF( LvArray::tensorOps::l2Norm< 3 >( getDirection() ) < 1e-20, - getDataContext() << ": " << viewKeyStruct::directionString() << " is required for " << + viewKeyStruct::directionString() << " is required for " << viewKeyStruct::tractionTypeString() << " = " << TractionType::vector << ", but appears to be unspecified", getDataContext() ); + ", but appears to be unspecified", + getDataContext() ); } else { GEOS_LOG_RANK_0_IF( LvArray::tensorOps::l2Norm< 3 >( getDirection() ) > 1e-20, - getDataContext() << ": " << viewKeyStruct::directionString() << " is not required unless " << + viewKeyStruct::directionString() << " is not required unless " << viewKeyStruct::tractionTypeString() << " = " << TractionType::vector << ", but appears to be specified" ); } @@ -94,12 +96,12 @@ void TractionBoundaryCondition::postInputInitialization() bool const inputStressRead = getWrapper< R2SymTensor >( viewKeyStruct::inputStressString() ).getSuccessfulReadFromInput(); GEOS_LOG_RANK_0_IF( inputStressRead && m_tractionType != TractionType::stress, - getDataContext() << ": " << viewKeyStruct::inputStressString() << " is specified, but " << + viewKeyStruct::inputStressString() << " is specified, but " << viewKeyStruct::tractionTypeString() << " != " << TractionType::stress << ", so value of " << viewKeyStruct::inputStressString() << " is unused." ); GEOS_ERROR_IF( !inputStressRead && m_tractionType == TractionType::stress, - getDataContext() << ": " << viewKeyStruct::tractionTypeString() << " = " << TractionType::stress << + viewKeyStruct::tractionTypeString() << " = " << TractionType::stress << ", but " << viewKeyStruct::inputStressString() << " is not specified.", getDataContext() ); diff --git a/src/coreComponents/fileIO/Outputs/MemoryStatsOutput.cpp b/src/coreComponents/fileIO/Outputs/MemoryStatsOutput.cpp index 340a6865fb7..3bfa3d397cd 100644 --- a/src/coreComponents/fileIO/Outputs/MemoryStatsOutput.cpp +++ b/src/coreComponents/fileIO/Outputs/MemoryStatsOutput.cpp @@ -49,8 +49,8 @@ void MemoryStatsOutput::postInputInitialization() { static bool isInstanceInitialized = false; GEOS_ERROR_IF( isInstanceInitialized, - GEOS_FMT( "{}: Multiple instances of {} are not supported, please remove this one.", - getDataContext(), catalogName() ) ); + GEOS_FMT( "Multiple instances of {} are not supported, please remove this one.", + catalogName() ), getDataContext() ); isInstanceInitialized = true; auto & memLogging = MemoryLogging::getInstance(); diff --git a/src/coreComponents/fileIO/Outputs/SiloOutput.cpp b/src/coreComponents/fileIO/Outputs/SiloOutput.cpp index 7d93495048f..03b8f931a82 100644 --- a/src/coreComponents/fileIO/Outputs/SiloOutput.cpp +++ b/src/coreComponents/fileIO/Outputs/SiloOutput.cpp @@ -97,9 +97,8 @@ void SiloOutput::postInputInitialization() string const onlyPlotSpecifiedFieldNamesString = viewKeysStruct::onlyPlotSpecifiedFieldNames; GEOS_THROW_IF( ( m_onlyPlotSpecifiedFieldNames != 0 ) && m_fieldNames.empty(), - GEOS_FMT( "{} `{}`: the flag `{}` is different from zero, but `{}` is empty, which is inconsistent", - catalogName(), getDataContext(), - onlyPlotSpecifiedFieldNamesString, fieldNamesString ), + GEOS_FMT( "{} : the flag `{}` is different from zero, but `{}` is empty, which is inconsistent", + catalogName(), onlyPlotSpecifiedFieldNamesString, fieldNamesString ), InputError, getDataContext() ); GEOS_LOG_RANK_0_IF( !m_fieldNames.empty() && ( m_onlyPlotSpecifiedFieldNames != 0 ), diff --git a/src/coreComponents/fileIO/Outputs/VTKOutput.cpp b/src/coreComponents/fileIO/Outputs/VTKOutput.cpp index 5f617298ad5..3b279b443df 100644 --- a/src/coreComponents/fileIO/Outputs/VTKOutput.cpp +++ b/src/coreComponents/fileIO/Outputs/VTKOutput.cpp @@ -120,9 +120,8 @@ void VTKOutput::postInputInitialization() string const onlyPlotSpecifiedFieldNamesString = viewKeysStruct::onlyPlotSpecifiedFieldNames; GEOS_THROW_IF( ( m_onlyPlotSpecifiedFieldNames != 0 ) && m_fieldNames.empty(), - GEOS_FMT( "{} `{}`: the flag `{}` is different from zero, but `{}` is empty, which is inconsistent", - catalogName(), getDataContext(), - onlyPlotSpecifiedFieldNamesString, fieldNamesString ), + GEOS_FMT( "{} : the flag `{}` is different from zero, but `{}` is empty, which is inconsistent", + catalogName(), onlyPlotSpecifiedFieldNamesString, fieldNamesString ), InputError, getDataContext() ); GEOS_LOG_RANK_0_IF( !m_fieldNames.empty() && ( m_onlyPlotSpecifiedFieldNames != 0 ), @@ -138,8 +137,7 @@ void VTKOutput::postInputInitialization() std::to_string( m_fieldNames.size() ), fieldNamesString, m_plotLevel ) ); GEOS_ERROR_IF( m_writeFaceElementsAs3D, - GEOS_FMT( "{} `{}`: 3D vtk plot of faceElements is not yet supported.", - catalogName(), getDataContext() ), + GEOS_FMT( "{} : 3D vtk plot of faceElements is not yet supported.", catalogName() ), getDataContext() ); } diff --git a/src/coreComponents/finiteElement/FiniteElementDiscretization.cpp b/src/coreComponents/finiteElement/FiniteElementDiscretization.cpp index be6a5716b43..b4cbabd85b1 100644 --- a/src/coreComponents/finiteElement/FiniteElementDiscretization.cpp +++ b/src/coreComponents/finiteElement/FiniteElementDiscretization.cpp @@ -63,7 +63,7 @@ FiniteElementDiscretization::~FiniteElementDiscretization() void FiniteElementDiscretization::postInputInitialization() { GEOS_ERROR_IF( m_useVem < 0 || m_useVem > 1, - getDataContext() << ": The flag useVirtualElements can be either 0 or 1", + "The flag useVirtualElements can be either 0 or 1", getDataContext() ); } @@ -193,7 +193,8 @@ FiniteElementDiscretization::factory( ElementType const parentElementShape ) con #endif default: { - GEOS_ERROR( getDataContext() << ": Element type " << parentElementShape << " does not have an associated element formulation." ); + GEOS_ERROR( "Element type " << parentElementShape << " does not have an associated element formulation.", + getDataContext() ); } } return {}; @@ -206,7 +207,7 @@ FiniteElementDiscretization::factory( ElementType const parentElementShape ) con #if !defined( GEOS_USE_HIP ) case ElementType::Hexahedron: GEOS_ERROR_IF( m_formulation != Formulation::SEM, - getDataContext() << ": Element type Hexahedron with order 2 available" << + "Element type Hexahedron with order 2 available" << " only when using the Spectral Element Method", getDataContext() ); return std::make_unique< Q2_Hexahedron_Lagrange_GaussLobatto >(); @@ -215,13 +216,15 @@ FiniteElementDiscretization::factory( ElementType const parentElementShape ) con #endif case ElementType::Tetrahedron: GEOS_ERROR_IF( m_formulation != Formulation::DG, - getDataContext() << ": Element type Tetrahedron with order 2 available" << - " only when using the Discontinuous Galerkin Method" ); + "Element type Tetrahedron with order 2 available" << + " only when using the Discontinuous Galerkin Method", + getDataContext() ); return std::make_unique< BB2_Tetrahedron >(); default: { - GEOS_ERROR( getDataContext() << ": Element type " << parentElementShape << " does not" << - " have an associated element formulation." ); + GEOS_ERROR( "Element type " << parentElementShape << " does not" << + " have an associated element formulation.", + getDataContext() ); } } return {}; @@ -234,7 +237,7 @@ FiniteElementDiscretization::factory( ElementType const parentElementShape ) con #if !defined( GEOS_USE_HIP ) case ElementType::Hexahedron: GEOS_ERROR_IF( m_formulation != Formulation::SEM, - getDataContext() << ": Element type Hexahedron with order 3 available" << + "Element type Hexahedron with order 3 available" << " only when using the Spectral Element Method", getDataContext() ); return std::make_unique< Q3_Hexahedron_Lagrange_GaussLobatto >(); @@ -243,13 +246,15 @@ FiniteElementDiscretization::factory( ElementType const parentElementShape ) con #endif case ElementType::Tetrahedron: GEOS_ERROR_IF( m_formulation != Formulation::DG, - getDataContext() << ": Element type Tetrahedron with order 3 available" << - " only when using the Discontinuous Galerkin Method" ); + "Element type Tetrahedron with order 3 available" << + " only when using the Discontinuous Galerkin Method", + getDataContext() ); return std::make_unique< BB3_Tetrahedron >(); default: { - GEOS_ERROR( getDataContext() << ": Element type " << parentElementShape << " does not" << - " have an associated element formulation." ); + GEOS_ERROR( "Element type " << parentElementShape << " does not" << + " have an associated element formulation.", + getDataContext() ); } } return {}; @@ -262,7 +267,7 @@ FiniteElementDiscretization::factory( ElementType const parentElementShape ) con #if !defined( GEOS_USE_HIP ) case ElementType::Hexahedron: GEOS_ERROR_IF( m_formulation != Formulation::SEM, - getDataContext() << ": Element type Hexahedron with order 4 available only" << + "Element type Hexahedron with order 4 available only" << " when using the Spectral Element Method", getDataContext() ); return std::make_unique< Q4_Hexahedron_Lagrange_GaussLobatto >(); @@ -271,13 +276,15 @@ FiniteElementDiscretization::factory( ElementType const parentElementShape ) con #endif //case ElementType::Tetrahedron: // GEOS_ERROR_IF( m_formulation != Formulation::DG, - // getDataContext() << ": Element type Tetrahedron with order 4 available" << - // " only when using the Discontinuous Galerkin Method" ); + // << "Element type Tetrahedron with order 4 available" << + // " only when using the Discontinuous Galerkin Method", + // getDataContext() ); // //return std::make_unique< BB4_Tetrahedron >(); default: { - GEOS_ERROR( getDataContext() << ": Element type " << parentElementShape << " does not have" << - " an associated element formulation." ); + GEOS_ERROR( "Element type " << parentElementShape << " does not have" << + " an associated element formulation.", + getDataContext() ); } } return {}; @@ -290,7 +297,7 @@ FiniteElementDiscretization::factory( ElementType const parentElementShape ) con #if !defined( GEOS_USE_HIP ) case ElementType::Hexahedron: GEOS_ERROR_IF( m_formulation != Formulation::SEM, - getDataContext() << ": Element type Hexahedron with order 5 available only" << + "Element type Hexahedron with order 5 available only" << " when using the Spectral Element Method", getDataContext() ); return std::make_unique< Q5_Hexahedron_Lagrange_GaussLobatto >(); @@ -299,19 +306,21 @@ FiniteElementDiscretization::factory( ElementType const parentElementShape ) con #endif //case ElementType::Tetrahedron: // GEOS_ERROR_IF( m_formulation != Formulation::DG, - // getDataContext() << ": Element type Tetrahedron with order 5 available" << + // getDataContext() << "Element type Tetrahedron with order 5 available" << // " only when using the Discontinuous Galerkin Method" ); // //return std::make_unique< BB5_Tetrahedron >(); default: { - GEOS_ERROR( getDataContext() << ": Element type " << parentElementShape << " does not have" << - " an associated element formulation." ); + GEOS_ERROR( "Element type " << parentElementShape << " does not have" << + " an associated element formulation.", + getDataContext() ); } } return {}; } - GEOS_ERROR( getDataContext() << ": Element type " << parentElementShape << " does not have an" << - " associated element formulation." ); + GEOS_ERROR( "Element type " << parentElementShape << " does not have an" << + " associated element formulation.", + getDataContext() ); return {}; } diff --git a/src/coreComponents/finiteVolume/HybridMimeticDiscretization.cpp b/src/coreComponents/finiteVolume/HybridMimeticDiscretization.cpp index f9740cbb547..9c6a3acc37f 100644 --- a/src/coreComponents/finiteVolume/HybridMimeticDiscretization.cpp +++ b/src/coreComponents/finiteVolume/HybridMimeticDiscretization.cpp @@ -90,7 +90,7 @@ HybridMimeticDiscretization::factory( string const & mimeticInnerProductType ) c } else { - GEOS_ERROR( getDataContext() << ": Key value of "<< mimeticInnerProductType <<" does not have an associated mimetic inner product." ); + GEOS_ERROR( "Key value of "<< mimeticInnerProductType <<" does not have an associated mimetic inner product.", getDataContext() ); } return rval; } diff --git a/src/coreComponents/functions/MultivariableTableFunction.cpp b/src/coreComponents/functions/MultivariableTableFunction.cpp index cd7eca72b66..a8b0e6fe4ce 100644 --- a/src/coreComponents/functions/MultivariableTableFunction.cpp +++ b/src/coreComponents/functions/MultivariableTableFunction.cpp @@ -35,7 +35,7 @@ MultivariableTableFunction::MultivariableTableFunction( const string & name, void MultivariableTableFunction::initializeFunctionFromFile( string const & filename ) { std::ifstream file( filename.c_str() ); - GEOS_THROW_IF( !file, catalogName() << " " << getDataContext() << ": could not read input file " << filename, + GEOS_THROW_IF( !file, catalogName() << " : could not read input file " << filename, InputError, getDataContext() ); integer numDims, numOps; @@ -47,17 +47,21 @@ void MultivariableTableFunction::initializeFunctionFromFile( string const & file file >> numDims; - GEOS_THROW_IF( !file, "Can`t read number of table dimensions", InputError ); + GEOS_THROW_IF( !file, "Can`t read number of table dimensions", InputError, getDataContext() ); file >> numOps; - GEOS_THROW_IF( !file, "Can`t read number of interpolatored operators", InputError ); + GEOS_THROW_IF( !file, "Can`t read number of interpolatored operators", InputError, getDataContext() ); // assume no more than 10 dimensions - GEOS_THROW_IF_LT_MSG( numDims, 1, catalogName() << " " << getDataContext() << ": positive integer value expected", InputError ); - GEOS_THROW_IF_GT_MSG( numDims, 10, catalogName() << " " << getDataContext() << ": maximum 10 dimensions expected", InputError ); + GEOS_THROW_IF_LT_MSG( numDims, 1, catalogName() << " : positive integer value expected", + InputError, getDataContext() ); + GEOS_THROW_IF_GT_MSG( numDims, 10, catalogName() << " : maximum 10 dimensions expected", + InputError, getDataContext() ); // assume no more than 100 operators - GEOS_THROW_IF_LT_MSG( numOps, 1, catalogName() << " " << getDataContext() << ": positive integer value expected", InputError ); - GEOS_THROW_IF_GT_MSG( numOps, 100, catalogName() << " " << getDataContext() << ": maximum 100 operators expected", InputError ); + GEOS_THROW_IF_LT_MSG( numOps, 1, catalogName() << " : positive integer value expected", + InputError, getDataContext() ); + GEOS_THROW_IF_GT_MSG( numOps, 100, catalogName() << " : maximum 100 operators expected", + InputError, getDataContext() ); axisMinimums.resize( numDims ); axisMaximums.resize( numDims ); @@ -68,16 +72,18 @@ void MultivariableTableFunction::initializeFunctionFromFile( string const & file for( integer i = 0; i < numDims; i++ ) { file >> axisPoints[i]; - GEOS_THROW_IF( !file, catalogName() << " " << getDataContext() << ": can`t read the number of points for axis " + std::to_string( i ), + GEOS_THROW_IF( !file, catalogName() << " : can`t read the number of points for axis " + std::to_string( i ), InputError, getDataContext() ); - GEOS_THROW_IF_LE_MSG( axisPoints[i], 1, catalogName() << " " << getDataContext() << ": minimum 2 discretization point per axis are expected", InputError ); + GEOS_THROW_IF_LE_MSG( axisPoints[i], 1, catalogName() << " : minimum 2 discretization point per axis are expected", + InputError, getDataContext() ); file >> axisMinimums[i]; - GEOS_THROW_IF( !file, catalogName() << " " << getDataContext() << ": can`t read minimum value for axis " + std::to_string( i ), + GEOS_THROW_IF( !file, catalogName() << " : can`t read minimum value for axis " + std::to_string( i ), InputError, getDataContext() ); file >> axisMaximums[i]; - GEOS_THROW_IF( !file, catalogName() << " " << getDataContext() << ": can`t read maximum value for axis " + std::to_string( i ), + GEOS_THROW_IF( !file, catalogName() << " : can`t read maximum value for axis " + std::to_string( i ), InputError, getDataContext() ); - GEOS_THROW_IF_LT_MSG( axisMaximums[i], axisMinimums[i], catalogName() << " " << getDataContext() << ": maximum axis value is expected to be larger than minimum", InputError ); + GEOS_THROW_IF_LT_MSG( axisMaximums[i], axisMinimums[i], catalogName() << " : maximum axis value is expected to be larger than minimum", + InputError, getDataContext() ); numPointsTotal *= axisPoints[i]; } @@ -86,10 +92,11 @@ void MultivariableTableFunction::initializeFunctionFromFile( string const & file real64 pointStorageMemoryLimitGB = 1; GEOS_THROW_IF_GT_MSG( numPointsTotal * numOps, pointStorageMemoryLimitGB * 1024 * 1024 * 1024 / 8, - catalogName() << " " << getDataContext() << - ": point storage size exceeds " + std::to_string( pointStorageMemoryLimitGB ) + + catalogName() << + " : point storage size exceeds " + std::to_string( pointStorageMemoryLimitGB ) + " Gb, please reduce number of points", - InputError ); + + InputError, getDataContext() ); m_pointData.resize( numPointsTotal * numOps ); @@ -99,14 +106,14 @@ void MultivariableTableFunction::initializeFunctionFromFile( string const & file for( auto j = 0; j < numOps; j++ ) { file >> m_pointData[i * numOps + j]; - GEOS_THROW_IF( !file, catalogName() << " " << getDataContext() << ": table file is shorter than expected", + GEOS_THROW_IF( !file, catalogName() << " : table file is shorter than expected", InputError, getDataContext() ); } } real64 value; file >> value; - GEOS_THROW_IF( file, catalogName() << " " << getDataContext() << ": table file is longer than expected", + GEOS_THROW_IF( file, catalogName() << " : table file is longer than expected", InputError, getDataContext() ); file.close(); @@ -167,15 +174,15 @@ void MultivariableTableFunction::initializeFunction() // check input - GEOS_THROW_IF_NE_MSG( m_numDims, m_axisMinimums.size(), catalogName() << " " << getDataContext() << - ": single minimum value is expected for each of " + std::to_string( m_numDims ) + "dimensions", - InputError ); - GEOS_THROW_IF_NE_MSG( m_numDims, m_axisMaximums.size(), catalogName() << " " << getDataContext() << - ": single maxumum value is expected for each of " + std::to_string( m_numDims ) + "dimensions", - InputError ); - GEOS_THROW_IF_NE_MSG( m_numDims, m_axisPoints.size(), catalogName() << " " << getDataContext() << + GEOS_THROW_IF_NE_MSG( m_numDims, m_axisMinimums.size(), catalogName() << + " : single minimum value is expected for each of " + std::to_string( m_numDims ) + "dimensions", + InputError, getDataContext() ); + GEOS_THROW_IF_NE_MSG( m_numDims, m_axisMaximums.size(), catalogName() << + " : single maxumum value is expected for each of " + std::to_string( m_numDims ) + "dimensions", + InputError, getDataContext() ); + GEOS_THROW_IF_NE_MSG( m_numDims, m_axisPoints.size(), catalogName() << "single number is expected for each of " + std::to_string( m_numDims ) + "dimensions", - InputError ); + InputError, getDataContext() ); m_axisSteps.resize( m_numDims ); m_axisStepInvs.resize( m_numDims ); @@ -210,17 +217,18 @@ void MultivariableTableFunction::initializeFunction() // check is point data size is correct - GEOS_THROW_IF_NE_MSG( globalIndex( numTablePoints ) * m_numOps, m_pointData.size(), catalogName() << " " << getDataContext() << - ": table values array is expected to have length of " + std::to_string( globalIndex( numTablePoints ) * m_numOps ), InputError ); + GEOS_THROW_IF_NE_MSG( globalIndex( numTablePoints ) * m_numOps, m_pointData.size(), catalogName() << + " : table values array is expected to have length of " + std::to_string( globalIndex( numTablePoints ) * m_numOps ), + InputError, getDataContext() ); // lets limit the hypercube storage size with 16 Gb real64 hypercubeStorageMemoryLimitGB = 16; GEOS_THROW_IF_GT_MSG( numTableHypercubes * m_numVerts * m_numOps, hypercubeStorageMemoryLimitGB * 1024 * 1024 * 1024 / 8, - catalogName() << " " << getDataContext() << - ": hypercube storage size exceeds " + std::to_string( hypercubeStorageMemoryLimitGB ) + + catalogName() << + " : hypercube storage size exceeds " + std::to_string( hypercubeStorageMemoryLimitGB ) + " Gb, please reduce number of points", - InputError ); + InputError, getDataContext() ); // initialize hypercube data storage m_hypercubeData.resize( numTableHypercubes * m_numVerts * m_numOps ); diff --git a/src/coreComponents/functions/TableFunction.cpp b/src/coreComponents/functions/TableFunction.cpp index 7ee6c4a3490..4d97d9766b8 100644 --- a/src/coreComponents/functions/TableFunction.cpp +++ b/src/coreComponents/functions/TableFunction.cpp @@ -83,7 +83,7 @@ void TableFunction::readFile( string const & filename, array1d< real64 > & targe } catch( std::runtime_error const & e ) { - GEOS_THROW( GEOS_FMT( "{} {}: {}", catalogName(), getDataContext(), e.what() ), InputError ); + GEOS_THROW( GEOS_FMT( "{}: {}", catalogName(), e.what() ), InputError, getDataContext() ); } } @@ -103,8 +103,8 @@ void TableFunction::setTableCoordinates( array1d< real64_array > const & coordin for( localIndex j = 1; j < coordinates[i].size(); ++j ) { GEOS_THROW_IF( coordinates[i][j] - coordinates[i][j-1] <= 0, - GEOS_FMT( "{} {}: coordinates must be strictly increasing, but axis {} is not", - catalogName(), getDataContext(), i ), + GEOS_FMT( "{} : coordinates must be strictly increasing, but axis {} is not", + catalogName(), i ), InputError, getDataContext() ); } m_coordinates.appendArray( coordinates[i].begin(), coordinates[i].end() ); @@ -165,17 +165,17 @@ void TableFunction::reInitializeFunction() for( localIndex j = 1; j < m_coordinates[ii].size(); ++j ) { GEOS_THROW_IF( m_coordinates[ii][j] - m_coordinates[ii][j-1] <= 0, - GEOS_FMT( "{} {}: coordinates must be strictly increasing, but axis {} is not", - catalogName(), getDataContext(), ii ), + GEOS_FMT( "{} : coordinates must be strictly increasing, but axis {} is not", + catalogName(), ii ), InputError, getDataContext() ); } } if( m_coordinates.size() > 0 && !m_values.empty() ) // coordinates and values have been set { GEOS_THROW_IF_NE_MSG( increment, m_values.size(), - GEOS_FMT( "{} {}: number of values does not match total number of table coordinates", - catalogName(), getDataContext() ), - InputError ); + GEOS_FMT( "{} : number of values does not match total number of table coordinates", + catalogName() ), + InputError, getDataContext() ); } // Create the kernel wrapper @@ -185,14 +185,13 @@ void TableFunction::reInitializeFunction() void TableFunction::checkCoord( real64 const coord, localIndex const dim ) const { GEOS_THROW_IF( dim >= m_coordinates.size() || dim < 0, - GEOS_FMT( "{}: The {} dimension ( no. {} ) doesn't exist in the table.", - getDataContext(), units::getDescription( getDimUnit( dim ) ), dim ), + GEOS_FMT( "The {} dimension ( no. {} ) doesn't exist in the table.", + units::getDescription( getDimUnit( dim ) ), dim ), SimulationError, getDataContext() ); real64 const lowerBound = m_coordinates[dim][0]; real64 const upperBound = m_coordinates[dim][m_coordinates.sizeOfArray( dim ) - 1]; GEOS_THROW_IF( coord > upperBound || coord < lowerBound, - GEOS_FMT( "{}: Requested {} is out of the table bounds ( lower bound: {} -> upper bound: {} ).", - getDataContext(), + GEOS_FMT( "Requested {} is out of the table bounds ( lower bound: {} -> upper bound: {} ).", units::formatValue( coord, getDimUnit( dim ) ), units::formatValue( lowerBound, getDimUnit( dim ) ), units::formatValue( upperBound, getDimUnit( dim ) ) ), @@ -214,8 +213,9 @@ real64 TableFunction::evaluate( real64 const * const input ) const real64 TableFunction::getCoord( real64 const * const input, localIndex const dim, InterpolationType interpolationMethod ) const { GEOS_ASSERT_MSG( interpolationMethod != InterpolationType::Linear, - GEOS_FMT( "{}: TableFunction::getCoord should not be called with {} interpolation method", - getDataContext(), EnumStrings< InterpolationType >::toString( interpolationMethod ))); + GEOS_FMT( "TableFunction::getCoord should not be called with {} interpolation method", + EnumStrings< InterpolationType >::toString( interpolationMethod )), + getDataContext() ); GEOS_ASSERT( dim >= 0 && dim < m_coordinates.size() ); return m_kernelWrapper.getCoord( input, dim, interpolationMethod ); } diff --git a/src/coreComponents/mesh/CellElementRegion.cpp b/src/coreComponents/mesh/CellElementRegion.cpp index fe669ed1864..940e6bae5fe 100644 --- a/src/coreComponents/mesh/CellElementRegion.cpp +++ b/src/coreComponents/mesh/CellElementRegion.cpp @@ -49,17 +49,15 @@ CellElementRegion::~CellElementRegion() void CellElementRegion::generateMesh( Group const & cellBlocks ) { - GEOS_THROW_IF( m_cellBlockNames.empty(), - GEOS_FMT( "{}: No cellBlock selected in this region.", - getDataContext() ), + GEOS_THROW_IF( m_cellBlockNames.empty(), "No cellBlock selected in this region.", InputError, getDataContext() ); Group & subRegions = this->getGroup( viewKeyStruct::elementSubRegions() ); for( string const & cbName : m_cellBlockNames ) { CellBlockABC const * cellBlock = cellBlocks.getGroupPointer< CellBlockABC >( cbName ); GEOS_THROW_IF( cellBlock == nullptr, - GEOS_FMT( "{}: No cellBlock named '{}' found.\nAvailable cellBlock list: {{ {} }}\nNo CellElementRegionSelector has been used to verify the cellBlock selection.", - getDataContext(), cbName, stringutilities::join( m_cellBlockNames, ", " ) ), + GEOS_FMT( "No cellBlock named '{}' found.\nAvailable cellBlock list: {{ {} }}\nNo CellElementRegionSelector has been used to verify the cellBlock selection.", + cbName, stringutilities::join( m_cellBlockNames, ", " ) ), InputError, getDataContext() ); // subRegion name must be the same as the cell-block (so we can match them and reference them in errors). diff --git a/src/coreComponents/mesh/CellElementSubRegion.cpp b/src/coreComponents/mesh/CellElementSubRegion.cpp index 95b2ac8b269..ff29ba81df3 100644 --- a/src/coreComponents/mesh/CellElementSubRegion.cpp +++ b/src/coreComponents/mesh/CellElementSubRegion.cpp @@ -397,13 +397,13 @@ void CellElementSubRegion:: default: { GEOS_ERROR( GEOS_FMT( "Volume calculation not supported for element type {} in subregion {}", - m_elementType, getDataContext() ) ); + m_elementType ), getDataContext() ); } } GEOS_ERROR_IF( m_elementVolume[k] <= 0.0, GEOS_FMT( "Negative volume for element {} type {} in subregion {}", - k, m_elementType, getDataContext() ) ); + k, m_elementType ), getDataContext() ); } void CellElementSubRegion::calculateElementGeometricQuantities( NodeManager const & nodeManager, diff --git a/src/coreComponents/mesh/ElementRegionManager.cpp b/src/coreComponents/mesh/ElementRegionManager.cpp index 367d0bb2662..4d8823b41e3 100644 --- a/src/coreComponents/mesh/ElementRegionManager.cpp +++ b/src/coreComponents/mesh/ElementRegionManager.cpp @@ -83,6 +83,8 @@ Group * ElementRegionManager::createChild( string const & childKey, string const GEOS_ERROR_IF( getUserAvailableKeys().count( childKey ) == 0, CatalogInterface::unknownTypeError( childKey, getDataContext(), getUserAvailableKeys() ), getDataContext() ); + CatalogInterface::unknownTypeError( childKey, getDataContext(), getUserAvailableKeys() ), + getDataContext() ); Group & elementRegions = this->getGroup( ElementRegionManager::groupKeyStruct::elementRegionsGroup() ); return &elementRegions.registerGroup( childName, CatalogInterface::factory( childKey, getDataContext(), @@ -222,9 +224,9 @@ void ElementRegionManager::generateWells( CellBlockManagerABC const & cellBlockM globalIndex const numWellElemsGlobal = MpiWrapper::sum( subRegion.size() ); GEOS_ERROR_IF( numWellElemsGlobal != lineBlock.numElements(), - "Invalid partitioning in well " << lineBlock.getDataContext() << - ", subregion " << subRegion.getDataContext(), - getDataContext() ); + "Invalid partitioning in well " << lineBlock.getName() << + ", subregion " << subRegion.getName(), + getDataContext(), lineBlock.getDataContext(), subRegion.getDataContext() ); } ); @@ -784,12 +786,12 @@ ElementRegionManager::getCellBlockToSubRegionMap( CellBlockManagerABC const & ce GEOS_UNUSED_VAR( region ); // unused if geos_error_if is nulld localIndex const blockIndex = cellBlocks.getIndex( subRegion.getName() ); GEOS_ERROR_IF( blockIndex == Group::subGroupMap::KeyIndex::invalid_index, - GEOS_FMT( "{}, subregion {}: Cell block not found at index {}.", - region.getDataContext().toString(), subRegion.getName(), blockIndex ), + GEOS_FMT( "subregion {}: Cell block not found at index {}.", + subRegion.getName(), blockIndex ), region.getDataContext() ); GEOS_ERROR_IF( blockMap( blockIndex, 1 ) != -1, - GEOS_FMT( "{}, subregion {}: Cell block at index {} is mapped to more than one subregion.", - region.getDataContext().toString(), subRegion.getName(), blockIndex ), + GEOS_FMT( "subregion {}: Cell block at index {} is mapped to more than one subregion.", + subRegion.getName(), blockIndex ), region.getDataContext() ); blockMap( blockIndex, 0 ) = er; diff --git a/src/coreComponents/mesh/FaceManager.cpp b/src/coreComponents/mesh/FaceManager.cpp index 1cf388d34f4..568da23ddd9 100644 --- a/src/coreComponents/mesh/FaceManager.cpp +++ b/src/coreComponents/mesh/FaceManager.cpp @@ -276,8 +276,8 @@ void FaceManager::sortAllFaceNodes( NodeManager const & nodeManager, // The face should be connected to at least one element. if( facesToElements( faceIndex, 0 ) < 0 && facesToElements( faceIndex, 1 ) < 0 ) { - GEOS_ERROR( getDataContext() << ": Face " << faceIndex << - " is not connected to any cell. You might have an invalid mesh." ); + GEOS_ERROR( "Face " << faceIndex << + " is not connected to any cell. You might have an invalid mesh.", getDataContext() ); } // Take the first defined face-to-(elt/region/sub region) to sorting direction. @@ -289,8 +289,8 @@ void FaceManager::sortAllFaceNodes( NodeManager const & nodeManager, if( er < 0 || esr < 0 || ei < 0 ) { - GEOS_ERROR( GEOS_FMT( "{0}: Face {1} is connected to an invalid element ({2}/{3}/{4}).", - getDataContext().toString(), faceIndex, er, esr, ei ) ); + GEOS_ERROR( GEOS_FMT( "Face {} is connected to an invalid element ({}/{}/{}).", + faceIndex, er, esr, ei ), getDataContext() ); } try diff --git a/src/coreComponents/mesh/MeshObjectPath.cpp b/src/coreComponents/mesh/MeshObjectPath.cpp index e5482d68ec5..4294baa0035 100644 --- a/src/coreComponents/mesh/MeshObjectPath.cpp +++ b/src/coreComponents/mesh/MeshObjectPath.cpp @@ -128,7 +128,7 @@ MeshObjectPath::fillPathTokens( string const & path, meshBodies.forSubGroups< MeshBody >( [&]( MeshBody const & meshBody ) { stdVector< string > meshLevelsNames; - existingMeshBodiesAndLevels += " MeshBody "+meshBody.getName() + ": { "; + existingMeshBodiesAndLevels += " MeshBody "+meshBody.getName() + "{ "; meshBody.forMeshLevels( [&]( MeshLevel const & meshLevel ) { meshLevelsNames.push_back( meshLevel.getName() ); @@ -212,7 +212,7 @@ void processTokenRecursive( dataRepository::Group const & parentGroup, } ); GEOS_THROW_IF( namesInRepository.empty(), - GEOS_FMT( "{0} has no children.", parentGroup.getDataContext().toString()), + GEOS_FMT( "{} has no children.", parentGroup.getName()), InputError, parentGroup.getDataContext() ); for( string const & inputEntry : stringutilities::tokenize( pathToken, " " ) ) @@ -235,7 +235,7 @@ void processTokenRecursive( dataRepository::Group const & parentGroup, GEOS_THROW_IF( !foundMatch, GEOS_FMT( "{0} has no child named {1}.\n" "{0} has the following children: {{ {2} }}", - parentGroup.getDataContext().toString(), + parentGroup.getName(), inputEntry, stringutilities::join( namesInRepository, ", " ) ), InputError, parentGroup.getDataContext() ); diff --git a/src/coreComponents/mesh/Perforation.cpp b/src/coreComponents/mesh/Perforation.cpp index f271a31ed47..ffc3fc91f32 100644 --- a/src/coreComponents/mesh/Perforation.cpp +++ b/src/coreComponents/mesh/Perforation.cpp @@ -90,9 +90,8 @@ void Perforation::postInputInitialization() { // Table name provided as input, check that it exists GEOS_THROW_IF( !functionManager.hasGroup< TableFunction >( m_perfStatusTableName ), - GEOS_FMT( "{}: missing perforation status table `{}`", - getDataContext(), m_perfStatusTableName ), - InputError ); + GEOS_FMT( "{}: missing perforation status table `{}`", m_perfStatusTableName ), + InputError, getDataContext() ); } if( !functionManager.hasGroup< TableFunction >( m_perfStatusTableName ) ) @@ -116,15 +115,14 @@ void Perforation::postInputInitialization() // User supplied table in Perforation section GEOS_THROW_IF( m_perfStatusTable[0].size() != m_perfStatusTable[1].size(), - GEOS_FMT( "{}: Perforation status table `{}` missing time or status.", m_perfStatusTableName, getDataContext() ), - InputError ); + GEOS_FMT( "Perforation status table `{}` missing time or status.", m_perfStatusTableName ), + InputError, getDataContext() ); for( std::ptrdiff_t i=0; i 0, - "Well " << lineBlock.getDataContext() << " contains shared well elements", + GEOS_THROW_IF( sharedElems.size() > 0, "contains shared well elements", InputError, lineBlock.getDataContext() ); // In Steps 1 and 2 we determine the local objects on this rank (elems and nodes) @@ -660,7 +659,7 @@ void WellElementSubRegion::checkPartitioningValidity( LineBlockABC const & lineB globalIndex const prevGlobal = prevElemIdsGlobal[iwelemGlobal][numBranches-1]; GEOS_THROW_IF( prevGlobal <= iwelemGlobal || prevGlobal < 0, - "The structure of well " << lineBlock.getDataContext() << " is invalid. " << + "The structure of well is invalid. " << " The main reason for this error is that there may be no perforation" << " in the bottom well element of the well, which is required to have" << " a well-posed problem.", diff --git a/src/coreComponents/mesh/generators/CellBlock.cpp b/src/coreComponents/mesh/generators/CellBlock.cpp index cd60545c5e9..4f4f3964444 100644 --- a/src/coreComponents/mesh/generators/CellBlock.cpp +++ b/src/coreComponents/mesh/generators/CellBlock.cpp @@ -121,7 +121,7 @@ void CellBlock::setElementType( ElementType elementType ) } default: { - GEOS_ERROR( "Invalid element type " << m_elementType << " for CellBlock " << getDataContext() ); + GEOS_ERROR( "Invalid element type " << m_elementType << " for CellBlock ", getDataContext() ); } } diff --git a/src/coreComponents/mesh/generators/InternalMeshGenerator.cpp b/src/coreComponents/mesh/generators/InternalMeshGenerator.cpp index 0eac2831c21..fcf196948bd 100644 --- a/src/coreComponents/mesh/generators/InternalMeshGenerator.cpp +++ b/src/coreComponents/mesh/generators/InternalMeshGenerator.cpp @@ -143,7 +143,7 @@ void InternalMeshGenerator::postInputInitialization() } if( failFlag ) { - GEOS_ERROR( getDataContext() << ": vertex/element mismatch.\n" << generalMeshErrorAdvice ); + GEOS_ERROR( "vertex/element mismatch.\n" << generalMeshErrorAdvice, getDataContext() ); } // If specified, check to make sure bias values have the correct length @@ -156,7 +156,7 @@ void InternalMeshGenerator::postInputInitialization() } if( failFlag ) { - GEOS_ERROR( getDataContext() << ": element/bias mismatch.\n" << generalMeshErrorAdvice ); + GEOS_ERROR( "element/bias mismatch.\n" << generalMeshErrorAdvice, getDataContext() ); } } @@ -170,8 +170,8 @@ void InternalMeshGenerator::postInputInitialization() } else { - GEOS_ERROR( getDataContext() << ": InternalMeshGenerator: The number of element types is inconsistent" << - " with the number of total cell blocks.\n" << generalMeshErrorAdvice ); + GEOS_ERROR( "InternalMeshGenerator: The number of element types is inconsistent" << + " with the number of total cell blocks.\n" << generalMeshErrorAdvice, getDataContext() ); } } @@ -206,7 +206,7 @@ void InternalMeshGenerator::postInputInitialization() } else { - GEOS_ERROR( getDataContext() << ": Incorrect number of regionLayout entries specified." ); + GEOS_ERROR( "Incorrect number of regionLayout entries specified.",getDataContext() ); } } } diff --git a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp index 8f1d434ad45..9dbe3d4efe1 100644 --- a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp +++ b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp @@ -119,7 +119,7 @@ void VTKMeshGenerator::postInputInitialization() m_dataSource = externalDataManager.getGroupPointer< VTKHierarchicalDataSource >( m_dataSourceName ); GEOS_THROW_IF( m_dataSource == nullptr, - getDataContext() << ": VTK Data Object Source not found: " << m_dataSourceName, + "VTK Data Object Source not found: " << m_dataSourceName, InputError, getDataContext() ); m_dataSource->open(); diff --git a/src/coreComponents/mesh/simpleGeometricObjects/Box.cpp b/src/coreComponents/mesh/simpleGeometricObjects/Box.cpp index 172f529ed59..1abc04e5aed 100644 --- a/src/coreComponents/mesh/simpleGeometricObjects/Box.cpp +++ b/src/coreComponents/mesh/simpleGeometricObjects/Box.cpp @@ -77,7 +77,7 @@ void Box::postInputInitialization() if( std::fabs( m_strikeAngle ) > 1e-20 ) { GEOS_ERROR_IF( (m_max[0]-m_min[0]) < (m_max[1]-m_min[1]), - getDataContext() << ": When a strike angle is specified, the box is supposed to" << + "When a strike angle is specified, the box is supposed to" << " represent a plane normal to the y direction. This box seems to be too thick.", getDataContext() ); diff --git a/src/coreComponents/mesh/simpleGeometricObjects/ThickPlane.cpp b/src/coreComponents/mesh/simpleGeometricObjects/ThickPlane.cpp index 4b04b18fd61..fb13744bda0 100644 --- a/src/coreComponents/mesh/simpleGeometricObjects/ThickPlane.cpp +++ b/src/coreComponents/mesh/simpleGeometricObjects/ThickPlane.cpp @@ -50,12 +50,12 @@ void ThickPlane::postInputInitialization() m_thickness *= 0.5; // actually store the half-thickness GEOS_ERROR_IF( m_thickness <= 0, - getDataContext() << ": The plane appears to have zero or negative thickness", + "The plane appears to have zero or negative thickness", getDataContext() ); LvArray::tensorOps::normalize< 3 >( m_normal ); GEOS_ERROR_IF( std::fabs( LvArray::tensorOps::l2Norm< 3 >( m_normal ) - 1.0 ) > 1e-15, - getDataContext() << ": Could not properly normalize input normal.", + "Could not properly normalize input normal.", getDataContext() ); } diff --git a/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp b/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp index cca018cabe3..800b5416302 100644 --- a/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp +++ b/src/coreComponents/physicsSolvers/LinearSolverParameters.cpp @@ -816,60 +816,54 @@ void LinearSolverParametersInput::postInputInitialization() static const std::set< integer > binaryOptions = { 0, 1 }; GEOS_ERROR_IF( binaryOptions.count( m_parameters.stopIfError ) == 0, - getWrapperDataContext( viewKeyStruct::stopIfErrorString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::stopIfErrorString() << " : can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::stopIfErrorString() ) ); GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.checkResidual ) == 0, - getWrapperDataContext( viewKeyStruct::directCheckResidualString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::directCheckResidualString() << " : can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::directCheckResidualString() ) ); GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.equilibrate ) == 0, - getWrapperDataContext( viewKeyStruct::directEquilString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::directEquilString() << " : can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::directEquilString() ) ); GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.replaceTinyPivot ) == 0, - getWrapperDataContext( viewKeyStruct::directReplTinyPivotString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::directReplTinyPivotString() << " : can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::directReplTinyPivotString() ) ); GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.iterativeRefine ) == 0, - getWrapperDataContext( viewKeyStruct::directIterRefString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::directIterRefString() << " : can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::directIterRefString() ) ); GEOS_ERROR_IF( binaryOptions.count( m_parameters.direct.parallel ) == 0, - getWrapperDataContext( viewKeyStruct::directParallelString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::directParallelString() << " : can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::directParallelString() ) ); GEOS_ERROR_IF_LT_MSG( m_parameters.krylov.maxIterations, 0, - getWrapperDataContext( viewKeyStruct::krylovMaxIterString() ) << - ": Invalid value." ); + viewKeyStruct::krylovMaxIterString() << ": Invalid value.", + getWrapperDataContext( viewKeyStruct::krylovMaxIterString() ) ); GEOS_ERROR_IF_LT_MSG( m_parameters.krylov.maxRestart, 0, - getWrapperDataContext( viewKeyStruct::krylovMaxRestartString() ) << - ": Invalid value." ); + viewKeyStruct::krylovMaxRestartString() << ": Invalid value.", + getWrapperDataContext( viewKeyStruct::krylovMaxRestartString() ) ); GEOS_ERROR_IF_LT_MSG( m_parameters.krylov.relTolerance, 0.0, - getWrapperDataContext( viewKeyStruct::krylovTolString() ) << - ": Invalid value." ); + viewKeyStruct::krylovTolString() << ": Invalid value.", + getWrapperDataContext( viewKeyStruct::krylovTolString() ) ); GEOS_ERROR_IF_GT_MSG( m_parameters.krylov.relTolerance, 1.0, - getWrapperDataContext( viewKeyStruct::krylovTolString() ) << - ": Invalid value." ); + viewKeyStruct::krylovTolString() << ": Invalid value.", + getWrapperDataContext( viewKeyStruct::krylovTolString() ) ); GEOS_ERROR_IF_LT_MSG( m_parameters.ifact.fill, 0, - getWrapperDataContext( viewKeyStruct::iluFillString() ) << - ": Invalid value." ); + viewKeyStruct::iluFillString() << ": Invalid value.", + getWrapperDataContext( viewKeyStruct::iluFillString() ) ); GEOS_ERROR_IF_LT_MSG( m_parameters.ifact.threshold, 0.0, - getWrapperDataContext( viewKeyStruct::iluThresholdString() ) << - ": Invalid value." ); + viewKeyStruct::iluThresholdString() << ": Invalid value.", + getWrapperDataContext( viewKeyStruct::iluThresholdString() ) ); GEOS_ERROR_IF_LT_MSG( m_parameters.amg.numSweeps, 0, - getWrapperDataContext( viewKeyStruct::amgNumSweepsString() ) << - ": Invalid value." ); + viewKeyStruct::amgNumSweepsString() << ": Invalid value.", + getWrapperDataContext( viewKeyStruct::amgNumSweepsString() ) ); GEOS_ERROR_IF_LT_MSG( m_parameters.amg.threshold, 0.0, - getWrapperDataContext( viewKeyStruct::amgThresholdString() ) << - ": Invalid value." ); + viewKeyStruct::amgThresholdString() << ": Invalid value.", + getWrapperDataContext( viewKeyStruct::amgThresholdString() ) ); GEOS_ERROR_IF_GT_MSG( m_parameters.amg.threshold, 1.0, - getWrapperDataContext( viewKeyStruct::amgThresholdString() ) << - ": Invalid value." ); + viewKeyStruct::amgThresholdString() << ": Invalid value.", + getWrapperDataContext( viewKeyStruct::amgThresholdString() ) ); // TODO input validation for other AMG parameters ? diff --git a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp index a604ff97cfd..94cbdf11f28 100644 --- a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp +++ b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp @@ -215,29 +215,38 @@ NonlinearSolverParameters::NonlinearSolverParameters( string const & name, void NonlinearSolverParameters::postInputInitialization() { GEOS_ERROR_IF_LE_MSG( m_timeStepDecreaseIterLimit, m_timeStepIncreaseIterLimit, - getWrapperDataContext( viewKeysStruct::timeStepIncreaseIterLimString() ) << - ": should be smaller than " << viewKeysStruct::timeStepDecreaseIterLimString() ); + viewKeysStruct::timeStepIncreaseIterLimString() << + "should be smaller than " << viewKeysStruct::timeStepDecreaseIterLimString(), + getWrapperDataContext( viewKeysStruct::timeStepIncreaseIterLimString() ) ); GEOS_ERROR_IF_LE_MSG( m_lineSearchResidualFactor, 0.0, - getWrapperDataContext( viewKeysStruct::lineSearchResidualFactorString() ) << ": should be positive" ); + viewKeysStruct::lineSearchResidualFactorString() << "should be positive", + getWrapperDataContext( viewKeysStruct::lineSearchResidualFactorString() ) ); if( m_oscillationScaling > 0 ) { // check oscillation parameters GEOS_ERROR_IF_LE_MSG( m_oscillationScalingFactor, 0.0, - getWrapperDataContext( viewKeysStruct::oscillationScalingFactorString() ) << ": should be positive" ); + viewKeysStruct::oscillationScalingFactorString() << "should be positive", + getWrapperDataContext( viewKeysStruct::oscillationScalingFactorString()) ); GEOS_ERROR_IF_GT_MSG( m_oscillationScalingFactor, 1.0, - getWrapperDataContext( viewKeysStruct::oscillationScalingFactorString() ) << ": can not be more than 1.0" ); + viewKeysStruct::oscillationScalingFactorString() << "can not be more than 1.0", + getWrapperDataContext( viewKeysStruct::oscillationScalingFactorString()) ); GEOS_ERROR_IF_LT_MSG( m_oscillationCheckDepth, 2, - getWrapperDataContext( viewKeysStruct::oscillationCheckDepthString() ) << ": can not be less than 2" ); + viewKeysStruct::oscillationCheckDepthString() << "can not be less than 2", + getWrapperDataContext( viewKeysStruct::oscillationCheckDepthString()) ); GEOS_ERROR_IF_LE_MSG( m_oscillationTolerance, 0.0, - getWrapperDataContext( viewKeysStruct::oscillationToleranceString() ) << ": should be positive" ); + viewKeysStruct::oscillationToleranceString() << "should be positive", + getWrapperDataContext( viewKeysStruct::oscillationToleranceString()) ); GEOS_ERROR_IF_GE_MSG( m_oscillationTolerance, 1.0, - getWrapperDataContext( viewKeysStruct::oscillationToleranceString() ) << ": can not be more than 1.0" ); + viewKeysStruct::oscillationToleranceString() << "can not be more than 1.0", + getWrapperDataContext( viewKeysStruct::oscillationToleranceString()) ); GEOS_ERROR_IF_LT_MSG( m_oscillationFraction, 0.0, - getWrapperDataContext( viewKeysStruct::oscillationFractionString() ) << ": can not be negative" ); + viewKeysStruct::oscillationFractionString() << "can not be negative", + getWrapperDataContext( viewKeysStruct::oscillationFractionString()) ); GEOS_ERROR_IF_GT_MSG( m_oscillationFraction, 1.0, - getWrapperDataContext( viewKeysStruct::oscillationFractionString() ) << ": can not be more than 1.0" ); + viewKeysStruct::oscillationFractionString() << "can not be more than 1.0", + getWrapperDataContext( viewKeysStruct::oscillationFractionString()) ); } if( getLogLevel() > 0 ) diff --git a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp index 8d301476cc5..1b123e0c39d 100644 --- a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp @@ -166,7 +166,7 @@ void PhysicsSolverBase::generateMeshTargetsFromTargetRegions( Group const & mesh if( targetTokens.size()==1 ) // no MeshBody or MeshLevel specified { GEOS_ERROR_IF( meshBodies.numSubGroups() != 1, - getDataContext() << ": No MeshBody information is specified in" << + "No MeshBody information is specified in" << " PhysicsSolverBase::meshTargets, but there are multiple MeshBody objects", getDataContext() ); MeshBody const & meshBody = meshBodies.getGroup< MeshBody >( 0 ); @@ -182,7 +182,7 @@ void PhysicsSolverBase::generateMeshTargetsFromTargetRegions( Group const & mesh { string const meshBodyName = targetTokens[0]; GEOS_ERROR_IF( !meshBodies.hasGroup( meshBodyName ), - getWrapperDataContext( viewKeyStruct::targetRegionsString() ) << ": MeshBody (" << + viewKeyStruct::targetRegionsString() << "MeshBody (" << meshBodyName << ") is specified in targetRegions, but does not exist.", getWrapperDataContext( viewKeyStruct::targetRegionsString() ) ); @@ -196,7 +196,7 @@ void PhysicsSolverBase::generateMeshTargetsFromTargetRegions( Group const & mesh } else { - GEOS_ERROR( getDataContext() << ": Invalid specification of targetRegions" ); + GEOS_ERROR( "Invalid specification of targetRegions", getDataContext() ); } } } @@ -241,8 +241,8 @@ localIndex PhysicsSolverBase::targetRegionIndex( string const & regionName ) con { auto const pos = std::find( m_targetRegionNames.begin(), m_targetRegionNames.end(), regionName ); GEOS_ERROR_IF( pos == m_targetRegionNames.end(), - GEOS_FMT( "{}: Region {} is not a target of the solver.", - getDataContext(), regionName ), getDataContext() ); + GEOS_FMT( "Region {} is not a target of the solver.", + regionName ), getDataContext() ); return std::distance( m_targetRegionNames.begin(), pos ); } @@ -360,8 +360,7 @@ bool PhysicsSolverBase::execute( real64 const time_n, } } GEOS_ERROR_IF( dtRemaining > 0.0, - getDataContext() << ": Maximum allowed number of sub-steps" - " reached. Consider increasing maxSubSteps.", + "Maximum allowed number of sub-steps reached. Consider increasing maxSubSteps.", getDataContext() ); // Decide what to do with the next Dt for the event running the solver. @@ -1452,14 +1451,12 @@ void PhysicsSolverBase::solveLinearSystem( DofManager const & dofManager, if( params.stopIfError ) { - GEOS_ERROR_IF( m_linearSolverResult.breakdown(), - getDataContext() << ": Linear solution breakdown -> simulation STOP", + GEOS_ERROR_IF( m_linearSolverResult.breakdown(), "Linear solution breakdown -> simulation STOP", getDataContext() ); } else { - GEOS_WARNING_IF( !m_linearSolverResult.success(), - getDataContext() << ": Linear solution failed", + GEOS_WARNING_IF( !m_linearSolverResult.success(), "Linear solution failed", getDataContext() ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp index 8089089777f..a2fc8ce0928 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp @@ -198,53 +198,67 @@ void CompositionalMultiphaseBase::postInputInitialization() FlowSolverBase::postInputInitialization(); GEOS_ERROR_IF_GT_MSG( m_maxCompFracChange, 1.0, - getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) << - ": The maximum absolute change in component fraction in a Newton iteration must be smaller or equal to 1.0" ); + viewKeyStruct::maxCompFracChangeString() << + "The maximum absolute change in component fraction in a Newton iteration must be smaller or equal to 1.0", + getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) ); GEOS_ERROR_IF_LE_MSG( m_maxCompFracChange, 0.0, - getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) << - ": The maximum absolute change in component fraction in a Newton iteration must be larger than 0.0" ); + viewKeyStruct::maxCompFracChangeString() << + "The maximum absolute change in component fraction in a Newton iteration must be larger than 0.0", + getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) ); GEOS_ERROR_IF_LE_MSG( m_maxRelativePresChange, 0.0, - getWrapperDataContext( viewKeyStruct::maxRelativePresChangeString() ) << - ": The maximum relative change in pressure in a Newton iteration must be larger than 0.0" ); + viewKeyStruct::maxRelativePresChangeString() << + "The maximum relative change in pressure in a Newton iteration must be larger than 0.0", + getWrapperDataContext( viewKeyStruct::maxRelativePresChangeString() ) ); GEOS_ERROR_IF_LE_MSG( m_maxRelativeTempChange, 0.0, - getWrapperDataContext( viewKeyStruct::maxRelativeTempChangeString() ) << - ": The maximum relative change in temperature in a Newton iteration must be larger than 0.0" ); + viewKeyStruct::maxRelativeTempChangeString() << + "The maximum relative change in temperature in a Newton iteration must be larger than 0.0", + getWrapperDataContext( viewKeyStruct::maxRelativeTempChangeString() ) ); GEOS_ERROR_IF_LE_MSG( m_maxRelativeCompDensChange, 0.0, - getWrapperDataContext( viewKeyStruct::maxRelativeCompDensChangeString() ) << - ": The maximum relative change in component density in a Newton iteration must be larger than 0.0" ); + viewKeyStruct::maxRelativeCompDensChangeString() << + "The maximum relative change in component density in a Newton iteration must be larger than 0.0", + getWrapperDataContext( viewKeyStruct::maxRelativeCompDensChangeString() ) ); GEOS_ERROR_IF_LE_MSG( m_targetRelativePresChange, 0.0, - getWrapperDataContext( viewKeyStruct::targetRelativePresChangeString() ) << - ": The target relative change in pressure in a time step must be larger than 0.0" ); + viewKeyStruct::targetRelativePresChangeString() << + "The target relative change in pressure in a time step must be larger than 0.0", + getWrapperDataContext( viewKeyStruct::targetRelativePresChangeString() ) ); GEOS_ERROR_IF_LE_MSG( m_targetRelativeTempChange, 0.0, - getWrapperDataContext( viewKeyStruct::targetRelativeTempChangeString() ) << - ": The target relative change in temperature in a time step must be larger than 0.0" ); + viewKeyStruct::targetRelativeTempChangeString() << + "The target relative change in temperature in a time step must be larger than 0.0", + getWrapperDataContext( viewKeyStruct::targetRelativeTempChangeString() ) ); GEOS_ERROR_IF_LE_MSG( m_targetPhaseVolFracChange, 0.0, - getWrapperDataContext( viewKeyStruct::targetPhaseVolFracChangeString() ) << - ": The target change in phase volume fraction in a time step must be larger than 0.0" ); + viewKeyStruct::targetPhaseVolFracChangeString() << + "The target change in phase volume fraction in a time step must be larger than 0.0", + getWrapperDataContext( viewKeyStruct::targetPhaseVolFracChangeString() ) ); GEOS_ERROR_IF_LE_MSG( m_targetRelativeCompDensChange, 0.0, - getWrapperDataContext( viewKeyStruct::targetRelativeCompDensChangeString() ) << - ": The target change in component density in a time step must be larger than 0.0" ); + viewKeyStruct::targetRelativeCompDensChangeString() << + "The target change in component density in a time step must be larger than 0.0", + getWrapperDataContext( viewKeyStruct::targetRelativeCompDensChangeString() ) ); GEOS_ERROR_IF_LE_MSG( m_targetCompFracChange, 0.0, - getWrapperDataContext( viewKeyStruct::targetCompFracChangeString() ) << - ": The target change in component fraction in a time step must be larger than 0.0" ); + viewKeyStruct::targetCompFracChangeString() << + "The target change in component fraction in a time step must be larger than 0.0", + getWrapperDataContext( viewKeyStruct::targetCompFracChangeString() ) ); GEOS_ERROR_IF_LT_MSG( m_solutionChangeScalingFactor, 0.0, - getWrapperDataContext( viewKeyStruct::solutionChangeScalingFactorString() ) << - ": The solution change scaling factor must be larger or equal to 0.0" ); + viewKeyStruct::solutionChangeScalingFactorString() << + "The solution change scaling factor must be larger or equal to 0.0", + getWrapperDataContext( viewKeyStruct::solutionChangeScalingFactorString() )); GEOS_ERROR_IF_GT_MSG( m_solutionChangeScalingFactor, 1.0, - getWrapperDataContext( viewKeyStruct::solutionChangeScalingFactorString() ) << - ": The solution change scaling factor must be smaller or equal to 1.0" ); + viewKeyStruct::solutionChangeScalingFactorString() << + "The solution change scaling factor must be smaller or equal to 1.0", + getWrapperDataContext( viewKeyStruct::solutionChangeScalingFactorString() )); GEOS_ERROR_IF_LE_MSG( m_minScalingFactor, 0.0, - getWrapperDataContext( viewKeyStruct::minScalingFactorString() ) << - ": The minumum scaling factor must be larger than 0.0" ); + viewKeyStruct::minScalingFactorString() << + "The minumum scaling factor must be larger than 0.0", + getWrapperDataContext( viewKeyStruct::minScalingFactorString() )); GEOS_ERROR_IF_GT_MSG( m_minScalingFactor, 1.0, - getWrapperDataContext( viewKeyStruct::minScalingFactorString() ) << - ": The minumum scaling factor must be smaller or equal to 1.0" ); + viewKeyStruct::minScalingFactorString() << + "The minumum scaling factor must be smaller or equal to 1.0", + getWrapperDataContext( viewKeyStruct::minScalingFactorString() )); if( m_isThermal && m_useSimpleAccumulation ) // useSimpleAccumulation is not yet compatible with thermal { - GEOS_LOG_RANK_0( GEOS_FMT( "{}: '{}' is not yet implemented for thermal simulation. Switched to phase sum accumulation.", - getDataContext(), viewKeyStruct::useSimpleAccumulationString() ) ); + GEOS_LOG_RANK_0( GEOS_FMT( "'{}' is not yet implemented for thermal simulation. Switched to phase sum accumulation.", + viewKeyStruct::useSimpleAccumulationString(), getDataContext() ) ); m_useSimpleAccumulation = 0; } @@ -254,18 +268,18 @@ void CompositionalMultiphaseBase::postInputInitialization() if( m_isThermal ) // z_c formulation is not yet compatible with thermal { - GEOS_ERROR( GEOS_FMT( "{}: '{}' is currently not available for thermal simulations", - getDataContext(), formulationName ) ); + GEOS_ERROR( GEOS_FMT( " '{}' is currently not available for thermal simulations", + formulationName ), getDataContext()); } if( m_hasDiffusion || m_hasDispersion ) // z_c formulation is not yet compatible with diffusion or dispersion { - GEOS_ERROR( GEOS_FMT( "{}: {} is currently not available for diffusion or dispersion", - getDataContext(), formulationName ) ); + GEOS_ERROR( GEOS_FMT( " {} is currently not available for diffusion or dispersion", + formulationName ), getDataContext() ); } if( m_isJumpStabilized ) // z_c formulation is not yet compatible with pressure stabilization { - GEOS_ERROR( GEOS_FMT( "{}: pressure stabilization is not yet supported by {}", - getDataContext(), formulationName ) ); + GEOS_ERROR( GEOS_FMT( " pressure stabilization is not yet supported by {}", + formulationName ), getDataContext() ); } } } @@ -316,25 +330,22 @@ void CompositionalMultiphaseBase::registerDataOnMesh( Group & meshBodies ) if( m_hasCapPressure ) { GEOS_THROW_IF( getConstitutiveName< CapillaryPressureBase >( subRegion ).empty(), - GEOS_FMT( "{}: Capillary pressure model not found on subregion {}", - getDataContext(), subRegion.getDataContext() ), - InputError ); + GEOS_FMT( "Capillary pressure model not found on subregion {}", subRegion.getName() ), + InputError, getDataContext(), subRegion.getDataContext() ); } if( m_hasDiffusion ) { GEOS_THROW_IF( getConstitutiveName< DiffusionBase >( subRegion ).empty(), - GEOS_FMT( "{}: Diffusion model not found on subregion {}", - getDataContext(), subRegion.getDataContext() ), - InputError ); + GEOS_FMT( "Diffusion model not found on subregion {}", subRegion.getName() ), + InputError, getDataContext(), subRegion.getDataContext() ); } if( m_hasDispersion ) { GEOS_THROW_IF( getConstitutiveName< DispersionBase >( subRegion ).empty(), - GEOS_FMT( "{}: Dispersion model not found on subregion {}", - getDataContext(), subRegion.getDataContext() ), - InputError ); + GEOS_FMT( " Dispersion model not found on subregion {}", subRegion.getName() ), + InputError, getDataContext(), subRegion.getDataContext() ); } } ); } ); @@ -495,15 +506,15 @@ 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.getDataContext(), rhs.getDataContext() ), - InputError ); + lhs.getName(), rhs.getName() ), + InputError, lhs.getDataContext(), rhs.getDataContext() ); 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.getDataContext(), rhs.getDataContext() ), - InputError ); + lhs.getName(), rhs.getName() ), + InputError, lhs.getDataContext(), rhs.getDataContext() ); } } @@ -512,15 +523,15 @@ void compareMulticomponentModels( MODEL1_TYPE const & lhs, MODEL2_TYPE const & r { GEOS_THROW_IF_NE_MSG( lhs.numFluidComponents(), rhs.numFluidComponents(), GEOS_FMT( "Mismatch in number of components between constitutive models {} and {}", - lhs.getDataContext(), rhs.getDataContext() ), - InputError ); + lhs.getName(), rhs.getName() ), + InputError, lhs.getDataContext(), rhs.getDataContext() ); 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.getDataContext(), rhs.getDataContext() ), - InputError ); + lhs.getName(), rhs.getName() ), + InputError, lhs.getDataContext(), rhs.getDataContext() ); } } @@ -546,14 +557,16 @@ void CompositionalMultiphaseBase::initializeAquiferBC( ConstitutiveManager const string_array const & aquiferWaterPhaseCompNames = bc.getWaterPhaseComponentNames(); GEOS_ERROR_IF_NE_MSG( fluid0.numFluidComponents(), aquiferWaterPhaseCompFrac.size(), - getDataContext() << ": Mismatch in number of components between constitutive model " - << fluid0.getName() << " and the water phase composition in aquifer " << bc.getName() ); + "Mismatch in number of components between constitutive model " + << fluid0.getName() << " and the water phase composition in aquifer " << bc.getName(), + getDataContext() ); for( integer ic = 0; ic < fluid0.numFluidComponents(); ++ic ) { GEOS_ERROR_IF_NE_MSG( fluid0.componentNames()[ic], aquiferWaterPhaseCompNames[ic], - getDataContext() << ": Mismatch in component names between constitutive model " - << fluid0.getName() << " and the water phase components in aquifer " << bc.getName() ); + "Mismatch in component names between constitutive model " + << fluid0.getName() << " and the water phase components in aquifer " << bc.getName(), + getDataContext() ); } } ); } @@ -612,12 +625,12 @@ void CompositionalMultiphaseBase::validateConstitutiveModels( DomainPartition co bool const isFluidModelThermal = fluid.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", - getDataContext(), fluid.getDataContext() ), + GEOS_FMT( "The thermal option is enabled in the solver, but the fluid model {} is incompatible with the thermal option", + fluid.getName() ), InputError, getDataContext(), fluid.getDataContext() ); 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", - getDataContext(), fluid.getDataContext() ), + GEOS_FMT( "The thermal option is enabled in fluid model {}, but the solver options are incompatible with the thermal option", + fluid.getName() ), InputError, getDataContext(), fluid.getDataContext() ); string const & relpermName = subRegion.getReference< string >( viewKeyStruct::relPermNamesString() ); @@ -1104,26 +1117,24 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium( DomainPartition // check that the gravity vector is aligned with the z-axis GEOS_THROW_IF( !isZero( gravVector[0] ) || !isZero( gravVector[1] ), - getCatalogName() << " " << getDataContext() << - ": the gravity vector specified in this simulation (" << gravVector[0] << " " << gravVector[1] << " " << gravVector[2] << + getCatalogName() << + " : 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 " << bc.getCatalogName() << " " << bc.getDataContext() << - "used in this simulation. To proceed, you can either: \n" << + "This is incompatible with the " << bc.getCatalogName() << + " 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", InputError, getDataContext(), bc.getDataContext() ); // ensure that the temperature and composition tables are defined GEOS_THROW_IF( bc.getTemperatureVsElevationTableName().empty(), - getCatalogName() << " " << bc.getDataContext() - << ": " << EquilibriumInitialCondition::viewKeyStruct::temperatureVsElevationTableNameString() + getCatalogName() << " : " << EquilibriumInitialCondition::viewKeyStruct::temperatureVsElevationTableNameString() << " must be provided for a multiphase simulation", - InputError ); + InputError, bc.getDataContext() ); GEOS_THROW_IF( bc.getComponentFractionVsElevationTableNames().empty(), - getCatalogName() << " " << bc.getDataContext() - << ": " << EquilibriumInitialCondition::viewKeyStruct::componentFractionVsElevationTableNamesString() + getCatalogName() << "" << EquilibriumInitialCondition::viewKeyStruct::componentFractionVsElevationTableNamesString() << " must be provided for a multiphase simulation", - InputError ); + InputError, bc.getDataContext() ); } ); if( equilCounter == 0 ) @@ -1180,7 +1191,7 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium( DomainPartition 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) ), getCatalogName() << " " << getDataContext() << - ": By looking at the elevation of the cell centers in this model, GEOS found that " << + "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 " << @@ -1223,13 +1234,13 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium( DomainPartition string_array const & componentNames = fs.getComponentNames(); GEOS_THROW_IF( fluid.componentNames().size() != componentNames.size(), "Mismatch in number of components between constitutive model " - << fluid.getDataContext() << " and the Equilibrium initial condition " << fs.getDataContext(), + << fluid.getName() << " and the Equilibrium initial condition " << fs.getName(), InputError, fluid.getDataContext(), fs.getDataContext() ); for( integer ic = 0; ic < fluid.numFluidComponents(); ++ic ) { GEOS_THROW_IF( fluid.componentNames()[ic] != componentNames[ic], "Mismatch in component names between constitutive model " - << fluid.getDataContext() << " and the Equilibrium initial condition " << fs.getDataContext(), + << fluid.getName() << " and the Equilibrium initial condition " << fs.getName(), InputError, fluid.getDataContext(), fs.getDataContext() ); } @@ -1237,8 +1248,8 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium( DomainPartition string_array const & phaseNames = fluid.phaseNames(); auto const itPhaseNames = std::find( std::begin( phaseNames ), std::end( phaseNames ), initPhaseName ); GEOS_THROW_IF( itPhaseNames == std::end( phaseNames ), - getCatalogName() << " " << getDataContext() << ": phase name " << - initPhaseName << " not found in the phases of " << fluid.getDataContext(), + getCatalogName() << " : phase name " << + initPhaseName << " not found in the phases of " << fluid.getName(), InputError, getDataContext(), fluid.getDataContext() ); integer const ipInit = std::distance( std::begin( phaseNames ), itPhaseNames ); @@ -1271,15 +1282,15 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium( DomainPartition pressureValues.toView() ); GEOS_THROW_IF( returnValue == isothermalCompositionalMultiphaseBaseKernels::HydrostaticPressureKernel::ReturnType::FAILED_TO_CONVERGE, - getCatalogName() << " " << getDataContext() << - ": hydrostatic pressure initialization failed to converge in region " << region.getName() << "! \n" << + getCatalogName() << + " : 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, getDataContext() ); GEOS_LOG_RANK_0_IF( returnValue == isothermalCompositionalMultiphaseBaseKernels::HydrostaticPressureKernel::ReturnType::DETECTED_MULTIPHASE_FLOW, getCatalogName() << " " << getDataContext() << - ": currently, GEOS assumes that there is only one mobile phase when computing the hydrostatic pressure. \n" << + " : 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" ); @@ -1334,8 +1345,8 @@ void CompositionalMultiphaseBase::computeHydrostaticEquilibrium( DomainPartition } ); GEOS_ERROR_IF( minPressure.get() < 0.0, - GEOS_FMT( "{}: A negative pressure of {} Pa was found during hydrostatic initialization in region/subRegion {}/{}", - getDataContext(), minPressure.get(), region.getName(), subRegion.getName() ), + GEOS_FMT( "A negative pressure of {} Pa was found during hydrostatic initialization in region/subRegion {}/{}", + minPressure.get(), region.getName(), subRegion.getName() ), getDataContext() ); } ); } ); @@ -1849,8 +1860,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", getDataContext() ), + GEOS_ERROR_IF( !bcConsistent, "CompositionalMultiphaseBase: inconsistent boundary conditions", getDataContext() ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp index f4a8d3c3ffd..7956430f34b 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp @@ -134,8 +134,8 @@ void CompositionalMultiphaseFVM::postInputInitialization() if( m_dbcParams.useDBC ) // z_c formulation is not compatible with DBC { - GEOS_ERROR( GEOS_FMT( "{}: '{}' is not compatible with {}", - getDataContext(), formulationName, viewKeyStruct::useDBCString() ) ); + GEOS_ERROR( GEOS_FMT( " '{}' is not compatible with {}", + formulationName, viewKeyStruct::useDBCString() ), getDataContext() ); } DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); @@ -146,10 +146,9 @@ void CompositionalMultiphaseFVM::postInputInitialization() if( upwindingParams.upwindingScheme == UpwindingScheme::C1PPU || upwindingParams.upwindingScheme == UpwindingScheme::IHU ) { - GEOS_ERROR( GEOS_FMT( "{}: {} is not available for {}", - getDataContext(), + GEOS_ERROR( GEOS_FMT( "{} is not available for {}", EnumStrings< UpwindingScheme >::toString( upwindingParams.upwindingScheme ), - formulationName ) ); + formulationName ), getDataContext() ); } } } @@ -205,8 +204,7 @@ void CompositionalMultiphaseFVM::initializePreSubGroups() FiniteVolumeManager const & fvManager = numericalMethodManager.getFiniteVolumeManager(); FluxApproximationBase const & fluxApprox = fvManager.getFluxApproximation( m_discretizationName ); GEOS_ERROR_IF( fluxApprox.upwindingParams().upwindingScheme == UpwindingScheme::HU2PH && m_numPhases != 2, - GEOS_FMT( "{}: upwinding scheme {} only supports 2-phase flow", - getDataContext(), + GEOS_FMT( "upwinding scheme {} only supports 2-phase flow", EnumStrings< UpwindingScheme >::toString( UpwindingScheme::HU2PH )), getDataContext() ); } @@ -1266,9 +1264,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( "{}: inconsistent boundary conditions", getDataContext() ), - getDataContext() ); + GEOS_ERROR_IF( !bcConsistent, "inconsistent boundary conditions", getDataContext() ); } using namespace isothermalCompositionalMultiphaseFVMKernels; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp index a022ad76443..a18e5462480 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp @@ -87,13 +87,11 @@ void CompositionalMultiphaseHybridFVM::initializePreSubGroups() FiniteVolumeManager const & fvManager = numericalMethodManager.getFiniteVolumeManager(); GEOS_THROW_IF( !fvManager.hasGroup< HybridMimeticDiscretization >( m_discretizationName ), - getCatalogName() << " " << getDataContext() << - ": the HybridMimeticDiscretization must be selected with CompositionalMultiphaseHybridFVM", + getCatalogName() <<" : the HybridMimeticDiscretization must be selected with CompositionalMultiphaseHybridFVM", InputError, getDataContext() ); GEOS_THROW_IF( m_hasCapPressure, - getCatalogName() << " " << getDataContext() << - ": capillary pressure is not yet supported by CompositionalMultiphaseHybridFVM", + getCatalogName() << " : capillary pressure is not yet supported by CompositionalMultiphaseHybridFVM", InputError, getDataContext() ); } @@ -112,8 +110,9 @@ void CompositionalMultiphaseHybridFVM::initializePostInitialConditionsPreSubGrou dynamicCast< QuasiTPFAInnerProduct const * >( &mimeticInnerProductBase ) || dynamicCast< SimpleInnerProduct const * >( &mimeticInnerProductBase ) ) { - GEOS_ERROR( getCatalogName() << " " << getDataContext() << - "The QuasiRT, QuasiTPFA, and Simple inner products are only available in SinglePhaseHybridFVM" ); + GEOS_ERROR( getCatalogName() << " " << + "The QuasiRT, QuasiTPFA, and Simple inner products are only available in SinglePhaseHybridFVM", + getDataContext() ); } m_lengthTolerance = domain.getMeshBody( 0 ).getGlobalLengthScale() * 1e-8; @@ -145,14 +144,13 @@ void CompositionalMultiphaseHybridFVM::initializePostInitialConditionsPreSubGrou } ); GEOS_THROW_IF( minVal.get() <= 0.0, - getCatalogName() << " " << getDataContext() << - ": the transmissibility multipliers used in SinglePhaseHybridFVM must strictly larger than 0.0", + getCatalogName() << " : the transmissibility multipliers used in SinglePhaseHybridFVM must strictly larger than 0.0", std::runtime_error, getDataContext() ); FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); fsManager.forSubGroups< AquiferBoundaryCondition >( [&] ( AquiferBoundaryCondition const & bc ) { - GEOS_LOG_RANK_0( getCatalogName() << " " << getDataContext() << ": An aquifer boundary condition named " << + GEOS_LOG_RANK_0( getCatalogName() << " " << 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/FlowSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp index 3cba71973ca..bbc5a8466c3 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp @@ -369,15 +369,17 @@ void FlowSolverBase::checkDiscretizationName() const if( !discretizationMethods.empty()) { - GEOS_ERROR( GEOS_FMT( "{}: can not find discretization named '{}' in 'FiniteVolume'.\nFound discretization : {}", - getDataContext(), m_discretizationName, discretizationMethods, - stringutilities::join( discretizationMethods, ", " ))); + GEOS_ERROR( GEOS_FMT( "can not find discretization named '{}' in 'FiniteVolume'.\nFound discretization : {}", + m_discretizationName, discretizationMethods, + stringutilities::join( discretizationMethods, ", " )), + getDataContext()); } else { - GEOS_ERROR( GEOS_FMT( "{}: can not find discretization named '{}' in 'FiniteVolume'.\n" \ + GEOS_ERROR( GEOS_FMT( "can not find discretization named '{}' in 'FiniteVolume'.\n" \ "No discretization found, check that you have correctly entered a numerical method", - getDataContext(), m_discretizationName )); + m_discretizationName ), + getDataContext()); } } } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp b/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp index 389a33357b7..c989e9a7a55 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp @@ -143,9 +143,9 @@ void ImmiscibleMultiphaseFlow::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 {}", - getDataContext(), subRegion.getDataContext() ), - InputError ); + GEOS_FMT( "Capillary pressure model not found on subregion {}", + subRegion.getName() ), + InputError, getDataContext(), subRegion.getDataContext() ); } // The resizing of the arrays needs to happen here, before the call to initializePreSubGroups, @@ -793,7 +793,7 @@ void ImmiscibleMultiphaseFlow::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( "ImmiscibleMultiphaseFlow {}: inconsistent boundary conditions", getDataContext() ) ); + GEOS_ERROR_IF( !bcConsistent, "ImmiscibleMultiphaseFlow : inconsistent boundary conditions", getDataContext() ); } FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp index 48f6b85b6af..03de86368a7 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp @@ -1068,8 +1068,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", getDataContext() ), + GEOS_ERROR_IF( !bcConsistent, "CompositionalMultiphaseBase : inconsistent boundary conditions", getDataContext() ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp index 6fca54281ae..b9206dedb0e 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp @@ -164,11 +164,11 @@ void SinglePhaseBase::validateConstitutiveModels( DomainPartition & domain ) con string const fluidModelName = castedFluid.getCatalogName(); 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", - getDataContext(), fluid.getDataContext() ), + fluid.getName() ), InputError, getDataContext(), fluid.getDataContext() ); 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", - getDataContext(), fluid.getDataContext() ), + fluid.getName() ), InputError, getDataContext(), fluid.getDataContext() ); } ); } ); @@ -414,10 +414,10 @@ void SinglePhaseBase::computeHydrostaticEquilibrium( DomainPartition & domain ) // check that the gravity vector is aligned with the z-axis GEOS_THROW_IF( !isZero( gravVector[0] ) || !isZero( gravVector[1] ), - getCatalogName() << " " << getDataContext() << - ": the gravity vector specified in this simulation (" << gravVector[0] << " " << gravVector[1] << " " << gravVector[2] << + getCatalogName() << + " : 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 " << bc.getCatalogName() << " " << bc.getDataContext() << + "This is incompatible with the " << bc.getCatalogName() << " " << bc.getName() << "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", @@ -425,21 +425,18 @@ void SinglePhaseBase::computeHydrostaticEquilibrium( DomainPartition & domain ) // ensure that the temperature tables are defined for thermal simulations GEOS_THROW_IF( m_isThermal && bc.getTemperatureVsElevationTableName().empty(), - getCatalogName() << " " << bc.getDataContext() - << ": " << EquilibriumInitialCondition::viewKeyStruct::temperatureVsElevationTableNameString() + getCatalogName() << " : " << EquilibriumInitialCondition::viewKeyStruct::temperatureVsElevationTableNameString() << " must be provided for a thermal simulation", InputError, getDataContext(), bc.getDataContext() ); //ensure that compositions are empty GEOS_THROW_IF( !bc.getComponentFractionVsElevationTableNames().empty(), - getCatalogName() << " " << bc.getDataContext() - << ": " << EquilibriumInitialCondition::viewKeyStruct::componentFractionVsElevationTableNamesString() + getCatalogName() << " : " << EquilibriumInitialCondition::viewKeyStruct::componentFractionVsElevationTableNamesString() << " must not be provided for a single phase simulation.", InputError, getDataContext(), bc.getDataContext() ); GEOS_THROW_IF( !bc.getComponentNames().empty(), - getCatalogName() << " " << bc.getDataContext() - << ": " << EquilibriumInitialCondition::viewKeyStruct::componentNamesString() + getCatalogName() << " : " << EquilibriumInitialCondition::viewKeyStruct::componentNamesString() << " must not be provided for a single phase simulation.", InputError, getDataContext(), bc.getDataContext() ); } ); @@ -497,7 +494,7 @@ void SinglePhaseBase::computeHydrostaticEquilibrium( DomainPartition & domain ) 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) ), getCatalogName() << " " << getDataContext() << - ": By looking at the elevation of the cell centers in this model, GEOS found that " << + "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 " << @@ -577,8 +574,8 @@ void SinglePhaseBase::computeHydrostaticEquilibrium( DomainPartition & domain ) pressureValues.toView() ); GEOS_THROW_IF( !equilHasConverged, - getCatalogName() << " " << getDataContext() << - ": hydrostatic pressure initialization failed to converge in region " << region.getName() << "!", + getCatalogName() << + " : hydrostatic pressure initialization failed to converge in region " << region.getName() << "!", std::runtime_error, getDataContext() ); } ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp index 5ae213a31b2..0e14dcc7884 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp @@ -94,8 +94,7 @@ void SinglePhaseHybridFVM::initializePreSubGroups() SinglePhaseBase::initializePreSubGroups(); GEOS_THROW_IF( m_isThermal, - GEOS_FMT( "{} {}: The thermal option is not supported by SinglePhaseHybridFVM", - getCatalogName(), getDataContext().toString() ), + GEOS_FMT( "{} : The thermal option is not supported by SinglePhaseHybridFVM", getCatalogName() ), InputError, getDataContext() ); DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); @@ -103,8 +102,7 @@ void SinglePhaseHybridFVM::initializePreSubGroups() FiniteVolumeManager const & fvManager = numericalMethodManager.getFiniteVolumeManager(); GEOS_THROW_IF( !fvManager.hasGroup< HybridMimeticDiscretization >( m_discretizationName ), - getCatalogName() << " " << getDataContext() << - ": the HybridMimeticDiscretization must be selected with SinglePhaseHybridFVM", + getCatalogName() << " : the HybridMimeticDiscretization must be selected with SinglePhaseHybridFVM", InputError, getDataContext() ); } @@ -139,8 +137,8 @@ void SinglePhaseHybridFVM::initializePostInitialConditionsPreSubGroups() } ); GEOS_THROW_IF_LE_MSG( minVal.get(), 0.0, - getCatalogName() << " " << getDataContext() << - "The transmissibility multipliers used in SinglePhaseHybridFVM must strictly larger than 0.0", + getCatalogName() << + " The transmissibility multipliers used in SinglePhaseHybridFVM must strictly larger than 0.0", std::runtime_error ); FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SourceFluxStatistics.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SourceFluxStatistics.cpp index e454f54030d..813b7e36f30 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SourceFluxStatistics.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SourceFluxStatistics.cpp @@ -58,9 +58,8 @@ void SourceFluxStatsAggregator::postInputInitialization() m_fluxNames.emplace_back( string( sourceFlux.getName() ) ); } ); GEOS_WARNING_IF( m_fluxNames.empty(), - GEOS_FMT( "{}: No {} was found in {}.", - getDataContext(), SourceFluxBoundaryCondition::catalogName(), - fsManager.getDataContext() ), + GEOS_FMT( "No {} was found in {}.", + SourceFluxBoundaryCondition::catalogName(), fsManager.getName() ), getDataContext(), fsManager.getDataContext() ); } else @@ -68,9 +67,10 @@ void SourceFluxStatsAggregator::postInputInitialization() for( string const & fluxName : m_fluxNames ) { GEOS_ERROR_IF( !fsManager.hasGroup< SourceFluxBoundaryCondition >( fluxName ), - GEOS_FMT( "{}: No {} named {} was found in {}.", - getDataContext(), SourceFluxBoundaryCondition::catalogName(), - fluxName, fsManager.getDataContext() ), getDataContext() ); + GEOS_FMT( "No {} named {} was found in {}.", + SourceFluxBoundaryCondition::catalogName(), + fluxName, fsManager.getName() ), + getDataContext(), fsManager.getDataContext() ); } } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp b/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp index 5accd9a0def..813d77c99ae 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp @@ -69,9 +69,7 @@ void StencilDataCollection::postInputInitialization() m_solver = physicsSolverManager.getGroupPointer< FlowSolverBase >( m_solverName ); GEOS_THROW_IF( m_solver == nullptr, - GEOS_FMT( "{}: Could not find flow solver named '{}'.", - getDataContext(), - m_solverName ), + GEOS_FMT( "Could not find flow solver named '{}'.", m_solverName ), InputError, getDataContext() ); } @@ -91,8 +89,9 @@ void StencilDataCollection::postInputInitialization() } catch( BadTypeError const & e ) { // only TPFA is supported for now - GEOS_ERROR( GEOS_FMT( "{}: target discretization is not supported by {} (for now, only '{}' is).", - getDataContext(), catalogName(), TwoPointFluxApproximation::catalogName() ) ); + GEOS_ERROR( GEOS_FMT( "target discretization is not supported by {} (for now, only '{}' is).", + catalogName(), TwoPointFluxApproximation::catalogName() ), + getDataContext() ); } } } @@ -113,11 +112,9 @@ void StencilDataCollection::initializePostInitialConditionsPostSubGroups() getName(), connCount, m_discretization->getName() ) ); ++supportedStencilCount; } ); - GEOS_ERROR_IF( supportedStencilCount == 0, - GEOS_FMT( "{}: No compatible discretization was found.", getDataContext() ), + GEOS_ERROR_IF( supportedStencilCount == 0, "No compatible discretization was found.", getDataContext() ); - GEOS_ERROR_IF( supportedStencilCount > 1, - GEOS_FMT( "{}: Multiple discretization was found.", getDataContext() ), + GEOS_ERROR_IF( supportedStencilCount > 1, "Multiple discretization was found.", getDataContext() ); } @@ -269,8 +266,8 @@ void StencilDataCollection::storeConnectionData( string_view stencilName, { // data storing GEOS_ERROR_IF_NE_MSG( size_t( m_cellAGlobalId.size() ), size_t( sortedData.size() ), - GEOS_FMT( "{}: Unexpected stencil size!\n{}", - getDataContext(), formatKernelDataExtract( kernelData, 8 ) ) ); + GEOS_FMT( "{}: Unexpected stencil size!\n{}", formatKernelDataExtract( kernelData, 8 ) ), + getDataContext() ); globalIndex i = 0; for( ConnectionData const & conn : sortedData ) { diff --git a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp index 98f54f20a2f..7ca9b25ff24 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp @@ -701,7 +701,7 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n, string const & subRegionName = subRegion.getName(); GEOS_ERROR_IF( bcStatusMap[subRegionName].count( setName ) > 0, - getDataContext() << ": Conflicting proppant boundary conditions on set " << setName, + "Conflicting proppant boundary conditions on set " << setName, getDataContext() ); bcStatusMap[subRegionName][setName].resize( m_numComponents ); bcStatusMap[subRegionName][setName].setValues< serialPolicy >( false ); @@ -722,10 +722,10 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n, localIndex const comp = fs.getComponent(); GEOS_ERROR_IF( bcStatusMap[subRegionName].count( setName ) == 0, - getDataContext() << ": Proppant boundary condition not prescribed on set '" << setName << "'", + "Proppant boundary condition not prescribed on set '" << setName << "'", getDataContext() ); GEOS_ERROR_IF( bcStatusMap[subRegionName][setName][comp], - getDataContext() << ": Conflicting composition[" << comp << "] boundary conditions on set '" << setName << "'", + "Conflicting composition[" << comp << "] boundary conditions on set '" << setName << "'", getDataContext() ); bcStatusMap[subRegionName][setName][comp] = true; @@ -745,7 +745,7 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n, { bcConsistent &= bcStatusEntryInner.second[ic]; GEOS_WARNING_IF( !bcConsistent, - getDataContext() << ": Composition boundary condition not applied to component " << + "Composition boundary condition not applied to component " << ic << " on region '" << bcStatusEntryOuter.first << "'," << " set '" << bcStatusEntryInner.first << "'", getDataContext() ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index 3b8184a1a38..b0a9afe6bf5 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -126,15 +126,18 @@ void CompositionalMultiphaseWell::postInputInitialization() WellSolverBase::postInputInitialization(); GEOS_ERROR_IF_GT_MSG( m_maxCompFracChange, 1.0, - getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) << - ": The maximum absolute change in component fraction must smaller or equal to 1.0" ); + viewKeyStruct::maxCompFracChangeString() << + "The maximum absolute change in component fraction must smaller or equal to 1.0", + getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) ); GEOS_ERROR_IF_LT_MSG( m_maxCompFracChange, 0.0, - getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) << - ": The maximum absolute change in component fraction must larger or equal to 0.0" ); + viewKeyStruct::maxCompFracChangeString() << + "The maximum absolute change in component fraction must larger or equal to 0.0", + getWrapperDataContext( viewKeyStruct::maxCompFracChangeString() ) ); GEOS_ERROR_IF_LE_MSG( m_maxRelativeCompDensChange, 0.0, - getWrapperDataContext( viewKeyStruct::maxRelativeCompDensChangeString() ) << - ": The maximum relative change in component density must be larger than 0.0" ); + viewKeyStruct::maxRelativeCompDensChangeString() << + "The maximum relative change in component density must be larger than 0.0", + getWrapperDataContext( viewKeyStruct::maxRelativeCompDensChangeString() ) ); } void CompositionalMultiphaseWell::registerDataOnMesh( Group & meshBodies ) @@ -305,15 +308,15 @@ 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.getDataContext(), rhs.getDataContext() ), - InputError ); + lhs.getName(), rhs.getName() ), + InputError, lhs.getDataContext(), rhs.getDataContext() ); 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.getDataContext(), rhs.getDataContext() ), - InputError ); + lhs.getName(), rhs.getName() ), + InputError, lhs.getDataContext(), rhs.getDataContext() ); } } @@ -322,15 +325,15 @@ void compareMulticomponentModels( MODEL1_TYPE const & lhs, MODEL2_TYPE const & r { GEOS_THROW_IF_NE_MSG( lhs.numFluidComponents(), rhs.numFluidComponents(), GEOS_FMT( "Mismatch in number of components between constitutive models {} and {}", - lhs.getDataContext(), rhs.getDataContext() ), - InputError ); + lhs.getName(), rhs.getName() ), + InputError, lhs.getDataContext(), rhs.getDataContext() ); 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.getDataContext(), rhs.getDataContext() ), - InputError ); + lhs.getName(), rhs.getName() ), + InputError, lhs.getDataContext(), rhs.getDataContext() ); } } @@ -353,6 +356,9 @@ void CompositionalMultiphaseWell::validateWellControlsForFluid( WellControls con } catch( SimulationError const & ex ) { string const errorMsg = GEOS_FMT( "{}: wrong surface pressure / temperature.\n", getDataContext() ); + ErrorLogger::global().currentErrorMsg() + .addToMsg( errorMsg ) + .addContextInfo( getDataContext().getContextInfo().setPriority( 1 ) ); ErrorLogger::global().currentErrorMsg() .addToMsg( errorMsg ) .addContextInfo( getDataContext().getContextInfo().setPriority( 1 ) ); @@ -415,15 +421,15 @@ void CompositionalMultiphaseWell::validateInjectionStreams( WellElementSubRegion { real64 const compFrac = injectionStream[ic]; GEOS_THROW_IF( ( compFrac < 0.0 ) || ( compFrac > 1.0 ), - "WellControls " << wellControls.getDataContext() << - ": Invalid injection stream for well " << subRegion.getName(), + "WellControls " << wellControls.getName() << + "Invalid injection stream for well " << subRegion.getName(), InputError, wellControls.getDataContext() ); compFracSum += compFrac; } GEOS_THROW_IF( ( compFracSum < 1.0 - std::numeric_limits< real64 >::epsilon() ) || ( compFracSum > 1.0 + std::numeric_limits< real64 >::epsilon() ), - "WellControls " << wellControls.getDataContext() << - ": Invalid injection stream for well " << subRegion.getName(), + "WellControls " << wellControls.getName() << + "Invalid injection stream for well " << subRegion.getName(), InputError, wellControls.getDataContext() ); } } @@ -453,15 +459,17 @@ void CompositionalMultiphaseWell::validateWellConstraints( real64 const & time_n string_array const & targetRegionsNames = flowSolver.getTargetRegionNames(); auto const pos = std::find( targetRegionsNames.begin(), targetRegionsNames.end(), regionName ); GEOS_ERROR_IF( pos == targetRegionsNames.end(), - GEOS_FMT( "{}: Region {} is not a target of the reservoir solver and cannot be used for referenceReservoirRegion in WellControl {}.", - getDataContext(), regionName, wellControls.getName() ) ); + GEOS_FMT( "Region {} is not a target of the reservoir solver and cannot be used for referenceReservoirRegion in WellControl {}.", + regionName, wellControls.getName() ), + getDataContext() ); ElementRegionBase const & region = elemManager.getRegion( wellControls.referenceReservoirRegion()); // Check if regions statistics are being computed GEOS_ERROR_IF( !region.hasWrapper( CompositionalMultiphaseStatistics::catalogName()), - GEOS_FMT( "{}: No region average quantities computed. WellControl {} referenceReservoirRegion field requires CompositionalMultiphaseStatistics to be configured for region {} ", - getDataContext(), wellControls.getName(), regionName )); + GEOS_FMT( "No region average quantities computed. WellControl {} referenceReservoirRegion field requires CompositionalMultiphaseStatistics to be configured for region {} ", + wellControls.getName(), regionName ), + getDataContext()); CompositionalMultiphaseStatistics::RegionStatistics const & stats = region.getReference< CompositionalMultiphaseStatistics::RegionStatistics >( CompositionalMultiphaseStatistics::regionStatisticsName() ); @@ -478,43 +486,35 @@ void CompositionalMultiphaseWell::validateWellConstraints( real64 const & time_n real64 const & targetMassRate = wellControls.getTargetMassRate( time_n ); GEOS_THROW_IF( wellControls.isInjector() && currentControl == WellControls::Control::PHASEVOLRATE, - "WellControls " << wellControls.getDataContext() << - ": Phase rate control is not available for injectors", + "Phase rate control is not available for injectors", InputError, wellControls.getDataContext() ); GEOS_THROW_IF( wellControls.isProducer() && currentControl == WellControls::Control::TOTALVOLRATE, - "WellControls " << wellControls.getDataContext() << - ": Total rate control is not available for producers", + "Total rate control is not available for producers", InputError, wellControls.getDataContext() ); GEOS_THROW_IF( wellControls.isInjector() && targetTotalRate < 0.0, - "WellControls " << wellControls.getDataContext() << - ": Target total rate cannot be negative for injectors", + "Target total rate cannot be negative for injectors", InputError, wellControls.getDataContext() ); GEOS_THROW_IF( wellControls.isInjector() && !isZero( targetPhaseRate ), - "WellControls " << wellControls.getDataContext() << - ": Target phase rate cannot be used for injectors", + "Target phase rate cannot be used for injectors", InputError, wellControls.getDataContext() ); GEOS_THROW_IF( wellControls.isProducer() && !isZero( targetTotalRate ), - "WellControls " << wellControls.getDataContext() << - ": Target total rate cannot be used for producers", + "Target total rate cannot be used for producers", InputError, wellControls.getDataContext() ); GEOS_THROW_IF( wellControls.isProducer() && !isZero( targetMassRate ), - "WellControls " << wellControls.getDataContext() << - ": Target mass rate cannot be used for producers", + "Target mass rate cannot be used for producers", InputError, wellControls.getDataContext() ); GEOS_THROW_IF( !m_useMass && !isZero( targetMassRate ), - "WellControls " << wellControls.getDataContext() << - ": Target mass rate cannot with useMass=0", + "Target mass rate cannot with useMass=0", InputError, wellControls.getDataContext() ); // 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 " << wellControls.getDataContext() << - ": Target phase rate cannot be negative for producers", + "Target phase rate cannot be negative for producers", InputError, wellControls.getDataContext() ); GEOS_THROW_IF( wellControls.isProducer() && !isZero( targetTotalRate ), "WellControls " << wellControls.getDataContext() << - ": Target total rate cannot be used for producers", + "Target total rate cannot be used for producers", InputError, wellControls.getDataContext() ); // Find target phase index for phase rate constraint @@ -526,8 +526,7 @@ void CompositionalMultiphaseWell::validateWellConstraints( real64 const & time_n } } GEOS_THROW_IF( wellControls.isProducer() && m_targetPhaseIndex == -1, - "WellControls " << wellControls.getDataContext() << - ": Phase " << wellControls.getTargetPhaseName() << " not found for well control " << wellControls.getName(), + "Phase " << wellControls.getTargetPhaseName() << " not found", InputError, wellControls.getDataContext() ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp index ce588ad3d5c..823ec8c08d8 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp @@ -161,15 +161,17 @@ void SinglePhaseWell::validateWellConstraints( real64 const & time_n, string_array const & targetRegionsNames = flowSolver.getTargetRegionNames(); auto const pos = std::find( targetRegionsNames.begin(), targetRegionsNames.end(), regionName ); GEOS_ERROR_IF( pos == targetRegionsNames.end(), - GEOS_FMT( "{}: Region {} is not a target of the reservoir solver and cannot be used for referenceReservoirRegion in WellControl {}.", - getDataContext(), regionName, wellControls.getName() ) ); + GEOS_FMT( "Region {} is not a target of the reservoir solver and cannot be used for referenceReservoirRegion in WellControl {}.", + regionName, wellControls.getName() ), + getDataContext() ); ElementRegionBase const & region = elemManager.getRegion( wellControls.referenceReservoirRegion() ); // Check if regions statistics are being computed GEOS_ERROR_IF( !region.hasWrapper( SinglePhaseStatistics::catalogName()), - GEOS_FMT( "{}: No region average quantities computed. WellControl {} referenceReservoirRegion field requires SinglePhaseStatistics to be configured for region {} ", - getDataContext(), wellControls.getName(), regionName )); + GEOS_FMT( "No region average quantities computed. WellControl {} referenceReservoirRegion field requires SinglePhaseStatistics to be configured for region {} ", + wellControls.getName(), regionName ), + getDataContext()); SinglePhaseStatistics::RegionStatistics const & stats = region.getReference< SinglePhaseStatistics::RegionStatistics >( SinglePhaseStatistics::regionStatisticsName() ); wellControls.setRegionAveragePressure( stats.averagePressure ); @@ -180,18 +182,15 @@ void SinglePhaseWell::validateWellConstraints( real64 const & time_n, real64 const targetTotalRate = wellControls.getTargetTotalRate( time_n ); real64 const targetPhaseRate = wellControls.getTargetPhaseRate( time_n ); GEOS_THROW_IF( currentControl == WellControls::Control::PHASEVOLRATE, - "WellControls " << wellControls.getDataContext() << - ": Phase rate control is not available for SinglePhaseWell", + "Phase rate control is not available for SinglePhaseWell", InputError, wellControls.getDataContext() ); // 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 " << wellControls.getDataContext() << - ": Target total rate cannot be negative", + "Target total rate cannot be negative", InputError, wellControls.getDataContext() ); GEOS_THROW_IF( !isZero( targetPhaseRate ), - "WellControls " << wellControls.getDataContext() << - ": Target phase rate cannot be used for SinglePhaseWell", + "Target phase rate cannot be used for SinglePhaseWell", InputError, wellControls.getDataContext() ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp index 098d80beac0..04cee3fb070 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp @@ -240,8 +240,7 @@ void WellControls::postInputInitialization() // 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, - getWrapperDataContext( viewKeyStruct::inputControlString() ) << - ": Input well control cannot be uninitialized", + viewKeyStruct::inputControlString() << " Input well control cannot be uninitialized", InputError, getWrapperDataContext( viewKeyStruct::inputControlString() ) ); if( m_currentControl == Control::UNINITIALIZED ) @@ -251,28 +250,28 @@ void WellControls::postInputInitialization() // 1.a) check target BHP GEOS_THROW_IF( m_targetBHP < 0, - getWrapperDataContext( viewKeyStruct::targetBHPString() ) << - ": Target bottom-hole pressure is negative", + viewKeyStruct::targetBHPString() << + "Target bottom-hole pressure is negative", InputError, getWrapperDataContext( viewKeyStruct::targetBHPString() ) ); // 1.b) check target rates GEOS_THROW_IF( m_targetTotalRate < 0, - getWrapperDataContext( viewKeyStruct::targetTotalRateString() ) << ": Target rate is negative", + viewKeyStruct::targetTotalRateString() << " Target rate is negative", InputError, getWrapperDataContext( viewKeyStruct::targetTotalRateString() ) ); GEOS_THROW_IF( m_targetPhaseRate < 0, - getWrapperDataContext( viewKeyStruct::targetPhaseRateString() ) << ": Target oil rate is negative", + viewKeyStruct::targetPhaseRateString() << " Target oil rate is negative", InputError, getWrapperDataContext( viewKeyStruct::targetPhaseRateString() ) ); GEOS_THROW_IF( m_targetMassRate < 0, - getWrapperDataContext( viewKeyStruct::targetMassRateString() ) << ": Target mass rate is negative", + viewKeyStruct::targetMassRateString() << " Target mass rate is negative", InputError, getWrapperDataContext( viewKeyStruct::targetMassRateString() ) ); GEOS_THROW_IF( (m_injectionStream.empty() && m_injectionTemperature >= 0) || (!m_injectionStream.empty() && m_injectionTemperature < 0), - "WellControls " << getDataContext() << ": Both " - << viewKeyStruct::injectionStreamString() << " and " << viewKeyStruct::injectionTemperatureString() - << " must be specified for multiphase simulations", + "WellControls : Both " + << viewKeyStruct::injectionStreamString() << " and " << viewKeyStruct::injectionTemperatureString() + << " must be specified for multiphase simulations", InputError, getDataContext() ); // 1.c) Set the multiplier for the rates @@ -292,25 +291,25 @@ void WellControls::postInputInitialization() for( localIndex ic = 0; ic < m_injectionStream.size(); ++ic ) { GEOS_ERROR_IF( m_injectionStream[ic] < 0.0 || m_injectionStream[ic] > 1.0, - getWrapperDataContext( viewKeyStruct::injectionStreamString() ) << ": Invalid injection stream", + viewKeyStruct::injectionStreamString()<< " Invalid injection stream", getWrapperDataContext( viewKeyStruct::injectionStreamString() ) ); sum += m_injectionStream[ic]; } GEOS_THROW_IF( LvArray::math::abs( 1.0 - sum ) > std::numeric_limits< real64 >::epsilon(), - getWrapperDataContext( viewKeyStruct::injectionStreamString() ) << ": Invalid injection stream", + viewKeyStruct::injectionStreamString() << " Invalid injection stream", InputError, getWrapperDataContext( viewKeyStruct::injectionStreamString() ) ); } // 3) check the flag for surface / reservoir conditions GEOS_THROW_IF( m_useSurfaceConditions != 0 && m_useSurfaceConditions != 1, - getWrapperDataContext( viewKeyStruct::useSurfaceConditionsString() ) << ": The flag to select surface/reservoir conditions must be equal to 0 or 1", + viewKeyStruct::useSurfaceConditionsString() << " The flag to select surface/reservoir conditions must be equal to 0 or 1", InputError, getWrapperDataContext( viewKeyStruct::useSurfaceConditionsString() ) ); // 4) check that at least one rate constraint has been defined GEOS_THROW_IF( ((m_targetPhaseRate <= 0.0 && m_targetPhaseRateTableName.empty()) && (m_targetMassRate <= 0.0 && m_targetMassRateTableName.empty()) && (m_targetTotalRate <= 0.0 && m_targetTotalRateTableName.empty())), - "WellControls " << getDataContext() << ": You need to specify a phase, mass, or total rate constraint. \n" << + "WellControls : You need to specify a phase, mass, or total rate constraint. \n" << "The phase rate constraint can be specified using " << "either " << viewKeyStruct::targetPhaseRateString() << " or " << viewKeyStruct::targetPhaseRateTableNameString() << ".\n" << @@ -324,27 +323,28 @@ void WellControls::postInputInitialization() // 5) check whether redundant information has been provided GEOS_THROW_IF( ((m_targetPhaseRate > 0.0 && !m_targetPhaseRateTableName.empty())), - "WellControls " << getDataContext() << ": You have provided redundant information for well phase rate." << + "WellControls : You have provided redundant information for well phase rate." << " The keywords " << viewKeyStruct::targetPhaseRateString() << " and " << viewKeyStruct::targetPhaseRateTableNameString() << " cannot be specified together", InputError, getDataContext() ); GEOS_THROW_IF( ((m_targetTotalRate > 0.0 && !m_targetTotalRateTableName.empty())), - "WellControls " << getDataContext() << ": You have provided redundant information for well total rate." << + "WellControls : You have provided redundant information for well total rate." << " The keywords " << viewKeyStruct::targetTotalRateString() << " and " << viewKeyStruct::targetTotalRateTableNameString() << " cannot be specified together", InputError, getDataContext() ); GEOS_THROW_IF( ((m_targetBHP > 0.0 && !m_targetBHPTableName.empty())), - "WellControls " << getDataContext() << ": You have provided redundant information for well BHP." << + "WellControls : You have provided redundant information for well BHP." << " The keywords " << viewKeyStruct::targetBHPString() << " and " << viewKeyStruct::targetBHPTableNameString() << " cannot be specified together", InputError, getDataContext() ); GEOS_THROW_IF( ((m_targetMassRate > 0.0 && !m_targetMassRateTableName.empty())), - "WellControls " << getDataContext() << ": You have provided redundant information for well mass rate." << + "WellControls : You have provided redundant information for well mass rate." << " The keywords " << viewKeyStruct::targetMassRateString() << " and " << viewKeyStruct::targetMassRateTableNameString() << " cannot be specified together", InputError, getDataContext() ); + InputError, getDataContext() ); GEOS_THROW_IF( ((m_targetMassRate > 0.0 && m_useSurfaceConditions==0)), - "WellControls " << getDataContext() << ": Option only valid if useSurfaceConditions set to 1", + "WellControls : Option only valid if useSurfaceConditions set to 1", InputError, getDataContext() ); // 6.1) If the well is under BHP control then the BHP must be specified. @@ -352,8 +352,8 @@ void WellControls::postInputInitialization() if( m_currentControl == Control::BHP ) { GEOS_THROW_IF( ((m_targetBHP <= 0.0 && m_targetBHPTableName.empty())), - "WellControls " << getDataContext() << ": You have to provide well BHP by specifying either " - << viewKeyStruct::targetBHPString() << " or " << viewKeyStruct::targetBHPTableNameString(), + "WellControls : You have to provide well BHP by specifying either " + << viewKeyStruct::targetBHPString() << " or " << viewKeyStruct::targetBHPTableNameString(), InputError, getDataContext() ); } else if( m_targetBHP <= 0.0 && m_targetBHPTableName.empty() ) @@ -367,20 +367,20 @@ void WellControls::postInputInitialization() // An injector must be controlled by TotalVolRate GEOS_THROW_IF( (isInjector() && (m_inputControl == Control::PHASEVOLRATE)), - "WellControls " << getDataContext() << ": You have to control an injector with " - << EnumStrings< Control >::toString( Control::TOTALVOLRATE ), + "WellControls : You have to control an injector with " + << EnumStrings< Control >::toString( Control::TOTALVOLRATE ), InputError, getDataContext() ); // An injector must be controlled by TotalVolRate GEOS_THROW_IF( (isProducer() && (m_inputControl == Control::MASSRATE)), - "WellControls " << getDataContext() << ": You have to control an injector with " - << EnumStrings< Control >::toString( Control::MASSRATE ), + "WellControls : You have to control an injector with " + << EnumStrings< Control >::toString( Control::MASSRATE ), InputError, getDataContext() ); // 8) Make sure that the initial pressure coefficient is positive GEOS_THROW_IF( m_initialPressureCoefficient < 0, - getWrapperDataContext( viewKeyStruct::initialPressureCoefficientString() ) << - ": This tuning coefficient is negative", + viewKeyStruct::initialPressureCoefficientString() << + "This tuning coefficient is negative", InputError, getWrapperDataContext( viewKeyStruct::initialPressureCoefficientString() ) ); @@ -396,8 +396,8 @@ void WellControls::postInputInitialization() m_targetBHPTable = &(functionManager.getGroup< TableFunction const >( m_targetBHPTableName )); GEOS_THROW_IF( m_targetBHPTable->getInterpolationMethod() != TableFunction::InterpolationType::Lower, - "WellControls " << getDataContext() << ": The interpolation method for the time-dependent BHP table " - << m_targetBHPTable->getName() << " should be TableFunction::InterpolationType::Lower", + "WellControls : The interpolation method for the time-dependent BHP table " + << m_targetBHPTable->getName() << " should be TableFunction::InterpolationType::Lower", InputError, getDataContext() ); } @@ -413,8 +413,8 @@ void WellControls::postInputInitialization() m_targetTotalRateTable = &(functionManager.getGroup< TableFunction const >( m_targetTotalRateTableName )); GEOS_THROW_IF( m_targetTotalRateTable->getInterpolationMethod() != TableFunction::InterpolationType::Lower, - "WellControls " << getDataContext() << ": The interpolation method for the time-dependent total rate table " - << m_targetTotalRateTable->getName() << " should be TableFunction::InterpolationType::Lower", + "WellControls : The interpolation method for the time-dependent total rate table " + << m_targetTotalRateTable->getName() << " should be TableFunction::InterpolationType::Lower", InputError, getDataContext() ); } @@ -430,8 +430,8 @@ void WellControls::postInputInitialization() m_targetPhaseRateTable = &(functionManager.getGroup< TableFunction const >( m_targetPhaseRateTableName )); GEOS_THROW_IF( m_targetPhaseRateTable->getInterpolationMethod() != TableFunction::InterpolationType::Lower, - "WellControls " << getDataContext() << ": The interpolation method for the time-dependent phase rate table " - << m_targetPhaseRateTable->getName() << " should be TableFunction::InterpolationType::Lower", + "WellControls : The interpolation method for the time-dependent phase rate table " + << m_targetPhaseRateTable->getName() << " should be TableFunction::InterpolationType::Lower", InputError, getDataContext() ); } // Create time-dependent mass rate table @@ -446,8 +446,8 @@ void WellControls::postInputInitialization() m_targetMassRateTable = &(functionManager.getGroup< TableFunction const >( m_targetMassRateTableName )); GEOS_THROW_IF( m_targetMassRateTable->getInterpolationMethod() != TableFunction::InterpolationType::Lower, - "WellControls " << getDataContext() << ": The interpolation method for the time-dependent mass rate table " - << m_targetMassRateTable->getName() << " should be TableFunction::InterpolationType::Lower", + "WellControls : The interpolation method for the time-dependent mass rate table " + << m_targetMassRateTable->getName() << " should be TableFunction::InterpolationType::Lower", InputError, getDataContext() ); } // 12) Create the time-dependent well status table @@ -468,8 +468,8 @@ void WellControls::postInputInitialization() m_statusTable = &(functionManager.getGroup< TableFunction const >( m_statusTableName )); GEOS_THROW_IF( m_statusTable->getInterpolationMethod() != TableFunction::InterpolationType::Lower, - "WellControls " << getDataContext() << ": The interpolation method for the time-dependent status table " - << m_statusTable->getName() << " should be TableFunction::InterpolationType::Lower", + "WellControls : The interpolation method for the time-dependent status table " + << m_statusTable->getName() << " should be TableFunction::InterpolationType::Lower", InputError, getDataContext() ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp index daeeffef3c1..9299cdc8532 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp @@ -169,9 +169,9 @@ void WellSolverBase::initializePostSubGroups() { TableFunction * tableFunction = functionManager.getGroupPointer< TableFunction >( perfStatusTableName[i] ); GEOS_THROW_IF( tableFunction->getInterpolationMethod() != TableFunction::InterpolationType::Lower, - "WellSolverBase " << getDataContext() << ": The interpolation method for the perforation status table " + "WellSolverBase : The interpolation method for the perforation status table " << tableFunction->getName() << " should be TableFunction::InterpolationType::Lower", - InputError ); + InputError, getDataContext() ); } } ); } ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/kernels/CompositionalMultiphaseWellKernels.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/kernels/CompositionalMultiphaseWellKernels.cpp index ee04ffa8c73..ab153369374 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/kernels/CompositionalMultiphaseWellKernels.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/kernels/CompositionalMultiphaseWellKernels.cpp @@ -680,13 +680,13 @@ PresTempCompFracInitializationKernel:: GEOS_THROW_IF( foundNegativePres.get() == 1, - wellControls.getDataContext() << "Invalid well initialization, negative pressure was found.", + "Invalid well initialization, negative pressure was found.", InputError, wellControls.getDataContext() ); GEOS_THROW_IF( foundNegativeTemp.get() == 1, - wellControls.getDataContext() << "Invalid well initialization, negative temperature was found.", + "Invalid well initialization, negative temperature was found.", InputError, wellControls.getDataContext() ); GEOS_THROW_IF( foundInconsistentCompFrac.get() == 1, - wellControls.getDataContext() << "Invalid well initialization, inconsistent component fractions were found.", + "Invalid well initialization, inconsistent component fractions were found.", InputError, wellControls.getDataContext() ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/kernels/SinglePhaseWellKernels.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/kernels/SinglePhaseWellKernels.cpp index ddd707cf9b1..5870c7c919c 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/kernels/SinglePhaseWellKernels.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/kernels/SinglePhaseWellKernels.cpp @@ -579,12 +579,12 @@ PresTempInitializationKernel:: } ); GEOS_THROW_IF( foundNegativePressure.get() == 1, - wellControls.getDataContext() << ": Invalid well initialization, negative pressure was found.", + "Invalid well initialization, negative pressure was found.", InputError, wellControls.getDataContext() ); if( isThermal ) // tjb change temp in isothermal cases shouldnt be an issue (also what if temp in fluid prop calcs like compo) { GEOS_THROW_IF( foundNegativeTemp.get() == 1, - wellControls.getDataContext() << "Invalid well initialization, negative temperature was found.", + "Invalid well initialization, negative temperature was found.", InputError, wellControls.getDataContext() ); } } diff --git a/src/coreComponents/physicsSolvers/inducedSeismicity/SpringSlider.cpp b/src/coreComponents/physicsSolvers/inducedSeismicity/SpringSlider.cpp index 345a118ed74..8aa60097e98 100644 --- a/src/coreComponents/physicsSolvers/inducedSeismicity/SpringSlider.cpp +++ b/src/coreComponents/physicsSolvers/inducedSeismicity/SpringSlider.cpp @@ -90,9 +90,8 @@ void SpringSlider< RSSOLVER_TYPE >::registerDataOnMesh( Group & meshBodies ) string & frictionLawName = subRegion.getReference< string >( viewKeyStruct::frictionLawNameString() ); frictionLawName = PhysicsSolverBase::getConstitutiveName< FrictionBase >( subRegion ); GEOS_ERROR_IF( frictionLawName.empty(), - GEOS_FMT( "{}: FrictionBase model not found on subregion {}", - this->getDataContext(), subRegion.getDataContext() ), - this->getDataContext() ); + GEOS_FMT( "FrictionBase model not found on subregion {}", subRegion.getName() ), + this->getDataContext(), subRegion.getDataContext() ); } ); } ); } diff --git a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp index 425bccfa72c..e42cf5aebca 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp @@ -151,17 +151,17 @@ 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( "{}: 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() ), + GEOS_FMT( "The input flag {} must be the same in the flow and well solvers, respectively '{}' and '{}'", + CompositionalMultiphaseBase::viewKeyStruct::useMassFlagString(), + Base::reservoirSolver()->getName(), Base::wellSolver()->getName() ), InputError, this->getDataContext(), Base::reservoirSolver()->getDataContext(), Base::wellSolver()->getDataContext() ); bool const isThermalFlow = flowSolver->getReference< integer >( CompositionalMultiphaseBase::viewKeyStruct::isThermalString() ); bool const isThermalWell = Base::wellSolver()->template getReference< integer >( CompositionalMultiphaseWell::viewKeyStruct::isThermalString() ); GEOS_THROW_IF( isThermalFlow != isThermalWell, - GEOS_FMT( "{}: the input flag {} must be the same in the flow and well solvers, respectively '{}' and '{}'", - this->getDataContext(), CompositionalMultiphaseBase::viewKeyStruct::isThermalString(), - Base::reservoirSolver()->getDataContext(), Base::wellSolver()->getDataContext() ), + GEOS_FMT( "The input flag {} must be the same in the flow and well solvers, respectively '{}' and '{}'", + CompositionalMultiphaseBase::viewKeyStruct::isThermalString(), + Base::reservoirSolver()->getName(), Base::wellSolver()->getName() ), InputError, this->getDataContext(), Base::reservoirSolver()->getDataContext(), Base::wellSolver()->getDataContext() ); } diff --git a/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.cpp b/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.cpp index fbb8e7fb935..7de02132da5 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.cpp @@ -155,8 +155,8 @@ bool validateWellPerforations( PhysicsSolverBase 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 flow solver", - wellSolver->getDataContext(), badPerforation.first, badPerforation.second ), + GEOS_FMT( "The well {} has a connection to the region {} which is not targeted by the flow solver", + badPerforation.first, badPerforation.second ), std::runtime_error, wellSolver->getDataContext() ); return hasBadPerforations == 0; } diff --git a/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp b/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp index c6da8277ae7..f3f766f3660 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CoupledSolver.hpp @@ -108,16 +108,11 @@ class CoupledSolver : public PhysicsSolverBase using SolverType = TYPEOFPTR( SolverPtr {} ); auto const & solverName = m_names[idx()]; solver = this->getParent().template getGroupPointer< SolverType >( solverName ); - if( solver== nullptr ) - { - string const solverWrapperKey = SolverType::coupledSolverAttributePrefix() + "SolverName"; - std::ostringstream errorMessage; - errorMessage << GEOS_FMT( "{}: Could not find solver named '{}'.\n", - getWrapperDataContext( solverWrapperKey ), solverName ); - throwSolversNotFound< SolverType >( errorMessage, SolverType::coupledSolverAttributePrefix() ); - } - - + GEOS_THROW_IF( solver == nullptr, + GEOS_FMT( "{}: Could not find solver '{}' of type {}", + getDataContext(), + solverName, solverType ), + InputError, getDataContext() ); GEOS_LOG_LEVEL_RANK_0( logInfo::Coupling, GEOS_FMT( "{}: found {} solver named {}", getName(), solver->getCatalogName(), solverName ) ); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp index 18e7714e97d..ccdfb5fc4f9 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp @@ -294,7 +294,7 @@ real64 SolidMechanicsLagrangianFEM::explicitKernelDispatch( MeshLevel & mesh, else { GEOS_ERROR( getWrapperDataContext( viewKeyStruct::strainTheoryString() ) << - ": Invalid option for strain theory (0 = infinitesimal strain, 1 = finite strain" ); + "Invalid option for strain theory (0 = infinitesimal strain, 1 = finite strain" ); } return rval; @@ -575,7 +575,8 @@ real64 SolidMechanicsLagrangianFEM::explicitStep( real64 const & time_n, SortedArrayView< localIndex const > const & targetSet ) { integer const component = bc.getComponent(); - GEOS_ERROR_IF_LT_MSG( component, 0, getDataContext() << ": Component index required for displacement BC " << bc.getDataContext() ); + GEOS_ERROR_IF_LT_MSG( component, 0, "Component index required for displacement BC ", + getDataContext(), bc.getDataContext() ); forAll< parallelDevicePolicy< 1024 > >( targetSet.size(), [=] GEOS_DEVICE ( localIndex const i ) @@ -588,7 +589,8 @@ real64 SolidMechanicsLagrangianFEM::explicitStep( real64 const & time_n, SortedArrayView< localIndex const > const & targetSet ) { integer const component = bc.getComponent(); - GEOS_ERROR_IF_LT_MSG( component, 0, getDataContext() << ": Component index required for displacement BC " << bc.getDataContext() ); + GEOS_ERROR_IF_LT_MSG( component, 0, "Component index required for displacement BC ", + getDataContext(), bc.getDataContext() ); forAll< parallelDevicePolicy< 1024 > >( targetSet.size(), [=] GEOS_DEVICE ( localIndex const i ) @@ -713,14 +715,14 @@ void SolidMechanicsLagrangianFEM::applyDisplacementBCImplicit( real64 const time "\n{} {}: There is no displacement boundary condition applied to this problem in the {} direction. \n" "The problem may be ill-posed.\n"; GEOS_WARNING_IF( isDisplacementBCAppliedGlobal[0] == 0, // target set is empty - GEOS_FMT( bcLogMessage, - getCatalogName(), getDataContext(), 'x' ), getDataContext() ); + GEOS_FMT( bcLogMessage, getCatalogName(), 'x' ), + getDataContext() ); GEOS_WARNING_IF( isDisplacementBCAppliedGlobal[1] == 0, // target set is empty - GEOS_FMT( bcLogMessage, - getCatalogName(), getDataContext(), 'y' ), getDataContext() ); + GEOS_FMT( bcLogMessage, getCatalogName(), 'y' ), + getDataContext() ); GEOS_WARNING_IF( isDisplacementBCAppliedGlobal[2] == 0, // target set is empty - GEOS_FMT( bcLogMessage, - getCatalogName(), getDataContext(), 'z' ), getDataContext() ); + GEOS_FMT( bcLogMessage, getCatalogName(), 'z' ), + getDataContext() ); } } diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp index b8fe2dd7c96..56d21c77b78 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp @@ -65,8 +65,7 @@ void SolidMechanicsStateReset::postInputInitialization() Group & physicsSolverManager = problemManager.getGroup( "Solvers" ); GEOS_THROW_IF( !physicsSolverManager.hasGroup( m_solidSolverName ), - GEOS_FMT( "Task {}: physics solver named {} not found", - getDataContext(), m_solidSolverName ), + GEOS_FMT( "Task {}: physics solver named {} not found", getName(), m_solidSolverName ), InputError, getDataContext() ); m_solidSolver = &physicsSolverManager.getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/ContactSolverBase.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/ContactSolverBase.cpp index 469aa255c3d..c3f6f15affd 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/contact/ContactSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/ContactSolverBase.cpp @@ -223,7 +223,7 @@ real64 ContactSolverBase::explicitStep( real64 const & GEOS_UNUSED_PARAM( time_n DomainPartition & GEOS_UNUSED_PARAM( domain ) ) { GEOS_MARK_FUNCTION; - GEOS_ERROR( getDataContext() << ": ExplicitStep non available for contact solvers." ); + GEOS_ERROR( "ExplicitStep non available for contact solvers.",getDataContext() ); return dt; } diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp index 855864cb1e3..32340de4b36 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp @@ -1321,8 +1321,9 @@ void SolidMechanicsLagrangeContact::computeFaceNodalArea( localIndex const kf0, } else { - GEOS_ERROR( "SolidMechanicsLagrangeContact " << getDataContext() << ": face with " << numNodesPerFace << - " nodes. Only triangles and quadrilaterals and PEBI prisms up to 11 sides are supported." ); + GEOS_ERROR( "SolidMechanicsLagrangeContact : face with " << numNodesPerFace << + " nodes. Only triangles and quadrilaterals and PEBI prisms up to 11 sides are supported.", + getDataContext() ); } } @@ -1829,8 +1830,7 @@ void SolidMechanicsLagrangeContact::assembleStabilization( MeshLevel const & mes realNodes++; } } - GEOS_ERROR_IF( realNodes != 2, - getDataContext() << ": An edge shared by two fracture elements must have 2 nodes.", + GEOS_ERROR_IF( realNodes != 2, "An edge shared by two fracture elements must have 2 nodes.", getDataContext() ); edge.resize( realNodes ); diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp index 76a9fd032c4..92f84af3bcc 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp @@ -193,18 +193,15 @@ void SurfaceGenerator::postInputInitialization() static const std::set< integer > binaryOptions = { 0, 1 }; GEOS_ERROR_IF( binaryOptions.count( m_isPoroelastic ) == 0, - getWrapperDataContext( viewKeyStruct::isPoroelasticString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::isPoroelasticString() << " option can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::isPoroelasticString() ) ); GEOS_ERROR_IF( binaryOptions.count( m_nodeBasedSIF ) == 0, - getWrapperDataContext( viewKeyStruct::nodeBasedSIFString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::nodeBasedSIFString() << " option can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::nodeBasedSIFString() ) ); GEOS_ERROR_IF( binaryOptions.count( m_mpiCommOrder ) == 0, - getWrapperDataContext( viewKeyStruct::mpiCommOrderString() ) << - ": option can be either 0 (false) or 1 (true)", + viewKeyStruct::mpiCommOrderString() << " option can be either 0 (false) or 1 (true)", getWrapperDataContext( viewKeyStruct::mpiCommOrderString() ) ); } @@ -953,8 +950,7 @@ void SurfaceGenerator::synchronizeTipSets ( FaceManager & faceManager, { localIndex const parentNodeIndex = parentNodeIndices[nodeIndex]; - GEOS_ERROR_IF( parentNodeIndex == -1, - getDataContext() << ": parentNodeIndex should not be -1", + GEOS_ERROR_IF( parentNodeIndex == -1, "parentNodeIndex should not be -1", getDataContext() ); m_tipNodes.remove( parentNodeIndex ); @@ -980,8 +976,7 @@ void SurfaceGenerator::synchronizeTipSets ( FaceManager & faceManager, { localIndex const parentEdgeIndex = parentEdgeIndices[edgeIndex]; - GEOS_ERROR_IF( parentEdgeIndex == -1, - getDataContext() << ": parentEdgeIndex should not be -1", + GEOS_ERROR_IF( parentEdgeIndex == -1, "parentEdgeIndex should not be -1", getDataContext() ); m_tipEdges.remove( parentEdgeIndex ); @@ -1015,8 +1010,7 @@ void SurfaceGenerator::synchronizeTipSets ( FaceManager & faceManager, for( localIndex const faceIndex : receivedObjects.newFaces ) { localIndex const parentFaceIndex = parentFaceIndices[faceIndex]; - GEOS_ERROR_IF( parentFaceIndex == -1, - getDataContext() << ": parentFaceIndex should not be -1", + GEOS_ERROR_IF( parentFaceIndex == -1, "parentFaceIndex should not be -1", getDataContext() ); m_trailingFaces.insert( parentFaceIndex ); @@ -1267,7 +1261,7 @@ bool SurfaceGenerator::findFracturePlanes( localIndex const nodeID, if( edge[0] == INT_MAX || edge[1] == INT_MAX ) { - GEOS_ERROR( getDataContext() << ": invalid edge (SurfaceGenerator::findFracturePlanes)." ); + GEOS_ERROR( "invalid edge (SurfaceGenerator::findFracturePlanes).", getDataContext() ); } @@ -1412,11 +1406,12 @@ bool SurfaceGenerator::findFracturePlanes( localIndex const nodeID, // NOT be included in the path!!! if( nextEdge!=startingEdge && !(isEdgeExternal[nextEdge]==1 && startingEdgeExternal ) ) { - GEOS_ERROR( getDataContext() << ": Crap !" << + GEOS_ERROR( "Crap !" << " NodeID, ParentID = " << nodeID << ", " << parentNodeIndex << '\n' << " Starting Edge/Face = " << startingEdge << ", " << startingFace << '\n' << " Face Separation Path = " << facePath << '\n' << - " Edge Separation Path = " << edgePath << '\n' ); + " Edge Separation Path = " << edgePath << '\n', + getDataContext() ); } // add faces in the path to separationPathFaces @@ -1528,7 +1523,7 @@ bool SurfaceGenerator::findFracturePlanes( localIndex const nodeID, } if( pathFound == false ) { - GEOS_ERROR( getDataContext() << ": couldn't find the next face in the rupture path (SurfaceGenerator::findFracturePlanes" ); + GEOS_ERROR( "couldn't find the next face in the rupture path (SurfaceGenerator::findFracturePlanes", getDataContext() ); } } @@ -1547,7 +1542,7 @@ bool SurfaceGenerator::findFracturePlanes( localIndex const nodeID, } else { - GEOS_ERROR( getDataContext() << ": next edge in separation path is apparently connected to less than 2 ruptured face (SurfaceGenerator::findFracturePlanes" ); + GEOS_ERROR( "next edge in separation path is apparently connected to less than 2 ruptured face (SurfaceGenerator::findFracturePlanes", getDataContext() ); } } @@ -1575,7 +1570,7 @@ bool SurfaceGenerator::findFracturePlanes( localIndex const nodeID, if( edge[0] == INT_MAX || edge[1] == INT_MAX ) { - GEOS_ERROR( getDataContext() << ": invalid edge. (SurfaceGenerator::findFracturePlanes" ); + GEOS_ERROR( "invalid edge. (SurfaceGenerator::findFracturePlanes", getDataContext() ); } @@ -3210,7 +3205,7 @@ void SurfaceGenerator::calculateNodeAndFaceSif( DomainPartition const & domain, if( tralingNodeID == std::numeric_limits< localIndex >::max()) { - GEOS_ERROR( getDataContext() << ": The triangular trailing face has three tip nodes but cannot find the other trailing face containing the trailing node." ); + GEOS_ERROR( "The triangular trailing face has three tip nodes but cannot find the other trailing face containing the trailing node.", getDataContext() ); } } else if( unpinchedNodeID.size() == 1 ) @@ -3498,8 +3493,9 @@ real64 SurfaceGenerator::calculateEdgeSif( DomainPartition const & domain, } else { - GEOS_ERROR( GEOS_FMT( "{}: Edge {} has two external faces, but the parent-child relationship is wrong.", - getDataContext(), edgeID ) ); + GEOS_ERROR( GEOS_FMT( "Edge {} has two external faces, but the parent-child relationship is wrong.", + edgeID ), + getDataContext() ); } trailFaceID = faceParentIndex[faceInvolved[0]]==-1 ? faceInvolved[0] : faceParentIndex[faceInvolved[0]]; @@ -3576,7 +3572,7 @@ real64 SurfaceGenerator::calculateEdgeSif( DomainPartition const & domain, if( numSharedNodes == 4 ) { - GEOS_ERROR( getDataContext() << ": The fracture face has four shared nodes with its child. This should not happen." ); + GEOS_ERROR( "The fracture face has four shared nodes with its child. This should not happen.", getDataContext() ); } else if( numSharedNodes == 3 ) { @@ -3585,7 +3581,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( getDataContext() << ": these two faces share three nodes but the number of remaining nodes is not one." ); + GEOS_ERROR( "these two faces share three nodes but the number of remaining nodes is not one.", getDataContext() ); } else { @@ -3624,7 +3620,7 @@ real64 SurfaceGenerator::calculateEdgeSif( DomainPartition const & domain, } if( convexCorner == std::numeric_limits< localIndex >::max()) - GEOS_ERROR( getDataContext() << ": This is a three-node-pinched edge but I cannot find the convex corner" ); + GEOS_ERROR( "This is a three-node-pinched edge but I cannot find the convex corner", getDataContext() ); } @@ -3694,7 +3690,7 @@ real64 SurfaceGenerator::calculateEdgeSif( DomainPartition const & domain, if( trailingNodes.size() > 2 || trailingNodes.size() == 0 ) { - GEOS_ERROR( getDataContext() << ": Fatal error in finding nodes behind tip edge." ); + GEOS_ERROR( "Fatal error in finding nodes behind tip edge.", getDataContext() ); } else if( trailingNodes.size() == 1 ) // Need some work to find the other node { diff --git a/src/coreComponents/physicsSolvers/wavePropagation/dg/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationDG.cpp b/src/coreComponents/physicsSolvers/wavePropagation/dg/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationDG.cpp index 367118d3c4b..3890fa1e517 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/dg/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationDG.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/dg/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationDG.cpp @@ -383,7 +383,7 @@ void AcousticWaveEquationDG::initializePostInitialConditionsPreSubGroups() real64 AcousticWaveEquationDG::computeTimeStep( real64 & dtOut ) { - GEOS_ERROR( getDataContext() << ": Time-Step computation for acoustic dg wave propagator not yet implemented" ); + GEOS_ERROR( " Time-Step computation for acoustic dg wave propagator not yet implemented", getDataContext() ); return dtOut; } @@ -391,7 +391,7 @@ real64 AcousticWaveEquationDG::computeTimeStep( real64 & dtOut ) void AcousticWaveEquationDG::applyFreeSurfaceBC( real64 const time, DomainPartition & domain ) { GEOS_UNUSED_VAR( time, domain ); - GEOS_ERROR( getDataContext() << ": Free-Surface computation for acoustic dg wave propagator not yet implemented" ); + GEOS_ERROR( " Free-Surface computation for acoustic dg wave propagator not yet implemented", getDataContext() ); // FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); // FunctionManager const & functionManager = FunctionManager::getInstance(); // diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEM.cpp index 35446a74147..1dbb298ceca 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEM.cpp @@ -212,7 +212,7 @@ void AcousticFirstOrderWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLev CellElementSubRegion & elementSubRegion ) { GEOS_THROW_IF( elementSubRegion.getElementType() != ElementType::Hexahedron, - getDataContext() << ": Invalid type of element, the acoustic solver is designed for hexahedral meshes only (C3D8) ", + "Invalid type of element, the acoustic solver is designed for hexahedral meshes only (C3D8) ", InputError, getDataContext() ); arrayView2d< localIndex const > const elemsToFaces = elementSubRegion.faceList(); @@ -349,7 +349,7 @@ void AcousticFirstOrderWaveEquationSEM::initializePostInitialConditionsPreSubGro real64 AcousticFirstOrderWaveEquationSEM::computeTimeStep( real64 & dtOut ) { - GEOS_ERROR( getDataContext() << ": Time-Step computation for the first order acoustic wave propagator not yet implemented" ); + GEOS_ERROR( " Time-Step computation for the first order acoustic wave propagator not yet implemented", getDataContext() ); return dtOut; } @@ -432,7 +432,7 @@ real64 AcousticFirstOrderWaveEquationSEM::explicitStepBackward( real64 const & t DomainPartition & domain, integer GEOS_UNUSED_PARAM( computeGradient ) ) { - GEOS_ERROR( getDataContext() << ": Backward propagation for the first-order wave propagator not yet implemented" ); + GEOS_ERROR( "Backward propagation for the first-order wave propagator not yet implemented", getDataContext() ); real64 dtOut = explicitStepInternal( time_n, dt, cycleNumber, domain ); return dtOut; } @@ -590,12 +590,12 @@ void AcousticFirstOrderWaveEquationSEM::cleanup( real64 const time_n, integer co void AcousticFirstOrderWaveEquationSEM::initializePML() { - GEOS_ERROR( getDataContext() << ": PML for the first order acoustic wave propagator not yet implemented" ); + GEOS_ERROR( "PML for the first order acoustic wave propagator not yet implemented", getDataContext() ); } void AcousticFirstOrderWaveEquationSEM::applyPML( real64 const, DomainPartition & ) { - GEOS_ERROR( getDataContext() << ": PML for the first order acoustic wave propagator not yet implemented" ); + GEOS_ERROR( "PML for the first order acoustic wave propagator not yet implemented", getDataContext() ); } REGISTER_CATALOG_ENTRY( PhysicsSolverBase, AcousticFirstOrderWaveEquationSEM, string const &, dataRepository::Group * const ) diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEM.cpp index 815be667e88..a9a9206afdc 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEM.cpp @@ -359,7 +359,7 @@ void AcousticVTIWaveEquationSEM::initializePostInitialConditionsPreSubGroups() real64 AcousticVTIWaveEquationSEM::computeTimeStep( real64 & dtOut ) { - GEOS_ERROR( getDataContext() << ": Time-Step computation for the second order acoustic vti wave propagator not yet implemented" ); + GEOS_ERROR( "Time-Step computation for the second order acoustic vti wave propagator not yet implemented", getDataContext() ); return dtOut; } diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp index 6190586dded..ec377cd1afd 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp @@ -221,7 +221,7 @@ void AcousticWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLevel & baseM CellElementSubRegion & elementSubRegion ) { GEOS_THROW_IF( elementSubRegion.getElementType() != ElementType::Hexahedron, - getDataContext() << ": Invalid type of element, the acoustic solver is designed for hexahedral meshes only (C3D8), using the SEM formulation", + "Invalid type of element, the acoustic solver is designed for hexahedral meshes only (C3D8), using the SEM formulation", InputError, getDataContext() ); arrayView2d< localIndex const > const elemsToFaces = elementSubRegion.faceList(); @@ -292,7 +292,7 @@ void AcousticWaveEquationSEM::addSourceToRightHandSide( integer const cycleNumbe arrayView2d< real32 const > const sourceValue = m_sourceValue.toViewConst(); GEOS_THROW_IF( cycleNumber > sourceValue.size( 0 ), - getDataContext() << ": Too many steps compared to array size", + "Too many steps compared to array size", std::runtime_error, getDataContext() ); forAll< EXEC_POLICY >( sourceConstants.size( 0 ), [=] GEOS_HOST_DEVICE ( localIndex const isrc ) { @@ -1039,12 +1039,12 @@ real64 AcousticWaveEquationSEM::explicitStepForward( real64 const & time_n, std::ofstream wf( fileName, std::ios::out | std::ios::binary ); GEOS_THROW_IF( !wf, - getDataContext() << ": Could not open file "<< fileName << " for writing", + "Could not open file "<< fileName << " for writing", InputError, getDataContext() ); wf.write( (char *)&p_n[0], p_n.size()*sizeof( real32 ) ); wf.close( ); GEOS_THROW_IF( !wf.good(), - getDataContext() << ": An error occured while writing "<< fileName, + "An error occured while writing "<< fileName, InputError, getDataContext() ); } @@ -1106,8 +1106,7 @@ real64 AcousticWaveEquationSEM::explicitStepBackward( real64 const & time_n, int const rank = MpiWrapper::commRank( MPI_COMM_GEOS ); std::string fileName = GEOS_FMT( "lifo/rank_{:05}/pressure_forward_{:06}_{:08}.dat", rank, m_shotIndex, cycleNumber ); std::ifstream wf( fileName, std::ios::in | std::ios::binary ); - GEOS_THROW_IF( !wf, - getDataContext() << ": Could not open file "<< fileName << " for reading", + GEOS_THROW_IF( !wf, "Could not open file "<< fileName << " for reading", InputError, getDataContext() ); p_forward.move( LvArray::MemorySpace::host, true ); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEM.cpp index 0434b2f71f9..ffc9fc8b4d3 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEM.cpp @@ -262,9 +262,8 @@ void ElasticFirstOrderWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLeve { GEOS_THROW_IF( elementSubRegion.getElementType() != ElementType::Hexahedron, - getDataContext() << ": Invalid type of element, the elastic solver is designed for hexahedral meshes only (C3D8) ", - InputError, getDataContext(), - elementSubRegion.getDataContext().getContextInfo().setPriority( -1 ) ); + "Invalid type of element, the elastic solver is designed for hexahedral meshes only (C3D8) ", + InputError, getDataContext(), elementSubRegion.getDataContext().getContextInfo().setPriority( -1 ) ); arrayView2d< localIndex const > const elemsToFaces = elementSubRegion.faceList(); arrayView2d< localIndex const, cells::NODE_MAP_USD > const & elemsToNodes = elementSubRegion.nodeList(); @@ -415,7 +414,7 @@ void ElasticFirstOrderWaveEquationSEM::initializePostInitialConditionsPreSubGrou real64 ElasticFirstOrderWaveEquationSEM::computeTimeStep( real64 & dtOut ) { - GEOS_ERROR( getDataContext() << ": Time-Step computation for the first order elastic wave propagator not yet implemented" ); + GEOS_ERROR( " Time-Step computation for the first order elastic wave propagator not yet implemented", getDataContext()); return dtOut; } @@ -499,7 +498,7 @@ real64 ElasticFirstOrderWaveEquationSEM::explicitStepBackward( real64 const & ti DomainPartition & domain, integer GEOS_UNUSED_PARAM( computeGradient ) ) { - GEOS_ERROR( getDataContext() << ": Backward propagation for the first order elastic wave propagator not yet implemented" ); + GEOS_ERROR( "Backward propagation for the first order elastic wave propagator not yet implemented", getDataContext()); real64 dtOut = explicitStepInternal( time_n, dt, cycleNumber, domain ); return dtOut; } @@ -737,12 +736,12 @@ void ElasticFirstOrderWaveEquationSEM::cleanup( real64 const time_n, void ElasticFirstOrderWaveEquationSEM::initializePML() { - GEOS_ERROR( getDataContext() << ": PML for the first order elastic wave propagator not yet implemented" ); + GEOS_ERROR( "PML for the first order elastic wave propagator not yet implemented", getDataContext()); } void ElasticFirstOrderWaveEquationSEM::applyPML( real64 const, DomainPartition & ) { - GEOS_ERROR( getDataContext() << ": PML for the first order elastic wave propagator not yet implemented" ); + GEOS_ERROR( "PML for the first order elastic wave propagator not yet implemented", getDataContext()); } REGISTER_CATALOG_ENTRY( PhysicsSolverBase, ElasticFirstOrderWaveEquationSEM, string const &, dataRepository::Group * const ) diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp index 2c16780151b..8937c8fff90 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp @@ -297,9 +297,8 @@ void ElasticWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLevel & baseMe { GEOS_THROW_IF( elementSubRegion.getElementType() != ElementType::Hexahedron, - getDataContext() << ": Invalid type of element, the elastic solver is designed for hexahedral meshes only (C3D8) ", - InputError, getDataContext(), - elementSubRegion.getDataContext().getContextInfo().setPriority( -1 ) ); + "Invalid type of element, the elastic solver is designed for hexahedral meshes only (C3D8) ", + InputError, getDataContext(), elementSubRegion.getDataContext().getContextInfo().setPriority( -1 ) ); arrayView2d< localIndex const > const elemsToFaces = elementSubRegion.faceList(); arrayView2d< localIndex const, cells::NODE_MAP_USD > const & elemsToNodes = elementSubRegion.nodeList(); @@ -767,7 +766,7 @@ void ElasticWaveEquationSEM::applyFreeSurfaceBC( real64 const time, DomainPartit } else { - GEOS_ERROR( getDataContext() << ": This option is not supported yet" ); + GEOS_ERROR( getDataContext() << "This option is not supported yet" ); } } ); } @@ -792,7 +791,7 @@ real64 ElasticWaveEquationSEM::explicitStepBackward( real64 const & time_n, DomainPartition & domain, integer GEOS_UNUSED_PARAM( computeGradient ) ) { - GEOS_ERROR( getDataContext() << ": 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, domain ); return dtOut; } @@ -1097,12 +1096,12 @@ void ElasticWaveEquationSEM::cleanup( real64 const time_n, void ElasticWaveEquationSEM::initializePML() { - GEOS_ERROR( getDataContext() << ": 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( getDataContext() << ": PML for the elastic wave propagator not yet implemented" ); + GEOS_ERROR( getDataContext() << "PML for the elastic wave propagator not yet implemented" ); } REGISTER_CATALOG_ENTRY( PhysicsSolverBase, ElasticWaveEquationSEM, string const &, dataRepository::Group * const ) diff --git a/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp b/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp index bd0561bc9b5..e013c74873f 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp @@ -336,8 +336,7 @@ void WaveSolverBase::postInputInitialization() { counter++; } ); - GEOS_THROW_IF( counter > 1, - getDataContext() << ": One single PML field specification is allowed", + GEOS_THROW_IF( counter > 1, "One single PML field specification is allowed", InputError, getDataContext() ); m_usePML = counter; @@ -460,8 +459,7 @@ localIndex WaveSolverBase::getNumNodesPerElem() FiniteElementDiscretization const * const feDiscretization = feDiscretizationManager.getGroupPointer< FiniteElementDiscretization >( m_discretizationName ); - GEOS_THROW_IF( feDiscretization == nullptr, - getDataContext() << ": FE discretization not found: " << m_discretizationName, + GEOS_THROW_IF( feDiscretization == nullptr, "FE discretization not found: " << m_discretizationName, InputError, getDataContext() ); localIndex numNodesPerElem = 0;