Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 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
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 @@ -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 */
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace geos
using namespace dataRepository;

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

Expand Down Expand Up @@ -184,6 +184,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 )

}
24 changes: 23 additions & 1 deletion src/coreComponents/fieldSpecification/FieldSpecification.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "common/DataTypes.hpp"
#include "common/format/EnumStrings.hpp"
#include "dataRepository/Group.hpp"
#include "fieldSpecification/FieldSpecificationABC.hpp"
#include "mesh/MeshObjectPath.hpp"

namespace geos
Expand All @@ -35,7 +36,7 @@ class Function;
* @class FieldSpecification
* A class to hold values for and administer a single boundary condition
*/
class FieldSpecification : public dataRepository::Group
class FieldSpecification : public FieldSpecificationABC
{
public:

Expand Down Expand Up @@ -247,6 +248,13 @@ class FieldSpecification : public dataRepository::Group
void setFieldName( string const & fieldName )
{ m_fieldName = fieldName; }

/**
* Mutator
* @param[in] component The component axis or a special value.
*/
void setComponent( int component )
{ m_component = component; }

/**
* Mutator
* @param[in] objectPath The path for the object
Expand Down Expand Up @@ -302,6 +310,20 @@ class FieldSpecification : public dataRepository::Group
*/
void setMeshObjectPath( Group const & meshBodies );

/**
* Mutator
* @param[in] beginTime Time after which the bc is allowed to be applied
*/
void setStartTime( real64 beginTime )
{ m_beginTime = beginTime; }

/**
* Mutator
* @param[in] endTime Time after which the bc will no longer be applied.
*/
void setEndTime( real64 endTime )
{ m_endTime = endTime; }

/**
* @brief Get the Mesh Object Paths object
*
Expand Down
36 changes: 36 additions & 0 deletions src/coreComponents/fieldSpecification/FieldSpecificationABC.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2024 TotalEnergies
* Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2023-2024 Chevron
* Copyright (c) 2019- GEOS/GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

#include "FieldSpecificationABC.hpp"

namespace geos
{
using namespace dataRepository;

FieldSpecificationABC::FieldSpecificationABC( string const & name, Group * parent ):
Group( name, parent )
{}

FieldSpecificationABC::~FieldSpecificationABC()
{}

FieldSpecificationABC::CatalogInterface::CatalogType &
FieldSpecificationABC::getCatalog()
{
static FieldSpecificationABC::CatalogInterface::CatalogType catalog;
return catalog;
}

}
107 changes: 107 additions & 0 deletions src/coreComponents/fieldSpecification/FieldSpecificationABC.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2024 TotalEnergies
* Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2023-2024 Chevron
* Copyright (c) 2019- GEOS/GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/**
* @file FieldSpecificationABC.hpp
*/

#ifndef GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONABC_HPP
#define GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONABC_HPP


#include "common/DataTypes.hpp"
#include "dataRepository/Group.hpp"
#include "functions/FunctionBase.hpp"
#include "functions/FunctionManager.hpp"

namespace geos
{
class Function;


/**
* @class FieldSpecificationABC
*
* Abstract Base Class grouping multiple types of field specifications.
*/
class FieldSpecificationABC : public dataRepository::Group
{
public:

/**
* @defgroup alias and functions to define statically initialized catalog
* @{
*/

/**
* alias to define the catalog type for this abstract type
*/
using CatalogInterface = dataRepository::CatalogInterface< FieldSpecificationABC,
string const &,
dataRepository::Group * const >;

/**
* @brief static function to return static catalog.
* @return the static catalog to create derived types through the static factory methods.
*/
static CatalogInterface::CatalogType & getCatalog();

/**
* @brief return the catalog name
* @return the catalog name
*/
virtual const string getCatalogName() const = 0;

/**
* @}
*/


/**
* @brief constructor
* @param name the name of the FieldSpecificationABC in the data repository
* @param parent the parent group of this group.
*/
FieldSpecificationABC( string const & name, dataRepository::Group * parent );

/**
* destructor
*/
virtual ~FieldSpecificationABC() override;


/// Deleted copy constructor
FieldSpecificationABC( FieldSpecificationABC const & ) = delete;

/// Defaulted move constructor
FieldSpecificationABC( FieldSpecificationABC && ) = default;

/// deleted copy assignment
FieldSpecificationABC & operator=( FieldSpecificationABC const & ) = delete;

/// deleted move assignement
FieldSpecificationABC & operator=( FieldSpecificationABC && ) = delete;

/**
* @brief View keys
*/
struct viewKeyStruct
{};

};

}

#endif //GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONABC_HPP
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2024 TotalEnergies
* Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2023-2024 Chevron
* Copyright (c) 2019- GEOS/GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/**
* @file FieldSpecificationFactory.cpp
*/

#include "FieldSpecificationFactory.hpp"
#include "PermeabilitySpecification.hpp"

namespace geos
{

namespace
{

template< typename ... SPEC_TYPES, typename LAMBDA >
void forExpandableSpecifications( dataRepository::Group & manager,
types::TypeList< SPEC_TYPES... >,
LAMBDA && lambda )
{
manager.template forSubGroups< SPEC_TYPES... >( std::forward< LAMBDA >( lambda ) );
}

}

void expandFieldSpecifications( dataRepository::Group & manager )
{
forExpandableSpecifications( manager, ExpandableSpecTypes{}, [&]( auto const & spec )
{
generateFieldSpecifications( spec, manager );
} );
}

} // namespace geos
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2024 TotalEnergies
* Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2023-2024 Chevron
* Copyright (c) 2019- GEOS/GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/**
* @file FieldSpecificationFactory.hpp
*/

#ifndef GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONFACTORY_HPP
#define GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONFACTORY_HPP


#include "common/TypeDispatch.hpp"
#include "dataRepository/Group.hpp"

namespace geos
{

class PermeabilitySpecification;

/**
* @brief List of high-level field specifications to expand into FieldSpecification objects.
*/
using ExpandableSpecTypes = types::TypeList< PermeabilitySpecification >;

/**
* @brief Generate FieldSpecifications based on the given "higher-level" specification
* @tparam SPEC_TYPE The type of the high-level specification
* @param specification The high-level specification used as a blueprint
* to create FieldSpecification
* @param manager The parent to store the created FieldSpecifications
*/
template< typename SPEC_TYPE >
void generateFieldSpecifications( SPEC_TYPE const & specification, dataRepository::Group & manager ) = delete;

/**
* @brief Expand high-level field specifications
* @param manager The manager group
* Expand all field specificiation listed in ExpandableSpecTypes
*/
void expandFieldSpecifications( dataRepository::Group & manager );

} // namespace geos


#endif //GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONFACTORY_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "mesh/MeshObjectPath.hpp"
#include "functions/FunctionManager.hpp"
#include "common/GEOS_RAJA_Interface.hpp"
#include "FieldSpecificationABC.hpp"

namespace geos
{
Expand Down
Loading
Loading