diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index ec41ed6c4b9..d05fec1255c 100644 --- a/.integrated_tests.yaml +++ b/.integrated_tests.yaml @@ -1,6 +1,6 @@ baselines: bucket: geosx - baseline: integratedTests/baseline_integratedTests-pr4005-17824-bac337a + baseline: integratedTests/baseline_integratedTests-pr4164-17838-91151f5 allow_fail: all: '' diff --git a/BASELINE_NOTES.md b/BASELINE_NOTES.md index 1f035eb7a2c..c01f8bc7a83 100644 --- a/BASELINE_NOTES.md +++ b/BASELINE_NOTES.md @@ -5,6 +5,10 @@ This file is designed to track changes to the integrated test baselines. Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining. These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD). +PR #4164 (2026-10-26) +===================== +Add a `Group` statistics layer for fracture surfaces. + PR #4005 (2026-10-23) ===================== Added a `Group` statistics layer for sets statistics diff --git a/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_multiphasePoromechanics_curvedFrac_smoke.xml b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_multiphasePoromechanics_curvedFrac_smoke.xml index afcecce988b..11a3610ed0c 100644 --- a/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_multiphasePoromechanics_curvedFrac_smoke.xml +++ b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_multiphasePoromechanics_curvedFrac_smoke.xml @@ -82,7 +82,7 @@ diff --git a/src/coreComponents/physicsSolvers/StatisticsAggregatorBase.hpp b/src/coreComponents/physicsSolvers/StatisticsAggregatorBase.hpp index 33d0b1480bc..14040fe452f 100644 --- a/src/coreComponents/physicsSolvers/StatisticsAggregatorBase.hpp +++ b/src/coreComponents/physicsSolvers/StatisticsAggregatorBase.hpp @@ -23,7 +23,7 @@ #include "common/DataTypes.hpp" #include "dataRepository/DataContext.hpp" #include "dataRepository/Group.hpp" -#include "mesh/CellElementRegion.hpp" +#include "mesh/ElementRegionBase.hpp" #include "mesh/MeshBody.hpp" #include "mesh/MeshLevel.hpp" @@ -102,7 +102,7 @@ class StatsAggregatorBase /** * @brief Standard function signature for any functor that applies on statistics group instances (StatsGroupType) * - param 0: OwnerType &, the group instance containing the data for which we want to aggregate the statistics (MeshLevel, - * CellElementRegion...) + * ElementRegionBase...) * - param 1: StatsAggregateGroupType &, the statistics aggregate Group where to store the data * @tparam OwnerType the concrete type of the OwnerType param */ @@ -209,7 +209,7 @@ class StatsAggregatorBase */ void forRegionStatistics( MeshLevelSet meshSet, StatsGroupType & setStats, - RegionStatsFunc< CellElementRegion & > const & functor ) const; + RegionStatsFunc< ElementRegionBase & > const & functor ) const; /** * @brief Execute the given functor on each sub-region available in the given region for the given set. @@ -217,9 +217,9 @@ class StatsAggregatorBase * @param setRegionStats the region statistics data structure for the given set. * @param functor the function to execute. */ - void forRegionStatistics( CellElementRegion & region, + void forRegionStatistics( ElementRegionBase & region, StatsGroupType & setRegionStats, - RegionStatsFunc< CellElementSubRegion & > const & functor ) const; + RegionStatsFunc< ElementSubRegionBase & > const & functor ) const; /** * @brief Get the Instance Statistics Group for the given mesh-level. @@ -399,7 +399,7 @@ class StatsAggregatorBase * @param targetSet * @note Must be implemented for each type that implements this template (CRTP). */ - void computeSubRegionRankStats( CellElementSubRegion & subRegion, + void computeSubRegionRankStats( ElementSubRegionBase & subRegion, StatsGroupType & subRegionStats, SetType const & targetSet ) const { static_cast< Impl const * >(this)->computeSubRegionRankStats( subRegion, subRegionStats, targetSet ); } diff --git a/src/coreComponents/physicsSolvers/StatisticsAggregatorBaseHelpers.hpp b/src/coreComponents/physicsSolvers/StatisticsAggregatorBaseHelpers.hpp index 103b250bd7f..c0cc92393b5 100644 --- a/src/coreComponents/physicsSolvers/StatisticsAggregatorBaseHelpers.hpp +++ b/src/coreComponents/physicsSolvers/StatisticsAggregatorBaseHelpers.hpp @@ -24,13 +24,31 @@ #include "dataRepository/DataContext.hpp" #include "dataRepository/Group.hpp" #include "mesh/CellElementRegion.hpp" -#include "mesh/CellElementSubRegion.hpp" +#include "mesh/ElementRegionBase.hpp" +#include "mesh/SurfaceElementRegion.hpp" #include "mesh/ElementRegionManager.hpp" #include "mesh/MeshLevel.hpp" namespace geos { +namespace internal +{ + +/** + * @return true if statistics are computed on this region: cell regions and surface (fracture) regions. + * Well regions are skipped. + * @param region the region to test + */ +inline bool isStatisticsRegion( ElementRegionBase const & region ) +{ + // we only process cell and surface regions (wells are skipped) + return dynamic_cast< CellElementRegion const * >( ®ion ) != nullptr || + dynamic_cast< SurfaceElementRegion const * >( ®ion ) != nullptr; +} + +} // namespace internal + inline RegionStatisticsBase::RegionStatisticsBase( string const & targetName, dataRepository::Group * const parent, string_view setName, @@ -63,11 +81,14 @@ StatsAggregatorBase< Impl >::getMeshLevelPartialSetNames( MeshLevel const & mesh { std::set< string > foundSetNames; - mesh.getElemManager().forElementRegions< CellElementRegion >( regionNames, + mesh.getElemManager().forElementRegions< ElementRegionBase >( regionNames, [&] ( localIndex &, - CellElementRegion const & region ) + ElementRegionBase const & region ) { - region.forElementSubRegions< CellElementSubRegion >( [&] ( CellElementSubRegion const & subRegion ) { + if( !internal::isStatisticsRegion( region ) ) + return; + + region.forElementSubRegions< ElementSubRegionBase >( [&] ( ElementSubRegionBase const & subRegion ) { dataRepository::Group const & sets = subRegion.sets(); sets.forWrappers< SetType >( [&] ( dataRepository::Wrapper< SetType > const & set ) { @@ -150,14 +171,14 @@ StatsAggregatorBase< Impl >::enableRegionStatisticsAggregation( RegionStatsRegis for( size_t regionId = 0; regionId < path.m_regionNames.size(); ++regionId ) { ElementRegionBase & region = elemManager.getRegion< ElementRegionBase >( path.m_regionNames[regionId] ); - if( dynamic_cast< CellElementRegion * >(®ion) != nullptr ) - { // we only process cell regions + if( internal::isStatisticsRegion( region ) ) + { StatsGroupType & setRegionStats = registerStatsFunc( meshSetStats, region.getName(), setName, m_dataOutputEnabled ); stdMap< string, SetType > & regionSetsCompounds = meshSetsCompounds.get_inserted( region.getName() ); regionFound = true; - region.forElementSubRegions< CellElementSubRegion >( [&] ( CellElementSubRegion & subRegion ) + region.forElementSubRegions< ElementSubRegionBase >( [&] ( ElementSubRegionBase & subRegion ) { registerStatsFunc( setRegionStats, subRegion.getName(), setName, false ); @@ -198,12 +219,12 @@ StatsAggregatorBase< Impl >::enableRegionStatisticsAggregation( RegionStatsRegis for( size_t regionId = 0; regionId < path.m_regionNames.size(); ++regionId ) { ElementRegionBase & region = elemManager.getRegion< ElementRegionBase >( path.m_regionNames[regionId] ); - if( dynamic_cast< CellElementRegion * >(®ion) != nullptr ) - { // we only process cell regions + if( internal::isStatisticsRegion( region ) ) + { StatsGroupType & setRegionStats = registerStatsFunc( meshSetStats, region.getName(), setName, false ); - region.forElementSubRegions< CellElementSubRegion >( [&] ( CellElementSubRegion & subRegion ) + region.forElementSubRegions< ElementSubRegionBase >( [&] ( ElementSubRegionBase & subRegion ) { registerStatsFunc( setRegionStats, subRegion.getName(), setName, false ); @@ -366,30 +387,28 @@ template< typename Impl > void StatsAggregatorBase< Impl >::forRegionStatistics( MeshLevelSet const meshSet, StatsGroupType & setStats, - RegionStatsFunc< CellElementRegion & > const & func ) const + RegionStatsFunc< ElementRegionBase & > const & func ) const { ElementRegionManager & elemManager = meshSet.mesh.getElemManager(); setStats.template forSubGroups< StatsGroupType >( [&] ( StatsGroupType & setRegionStats ) { string_view regionName = setRegionStats.getTargetName(); ElementRegionBase & region = elemManager.getRegion< ElementRegionBase >( string( regionName ) ); - CellElementRegion * cellRegion = dynamic_cast< CellElementRegion * >(®ion); // we only process cell regions - - if( cellRegion != nullptr ) - func( *cellRegion, setRegionStats ); + if( internal::isStatisticsRegion( region ) ) // we only process cell and surface regions (wells are skipped) + func( region, setRegionStats ); } ); } template< typename Impl > void -StatsAggregatorBase< Impl >::forRegionStatistics( CellElementRegion & setRegion, +StatsAggregatorBase< Impl >::forRegionStatistics( ElementRegionBase & setRegion, StatsGroupType & setRegionStats, - RegionStatsFunc< CellElementSubRegion & > const & func ) const + RegionStatsFunc< ElementSubRegionBase & > const & func ) const { setRegionStats.template forSubGroups< StatsGroupType >( [&] ( StatsGroupType & subRegionStatistics ) { string_view subRegionName = subRegionStatistics.getTargetName(); - CellElementSubRegion & subRegion = setRegion.getSubRegion< CellElementSubRegion >( string( subRegionName ) ); + ElementSubRegionBase & subRegion = setRegion.getSubRegion< ElementSubRegionBase >( string( subRegionName ) ); func( subRegion, subRegionStatistics ); } ); @@ -436,11 +455,11 @@ StatsAggregatorBase< Impl >::computeRegionsStatistics( real64 const timeRequest { initStats( setStats, timeRequest ); forRegionStatistics( meshSet, setStats, - [&, timeRequest] ( CellElementRegion & region, StatsGroupType & regionStats ) + [&, timeRequest] ( ElementRegionBase & region, StatsGroupType & regionStats ) { initStats( regionStats, timeRequest ); forRegionStatistics( region, regionStats, - [&, timeRequest] ( CellElementSubRegion & subRegion, StatsGroupType & subRegionStats ) + [&, timeRequest] ( ElementSubRegionBase & subRegion, StatsGroupType & subRegionStats ) { initStats( subRegionStats, timeRequest ); @@ -457,10 +476,10 @@ StatsAggregatorBase< Impl >::computeRegionsStatistics( real64 const timeRequest [&] ( MeshLevelSet meshSet, StatsGroupType & setStats ) { forRegionStatistics( meshSet, setStats, - [&] ( CellElementRegion & region, StatsGroupType & regionStats ) + [&] ( ElementRegionBase & region, StatsGroupType & regionStats ) { forRegionStatistics( region, regionStats, - [&] ( CellElementSubRegion &, StatsGroupType & subRegionStats ) + [&] ( ElementSubRegionBase &, StatsGroupType & subRegionStats ) { aggregateStats( regionStats, subRegionStats ); // sub-region stats finalization is disabled, it does not seem useful diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.cpp index 8bb4c3f3b6a..382d3919819 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.cpp @@ -196,7 +196,7 @@ void StatsAggregator::initStats( RegionStatistics & stats, real64 const time ) c stats.m_componentMass.setValues< serialPolicy >( 0.0 ); } -void StatsAggregator::computeSubRegionRankStats( CellElementSubRegion & subRegion, +void StatsAggregator::computeSubRegionRankStats( ElementSubRegionBase & subRegion, RegionStatistics & subRegionStats, SetType const & targetSet ) const { @@ -328,7 +328,7 @@ void StatsAggregator::postAggregateStats( RegionStatistics & stats ) { if( stats.m_totalUncompactedPoreVolume > 0 ) { - float invTotalUncompactedPoreVolume = 1.0 / stats.m_totalUncompactedPoreVolume; + real64 const invTotalUncompactedPoreVolume = 1.0 / stats.m_totalUncompactedPoreVolume; stats.m_averagePressure *= invTotalUncompactedPoreVolume; stats.m_averageTemperature *= invTotalUncompactedPoreVolume; } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.hpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.hpp index 0a403fd5646..71db4c9939d 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.hpp @@ -25,9 +25,9 @@ * |-> Level0 : MeshLevel * | |-> ElementRegions : ElementRegionManager * | | |-> elementRegionsGroup : Group - * | | |-> "Channel" : CellElementRegion + * | | |-> "Channel" : ElementRegionBase * | | | |-> elementSubRegions : Group - * | | | |-> "cb-0_0_0" : CellElementSubRegion + * | | | |-> "cb-0_0_0" : ElementSubRegionBase * | | | | | * pressure : Wrapper< real64 array > * | | | | | * temperature : Wrapper< real64 array > * | | | | |-> sets : Group @@ -37,7 +37,7 @@ * | | | | | * | | | | [...] (other fields) * | | | | - * | | | |-> "cb-0_0_1" : CellElementSubRegion + * | | | |-> "cb-0_0_1" : ElementSubRegionBase * | | | | | * pressure : Wrapper< real64 array > * | | | | | * temperature : Wrapper< real64 array > * | | | | |-> sets : Group @@ -49,9 +49,9 @@ * | | | | * | | | [...] (other sub-regions) * | | | - * | | |-> "Barrier" : CellElementRegion - * | | |-> "cb-1_0_0" : CellElementSubRegion - * | | |-> "cb-1_0_1" : CellElementSubRegion + * | | |-> "Barrier" : ElementRegionBase + * | | |-> "cb-1_0_0" : ElementSubRegionBase + * | | |-> "cb-1_0_1" : ElementSubRegionBase * | | [...] (other sub-regions) * | | * | |-> nodeManager : NodeManager @@ -159,7 +159,7 @@ class RegionStatistics : public RegionStatisticsBase /// total region pore volume real64 m_totalPoreVolume; - /// total region uncompacted pore volume (not necessarily output, useful for weighting cell pressure data) + /// total region uncompacted pore volume (not necessarily output, useful for weighting element pressure data) real64 m_totalUncompactedPoreVolume; /// phase region dynamic pore volume array1d< real64 > const m_phaseDynamicPoreVolume; @@ -311,7 +311,7 @@ class StatsAggregator : public StatsAggregatorBase< StatsAggregator > /// @cond DO_NOT_DOCUMENT void initStats( RegionStatistics & stats, real64 time ) const; - void computeSubRegionRankStats( CellElementSubRegion & subRegion, + void computeSubRegionRankStats( ElementSubRegionBase & subRegion, RegionStatistics & subRegionStats, SetType const & targetSet ) const; void aggregateStats( RegionStatistics & stats, RegionStatistics const & other ) const; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp index 2241e7815df..9eb4883d4a8 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp @@ -371,7 +371,7 @@ void StatsTask::outputLogStats( real64 const statsTime, if( logPerRegion ) { m_aggregator->forRegionStatistics( meshSet, meshSetStats, - [&] ( CellElementRegion & region, + [&] ( ElementRegionBase & region, RegionStatistics & setRegionStats ) { outputRegionStats( GEOS_FMT( "{} / {} / Region: '{}' ({} elements)", @@ -450,7 +450,7 @@ void StatsTask::outputCsvStats( real64 statsTime, outputRegionStats( meshSet.mesh.getName(), meshSet.setName, meshSetStats ); m_aggregator->forRegionStatistics( meshSet, meshSetStats, - [&] ( CellElementRegion & region, + [&] ( ElementRegionBase & region, RegionStatistics & setRegionStats ) { outputRegionStats( region.getName(), setRegionStats.getSetName(), setRegionStats ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.cpp index d7810e54414..d5565efb6f8 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.cpp @@ -92,7 +92,7 @@ void StatsAggregator::initStats( RegionStatistics & stats, real64 const time ) c stats.m_totalMass = 0.0; } -void StatsAggregator::computeSubRegionRankStats( CellElementSubRegion & subRegion, +void StatsAggregator::computeSubRegionRankStats( ElementSubRegionBase & subRegion, RegionStatistics & subRegionStats, SetType const & targetSet ) const { @@ -186,7 +186,7 @@ void StatsAggregator::postAggregateStats( RegionStatistics & stats ) { if( stats.m_totalUncompactedPoreVolume > 0 ) { - float invTotalUncompactedPoreVolume = 1.0 / stats.m_totalUncompactedPoreVolume; + real64 const invTotalUncompactedPoreVolume = 1.0 / stats.m_totalUncompactedPoreVolume; stats.m_averagePressure *= invTotalUncompactedPoreVolume; stats.m_averageTemperature *= invTotalUncompactedPoreVolume; } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.hpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.hpp index 762864cf9b8..02acd88d57b 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.hpp @@ -209,7 +209,7 @@ class StatsAggregator : public StatsAggregatorBase< StatsAggregator > /// @cond DO_NOT_DOCUMENT void initStats( RegionStatistics & stats, real64 time ) const; - void computeSubRegionRankStats( CellElementSubRegion & subRegion, + void computeSubRegionRankStats( ElementSubRegionBase & subRegion, RegionStatistics & subRegionStats, SetType const & targetSet ) const; void aggregateStats( RegionStatistics & stats, RegionStatistics const & other ) const; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsTask.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsTask.cpp index 8a8cd460bf6..75956c53dbe 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsTask.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsTask.cpp @@ -242,7 +242,7 @@ void StatsTask::outputLogStats( real64 const statsTime, if( logPerRegion ) { m_aggregator->forRegionStatistics( meshSet, meshSetStats, - [&] ( CellElementRegion & region, + [&] ( ElementRegionBase & region, RegionStatistics & setRegionStats ) { outputRegionStats( GEOS_FMT( "{} / {} / Region: '{}' ({} elements)", @@ -308,7 +308,7 @@ void StatsTask::outputCsvStats( real64 statsTime, outputRegionStats( meshSet.mesh.getName(), meshSet.setName, meshSetStats ); m_aggregator->forRegionStatistics( meshSet, meshSetStats, - [&] ( CellElementRegion & region, + [&] ( ElementRegionBase & region, RegionStatistics & setRegionStats ) { outputRegionStats( region.getName(), setRegionStats.getSetName(), setRegionStats ); diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index 83d7c5bf0e3..5be40a17911 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -5,17 +5,17 @@ - + - + - + @@ -30,17 +30,17 @@ - + - + - + @@ -65,17 +65,17 @@ - + - + - + @@ -85,17 +85,17 @@ - + - + - + @@ -110,52 +110,52 @@ - + - + - + - + - + - + - + - + - + - + @@ -165,7 +165,7 @@ - + diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index 0f2a1048b13..841191862d7 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -5,17 +5,17 @@ - + - + - + @@ -30,17 +30,17 @@ - + - + - + @@ -65,17 +65,17 @@ - + - + - + @@ -85,17 +85,17 @@ - + - + - + @@ -110,52 +110,52 @@ - + - + - + - + - + - + - + - + - + - + @@ -165,7 +165,7 @@ - +