Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0c79a66
add FieldSpecificationABC abstract class
kdrienCG Mar 27, 2026
f234750
Move FieldSpecificationBase catalog to FieldSpecificationABC
kdrienCG Mar 27, 2026
cf11e8f
add PermeabilitySpecification
kdrienCG Mar 31, 2026
35d9a46
add FieldSpecificationFactory interface
kdrienCG Mar 31, 2026
a5ddb58
Add PermeabilitySpecificationFactory
kdrienCG Mar 31, 2026
7098e09
Add specifications factory creation logic to FieldSpecificationManager
kdrienCG Mar 31, 2026
dca1b4a
set description for scales wrapper
kdrienCG Apr 7, 2026
1efaccf
change type of m_scales to R1Tensor
kdrienCG Apr 7, 2026
e40b8c9
modify for loop type to integer
kdrienCG Apr 8, 2026
c736a7d
add RST documentation for PermeabilitySpecification
kdrienCG Apr 8, 2026
42f7c62
uncrustify
kdrienCG Apr 10, 2026
7a2d7e8
Merge branch 'develop' into feature/kdrienCG/permeabilitySpecification
kdrienCG Apr 13, 2026
16f7e43
add missing documentation
kdrienCG Apr 14, 2026
74cda9c
fix parameter name
kdrienCG Apr 14, 2026
cd4a134
Merge remote-tracking branch 'upstream/develop' into feature/kdrienCG…
kdrienCG Jun 2, 2026
0db9276
update schema
kdrienCG Jun 2, 2026
2472811
correct documentation in PermeabilitySpecification.rst
kdrienCG Jun 2, 2026
6cd3a40
fix typo in FieldSpecificationABC.hpp
kdrienCG Jun 2, 2026
588cc90
add non-negative validation
kdrienCG Jun 2, 2026
720af0c
Merge branch 'develop' into feature/kdrienCG/permeabilitySpecification
kdrienCG Jun 2, 2026
3ab20c6
modify to a lighter implementation with type dispatch
kdrienCG Jun 29, 2026
e2d1a55
Merge branch 'develop' into feature/kdrienCG/permeabilitySpecification
kdrienCG Jul 15, 2026
53309df
Merge branch 'feature/kdrienCG/nonScalarFieldSpecification' into feat…
kdrienCG Jul 15, 2026
2a604b1
Merge remote-tracking branch 'upstream/feature/kdrienCG/nonScalarFiel…
kdrienCG Jul 17, 2026
cd899ab
Merge branch 'feature/kdrienCG/nonScalarFieldSpecification' into feat…
kdrienCG Jul 17, 2026
9f93127
add optional beginTime and endTime support
kdrienCG Jul 17, 2026
067f986
add functionName size validation
kdrienCG Jul 17, 2026
996a13d
add tests
kdrienCG Jul 17, 2026
3e32d57
add errorSetMode
kdrienCG Jul 20, 2026
653bca1
🚧 new design proposal "ProcessorRegistry": more scalable (no static l…
MelReyCG Jul 24, 2026
5b5851d
🚧 proposal to reference the original DataContext
MelReyCG Jul 24, 2026
b3c9a8c
fix/accept new design proposal "ProcessorRegistry"
kdrienCG Jul 28, 2026
fc40a83
add component attribute
kdrienCG Jul 28, 2026
59c31c5
fix/accept reference to original DataContext
kdrienCG Jul 29, 2026
de24397
modify a case with a PermeabilitySpecification
kdrienCG Jul 29, 2026
cbcce92
update FieldSpecificationABC description
kdrienCG Jul 29, 2026
5d1644a
add check for valid cell region
kdrienCG Jul 29, 2026
9cfecaf
move common methods to FieldSpecificationABC
kdrienCG Jul 29, 2026
b18352b
remove redundant copy/move constructor declarations
kdrienCG Jul 29, 2026
2bfc5df
(WIP) remove fieldName
kdrienCG Jul 29, 2026
ddfd8a8
remove component
kdrienCG Jul 30, 2026
c5d9c4b
move todo comments into class code documentation
kdrienCG Jul 30, 2026
98b842d
move setNames in FieldSpecificationABC
kdrienCG Jul 30, 2026
63bd5b9
remove dead code
kdrienCG Jul 30, 2026
1e72da6
set permeabilityModelName as optional
kdrienCG Jul 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,33 +91,13 @@
</Constitutive>

<FieldSpecifications>
<FieldSpecification
name="permx"
component="0"
initialCondition="1"
<PermeabilitySpecification
name="perm"
setNames="{ all }"
objectPath="ElementRegions/reservoir/block"
fieldName="rockPerm_permeability"
functionName="permxFunc"
scale="9.869233e-16"/>
<FieldSpecification
name="permy"
component="1"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/reservoir/block"
fieldName="rockPerm_permeability"
functionName="permyFunc"
scale="9.869233e-16"/>
<FieldSpecification
name="permz"
component="2"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/reservoir/block"
fieldName="rockPerm_permeability"
functionName="permzFunc"
scale="9.869233e-16"/>
regionNames="reservoir/block"
permeabilityModelName="rockPerm"
functionName="{ permxFunc, permyFunc, permzFunc }"
scale="{ 9.869233e-16, 9.869233e-16, 9.869233e-16 }"/>

<FieldSpecification
name="referencePorosity"
Expand Down
5 changes: 5 additions & 0 deletions src/coreComponents/dataRepository/Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ string Group::getPath() const
return noProblem.empty() ? "/" : noProblem;
}

void Group::setDataContextReference( Group const & referencedGroup )
{
m_dataContext = std::make_unique< GroupContext >( referencedGroup, getName() );
}

string Group::processInputName( xmlWrapper::xmlNode const & targetNode,
xmlWrapper::xmlNodePos const & targetNodePos,
string_view parentNodeName,
Expand Down
6 changes: 6 additions & 0 deletions src/coreComponents/dataRepository/Group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,12 @@ class Group
DataContext const & getDataContext() const
{ return *m_dataContext; }

/**
* @brief Allow to define a different data context for the instance, typically when we want to show another
* group when an error occurs.
*/
void setDataContextReference( Group const & referencedGroup );

/**
* @return DataContext object that that stores contextual information on a wrapper contained by
* this group that can be used in output messages.
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/dataRepository/GroupContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ namespace dataRepository
{


GroupContext::GroupContext( Group & group, string_view objectName ):
GroupContext::GroupContext( Group const & group, string_view objectName ):
DataContext( objectName ),
m_group( group )
{}
GroupContext::GroupContext( Group & group ):
GroupContext::GroupContext( Group const & group ):
GroupContext( group, group.getName() )
{}

Expand Down
18 changes: 9 additions & 9 deletions src/coreComponents/dataRepository/GroupContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ class GroupContext : public DataContext
* @brief Construct a new GroupContext object
* @param group The reference to the Group related to this GroupContext.
*/
GroupContext( Group & group );
GroupContext( Group const & group );

/**
* @brief Construct a new GroupContext object
* @param group The reference to the Group related to this GroupContext.
* @param objectName Target object name.
*/
GroupContext( Group const & group, string_view objectName );

/**
* @return the reference to the Group related to this GroupContext.
Expand All @@ -52,15 +59,8 @@ class GroupContext : public DataContext

protected:

/**
* @brief Construct a new GroupContext object
* @param group The reference to the Group related to this GroupContext.
* @param objectName Target object name.
*/
GroupContext( Group & group, string_view objectName );

/// The reference to the Group related to this GroupContext.
Group & m_group;
Group const & m_group;

private:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ AquiferBoundaryCondition::KernelWrapper AquiferBoundaryCondition::createKernelWr
pressureInfluenceFunction.createKernelWrapper() );
}

REGISTER_CATALOG_ENTRY( FieldSpecification, AquiferBoundaryCondition, string const &, Group * const )
REGISTER_CATALOG_ENTRY( FieldSpecificationABC, AquiferBoundaryCondition, string const &, Group * const )


} /* namespace geos */
6 changes: 6 additions & 0 deletions src/coreComponents/fieldSpecification/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ set( fieldSpecification_headers
DirichletBoundaryCondition.hpp
EquilibriumInitialCondition.hpp
FieldSpecification.hpp
FieldSpecificationABC.hpp
FieldSpecificationFactory.hpp
FieldSpecificationManager.hpp
FieldSpecificationImpl.hpp
SourceFluxBoundaryCondition.hpp
TractionBoundaryCondition.hpp
AquiferBoundaryCondition.hpp
PerfectlyMatchedLayer.hpp
PermeabilitySpecification.hpp
)

#
Expand All @@ -41,11 +44,14 @@ set( fieldSpecification_sources
DirichletBoundaryCondition.cpp
EquilibriumInitialCondition.cpp
FieldSpecification.cpp
FieldSpecificationABC.cpp
FieldSpecificationFactory.cpp
FieldSpecificationManager.cpp
SourceFluxBoundaryCondition.cpp
TractionBoundaryCondition.cpp
AquiferBoundaryCondition.cpp
PerfectlyMatchedLayer.cpp
PermeabilitySpecification.cpp
)

set( dependencyList ${parallelDeps} mesh )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ DirichletBoundaryCondition::~DirichletBoundaryCondition()



REGISTER_CATALOG_ENTRY( FieldSpecification, DirichletBoundaryCondition, string const &, Group * const )
REGISTER_CATALOG_ENTRY( FieldSpecificationABC, DirichletBoundaryCondition, string const &, Group * const )

} /* namespace geos */
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void EquilibriumInitialCondition::initializePreSubGroups()
}
}

REGISTER_CATALOG_ENTRY( FieldSpecification, EquilibriumInitialCondition, string const &, Group * const )
REGISTER_CATALOG_ENTRY( FieldSpecificationABC, EquilibriumInitialCondition, string const &, Group * const )


} /* namespace geos */
75 changes: 10 additions & 65 deletions src/coreComponents/fieldSpecification/FieldSpecification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,10 @@ namespace geos
using namespace dataRepository;

FieldSpecification::FieldSpecification( string const & name, Group * parent ):
Group( name, parent )
FieldSpecificationABC( name, parent )
{
setInputFlags( InputFlags::OPTIONAL_NONUNIQUE );

registerWrapper( viewKeyStruct::setNamesString(), &m_setNames ).
setRTTypeName( rtTypes::CustomTypes::groupNameRefArray ).
setInputFlag( InputFlags::REQUIRED ).
setSizedFromParent( 0 ).
setDescription( "Names of sets that the boundary condition is applied to.\n"
"A set can contain heterogeneous elements in the mesh (volumes, nodes, faces, edges).\n"
"A set can be be defined by a 'Geometry' component, or correspond to imported sets in case of an external mesh" );

registerWrapper( viewKeyStruct::objectPathString(), &m_objectPath ).
setRTTypeName( rtTypes::CustomTypes::groupNameRef ).
setInputFlag( InputFlags::OPTIONAL ).
Expand All @@ -54,42 +46,6 @@ FieldSpecification::FieldSpecification( string const & name, Group * parent ):
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Direction to apply boundary condition to." );

registerWrapper( viewKeyStruct::functionNamesString(), &m_functionNames ).
setRTTypeName( rtTypes::CustomTypes::groupNameRefArray ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Name(s) of function(s) that specifies variation of the boundary condition." );

registerWrapper( viewKeyStruct::scalesString(), &m_scales ).
setApplyDefaultValue( 0.0 ).
setInputFlag( InputFlags::OPTIONAL ).
setSizedFromParent( 0 ).
setDescription( "Apply scaling factor(s) for the value(s) of the boundary condition." );

registerWrapper( viewKeyStruct::initialConditionString(), &m_initialCondition ).
setApplyDefaultValue( 0 ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Boundary condition is applied as an initial condition." );

registerWrapper( viewKeyStruct::beginTimeString(), &m_beginTime ).
setApplyDefaultValue( -1.0e99 ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Time at which the boundary condition will start being applied." );

registerWrapper( viewKeyStruct::endTimeString(), &m_endTime ).
setApplyDefaultValue( 1.0e99 ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Time at which the boundary condition will stop being applied." );

registerWrapper( viewKeyStruct::errorSetModeString(), &m_emptySetErrorMode ).
setInputFlag( InputFlags::OPTIONAL ).
setApplyDefaultValue( SetErrorMode::error ).
setDescription( GEOS_FMT( "Set the log state when a “set” does not target any region\n"
"When set to \"{}\", no output.\n"
"When set to \"{}\", output a warning.\n"
"When set to \"{}\", output a throw.\n",
EnumStrings< SetErrorMode >::toString( SetErrorMode::silent ),
EnumStrings< SetErrorMode >::toString( SetErrorMode::warning ),
EnumStrings< SetErrorMode >::toString( SetErrorMode::error ) ));
}


Expand All @@ -106,25 +62,14 @@ FieldSpecification::getCatalog()

void FieldSpecification::postInputInitialization()
{
{ // both conditions work together
GEOS_THROW_IF( !m_functionNames.empty() &&
m_functionNames.size() != 1 &&
m_functionNames.size() != static_cast< string_array::size_type >( m_scales.size() ),
GEOS_FMT ( "Size mismatch: '{}' has {} entries but '{}' has {}. "
"'{}' either must be empty, have a single entry, or be sized exactly like '{}'",
viewKeyStruct::functionNamesString(), m_functionNames.size(),
viewKeyStruct::scalesString(), m_scales.size(),
viewKeyStruct::functionNamesString(), viewKeyStruct::scalesString() ),
InputError,
getDataContext() );

GEOS_THROW_IF( m_component != -1 && m_scales.size() > 1,
GEOS_FMT ( "'{}' must not be set when '{}' has more than one value.",
viewKeyStruct::componentString(),
viewKeyStruct::scalesString() ),
InputError,
getDataContext() );
}
FieldSpecificationABC::postInputInitialization();

GEOS_THROW_IF( m_component != -1 && m_scales.size() > 1,
GEOS_FMT ( "'{}' must not be set when '{}' has more than one value.",
viewKeyStruct::componentString(),
viewKeyStruct::scalesString() ),
InputError,
getDataContext() );
}

void FieldSpecification::validateNumArrayComp( localIndex numComp )
Expand Down Expand Up @@ -184,6 +129,6 @@ void FieldSpecification::setMeshObjectPath( Group const & meshBodies )



REGISTER_CATALOG_ENTRY( FieldSpecification, FieldSpecification, string const &, Group * const )
REGISTER_CATALOG_ENTRY( FieldSpecificationABC, FieldSpecification, string const &, Group * const )

}
Loading
Loading