diff --git a/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.cpp b/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.cpp
index 4a9c99a7b2f..e420fc303dc 100644
--- a/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.cpp
+++ b/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.cpp
@@ -19,13 +19,15 @@
#include "AquiferBoundaryCondition.hpp"
+#include "functions/FunctionManager.hpp"
+
namespace geos
{
using namespace dataRepository;
AquiferBoundaryCondition::AquiferBoundaryCondition( string const & name, Group * parent )
- : FieldSpecificationBase( name, parent ),
+ : FieldSpecification( name, parent ),
m_waterPhaseIndex( -1 ),
m_cumulativeFlux( 0.0 )
{
@@ -99,15 +101,15 @@ AquiferBoundaryCondition::AquiferBoundaryCondition( string const & name, Group *
registerWrapper( viewKeyStruct::cumulativeFluxString(), &m_cumulativeFlux ).
setInputFlag( InputFlags::FALSE );
- getWrapper< string >( FieldSpecificationBase::viewKeyStruct::fieldNameString() ).
+ getWrapper< string >( FieldSpecification::viewKeyStruct::fieldNameString() ).
setInputFlag( InputFlags::FALSE );
setFieldName( catalogName() );
- getWrapper< string >( FieldSpecificationBase::viewKeyStruct::objectPathString() ).
+ getWrapper< string >( FieldSpecification::viewKeyStruct::objectPathString() ).
setInputFlag( InputFlags::FALSE );
setObjectPath( "faceManager" );
- getWrapper< int >( FieldSpecificationBase::viewKeyStruct::componentString() ).
+ getWrapper< int >( FieldSpecification::viewKeyStruct::componentString() ).
setInputFlag( InputFlags::FALSE );
}
@@ -300,7 +302,7 @@ AquiferBoundaryCondition::KernelWrapper AquiferBoundaryCondition::createKernelWr
pressureInfluenceFunction.createKernelWrapper() );
}
-REGISTER_CATALOG_ENTRY( FieldSpecificationBase, AquiferBoundaryCondition, string const &, Group * const )
+REGISTER_CATALOG_ENTRY( FieldSpecification, AquiferBoundaryCondition, string const &, Group * const )
} /* namespace geos */
diff --git a/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.hpp b/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.hpp
index 275bc645ec4..8e726beed0e 100644
--- a/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.hpp
+++ b/src/coreComponents/fieldSpecification/AquiferBoundaryCondition.hpp
@@ -21,7 +21,7 @@
#ifndef GEOS_FIELDSPECIFICATION_AQUIFERBOUNDARYCONDITION_HPP
#define GEOS_FIELDSPECIFICATION_AQUIFERBOUNDARYCONDITION_HPP
-#include "FieldSpecificationBase.hpp"
+#include "FieldSpecification.hpp"
#include "functions/TableFunction.hpp"
namespace geos
@@ -31,7 +31,7 @@ namespace geos
* @class AquiferBoundaryCondition
* Holds data and methods to apply a traction boundary condition
*/
-class AquiferBoundaryCondition : public FieldSpecificationBase
+class AquiferBoundaryCondition : public FieldSpecification
{
public:
@@ -118,7 +118,7 @@ class AquiferBoundaryCondition : public FieldSpecificationBase
};
- /// @copydoc FieldSpecificationBase(string const &, dataRepository::Group *)
+ /// @copydoc FieldSpecification(string const &, dataRepository::Group *)
AquiferBoundaryCondition( string const & name, Group * parent );
/// deleted default constructor
@@ -202,7 +202,7 @@ class AquiferBoundaryCondition : public FieldSpecificationBase
/**
* @brief View keys
*/
- struct viewKeyStruct : public FieldSpecificationBase::viewKeyStruct
+ struct viewKeyStruct : public FieldSpecification::viewKeyStruct
{
// aquifer geological properties
diff --git a/src/coreComponents/fieldSpecification/CMakeLists.txt b/src/coreComponents/fieldSpecification/CMakeLists.txt
index 8dc6827d664..1ab2ae911b0 100644
--- a/src/coreComponents/fieldSpecification/CMakeLists.txt
+++ b/src/coreComponents/fieldSpecification/CMakeLists.txt
@@ -25,8 +25,9 @@ Contains:
set( fieldSpecification_headers
DirichletBoundaryCondition.hpp
EquilibriumInitialCondition.hpp
- FieldSpecificationBase.hpp
+ FieldSpecification.hpp
FieldSpecificationManager.hpp
+ FieldSpecificationImpl.hpp
SourceFluxBoundaryCondition.hpp
TractionBoundaryCondition.hpp
AquiferBoundaryCondition.hpp
@@ -39,7 +40,7 @@ set( fieldSpecification_headers
set( fieldSpecification_sources
DirichletBoundaryCondition.cpp
EquilibriumInitialCondition.cpp
- FieldSpecificationBase.cpp
+ FieldSpecification.cpp
FieldSpecificationManager.cpp
SourceFluxBoundaryCondition.cpp
TractionBoundaryCondition.cpp
diff --git a/src/coreComponents/fieldSpecification/DirichletBoundaryCondition.cpp b/src/coreComponents/fieldSpecification/DirichletBoundaryCondition.cpp
index 19a62d921dd..31ce54725c0 100644
--- a/src/coreComponents/fieldSpecification/DirichletBoundaryCondition.cpp
+++ b/src/coreComponents/fieldSpecification/DirichletBoundaryCondition.cpp
@@ -24,7 +24,7 @@ namespace geos
using namespace dataRepository;
DirichletBoundaryCondition::DirichletBoundaryCondition( string const & name, Group * const parent ):
- FieldSpecificationBase( name, parent )
+ FieldSpecification( name, parent )
{
// TODO Auto-generated constructor stub
@@ -37,6 +37,6 @@ DirichletBoundaryCondition::~DirichletBoundaryCondition()
-REGISTER_CATALOG_ENTRY( FieldSpecificationBase, DirichletBoundaryCondition, string const &, Group * const )
+REGISTER_CATALOG_ENTRY( FieldSpecification, DirichletBoundaryCondition, string const &, Group * const )
} /* namespace geos */
diff --git a/src/coreComponents/fieldSpecification/DirichletBoundaryCondition.hpp b/src/coreComponents/fieldSpecification/DirichletBoundaryCondition.hpp
index 553ac23e7dc..0803fa289d2 100644
--- a/src/coreComponents/fieldSpecification/DirichletBoundaryCondition.hpp
+++ b/src/coreComponents/fieldSpecification/DirichletBoundaryCondition.hpp
@@ -20,7 +20,7 @@
#ifndef GEOS_FIELDSPECIFICATION_DIRICHLETBOUNDARYCONDITION_HPP_
#define GEOS_FIELDSPECIFICATION_DIRICHLETBOUNDARYCONDITION_HPP_
-#include "FieldSpecificationBase.hpp"
+#include "FieldSpecification.hpp"
namespace geos
{
@@ -29,7 +29,7 @@ namespace geos
* @class DirichletBoundaryCondition
* A class to manage Dirichlet boundary conditions
*/
-class DirichletBoundaryCondition : public FieldSpecificationBase
+class DirichletBoundaryCondition : public FieldSpecification
{
public:
/// @copydoc geos::dataRepository::Group::Group( string const & name, Group * const parent )
diff --git a/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.cpp b/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.cpp
index 6e0f1181e6e..8654e47b1b5 100644
--- a/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.cpp
+++ b/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.cpp
@@ -19,6 +19,7 @@
#include "EquilibriumInitialCondition.hpp"
+#include "functions/FunctionManager.hpp"
#include "functions/TableFunction.hpp"
namespace geos
@@ -27,7 +28,7 @@ namespace geos
using namespace dataRepository;
EquilibriumInitialCondition::EquilibriumInitialCondition( string const & name, Group * parent ):
- FieldSpecificationBase( name, parent )
+ FieldSpecification( name, parent )
{
registerWrapper( viewKeyStruct::datumElevationString(), &m_datumElevation ).
setInputFlag( InputFlags::REQUIRED ).
@@ -77,18 +78,18 @@ EquilibriumInitialCondition::EquilibriumInitialCondition( string const & name, G
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Phase contacts' elevations [m]" );
- getWrapper< string >( FieldSpecificationBase::viewKeyStruct::fieldNameString() ).
+ getWrapper< string >( FieldSpecification::viewKeyStruct::fieldNameString() ).
setInputFlag( InputFlags::FALSE );
setFieldName( catalogName() );
- getWrapper< int >( FieldSpecificationBase::viewKeyStruct::componentString() ).
+ getWrapper< int >( FieldSpecification::viewKeyStruct::componentString() ).
setInputFlag( InputFlags::FALSE );
- getWrapper< int >( FieldSpecificationBase::viewKeyStruct::initialConditionString() ).
+ getWrapper< int >( FieldSpecification::viewKeyStruct::initialConditionString() ).
setInputFlag( InputFlags::FALSE );
initialCondition( false ); // to make sure this is not called by applyInitialConditions
- getWrapper< string_array >( FieldSpecificationBase::viewKeyStruct::setNamesString() ).
+ getWrapper< string_array >( FieldSpecification::viewKeyStruct::setNamesString() ).
setRTTypeName( rtTypes::CustomTypes::groupNameRefArray ).
setInputFlag( InputFlags::FALSE );
addSetName( "all" );
@@ -243,7 +244,7 @@ void EquilibriumInitialCondition::initializePreSubGroups()
}
}
-REGISTER_CATALOG_ENTRY( FieldSpecificationBase, EquilibriumInitialCondition, string const &, Group * const )
+REGISTER_CATALOG_ENTRY( FieldSpecification, EquilibriumInitialCondition, string const &, Group * const )
} /* namespace geos */
diff --git a/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.hpp b/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.hpp
index 08c91e96b2f..5d5c739f241 100644
--- a/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.hpp
+++ b/src/coreComponents/fieldSpecification/EquilibriumInitialCondition.hpp
@@ -21,7 +21,7 @@
#ifndef GEOS_FIELDSPECIFICATION_EQUILIBRIUMINITIALCONDITION_HPP
#define GEOS_FIELDSPECIFICATION_EQUILIBRIUMINITIALCONDITION_HPP
-#include "FieldSpecificationBase.hpp"
+#include "FieldSpecification.hpp"
namespace geos
{
@@ -30,11 +30,11 @@ namespace geos
* @class EquilibriumInitialCondition
* Holds data to compute an hydrostatic equilibrium condition for flow problems
*/
-class EquilibriumInitialCondition : public FieldSpecificationBase
+class EquilibriumInitialCondition : public FieldSpecification
{
public:
- /// @copydoc FieldSpecificationBase(string const &, dataRepository::Group *)
+ /// @copydoc FieldSpecification(string const &, dataRepository::Group *)
EquilibriumInitialCondition( string const & name, Group * parent );
/// deleted default constructor
@@ -124,7 +124,7 @@ class EquilibriumInitialCondition : public FieldSpecificationBase
/**
* @brief View keys
*/
- struct viewKeyStruct : public FieldSpecificationBase::viewKeyStruct
+ struct viewKeyStruct : public FieldSpecification::viewKeyStruct
{
// equilibration parameters
diff --git a/src/coreComponents/fieldSpecification/FieldSpecificationBase.cpp b/src/coreComponents/fieldSpecification/FieldSpecification.cpp
similarity index 90%
rename from src/coreComponents/fieldSpecification/FieldSpecificationBase.cpp
rename to src/coreComponents/fieldSpecification/FieldSpecification.cpp
index 94e78e7e06a..74f910d6cb4 100644
--- a/src/coreComponents/fieldSpecification/FieldSpecificationBase.cpp
+++ b/src/coreComponents/fieldSpecification/FieldSpecification.cpp
@@ -13,15 +13,13 @@
* ------------------------------------------------------------------------------------------------------------
*/
-#include "FieldSpecificationBase.hpp"
-
-#include "fieldSpecification/FieldSpecificationManager.hpp"
+#include "FieldSpecification.hpp"
namespace geos
{
using namespace dataRepository;
-FieldSpecificationBase::FieldSpecificationBase( string const & name, Group * parent ):
+FieldSpecification::FieldSpecification( string const & name, Group * parent ):
Group( name, parent )
{
setInputFlags( InputFlags::OPTIONAL_NONUNIQUE );
@@ -99,19 +97,19 @@ FieldSpecificationBase::FieldSpecificationBase( string const & name, Group * par
}
-FieldSpecificationBase::~FieldSpecificationBase()
+FieldSpecification::~FieldSpecification()
{}
-FieldSpecificationBase::CatalogInterface::CatalogType &
-FieldSpecificationBase::getCatalog()
+FieldSpecification::CatalogInterface::CatalogType &
+FieldSpecification::getCatalog()
{
- static FieldSpecificationBase::CatalogInterface::CatalogType catalog;
+ static FieldSpecification::CatalogInterface::CatalogType catalog;
return catalog;
}
-void FieldSpecificationBase::setMeshObjectPath( Group const & meshBodies )
+void FieldSpecification::setMeshObjectPath( Group const & meshBodies )
{
try
{
@@ -131,6 +129,6 @@ void FieldSpecificationBase::setMeshObjectPath( Group const & meshBodies )
-REGISTER_CATALOG_ENTRY( FieldSpecificationBase, FieldSpecificationBase, string const &, Group * const )
+REGISTER_CATALOG_ENTRY( FieldSpecification, FieldSpecification, string const &, Group * const )
}
diff --git a/src/coreComponents/fieldSpecification/FieldSpecification.hpp b/src/coreComponents/fieldSpecification/FieldSpecification.hpp
new file mode 100644
index 00000000000..da0caa4195c
--- /dev/null
+++ b/src/coreComponents/fieldSpecification/FieldSpecification.hpp
@@ -0,0 +1,326 @@
+/*
+ * ------------------------------------------------------------------------------------------------------------
+ * 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 FieldSpecification.hpp
+ */
+
+#ifndef GEOS_FIELDSPECIFICATION_FIELDSPECIFICATION_HPP
+#define GEOS_FIELDSPECIFICATION_FIELDSPECIFICATION_HPP
+
+
+#include "common/DataTypes.hpp"
+#include "common/format/EnumStrings.hpp"
+#include "dataRepository/Group.hpp"
+#include "mesh/MeshObjectPath.hpp"
+
+namespace geos
+{
+class Function;
+
+
+/**
+ * @class FieldSpecification
+ * A class to hold values for and administer a single boundary condition
+ */
+class FieldSpecification : public dataRepository::Group
+{
+public:
+
+ /**
+ * @defgroup alias and functions to defined statically initialized catalog
+ * @{
+ */
+
+ /**
+ * alias to define the catalog type for this base type
+ */
+ using CatalogInterface = dataRepository::CatalogInterface< FieldSpecification,
+ string const &,
+ dataRepository::Group * const >;
+ /**
+ * @enum SetErrorMode
+ * @brief Indicate the error handling mode.
+ */
+ enum class SetErrorMode : integer
+ {
+ silent,
+ error,
+ warning
+ };
+
+ /**
+ * @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 Static Factory Catalog Functions
+ * @return the catalog name
+ */
+ static string catalogName() { return "FieldSpecification"; }
+
+ /**
+ * @brief return the catalog name
+ * @return the catalog name
+ */
+ virtual const string getCatalogName() const
+ { return FieldSpecification::catalogName(); }
+
+ /**
+ * @}
+ */
+
+
+ /**
+ * @brief constructor
+ * @param name the name of the FieldSpecification in the data repository
+ * @param parent the parent group of this group.
+ */
+ FieldSpecification( string const & name, dataRepository::Group * parent );
+
+ /**
+ * destructor
+ */
+ virtual ~FieldSpecification() override;
+
+
+ /// Deleted copy constructor
+ FieldSpecification( FieldSpecification const & ) = delete;
+
+ /// Defaulted move constructor
+ FieldSpecification( FieldSpecification && ) = default;
+
+ /// deleted copy assignment
+ FieldSpecification & operator=( FieldSpecification const & ) = delete;
+
+ /// deleted move assignement
+ FieldSpecification & operator=( FieldSpecification && ) = delete;
+
+ /**
+ * @brief View keys
+ */
+ struct viewKeyStruct
+ {
+ /// @return The key for setName
+ constexpr static char const * setNamesString() { return "setNames"; }
+ /// @return The key for constitutivePath
+ constexpr static char const * constitutivePathString() { return "constitutivePath"; }
+ /// @return The key for objectPath
+ constexpr static char const * objectPathString() { return "objectPath"; }
+ /// @return The key for fieldName
+ constexpr static char const * fieldNameString() { return "fieldName"; }
+ /// @return The key for dataType
+ constexpr static char const * dataTypeString() { return "dataType"; }
+ /// @return The key for component
+ constexpr static char const * componentString() { return "component"; }
+ /// @return The key for direction
+ constexpr static char const * directionString() { return "direction"; }
+ /// @return The key for bcApplicationTableName
+ constexpr static char const * bcApplicationTableNameString() { return "bcApplicationTableName"; }
+ /// @return The key for scale
+ constexpr static char const * scaleString() { return "scale"; }
+ /// @return The key for functionName
+ constexpr static char const * functionNameString() { return "functionName"; }
+ /// @return The key for initialCondition
+ constexpr static char const * initialConditionString() { return "initialCondition"; }
+ /// @return The key for beginTime
+ constexpr static char const * beginTimeString() { return "beginTime"; }
+ /// @return The key for endTime
+ constexpr static char const * endTimeString() { return "endTime"; }
+ /// @return The key errorSetMode
+ constexpr static char const * errorSetModeString() { return "errorSetMode"; }
+ };
+
+ /**
+ * Accessor
+ * @return const reference to m_function
+ */
+ string const & getFunctionName() const
+ { return m_functionName; }
+
+ /**
+ * Accessor
+ * @return const reference to m_objectPath
+ */
+ virtual const string & getObjectPath() const
+ { return m_objectPath; }
+
+ /**
+ * Accessor
+ * @return const reference to m_fieldName
+ */
+ virtual const string & getFieldName() const
+ { return m_fieldName; }
+
+ /**
+ * Accessing the considered component.
+ * @return The component axis or a special value.
+ */
+ virtual int getComponent() const
+ { return m_component; }
+
+ /**
+ * Accessor
+ * @return const reference to m_direction
+ */
+ virtual R1Tensor const & getDirection() const
+ { return m_direction; }
+
+ /**
+ * Accessor
+ * @return const m_beginTime
+ */
+ real64 getStartTime() const
+ { return m_beginTime; }
+
+ /**
+ * Accessor
+ * @return const m_endTime
+ */
+ real64 getEndTime() const
+ { return m_endTime; }
+
+ /**
+ * Accessor
+ * @return const reference to m_setNames
+ */
+ string_array const & getSetNames() const
+ { return m_setNames; }
+
+ /**
+ * Accessor
+ * @return const m_initialCondition
+ */
+ int initialCondition() const
+ { return m_initialCondition; }
+
+ /**
+ * Accessor
+ * @return const m_scale
+ */
+ real64 getScale() const
+ { return m_scale; }
+
+ /**
+ * Mutator
+ * @param[in] fieldName The name of the field
+ */
+ void setFieldName( string const & fieldName )
+ { m_fieldName = fieldName; }
+
+ /**
+ * Mutator
+ * @param[in] objectPath The path for the object
+ */
+ void setObjectPath( string const & objectPath )
+ { m_objectPath = objectPath; }
+
+ /**
+ * Mutator
+ * @param[in] scale Scaling factor
+ */
+ void setScale( real64 const & scale )
+ { m_scale = scale; }
+
+ /**
+ * Mutator
+ * @param[in] isInitialCondition Logical value to indicate if it is an initial condition
+ */
+ void initialCondition( bool isInitialCondition )
+ { m_initialCondition = isInitialCondition; }
+
+ /**
+ * Mutator
+ * @param[in] setName The name of the set
+ */
+ void addSetName( string const & setName )
+ { m_setNames.emplace_back( setName ); }
+
+ /**
+ * @brief Set the Mesh Object Path object
+ *
+ * @param meshBodies The group containing all the MeshBody objects
+ */
+ void setMeshObjectPath( Group const & meshBodies );
+
+ /**
+ * @brief Get the Mesh Object Paths object
+ *
+ * @return reference to const m_meshObjectPaths
+ */
+ MeshObjectPath const & getMeshObjectPaths() const
+ { return *(m_meshObjectPaths.get()); }
+
+
+protected:
+
+
+private:
+
+
+ /// the names of the sets that the boundary condition is applied to
+ string_array m_setNames;
+
+ /// the path to the object which contains the fields that the boundary condition is applied to
+ string m_objectPath;
+
+ std::unique_ptr< MeshObjectPath > m_meshObjectPaths;
+
+ /// the name of the field the boundary condition is applied to or a key string to use for
+ /// determining whether or not to apply the boundary condition.
+ string m_fieldName;
+
+
+ /// The component the boundary condition acts on. Not used if field is a scalar.
+ int m_component;
+
+ /// The direction the boundary condition acts in.
+ R1Tensor m_direction;
+
+ /// Whether or not the boundary condition is an initial condition.
+ int m_initialCondition;
+
+ /// The name of the function used to generate values for application.
+ string m_functionName;
+
+ /// The scale factor to use on the value of the boundary condition.
+ real64 m_scale;
+
+ /// Time after which the bc is allowed to be applied
+ real64 m_beginTime;
+
+ /// Time after which the bc will no longer be applied.
+ real64 m_endTime;
+
+ /// The name of a function used to turn on and off the boundary condition.
+ string m_bcApplicationFunctionName;
+
+ /// Enum containing the possible output modes when an error occur
+ SetErrorMode m_emptySetErrorMode;
+};
+
+/**
+ * @brief Indicate the error handling mode
+ */
+ENUM_STRINGS( FieldSpecification::SetErrorMode,
+ "silent",
+ "error",
+ "warning" );
+
+}
+
+#endif //GEOS_FIELDSPECIFICATION_FIELDSPECIFICATION_HPP
diff --git a/src/coreComponents/fieldSpecification/FieldSpecificationBase.hpp b/src/coreComponents/fieldSpecification/FieldSpecificationImpl.hpp
similarity index 50%
rename from src/coreComponents/fieldSpecification/FieldSpecificationBase.hpp
rename to src/coreComponents/fieldSpecification/FieldSpecificationImpl.hpp
index 1905a4e5c36..e23419628f1 100644
--- a/src/coreComponents/fieldSpecification/FieldSpecificationBase.hpp
+++ b/src/coreComponents/fieldSpecification/FieldSpecificationImpl.hpp
@@ -14,16 +14,15 @@
*/
/**
- * @file FieldSpecificationBase.hpp
+ * @file FieldSpecificationImpl.hpp
*/
-#ifndef GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONBASE_HPP
-#define GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONBASE_HPP
+#ifndef GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONIMPL_HPP
+#define GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONIMPL_HPP
+#include "FieldSpecification.hpp"
#include "common/DataTypes.hpp"
#include "common/TypeDispatch.hpp"
-#include "codingUtilities/traits.hpp"
-#include "codingUtilities/Utilities.hpp"
#include "dataRepository/Group.hpp"
#include "functions/FunctionBase.hpp"
#include "common/FieldSpecificationOps.hpp"
@@ -38,192 +37,137 @@ class Function;
/**
- * @class FieldSpecificationBase
- * A class to hold values for and administer a single boundary condition
+ * @class FieldSpecificationImpl
+ * @brief Methods to apply field specifications
*/
-class FieldSpecificationBase : public dataRepository::Group
+class FieldSpecificationImpl
{
public:
/**
- * @defgroup alias and functions to defined statically initialized catalog
- * @{
- */
-
- /**
- * alias to define the catalog type for this base type
- */
- using CatalogInterface = dataRepository::CatalogInterface< FieldSpecificationBase,
- string const &,
- dataRepository::Group * const >;
- /**
- * @enum SetErrorMode
- * @brief Indicate the error handling mode.
- */
- enum class SetErrorMode : integer
- {
- silent,
- error,
- warning
- };
-
- /**
- * @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 Static Factory Catalog Functions
- * @return the catalog name
- */
- static string catalogName() { return "FieldSpecification"; }
-
- /**
- * @brief return the catalog name
- * @return the catalog name
- */
- virtual const string getCatalogName() const
- {
- return FieldSpecificationBase::catalogName();
- }
-
- /**
- * @}
- */
-
-
- /**
- * @brief constructor
- * @param name the name of the FieldSpecificationBase in the data repository
- * @param parent the parent group of this group.
- */
- FieldSpecificationBase( string const & name, dataRepository::Group * parent );
-
- /**
- * destructor
+ * @brief Apply this field specification to the discretization
+ *
+ * @tparam OBJECT_TYPE The type of discretization/mesh object that the
+ * specification is being applied to.
+ * @tparam BC_TYPE The type of BC being applied
+ * @tparam LAMBDA
+ * @param fs The field specification data object
+ * @param mesh The MeshLevel that the specification is applied to
+ * @param lambda The being executed
*/
- virtual ~FieldSpecificationBase() override;
-
-
- /// Deleted copy constructor
- FieldSpecificationBase( FieldSpecificationBase const & ) = delete;
-
- /// Defaulted move constructor
- FieldSpecificationBase( FieldSpecificationBase && ) = default;
-
- /// deleted copy assignment
- FieldSpecificationBase & operator=( FieldSpecificationBase const & ) = delete;
-
- /// deleted move assignement
- FieldSpecificationBase & operator=( FieldSpecificationBase && ) = delete;
+ template< typename OBJECT_TYPE, typename BC_TYPE = FieldSpecification, typename LAMBDA >
+ static void apply( BC_TYPE const & fs, MeshLevel & mesh, LAMBDA && lambda );
/**
- * @brief Apply this field specification to the discretization
+ * @brief If applicable in the current time and field, apply this field specification
+ * to the discretization
*
* @tparam OBJECT_TYPE The type of discretization/mesh object that the
* specification is being applied to.
* @tparam BC_TYPE The type of BC being applied
* @tparam LAMBDA
+ * @param fs The field specification data object
* @param mesh The MeshLevel that the specification is applied to
* @param lambda The being executed
+ * @param time The time at which the field will be evaluated. For instance if the
+ * field is a time dependent function, this is the evaluation time.
+ * @param fieldName The name of the field/variable that the value will be applied to.
+ * It may not be necessary that this name is in the data repository, as the user
+ * supplied lambda may apply whatever it condition it would like. However, this
+ * name is used for comparing against the value given in the specification.
+
+ * This function checks if the field should be applied, and applies it. More specifically,
+ * this function simply checks the values of fieldName against its FieldSpecification object
+ * and decides on whether or not to call the user defined lambda.
*/
- template< typename OBJECT_TYPE,
- typename BC_TYPE = FieldSpecificationBase,
- typename LAMBDA >
- void apply( MeshLevel & mesh,
- LAMBDA && lambda ) const
- {
- MeshObjectPath const & meshObjectPaths = this->getMeshObjectPaths();
- meshObjectPaths.forObjectsInPath< OBJECT_TYPE >( mesh,
- [&] ( OBJECT_TYPE & object )
- {
- {
- dataRepository::Group const & setGroup = object.getGroup( ObjectManagerBase::groupKeyStruct::setsString() );
- string_array setNames = this->getSetNames();
- for( auto & setName : setNames )
- {
- if( setGroup.hasWrapper( setName ) )
- {
- SortedArrayView< localIndex const > const & targetSet = setGroup.getReference< SortedArray< localIndex > >( setName );
- lambda( dynamic_cast< BC_TYPE const & >(*this), setName, targetSet, object, getFieldName() );
- }
- }
- }
- } );
- }
+ template< typename OBJECT_TYPE, typename BC_TYPE = FieldSpecification, typename LAMBDA >
+ static void apply( BC_TYPE const & fs,
+ MeshLevel & mesh,
+ LAMBDA && lambda,
+ real64 const & time,
+ string const & fieldName );
/**
* @tparam FIELD_OP type that contains static functions to apply the value to the field
+ * @param[in] fs the field specification data object.
* @param[in] field the field to apply the value to.
* @param[in] targetSet the set of indices which the value will be applied.
- * @param[in] time The time at which any time dependent functions are to be evaluated as part of the
- * application of the value.
+ * @param[in] time The time at which any time dependent functions are to be evaluated as
+ * part of the application of the value.
* @param[in] dataGroup the Group that contains the field to apply the value to.
*
* This function applies the value to a field variable.
*/
template< typename FIELD_OP, typename POLICY, typename T, int N, int USD >
- void applyFieldValueKernel( ArrayView< T, N, USD > const & field,
- SortedArrayView< localIndex const > const & targetSet,
- real64 const time,
- Group & dataGroup ) const;
+ static void applyFieldValueKernel( FieldSpecification const & fs,
+ ArrayView< T, N, USD > const & field,
+ SortedArrayView< localIndex const > const & targetSet,
+ real64 const time,
+ dataRepository::Group & dataGroup );
/**
* @tparam FIELD_OP type that contains static functions to apply the value to the field
+ * @param[in] fs the field specification data object
* @param[in] targetSet the set of indices which the value will be applied.
- * @param[in] time The time at which any time dependent functions are to be evaluated as part of the
- * application of the value.
+ * @param[in] time The time at which any time dependent functions are to be evaluated as
+ * part of the application of the value.
* @param[in] dataGroup the Group that contains the field to apply the value to.
- * @param[in] fieldname the name of the field to apply the value to.
+ * @param[in] fieldName the name of the field to apply the value to.
*
* This function applies the value to a field variable. This function is typically
* called from within the lambda to a call to FieldSpecificationManager::applyFieldValue().
*/
template< typename FIELD_OP, typename POLICY=parallelHostPolicy >
- void applyFieldValue( SortedArrayView< localIndex const > const & targetSet,
- real64 const time,
- dataRepository::Group & dataGroup,
- string const & fieldname ) const;
+ static void applyFieldValue( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
+ real64 const time,
+ dataRepository::Group & dataGroup,
+ string const & fieldName );
/**
* @brief Apply a boundary condition to a system of equations.
- * @tparam FIELD_OP A wrapper struct to define how the boundary condition operates on the variables.
- * Either \ref OpEqual or \ref OpAdd.
+ * @tparam FIELD_OP A wrapper struct to define how the boundary condition operates on
+ * the variables. Either \ref OpEqual or \ref OpAdd.
* @tparam POLICY Execution policy to use when iterating over the target set.
* @tparam T Data type of the field.
* @tparam NDIM Number of dimensions in the field array.
* @tparam USD Unit stride dimension of the field array.
+ * @param fs The field specification data object.
* @param targetSet The set of indices which the boundary condition will be applied.
- * @param time The time at which any time dependent functions are to be evaluated as part of the
- * application of the boundary condition.
+ * @param time The time at which any time dependent functions are to be evaluated as
+ * part of the application of the boundary condition.
* @param dataGroup The Group that contains the field to apply the boundary condition to.
- * @param dofMap The map from the local index of the primary field to the global degree of freedom number.
+ * @param dofMap The map from the local index of the primary field to the global degree of
+ * freedom number.
* @param dofRankOffset Offset of dof indices on current rank.
* @param matrix Local part of the system matrix.
* @param rhs Local part of the system rhs vector.
* @param fieldView Array view of the field data.
*
- * @note This function is rarely used directly. More often it is called by other ApplyBoundaryCondition functions.
+ * @note This function is rarely used directly. More often it is called by
+ * other ApplyBoundaryCondition functions.
*/
template< typename FIELD_OP, typename POLICY, typename T, int NDIM, int USD >
- void applyBoundaryConditionToSystemKernel( SortedArrayView< localIndex const > const & targetSet,
- real64 const time,
- dataRepository::Group const & dataGroup,
- arrayView1d< globalIndex const > const & dofMap,
- globalIndex const dofRankOffset,
- CRSMatrixView< real64, globalIndex const > const & matrix,
- arrayView1d< real64 > const & rhs,
- ArrayView< T const, NDIM, USD > const & fieldView ) const;
+ static void
+ applyBoundaryConditionToSystemKernel( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
+ real64 const time,
+ dataRepository::Group const & dataGroup,
+ arrayView1d< globalIndex const > const & dofMap,
+ globalIndex const dofRankOffset,
+ CRSMatrixView< real64, globalIndex const > const & matrix,
+ arrayView1d< real64 > const & rhs,
+ ArrayView< T const, NDIM, USD > const & fieldView );
/**
* @brief Apply a boundary condition to a system of equations.
- * @tparam FIELD_OP A wrapper struct to define how the boundary condition operates on the variables.
- * Either \ref OpEqual or \ref OpAdd.
+ * @tparam FIELD_OP A wrapper struct to define how the boundary condition operates on
+ * the variables. Either \ref OpEqual or \ref OpAdd.
* @tparam POLICY Execution policy to use when iterating over target set.
+ * @param[in] fs The field specification data object
* @param[in] targetSet The set of indices which the boundary condition will be applied.
- * @param[in] time The time at which any time dependent functions are to be evaluated as part of the
- * application of the boundary condition.
+ * @param[in] time The time at which any time dependent functions are to be evaluated as
+ * part of the application of the boundary condition.
* @param[in] dataGroup The Group that contains the field to apply the boundary condition to.
* @param[in] fieldName The name of the field to apply the boundary condition to.
* @param[in] dofMapName The name of the map from the local index of the primary field to the
@@ -232,61 +176,67 @@ class FieldSpecificationBase : public dataRepository::Group
* @param[in,out] matrix Local part of the system matrix.
* @param[in,out] rhs Local part of the system rhs vector.
*
- * This function applies the boundary condition to a linear system of equations. This function is
- * typically called from within the lambda to a call to BoundaryConditionManager::ApplyBoundaryCondition().
+ * This function applies the boundary condition to a linear system of equations.
+ * This function is typically called from within the lambda to a call to
+ * BoundaryConditionManager::ApplyBoundaryCondition().
*/
template< typename FIELD_OP, typename POLICY >
- void applyBoundaryConditionToSystem( SortedArrayView< localIndex const > const & targetSet,
- real64 const time,
- dataRepository::Group const & dataGroup,
- string const & fieldName,
- string const & dofMapName,
- globalIndex const dofRankOffset,
- CRSMatrixView< real64, globalIndex const > const & matrix,
- arrayView1d< real64 > const & rhs ) const;
+ static void
+ applyBoundaryConditionToSystem( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
+ real64 const time,
+ dataRepository::Group const & dataGroup,
+ string const & fieldName,
+ string const & dofMapName,
+ globalIndex const dofRankOffset,
+ CRSMatrixView< real64, globalIndex const > const & matrix,
+ arrayView1d< real64 > const & rhs );
/**
* @brief Apply a boundary condition to a system of equations.
- * @tparam FIELD_OP A wrapper struct to define how the boundary condition operates on the variables.
- * Either \ref OpEqual or \ref OpAdd.
+ * @tparam FIELD_OP A wrapper struct to define how the boundary condition operates on
+ * the variables. Either \ref OpEqual or \ref OpAdd.
* @tparam POLICY Execution policy to use when iterating over target set.
* @tparam LAMBDA The type of lambda function passed into the parameter list.
+ * @param[in] fs The field specification data object.
* @param[in] targetSet The set of indices which the boundary condition will be applied.
- * @param[in] time The time at which any time dependent functions are to be evaluated as part of the
- * application of the boundary condition.
+ * @param[in] time The time at which any time dependent functions are to be evaluated as
+ * part of the application of the boundary condition.
* @param[in] dataGroup The Group that contains the field to apply the boundary condition to.
* @param[in] dofMap The map from the local index of the primary field to the global degree of
* freedom number.
* @param[in] dofRankOffset Offset of dof indices on current rank.
* @param[inout] matrix Local part of the system matrix.
* @param[inout] rhs Local part of the system rhs vector.
- * @param[in] lambda A lambda function which defines how the value that is passed into the functions
- * provided by the FIELD_OP templated type.
+ * @param[in] lambda A lambda function which defines how the value that is passed into
+ * the functions provided by the FIELD_OP templated type.
*
- * This function applies the boundary condition to a linear system of equations. This function is
- * typically called from within the lambda to a call to
+ * This function applies the boundary condition to a linear system of equations.
+ * This function is typically called from within the lambda to a call to
* BoundaryConditionManager::ApplyBoundaryCondition().
*/
template< typename FIELD_OP, typename POLICY, typename LAMBDA >
- void
- applyBoundaryConditionToSystem( SortedArrayView< localIndex const > const & targetSet,
+ static void
+ applyBoundaryConditionToSystem( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
real64 const time,
dataRepository::Group const & dataGroup,
arrayView1d< globalIndex const > const & dofMap,
globalIndex const dofRankOffset,
CRSMatrixView< real64, globalIndex const > const & matrix,
arrayView1d< real64 > const & rhs,
- LAMBDA && lambda ) const;
+ LAMBDA && lambda );
/**
* @brief Apply a boundary condition to a system of equations.
- * @tparam FIELD_OP A wrapper struct to define how the boundary condition operates on the variables.
- * Either \ref OpEqual or \ref OpAdd.
+ * @tparam FIELD_OP A wrapper struct to define how the boundary condition operates on
+ * the variables. Either \ref OpEqual or \ref OpAdd.
* @tparam POLICY Execution policy to use when iterating over target set.
* @tparam LAMBDA The type of lambda function passed into the parameter list.
+ * @param[in] fs The field specification data object.
* @param[in] targetSet The set of indices which the boundary condition will be applied.
- * @param[in] time The time at which any time dependent functions are to be evaluated as part of the
- * application of the boundary condition.
+ * @param[in] time The time at which any time dependent functions are to be evaluated as
+ * part of the application of the boundary condition.
* @param[in] dt time step size which is applied as a factor to bc values
* @param[in] dataGroup The Group that contains the field to apply the boundary condition to.
* @param[in] dofMap The map from the local index of the primary field to the global degree of
@@ -294,16 +244,17 @@ class FieldSpecificationBase : public dataRepository::Group
* @param[in] dofRankOffset Offset of dof indices on current rank.
* @param[inout] matrix Local part of the system matrix.
* @param[inout] rhs Local part of the system rhs vector.
- * @param[in] lambda A lambda function which defines how the value that is passed into the functions
- * provided by the FIELD_OP templated type.
+ * @param[in] lambda A lambda function which defines how the value that is passed into the
+ * functions provided by the FIELD_OP templated type.
*
- * This function applies the boundary condition to a linear system of equations. This function is
- * typically called from within the lambda to a call to
+ * This function applies the boundary condition to a linear system of equations.
+ * This function is typically called from within the lambda to a call to
* BoundaryConditionManager::ApplyBoundaryCondition().
*/
template< typename FIELD_OP, typename POLICY, typename LAMBDA >
- void
- applyBoundaryConditionToSystem( SortedArrayView< localIndex const > const & targetSet,
+ static void
+ applyBoundaryConditionToSystem( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
real64 const time,
real64 const dt,
dataRepository::Group const & dataGroup,
@@ -311,40 +262,48 @@ class FieldSpecificationBase : public dataRepository::Group
globalIndex const dofRankOffset,
CRSMatrixView< real64, globalIndex const > const & matrix,
arrayView1d< real64 > const & rhs,
- LAMBDA && lambda ) const;
+ LAMBDA && lambda );
/**
- * @brief Compute the contributions that will be added/enforced to the right-hand side, and collect the corresponding dof numbers
- * @tparam FIELD_OP A wrapper struct to define how the boundary condition operates on the variables.
- * Either \ref OpEqual or \ref OpAdd.
+ * @brief Compute the contributions that will be added/enforced to the right-hand side,
+ * and collect the corresponding dof numbers
+ * @tparam FIELD_OP A wrapper struct to define how the boundary condition operates on
+ * the variables. Either \ref OpEqual or \ref OpAdd.
* @tparam POLICY Execution policy to use when iterating over target set.
* @tparam LAMBDA The type of lambda function passed into the parameter list.
+ * @param[in] fs The field specification data object.
* @param[in] targetSet The set of indices which the boundary condition will be applied.
- * @param[in] time The time at which any time dependent functions are to be evaluated as part of the
- * application of the boundary condition.
+ * @param[in] time The time at which any time dependent functions are to be evaluated as
+ * part of the application of the boundary condition.
* @param[in] dt time step size which is applied as a factor to bc values
* @param[in] dataGroup The Group that contains the field to apply the boundary condition to.
* @param[in] dofMap The map from the local index of the primary field to the global degree of
* freedom number.
* @param[in] dofRankOffset Offset of dof indices on current rank.
* @param[inout] matrix Local part of the system matrix.
- * @param[inout] dof array storing the degrees of freedom of the rhsContribution, to know where in the rhs they will be added/enforced
- * @param[inout] rhsContribution array storing the values that will be added/enforced to the right-hand side
- * @param[in] lambda A lambda function which defines how the value that is passed into the functions
- * provided by the FIELD_OP templated type.
+ * @param[inout] dof array storing the degrees of freedom of the rhsContribution, to know where
+ * in the rhs they will be added/enforced
+ * @param[inout] rhsContribution array storing the values that will be added/enforced to the
+ * right-hand side
+ * @param[in] lambda A lambda function which defines how the value that is passed into the
+ * functions provided by the FIELD_OP templated type.
*
- * Note that this function only computes the rhs contributions, but does not apply them to the right-hand side.
+ * Note that this function only computes the rhs contributions, but does not apply them
+ * to the right-hand side.
* The application of these rhs contributions is done in applyBoundaryConditionToSystem.
*
- * Why did we have to extract the computation of the rhs contributions from applyBoundaryConditionToSystem?
- * Because applyBoundaryConditionToSystem is not very well suited to apply the rhsContributions to the equation layout used in the
- * compositional solvers.
- * Therefore, the compositional solvers do not call applyBoundaryConditionToSystem, but instead call computeRhsContribution directly, and
- * apply these rhs contributions "manually" according to the equation layout used in the solver
+ * Why did we have to extract the computation of the rhs contributions from
+ * applyBoundaryConditionToSystem?
+ * Because applyBoundaryConditionToSystem is not very well suited to apply the rhsContributions
+ * to the equation layout used in the compositional solvers.
+ * Therefore, the compositional solvers do not call applyBoundaryConditionToSystem, but instead
+ * call computeRhsContribution directly, and apply these rhs contributions "manually" according
+ * to the equation layout used in the solver
*/
template< typename FIELD_OP, typename POLICY, typename LAMBDA >
- void
- computeRhsContribution( SortedArrayView< localIndex const > const & targetSet,
+ static void
+ computeRhsContribution( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
real64 const time,
real64 const dt,
dataRepository::Group const & dataGroup,
@@ -353,12 +312,12 @@ class FieldSpecificationBase : public dataRepository::Group
CRSMatrixView< real64, globalIndex const > const & matrix,
arrayView1d< globalIndex > const & dof,
arrayView1d< real64 > const & rhsContribution,
- LAMBDA && lambda ) const;
-
+ LAMBDA && lambda );
/**
* @brief Function to zero matrix rows to apply boundary conditions
* @tparam POLICY the execution policy to use when zeroing rows
+ * @param[in] fs The field specification data object
* @param[in] targetSet The set of indices which the boundary condition will be applied.
* @param[in] dofMap The map from the local index of the primary field to the global degree of
* freedom number.
@@ -367,259 +326,71 @@ class FieldSpecificationBase : public dataRepository::Group
* This function zeroes the rows of the matrix that correspond to boundary conditions.
*/
template< typename POLICY >
- void zeroSystemRowsForBoundaryCondition( SortedArrayView< localIndex const > const & targetSet,
- arrayView1d< globalIndex const > const & dofMap,
- CRSMatrixView< real64, globalIndex const > const & matrix ) const;
-
- /**
- * @brief View keys
- */
- struct viewKeyStruct
- {
- /// @return The key for setName
- constexpr static char const * setNamesString() { return "setNames"; }
- /// @return The key for constitutivePath
- constexpr static char const * constitutivePathString() { return "constitutivePath"; }
- /// @return The key for objectPath
- constexpr static char const * objectPathString() { return "objectPath"; }
- /// @return The key for fieldName
- constexpr static char const * fieldNameString() { return "fieldName"; }
- /// @return The key for dataType
- constexpr static char const * dataTypeString() { return "dataType"; }
- /// @return The key for component
- constexpr static char const * componentString() { return "component"; }
- /// @return The key for direction
- constexpr static char const * directionString() { return "direction"; }
- /// @return The key for bcApplicationTableName
- constexpr static char const * bcApplicationTableNameString() { return "bcApplicationTableName"; }
- /// @return The key for scale
- constexpr static char const * scaleString() { return "scale"; }
- /// @return The key for functionName
- constexpr static char const * functionNameString() { return "functionName"; }
- /// @return The key for initialCondition
- constexpr static char const * initialConditionString() { return "initialCondition"; }
- /// @return The key for beginTime
- constexpr static char const * beginTimeString() { return "beginTime"; }
- /// @return The key for endTime
- constexpr static char const * endTimeString() { return "endTime"; }
- /// @return The key errorSetMode
- constexpr static char const * errorSetModeString() { return "errorSetMode"; }
- };
-
- /**
- * Accessor
- * @return const reference to m_function
- */
- string const & getFunctionName() const
- {
- return m_functionName;
- }
-
- /**
- * Accessor
- * @return const reference to m_objectPath
- */
- virtual const string & getObjectPath() const
- {
- return m_objectPath;
- }
-
- /**
- * Accessor
- * @return const reference to m_fieldName
- */
- virtual const string & getFieldName() const
- {
- return m_fieldName;
- }
-
- /**
- * Accessing the considered component.
- * @return The component axis or a special value.
- */
- virtual int getComponent() const
- {
- return m_component;
- }
-
- /**
- * Accessor
- * @return const reference to m_direction
- */
- virtual R1Tensor const & getDirection() const
- {
- GEOS_UNUSED_VAR( time );
- return m_direction;
- }
-
- /**
- * Accessor
- * @return const m_beginTime
- */
- real64 getStartTime() const
- {
- return m_beginTime;
- }
-
- /**
- * Accessor
- * @return const m_endTime
- */
- real64 getEndTime() const
- {
- return m_endTime;
- }
-
- /**
- * Accessor
- * @return const reference to m_setNames
- */
- string_array const & getSetNames() const
- {
- return m_setNames;
- }
-
- /**
- * Accessor
- * @return const m_initialCondition
- */
- int initialCondition() const
- {
- return m_initialCondition;
- }
-
- /**
- * Accessor
- * @return const m_scale
- */
- real64 getScale() const
- {
- return m_scale;
- }
-
- /**
- * Mutator
- * @param[in] fieldName The name of the field
- */
- void setFieldName( string const & fieldName )
- {
- m_fieldName = fieldName;
- }
-
- /**
- * Mutator
- * @param[in] objectPath The path for the object
- */
- void setObjectPath( string const & objectPath )
- {
- m_objectPath = objectPath;
- }
-
- /**
- * Mutator
- * @param[in] scale Scaling factor
- */
- void setScale( real64 const & scale )
- {
- m_scale = scale;
- }
-
- /**
- * Mutator
- * @param[in] isInitialCondition Logical value to indicate if it is an initial condition
- */
- void initialCondition( bool isInitialCondition )
- {
- m_initialCondition = isInitialCondition;
- }
+ static void
+ zeroSystemRowsForBoundaryCondition( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
+ arrayView1d< globalIndex const > const & dofMap,
+ CRSMatrixView< real64, globalIndex const > const & matrix );
+};
- /**
- * Mutator
- * @param[in] setName The name of the set
- */
- void addSetName( string const & setName )
+template< typename OBJECT_TYPE, typename BC_TYPE, typename LAMBDA >
+void FieldSpecificationImpl::apply( BC_TYPE const & fs,
+ MeshLevel & mesh,
+ LAMBDA && lambda )
+{
+ MeshObjectPath const & meshObjectPaths = fs.getMeshObjectPaths();
+ meshObjectPaths.forObjectsInPath< OBJECT_TYPE >( mesh,
+ [&] ( OBJECT_TYPE & object )
{
- m_setNames.emplace_back( setName );
- }
-
- /**
- * @brief Set the Mesh Object Path object
- *
- * @param meshBodies The group containing all the MeshBody objects
- */
- void setMeshObjectPath( Group const & meshBodies );
+ {
+ dataRepository::Group const & setGroup = object.getGroup( ObjectManagerBase::groupKeyStruct::setsString() );
+ string_array setNames = fs.getSetNames();
+ for( auto & setName : setNames )
+ {
+ if( setGroup.hasWrapper( setName ) )
+ {
+ SortedArrayView< localIndex const > const & targetSet =
+ setGroup.getReference< SortedArray< localIndex > >( setName );
+ lambda( fs, setName, targetSet, object, fs.getFieldName() );
+ }
+ }
+ }
+ } );
+}
- /**
- * @brief Get the Mesh Object Paths object
- *
- * @return reference to const m_meshObjectPaths
- */
- MeshObjectPath const & getMeshObjectPaths() const
+template< typename OBJECT_TYPE, typename BC_TYPE, typename LAMBDA >
+void FieldSpecificationImpl::apply( BC_TYPE const & fs,
+ MeshLevel & mesh,
+ LAMBDA && lambda,
+ real64 const & time,
+ string const & fieldName )
+{
+ integer const isInitialCondition = fs.initialCondition();
+ if( ( isInitialCondition && fieldName=="") || // this only use case for this line is in the unit test for field specification
+ ( !isInitialCondition && time >= fs.getStartTime()
+ && time < fs.getEndTime()
+ && fieldName == fs.getFieldName() ) )
{
- return *(m_meshObjectPaths.get());
+ FieldSpecificationImpl::apply< OBJECT_TYPE >( fs, mesh, std::forward< LAMBDA >( lambda ) );
}
-
-
-protected:
-
-
-private:
-
-
- /// the names of the sets that the boundary condition is applied to
- string_array m_setNames;
-
- /// the path to the object which contains the fields that the boundary condition is applied to
- string m_objectPath;
-
- std::unique_ptr< MeshObjectPath > m_meshObjectPaths;
-
- /// the name of the field the boundary condition is applied to or a key string to use for
- /// determining whether or not to apply the boundary condition.
- string m_fieldName;
-
-
- /// The component the boundary condition acts on. Not used if field is a scalar.
- int m_component;
-
- /// The direction the boundary condition acts in.
- R1Tensor m_direction;
-
- /// Whether or not the boundary condition is an initial condition.
- int m_initialCondition;
-
- /// The name of the function used to generate values for application.
- string m_functionName;
-
- /// The scale factor to use on the value of the boundary condition.
- real64 m_scale;
-
- /// Time after which the bc is allowed to be applied
- real64 m_beginTime;
-
- /// Time after which the bc will no longer be applied.
- real64 m_endTime;
-
- /// The name of a function used to turn on and off the boundary condition.
- string m_bcApplicationFunctionName;
-
- /// Enum containing the possible output modes when an error occur
- SetErrorMode m_emptySetErrorMode;
-};
-
+}
template< typename FIELD_OP, typename POLICY, typename T, int N, int USD >
-void FieldSpecificationBase::applyFieldValueKernel( ArrayView< T, N, USD > const & field,
- SortedArrayView< localIndex const > const & targetSet,
- real64 const time,
- Group & dataGroup ) const
+void
+FieldSpecificationImpl::
+ applyFieldValueKernel( FieldSpecification const & fs,
+ ArrayView< T, N, USD > const & field,
+ SortedArrayView< localIndex const > const & targetSet,
+ real64 const time,
+ dataRepository::Group & dataGroup )
{
- integer const component = getComponent();
+ integer const component = fs.getComponent();
+ string const & functionName = fs.getFunctionName();
FunctionManager & functionManager = FunctionManager::getInstance();
- if( m_functionName.empty() )
+ if( functionName.empty() )
{
- real64 const value = m_scale;
+ real64 const value = fs.getScale();
forAll< POLICY >( targetSet.size(), [=] GEOS_HOST_DEVICE ( localIndex const i )
{
localIndex const a = targetSet[ i ];
@@ -632,15 +403,18 @@ void FieldSpecificationBase::applyFieldValueKernel( ArrayView< T, N, USD > const
{
try
{
- return functionManager.getGroup< FunctionBase >( m_functionName );
+ return functionManager.getGroup< FunctionBase >( functionName );
}
catch( std::exception const & e )
{
string const errorMsg = GEOS_FMT( "Error while reading {}:\n",
- getWrapperDataContext( viewKeyStruct::functionNameString() ) );
+ fs.getWrapperDataContext( FieldSpecification::
+ viewKeyStruct::
+ functionNameString() ) );
ErrorLogger::global().modifyCurrentExceptionMessage()
.addToMsg( errorMsg )
- .addContextInfo( getWrapperDataContext( viewKeyStruct::functionNameString() ).getContextInfo()
+ .addContextInfo( fs.getWrapperDataContext( FieldSpecification::viewKeyStruct::functionNameString() )
+ .getContextInfo()
.setPriority( 1 ) );
throw InputError( e, errorMsg );
}
@@ -648,7 +422,7 @@ void FieldSpecificationBase::applyFieldValueKernel( ArrayView< T, N, USD > const
if( function.isFunctionOfTime()==2 )
{
- real64 const value = m_scale * function.evaluate( &time );
+ real64 const value = fs.getScale() * function.evaluate( &time );
forAll< POLICY >( targetSet.size(), [=] GEOS_HOST_DEVICE ( localIndex const i )
{
localIndex const a = targetSet[ i ];
@@ -660,7 +434,7 @@ void FieldSpecificationBase::applyFieldValueKernel( ArrayView< T, N, USD > const
real64_array result( static_cast< localIndex >( targetSet.size() ) );
function.evaluate( dataGroup, time, targetSet, result );
arrayView1d< real64 const > const & resultView = result.toViewConst();
- real64 const scale = m_scale;
+ real64 const scale = fs.getScale();
forAll< POLICY >( targetSet.size(), [=] GEOS_HOST_DEVICE ( localIndex const i )
{
localIndex const a = targetSet[ i ];
@@ -670,17 +444,19 @@ void FieldSpecificationBase::applyFieldValueKernel( ArrayView< T, N, USD > const
}
}
-
template< typename FIELD_OP, typename POLICY >
-void FieldSpecificationBase::applyFieldValue( SortedArrayView< localIndex const > const & targetSet,
- real64 const time,
- dataRepository::Group & dataGroup,
- string const & fieldName ) const
+void
+FieldSpecificationImpl::
+ applyFieldValue( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
+ real64 const time,
+ dataRepository::Group & dataGroup,
+ string const & fieldName )
{
dataRepository::WrapperBase & wrapper = dataGroup.getWrapperBase( fieldName );
- // // This function is used in setting boundary/initial conditions on simulation fields.
- // // This is meaningful for 1/2/3D real arrays and sometimes 1D integer (indicator) arrays.
+ // This function is used in setting boundary/initial conditions on simulation fields.
+ // This is meaningful for 1/2/3D real arrays and sometimes 1D integer (indicator) arrays.
using FieldTypes = types::ListofTypeList< types::Join< types::ArrayTypes< types::RealTypes, types::DimsUpTo< 3 > >,
types::ArrayTypes< types::TypeList< integer >, types::DimsSingle< 1 > > > >;
@@ -689,23 +465,37 @@ void FieldSpecificationBase::applyFieldValue( SortedArrayView< localIndex const
{
using ArrayType = camp::first< decltype( tupleOfTypes ) >;
auto & wrapperT = dataRepository::Wrapper< ArrayType >::cast( wrapper );
- applyFieldValueKernel< FIELD_OP, POLICY >( wrapperT.reference().toView(), targetSet, time, dataGroup );
+ applyFieldValueKernel< FIELD_OP, POLICY >( fs,
+ wrapperT.reference().toView(),
+ targetSet,
+ time,
+ dataGroup );
}, wrapper );
}
template< typename FIELD_OP, typename POLICY, typename T, int NDIM, int USD >
-void FieldSpecificationBase::applyBoundaryConditionToSystemKernel( SortedArrayView< localIndex const > const & targetSet,
- real64 const time,
- dataRepository::Group const & dataGroup,
- arrayView1d< globalIndex const > const & dofMap,
- globalIndex const dofRankOffset,
- CRSMatrixView< real64, globalIndex const > const & matrix,
- arrayView1d< real64 > const & rhs,
- ArrayView< T const, NDIM, USD > const & fieldView ) const
+void
+FieldSpecificationImpl::
+ applyBoundaryConditionToSystemKernel( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
+ real64 const time,
+ dataRepository::Group const & dataGroup,
+ arrayView1d< globalIndex const > const & dofMap,
+ globalIndex const dofRankOffset,
+ CRSMatrixView< real64, globalIndex const > const & matrix,
+ arrayView1d< real64 > const & rhs,
+ ArrayView< T const, NDIM, USD > const & fieldView )
{
- integer const component = getComponent();
- this->applyBoundaryConditionToSystem< FIELD_OP, POLICY >( targetSet, time, dataGroup, dofMap, dofRankOffset, matrix, rhs,
- [fieldView, component] GEOS_HOST_DEVICE ( localIndex const a )
+ integer const component = fs.getComponent();
+ applyBoundaryConditionToSystem< FIELD_OP, POLICY >( fs,
+ targetSet,
+ time,
+ dataGroup,
+ dofMap,
+ dofRankOffset,
+ matrix,
+ rhs,
+ [fieldView, component] GEOS_HOST_DEVICE ( localIndex const a )
{
real64 value = 0.0;
FieldSpecificationEqual::readFieldValue( fieldView, a, component, value );
@@ -714,14 +504,17 @@ void FieldSpecificationBase::applyBoundaryConditionToSystemKernel( SortedArrayVi
}
template< typename FIELD_OP, typename POLICY >
-void FieldSpecificationBase::applyBoundaryConditionToSystem( SortedArrayView< localIndex const > const & targetSet,
- real64 const time,
- dataRepository::Group const & dataGroup,
- string const & fieldName,
- string const & dofMapName,
- globalIndex const dofRankOffset,
- CRSMatrixView< real64, globalIndex const > const & matrix,
- arrayView1d< real64 > const & rhs ) const
+void
+FieldSpecificationImpl::
+ applyBoundaryConditionToSystem( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
+ real64 const time,
+ dataRepository::Group const & dataGroup,
+ string const & fieldName,
+ string const & dofMapName,
+ globalIndex const dofRankOffset,
+ CRSMatrixView< real64, globalIndex const > const & matrix,
+ arrayView1d< real64 > const & rhs )
{
dataRepository::WrapperBase const & wrapper = dataGroup.getWrapperBase( fieldName );
arrayView1d< globalIndex const > const & dofMap = dataGroup.getReference< array1d< globalIndex > >( dofMapName );
@@ -732,7 +525,8 @@ void FieldSpecificationBase::applyBoundaryConditionToSystem( SortedArrayView< lo
{
using ArrayType = camp::first< decltype( tupleOfTypes ) >;
auto const & wrapperT = dataRepository::Wrapper< ArrayType >::cast( wrapper );
- applyBoundaryConditionToSystemKernel< FIELD_OP, POLICY >( targetSet,
+ applyBoundaryConditionToSystemKernel< FIELD_OP, POLICY >( fs,
+ targetSet,
time,
dataGroup,
dofMap,
@@ -745,17 +539,19 @@ void FieldSpecificationBase::applyBoundaryConditionToSystem( SortedArrayView< lo
template< typename FIELD_OP, typename POLICY, typename LAMBDA >
void
-FieldSpecificationBase::
- applyBoundaryConditionToSystem( SortedArrayView< localIndex const > const & targetSet,
+FieldSpecificationImpl::
+ applyBoundaryConditionToSystem( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
real64 const time,
dataRepository::Group const & dataGroup,
arrayView1d< globalIndex const > const & dofMap,
globalIndex const dofRankOffset,
CRSMatrixView< real64, globalIndex const > const & matrix,
arrayView1d< real64 > const & rhs,
- LAMBDA && lambda ) const
+ LAMBDA && lambda )
{
- return applyBoundaryConditionToSystem< FIELD_OP, POLICY >( targetSet,
+ return applyBoundaryConditionToSystem< FIELD_OP, POLICY >( fs,
+ targetSet,
time,
1.0,
dataGroup,
@@ -768,8 +564,9 @@ FieldSpecificationBase::
template< typename FIELD_OP, typename POLICY, typename LAMBDA >
void
-FieldSpecificationBase::
- applyBoundaryConditionToSystem( SortedArrayView< localIndex const > const & targetSet,
+FieldSpecificationImpl::
+ applyBoundaryConditionToSystem( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
real64 const time,
real64 const dt,
dataRepository::Group const & dataGroup,
@@ -777,7 +574,7 @@ FieldSpecificationBase::
globalIndex const dofRankOffset,
CRSMatrixView< real64, globalIndex const > const & matrix,
arrayView1d< real64 > const & rhs,
- LAMBDA && lambda ) const
+ LAMBDA && lambda )
{
array1d< globalIndex > dofArray( targetSet.size() );
arrayView1d< globalIndex > const & dof = dofArray.toView();
@@ -785,7 +582,8 @@ FieldSpecificationBase::
array1d< real64 > rhsContributionArray( targetSet.size() );
arrayView1d< real64 > const & rhsContribution = rhsContributionArray.toView();
- computeRhsContribution< FIELD_OP, POLICY, LAMBDA >( targetSet,
+ computeRhsContribution< FIELD_OP, POLICY, LAMBDA >( fs,
+ targetSet,
time,
dt,
dataGroup,
@@ -801,8 +599,9 @@ FieldSpecificationBase::
template< typename FIELD_OP, typename POLICY, typename LAMBDA >
void
-FieldSpecificationBase::
- computeRhsContribution( SortedArrayView< localIndex const > const & targetSet,
+FieldSpecificationImpl::
+ computeRhsContribution( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
real64 const time,
real64 const dt,
dataRepository::Group const & dataGroup,
@@ -811,18 +610,20 @@ FieldSpecificationBase::
CRSMatrixView< real64, globalIndex const > const & matrix,
arrayView1d< globalIndex > const & dof,
arrayView1d< real64 > const & rhsContribution,
- LAMBDA && lambda ) const
+ LAMBDA && lambda )
{
- integer const component = ( getComponent() >=0 ) ? getComponent() : 0;
- string const & functionName = getReference< string >( viewKeyStruct::functionNameString() );
+ integer const component = ( fs.getComponent() >= 0 ) ? fs.getComponent() : 0;
+ string const & functionName = fs.getFunctionName();
FunctionManager & functionManager = FunctionManager::getInstance();
// Compute the value of the rhs terms, and collect the dof numbers
- // The rhs terms will be assembled in applyBoundaryConditionToSystem (or in the solver for CompositionalMultiphaseBase)
+ // The rhs terms will be assembled in applyBoundaryConditionToSystem
+ // (or in the solver for CompositionalMultiphaseBase)
- if( functionName.empty() || functionManager.getGroup< FunctionBase >( functionName ).isFunctionOfTime() == 2 )
+ if( functionName.empty() ||
+ functionManager.getGroup< FunctionBase >( functionName ).isFunctionOfTime() == 2 )
{
- real64 value = m_scale * dt;
+ real64 value = fs.getScale() * dt;
if( !functionName.empty() )
{
FunctionBase const & function = functionManager.getGroup< FunctionBase >( functionName );
@@ -830,7 +631,15 @@ FieldSpecificationBase::
}
forAll< POLICY >( targetSet.size(),
- [targetSet, dof, dofMap, dofRankOffset, component, matrix, rhsContribution, value, lambda] GEOS_HOST_DEVICE ( localIndex const i )
+ [targetSet,
+ dof,
+ dofMap,
+ dofRankOffset,
+ component,
+ matrix,
+ rhsContribution,
+ value,
+ lambda] GEOS_HOST_DEVICE ( localIndex const i )
{
localIndex const a = targetSet[ i ];
dof[ i ] = dofMap[ a ] + component;
@@ -849,11 +658,19 @@ FieldSpecificationBase::
real64_array resultsArray( targetSet.size() );
function.evaluate( dataGroup, time, targetSet, resultsArray );
arrayView1d< real64 const > const & results = resultsArray.toViewConst();
- real64 const value = m_scale * dt;
+ real64 const value = fs.getScale() * dt;
forAll< POLICY >( targetSet.size(),
- [targetSet, dof, dofMap, dofRankOffset, component, matrix, rhsContribution, results, value, lambda] GEOS_HOST_DEVICE (
- localIndex const i )
+ [targetSet,
+ dof,
+ dofMap,
+ dofRankOffset,
+ component,
+ matrix,
+ rhsContribution,
+ results,
+ value,
+ lambda] GEOS_HOST_DEVICE ( localIndex const i )
{
localIndex const a = targetSet[ i ];
dof[ i ] = dofMap[ a ] + component;
@@ -867,15 +684,17 @@ FieldSpecificationBase::
}
}
-
template< typename POLICY >
-void FieldSpecificationBase::zeroSystemRowsForBoundaryCondition( SortedArrayView< localIndex const > const & targetSet,
- arrayView1d< globalIndex const > const & dofMap,
- CRSMatrixView< real64, globalIndex const > const & matrix ) const
-
+void
+FieldSpecificationImpl::
+ zeroSystemRowsForBoundaryCondition( FieldSpecification const & fs,
+ SortedArrayView< localIndex const > const & targetSet,
+ arrayView1d< globalIndex const > const & dofMap,
+ CRSMatrixView< real64, globalIndex const > const & matrix )
{
- integer const component = ( getComponent() >=0 ) ? getComponent() : 0;
- forAll< POLICY >( targetSet.size(), [targetSet, dofMap, matrix, component] GEOS_HOST_DEVICE ( localIndex const i )
+ integer const component = ( fs.getComponent() >= 0 ) ? fs.getComponent() : 0;
+ forAll< POLICY >( targetSet.size(),
+ [targetSet, dofMap, matrix, component] GEOS_HOST_DEVICE ( localIndex const i )
{
localIndex const a = targetSet[ i ];
globalIndex const dof = dofMap[ a ] + component;
@@ -891,14 +710,6 @@ void FieldSpecificationBase::zeroSystemRowsForBoundaryCondition( SortedArrayView
}
-/**
- * @brief Indicate the error handling mode
- */
-ENUM_STRINGS( FieldSpecificationBase::SetErrorMode,
- "silent",
- "error",
- "warning" );
-
-}
+} /* namespace geos */
-#endif //GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONBASE_HPP
+#endif //GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONIMPL_HPP
diff --git a/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp b/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp
index 6697c275715..f5fe8126991 100644
--- a/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp
+++ b/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp
@@ -53,8 +53,8 @@ FieldSpecificationManager & FieldSpecificationManager::getInstance()
Group * FieldSpecificationManager::createChild( string const & childKey, string const & childName )
{
GEOS_LOG_RANK_0( GEOS_FMT( "{}: adding {} {}", getName(), childKey, childName ) );
- std::unique_ptr< FieldSpecificationBase > bc =
- FieldSpecificationBase::CatalogInterface::factory( childKey, getDataContext(), childName, this );
+ std::unique_ptr< FieldSpecification > bc =
+ FieldSpecification::CatalogInterface::factory( childKey, getDataContext(), childName, this );
return &this->registerGroup( childName, std::move( bc ) );
}
@@ -62,7 +62,7 @@ Group * FieldSpecificationManager::createChild( string const & childKey, string
void FieldSpecificationManager::expandObjectCatalogs()
{
// During schema generation, register one of each type derived from BoundaryConditionBase here
- for( auto & catalogIter: FieldSpecificationBase::getCatalog())
+ for( auto & catalogIter: FieldSpecification::getCatalog())
{
createChild( catalogIter.first, catalogIter.first );
}
@@ -73,7 +73,7 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
DomainPartition const & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" );
Group const & meshBodies = domain.getMeshBodies();
// loop over all the FieldSpecification of the XML file
- this->forSubGroups< FieldSpecificationBase >( [&] ( FieldSpecificationBase const & fs )
+ this->forSubGroups< FieldSpecification >( [&] ( FieldSpecification const & fs )
{
localIndex isFieldNameFound = 0;
// map from set name to a flag (1 if targetSet has been created, 0 otherwise)
@@ -102,14 +102,15 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
// Step 2: apply the boundary condition
- fs.apply< Group >( mesh,
- [&]( FieldSpecificationBase const &,
- string const & setName,
- SortedArrayView< localIndex const > const & targetSet,
- Group & targetGroup,
- string const fieldName )
+ FieldSpecificationImpl::apply< Group >( fs,
+ mesh,
+ [&]( FieldSpecification const &,
+ string const & setName,
+ SortedArrayView< localIndex const > const & targetSet,
+ Group & targetGroup,
+ string const fieldName )
{
- InputFlags const flag = fs.getWrapper< string >( FieldSpecificationBase::viewKeyStruct::fieldNameString() ).getInputFlag();
+ InputFlags const flag = fs.getWrapper< string >( FieldSpecification::viewKeyStruct::fieldNameString() ).getInputFlag();
// 2.a) If we enter this loop, we know that the set has been created
// Fracture/fault sets are created later and the "apply" call silently ignores them
@@ -194,14 +195,14 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
std::ostringstream errorMessageBuilder;
errorMessageBuilder << GEOS_FMT( "\n{}: there are no set(s) named `{}` under the {} `{}`.\n",
- fs.getWrapperDataContext( FieldSpecificationBase::viewKeyStruct::objectPathString() ),
+ fs.getWrapperDataContext( FieldSpecification::viewKeyStruct::objectPathString() ),
fmt::join( missingSetNames, ", " ),
- FieldSpecificationBase::viewKeyStruct::objectPathString(), fs.getObjectPath() );
+ FieldSpecification::viewKeyStruct::objectPathString(), fs.getObjectPath() );
errorMessageBuilder << ( !registeredSets.empty() ?
GEOS_FMT( "Available set(s) are: {}",
stringutilities::join( registeredSets, ", " ) ) :
GEOS_FMT( "No set are available for the targeted `{}`",
- FieldSpecificationBase::viewKeyStruct::objectPathString() ) );
+ FieldSpecification::viewKeyStruct::objectPathString() ) );
GEOS_THROW( errorMessageBuilder.str(), InputError, getDataContext() );
}
@@ -241,22 +242,22 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
message << GEOS_FMT( "Set '{}' does not capture anything in the mesh ", setName );
}
}
- auto errMode = fs.getReference< FieldSpecificationBase::SetErrorMode >(
- FieldSpecificationBase::viewKeyStruct::errorSetModeString());
+ auto errMode = fs.getReference< FieldSpecification::SetErrorMode >(
+ FieldSpecification::viewKeyStruct::errorSetModeString());
- if( errMode == FieldSpecificationBase::SetErrorMode::error && m_isSurfaceGenerationCase )
+ if( errMode == FieldSpecification::SetErrorMode::error && m_isSurfaceGenerationCase )
{
- errMode = FieldSpecificationBase::SetErrorMode::warning;
+ errMode = FieldSpecification::SetErrorMode::warning;
}
switch( errMode )
{
- case FieldSpecificationBase::SetErrorMode::silent:
+ case FieldSpecification::SetErrorMode::silent:
break;
- case FieldSpecificationBase::SetErrorMode::error:
+ case FieldSpecification::SetErrorMode::error:
GEOS_THROW( message.str(), InputError, getDataContext() );
break;
- case FieldSpecificationBase::SetErrorMode::warning:
+ case FieldSpecification::SetErrorMode::warning:
if( m_isSurfaceGenerationCase )
message << "As the simulation includes a SurfaceGenerator, the set may be modified later";
GEOS_WARNING( message.str() );
@@ -268,7 +269,7 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
{
std::ostringstream errorMessageBuilder;
errorMessageBuilder << GEOS_FMT( "\n{}: there are no field named `{}` under the region `{}`.\n",
- fs.getWrapperDataContext( FieldSpecificationBase::viewKeyStruct::fieldNameString() ),
+ fs.getWrapperDataContext( FieldSpecification::viewKeyStruct::fieldNameString() ),
fs.getFieldName(), fs.getObjectPath() );
std::set< string > registeredFields;
@@ -295,18 +296,19 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
void FieldSpecificationManager::applyInitialConditions( MeshLevel & mesh ) const
{
- this->forSubGroups< FieldSpecificationBase >( [&] ( FieldSpecificationBase const & fs )
+ this->forSubGroups< FieldSpecification >( [&] ( FieldSpecification const & fs )
{
if( fs.initialCondition() )
{
- fs.apply< dataRepository::Group >( mesh,
- [&]( FieldSpecificationBase const & bc,
- string const &,
- SortedArrayView< localIndex const > const & targetObject,
- Group & targetGroup,
- string const fieldName )
+ FieldSpecificationImpl::apply< dataRepository::Group >( fs,
+ mesh,
+ [&]( FieldSpecification const & bc,
+ string const &,
+ SortedArrayView< localIndex const > const & targetObject,
+ Group & targetGroup,
+ string const fieldName )
{
- bc.applyFieldValue< FieldSpecificationEqual >( targetObject, 0.0, targetGroup, fieldName );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual >( bc, targetObject, 0.0, targetGroup, fieldName );
} );
}
} );
diff --git a/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp b/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp
index b1d929e6561..cd033d27b62 100644
--- a/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp
+++ b/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp
@@ -20,7 +20,8 @@
#ifndef GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONMANAGER_HPP_
#define GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONMANAGER_HPP_
-#include "FieldSpecificationBase.hpp"
+#include "FieldSpecification.hpp"
+#include "FieldSpecificationImpl.hpp"
#include "common/format/StringUtilities.hpp"
#include "common/DataTypes.hpp"
@@ -64,9 +65,9 @@ class FieldSpecificationManager : public dataRepository::Group
static FieldSpecificationManager & getInstance();
/**
- * @brief Create a new FieldSpecificationBase object as a child of this group.
- * @param childKey the catalog key of the new FieldSpecificationBase derived type to create
- * @param childName the name of the new FieldSpecificationBase object in the repository
+ * @brief Create a new FieldSpecification object as a child of this group.
+ * @param childKey the catalog key of the new FieldSpecification derived type to create
+ * @param childName the name of the new FieldSpecification object in the repository
* @return the group child
*/
virtual Group * createChild( string const & childKey, string const & childName ) override;
@@ -86,11 +87,11 @@ class FieldSpecificationManager : public dataRepository::Group
* name is used for comparing against the value given in the field specification.
*
* Interface function that applies a boundary condition directly to a field variable by looping
- * through all FieldSpecificationBase objects present in the FieldSpecificationManager. Searches
+ * through all FieldSpecification objects present in the FieldSpecificationManager. Searches
* for the string specified in fieldPath as a substring in the objectPath specified in the input
* file, checks if fieldName is equal to the fieldName specified in the input file, and check if
- * the time parameter falls within the beginTime and endTime of the FieldSpecificationBase object,
- * and calls FieldSpecificationBase::applyFieldValue().
+ * the time parameter falls within the beginTime and endTime of the FieldSpecification object,
+ * and calls FieldSpecification::applyFieldValue().
*
*/
template< typename POLICY=parallelHostPolicy >
@@ -101,7 +102,7 @@ class FieldSpecificationManager : public dataRepository::Group
GEOS_MARK_FUNCTION;
applyFieldValue< POLICY >( time, mesh, fieldName,
- [&]( FieldSpecificationBase const &,
+ [&]( FieldSpecification const &,
SortedArrayView< localIndex const > const & ){} );
}
@@ -121,13 +122,13 @@ class FieldSpecificationManager : public dataRepository::Group
* after application of value to the field.
*
* Interface function that applies a value directly to a field by looping
- * through all FieldSpecificationBase objects present in the FieldSpecificationManager. Searches
+ * through all FieldSpecification objects present in the FieldSpecificationManager. Searches
* for the string specified in fieldPath as a substring in the objectPath specified in the input
* file, checks if fieldName is equal to the fieldName specified in the input file, and check if
- * the time parameter falls within the beginTime and endTime of the FieldSpecificationBase object,
- * and calls FieldSpecificationBase::applyFieldValue(), and calls the lambda function
- * to apply any operations required for completing the application of the value to the field in addition to
- * setting the target field.
+ * the time parameter falls within the beginTime and endTime of the FieldSpecification object,
+ * and calls FieldSpecification::applyFieldValue(), and calls the lambda function
+ * to apply any operations required for completing the application of the value to the field in
+ * addition to setting the target field.
*/
template< typename POLICY=parallelHostPolicy, typename LAMBDA=void >
void applyFieldValue( real64 const time,
@@ -154,13 +155,13 @@ class FieldSpecificationManager : public dataRepository::Group
* after application of value to the field.
*
* Interface function that applies a value directly to a field by looping
- * through all FieldSpecificationBase objects present in the FieldSpecificationManager. Calls the
+ * through all FieldSpecification objects present in the FieldSpecificationManager. Calls the
* preLambda function to apply any operations required before the application of the value to the
* field in addition to setting the target field. Searches for the string specified in fieldPath
* as a substring in the objectPath specified in the input file, checks if fieldName is equal to
* the fieldName specified in the input file, and check if the time parameter falls within the
- * beginTime and endTime of the FieldSpecificationBase object, and calls
- * FieldSpecificationBase::applyFieldValue(), and calls the postLambda function to apply any
+ * beginTime and endTime of the FieldSpecification object, and calls
+ * FieldSpecification::applyFieldValue(), and calls the postLambda function to apply any
* operations required for completing the application of the value to the field in addition to
* setting the target field.
*/
@@ -201,11 +202,11 @@ class FieldSpecificationManager : public dataRepository::Group
*
* This function loops through all available fields, checks to see if they
* should be applied, and applies them. More specifically, this function simply checks
- * values of fieldPath,fieldName, against each FieldSpecificationBase object contained in the
+ * values of fieldPath,fieldName, against each FieldSpecification object contained in the
* FieldSpecificationManager and decides on whether or not to call the user defined lambda.
*/
template< typename OBJECT_TYPE=dataRepository::Group,
- typename BCTYPE = FieldSpecificationBase,
+ typename BCTYPE = FieldSpecification,
typename LAMBDA >
void apply( real64 const time,
MeshLevel & mesh,
@@ -217,15 +218,14 @@ class FieldSpecificationManager : public dataRepository::Group
string const meshBodyName = mesh.getParent().getParent().getName();
string const meshLevelName = mesh.getName();
- // loop over all FieldSpecificationBase objects
+ // loop over all FieldSpecification objects
this->forSubGroups< BCTYPE >( [&] ( BCTYPE const & fs )
{
- integer const isInitialCondition = fs.initialCondition();
- if( ( isInitialCondition && fieldName=="") || // this only use case for this line is in the unit test for field specification
- ( !isInitialCondition && time >= fs.getStartTime() && time < fs.getEndTime() && fieldName == fs.getFieldName() ) )
- {
- fs.template apply< OBJECT_TYPE, BCTYPE, LAMBDA >( mesh, std::forward< LAMBDA >( lambda ) );
- }
+ FieldSpecificationImpl::apply< OBJECT_TYPE, BCTYPE, LAMBDA >( fs,
+ mesh,
+ std::forward< LAMBDA >( lambda ),
+ time,
+ fieldName );
} );
}
@@ -256,13 +256,17 @@ FieldSpecificationManager::
GEOS_MARK_FUNCTION;
apply( time, mesh, fieldName,
- [&]( FieldSpecificationBase const & fs,
+ [&]( FieldSpecification const & fs,
string const &,
SortedArrayView< localIndex const > const & targetSet,
Group & targetGroup,
string const & targetField )
{
- fs.applyFieldValue< FieldSpecificationEqual, POLICY >( targetSet, time, targetGroup, targetField );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual, POLICY >( fs,
+ targetSet,
+ time,
+ targetGroup,
+ targetField );
lambda( fs, targetSet );
} );
}
@@ -279,14 +283,18 @@ FieldSpecificationManager::
GEOS_MARK_FUNCTION;
apply( time, mesh, fieldName,
- [&]( FieldSpecificationBase const & fs,
+ [&]( FieldSpecification const & fs,
string const &,
SortedArrayView< localIndex const > const & targetSet,
Group & targetGroup,
string const & targetField )
{
preLambda( fs, targetSet );
- fs.applyFieldValue< FieldSpecificationEqual, POLICY >( targetSet, time, targetGroup, targetField );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual, POLICY >( fs,
+ targetSet,
+ time,
+ targetGroup,
+ targetField );
postLambda( fs, targetSet );
} );
}
diff --git a/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.cpp b/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.cpp
index 7e71480536c..e8bfabcf5bd 100644
--- a/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.cpp
+++ b/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.cpp
@@ -25,7 +25,7 @@ namespace geos
using namespace dataRepository;
PerfectlyMatchedLayer::PerfectlyMatchedLayer( string const & name, Group * const parent ):
- FieldSpecificationBase( name, parent )
+ FieldSpecification( name, parent )
{
registerWrapper( viewKeyStruct::xMinString(), &m_xMin ).
setInputFlag( InputFlags::OPTIONAL ).
@@ -66,11 +66,11 @@ PerfectlyMatchedLayer::PerfectlyMatchedLayer( string const & name, Group * const
setApplyDefaultValue( {-1.0, -1.0, -1.0} ).
setDescription( "Wave speed in the PML, at right, back, and bottom sides, used to compute the damping profile" );
- getWrapper< string >( FieldSpecificationBase::viewKeyStruct::fieldNameString() ).
+ getWrapper< string >( FieldSpecification::viewKeyStruct::fieldNameString() ).
setInputFlag( InputFlags::FALSE );
setFieldName( catalogName() );
- getWrapper< int >( FieldSpecificationBase::viewKeyStruct::initialConditionString() ).
+ getWrapper< int >( FieldSpecification::viewKeyStruct::initialConditionString() ).
setInputFlag( InputFlags::FALSE );
initialCondition( false ); // to make sure this is not called by applyInitialConditions
@@ -121,6 +121,6 @@ void PerfectlyMatchedLayer::postInputInitialization()
}
-REGISTER_CATALOG_ENTRY( FieldSpecificationBase, PerfectlyMatchedLayer, string const &, Group * const )
+REGISTER_CATALOG_ENTRY( FieldSpecification, PerfectlyMatchedLayer, string const &, Group * const )
} /* namespace geos */
diff --git a/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.hpp b/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.hpp
index 802e2be9cc7..63bfe334d39 100644
--- a/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.hpp
+++ b/src/coreComponents/fieldSpecification/PerfectlyMatchedLayer.hpp
@@ -21,7 +21,7 @@
#ifndef GEOS_FIELDSPECIFICATION_PERFECTLYMATCHEDLAYER_HPP_
#define GEOS_FIELDSPECIFICATION_PERFECTLYMATCHEDLAYER_HPP_
-#include "FieldSpecificationBase.hpp"
+#include "FieldSpecification.hpp"
namespace geos
{
@@ -30,12 +30,12 @@ namespace geos
* @class PerfectlyMatchedLayer
* A class to manage Perfectly Matched Layer for wave propagation solvers
*/
-class PerfectlyMatchedLayer : public FieldSpecificationBase
+class PerfectlyMatchedLayer : public FieldSpecification
{
public:
/**
* @brief constructor
- * @param name the name of the FieldSpecificationBase in the data repository
+ * @param name the name of the FieldSpecification in the data repository
* @param parent the parent group of this group.
*/
PerfectlyMatchedLayer( string const & name, dataRepository::Group * const parent );
@@ -101,7 +101,7 @@ class PerfectlyMatchedLayer : public FieldSpecificationBase
/**
* @brief View keys
*/
- struct viewKeyStruct : public FieldSpecificationBase::viewKeyStruct
+ struct viewKeyStruct : public FieldSpecification::viewKeyStruct
{
/// @return String key for the mininum (x,y,z) coordinates of inner PML boundaries
static constexpr char const * xMinString() { return "xMin"; }
diff --git a/src/coreComponents/fieldSpecification/SourceFluxBoundaryCondition.cpp b/src/coreComponents/fieldSpecification/SourceFluxBoundaryCondition.cpp
index 8a05108fe9d..08ce7843a75 100644
--- a/src/coreComponents/fieldSpecification/SourceFluxBoundaryCondition.cpp
+++ b/src/coreComponents/fieldSpecification/SourceFluxBoundaryCondition.cpp
@@ -25,24 +25,24 @@ namespace geos
using namespace dataRepository;
SourceFluxBoundaryCondition::SourceFluxBoundaryCondition( string const & name, Group * const parent ):
- FieldSpecificationBase( name, parent )
+ FieldSpecification( name, parent )
{
- getWrapper< string >( FieldSpecificationBase::viewKeyStruct::fieldNameString() ).
+ getWrapper< string >( FieldSpecification::viewKeyStruct::fieldNameString() ).
setInputFlag( InputFlags::FALSE );
setFieldName( catalogName() );
- getWrapper< string >( FieldSpecificationBase::viewKeyStruct::functionNameString() ).
+ getWrapper< string >( FieldSpecification::viewKeyStruct::functionNameString() ).
setDescription( GEOS_FMT( "Name of a function that specifies the variation of the production rate variations of this {}."
"Multiplied by {}. If no function is provided, a constant value of 1 is used."
"The produced fluid rate unit is in kg by default, or in mole if the flow solver uses moles.",
catalogName(),
- FieldSpecificationBase::viewKeyStruct::scaleString() ) );
+ FieldSpecification::viewKeyStruct::scaleString() ) );
- getWrapper< real64 >( FieldSpecificationBase::viewKeyStruct::scaleString() ).
+ getWrapper< real64 >( FieldSpecification::viewKeyStruct::scaleString() ).
setDescription( GEOS_FMT( "Multiplier of the {0} value. If no {0} is provided, this value is used directly.",
- FieldSpecificationBase::viewKeyStruct::functionNameString() ) );
+ FieldSpecification::viewKeyStruct::functionNameString() ) );
}
-REGISTER_CATALOG_ENTRY( FieldSpecificationBase, SourceFluxBoundaryCondition, string const &, Group * const )
+REGISTER_CATALOG_ENTRY( FieldSpecification, SourceFluxBoundaryCondition, string const &, Group * const )
} /* namespace geos */
diff --git a/src/coreComponents/fieldSpecification/SourceFluxBoundaryCondition.hpp b/src/coreComponents/fieldSpecification/SourceFluxBoundaryCondition.hpp
index 2ee5e258bef..5fb3c562f82 100644
--- a/src/coreComponents/fieldSpecification/SourceFluxBoundaryCondition.hpp
+++ b/src/coreComponents/fieldSpecification/SourceFluxBoundaryCondition.hpp
@@ -21,7 +21,7 @@
#ifndef GEOS_FIELDSPECIFICATION_SOURCEFLUXBOUNDARYCONDITION_HPP_
#define GEOS_FIELDSPECIFICATION_SOURCEFLUXBOUNDARYCONDITION_HPP_
-#include "FieldSpecificationBase.hpp"
+#include "FieldSpecification.hpp"
namespace geos
{
@@ -30,12 +30,12 @@ namespace geos
* @class SourceFluxBoundaryCondition
* A class to manage Neumann boundary conditions
*/
-class SourceFluxBoundaryCondition : public FieldSpecificationBase
+class SourceFluxBoundaryCondition : public FieldSpecification
{
public:
/**
* @brief constructor
- * @param name the name of the FieldSpecificationBase in the data repository
+ * @param name the name of the FieldSpecification in the data repository
* @param parent the parent group of this group.
*/
SourceFluxBoundaryCondition( string const & name, dataRepository::Group * const parent );
diff --git a/src/coreComponents/fieldSpecification/TractionBoundaryCondition.cpp b/src/coreComponents/fieldSpecification/TractionBoundaryCondition.cpp
index 49392b016f0..6025988406e 100644
--- a/src/coreComponents/fieldSpecification/TractionBoundaryCondition.cpp
+++ b/src/coreComponents/fieldSpecification/TractionBoundaryCondition.cpp
@@ -21,6 +21,7 @@
#include "finiteElement/elementFormulations/H1_TriangleFace_Lagrange1_Gauss.hpp"
#include "finiteElement/elementFormulations/H1_QuadrilateralFace_Lagrange1_GaussLegendre2.hpp"
+#include "functions/FunctionManager.hpp"
#include "functions/TableFunction.hpp"
namespace geos
@@ -29,7 +30,7 @@ namespace geos
using namespace dataRepository;
TractionBoundaryCondition::TractionBoundaryCondition( string const & name, Group * parent ):
- FieldSpecificationBase( name, parent ),
+ FieldSpecification( name, parent ),
m_tractionType( TractionType::vector ),
m_inputStress{},
m_scaleSet(),
@@ -66,11 +67,11 @@ TractionBoundaryCondition::TractionBoundaryCondition( string const & name, Group
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "The flag to indicate whether to apply the nodal scale on the traction magnitude" );
- getWrapper< string >( FieldSpecificationBase::viewKeyStruct::fieldNameString() ).
+ getWrapper< string >( FieldSpecification::viewKeyStruct::fieldNameString() ).
setInputFlag( InputFlags::FALSE );
setFieldName( catalogName() );
- getWrapper< int >( FieldSpecificationBase::viewKeyStruct::componentString() ).
+ getWrapper< int >( FieldSpecification::viewKeyStruct::componentString() ).
setInputFlag( InputFlags::FALSE );
}
@@ -437,7 +438,7 @@ void TractionBoundaryCondition::reinitScaleSet( FaceManager const & faceManager,
} );
}
-REGISTER_CATALOG_ENTRY( FieldSpecificationBase, TractionBoundaryCondition, string const &, Group * const )
+REGISTER_CATALOG_ENTRY( FieldSpecification, TractionBoundaryCondition, string const &, Group * const )
} /* namespace geos */
diff --git a/src/coreComponents/fieldSpecification/TractionBoundaryCondition.hpp b/src/coreComponents/fieldSpecification/TractionBoundaryCondition.hpp
index 9d32b2becc0..a4aeb779590 100644
--- a/src/coreComponents/fieldSpecification/TractionBoundaryCondition.hpp
+++ b/src/coreComponents/fieldSpecification/TractionBoundaryCondition.hpp
@@ -21,7 +21,7 @@
#ifndef GEOS_FIELDSPECIFICATION_TRACTIONBOUNDARYCONDITION_HPP
#define GEOS_FIELDSPECIFICATION_TRACTIONBOUNDARYCONDITION_HPP
-#include "FieldSpecificationBase.hpp"
+#include "FieldSpecification.hpp"
#include "mesh/FaceManager.hpp"
#include "mesh/NodeManager.hpp"
@@ -34,10 +34,10 @@ class TableFunction;
* @class TractionBoundaryCondition
* Holds data and methods to apply a traction boundary condition
*/
-class TractionBoundaryCondition : public FieldSpecificationBase
+class TractionBoundaryCondition : public FieldSpecification
{
public:
- /// @copydoc FieldSpecificationBase(string const &, dataRepository::Group *)
+ /// @copydoc FieldSpecification(string const &, dataRepository::Group *)
TractionBoundaryCondition( string const & name, Group * parent );
/// deleted default constructor
@@ -98,7 +98,7 @@ class TractionBoundaryCondition : public FieldSpecificationBase
/**
* @brief View keys
*/
- struct viewKeyStruct : public FieldSpecificationBase::viewKeyStruct
+ struct viewKeyStruct : public FieldSpecification::viewKeyStruct
{
/// @return The key for tractionType
constexpr static char const * tractionTypeString() { return "tractionType"; }
diff --git a/src/coreComponents/finiteVolume/FluxApproximationBase.cpp b/src/coreComponents/finiteVolume/FluxApproximationBase.cpp
index 673d6f1b53c..4104ab292b9 100644
--- a/src/coreComponents/finiteVolume/FluxApproximationBase.cpp
+++ b/src/coreComponents/finiteVolume/FluxApproximationBase.cpp
@@ -143,7 +143,7 @@ void FluxApproximationBase::initializePostInitialConditionsPreSubGroups()
fsManager.apply< FaceManager >( 0.0, // time = 0
mesh,
fieldName,
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const & faceSet,
FaceManager const &,
diff --git a/src/coreComponents/integrationTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp b/src/coreComponents/integrationTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp
index 0e948a64332..e257939aa0c 100644
--- a/src/coreComponents/integrationTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp
+++ b/src/coreComponents/integrationTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp
@@ -17,6 +17,7 @@
#include "mainInterface/ProblemManager.hpp"
#include "mainInterface/GeosxState.hpp"
#include "mainInterface/initialization.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "mesh/DomainPartition.hpp"
#include "mesh/generators/CellBlockManager.hpp"
@@ -40,7 +41,7 @@ void RegisterAndApplyField( DomainPartition & domain,
{
FieldSpecificationManager & fieldSpecificationManager = FieldSpecificationManager::getInstance();
- FieldSpecificationBase & fieldSpec = fieldSpecificationManager.registerGroup< FieldSpecificationBase >( fieldName );
+ FieldSpecification & fieldSpec = fieldSpecificationManager.registerGroup< FieldSpecification >( fieldName );
fieldSpec.setFieldName( fieldName );
fieldSpec.setObjectPath( objectPath );
fieldSpec.setMeshObjectPath( domain.getMeshBodies() );
@@ -51,13 +52,13 @@ void RegisterAndApplyField( DomainPartition & domain,
fieldSpecificationManager.apply( 0.,
domain.getMeshBody( 0 ).getBaseDiscretization(),
"",
- [&] ( FieldSpecificationBase const & bc,
+ [&] ( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
Group & targetGroup,
string const name )
{
- bc.applyFieldValue< FieldSpecificationEqual >( targetSet, 0.0, targetGroup, name );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual >( bc, targetSet, 0.0, targetGroup, name );
} );
}
diff --git a/src/coreComponents/integrationTests/xmlTests/testXMLFile.cpp b/src/coreComponents/integrationTests/xmlTests/testXMLFile.cpp
index 274a5d52e9b..8c0fd3aad89 100644
--- a/src/coreComponents/integrationTests/xmlTests/testXMLFile.cpp
+++ b/src/coreComponents/integrationTests/xmlTests/testXMLFile.cpp
@@ -18,7 +18,6 @@
#include "mainInterface/initialization.hpp"
#include "mainInterface/GeosxState.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
-#include "fieldSpecification/FieldSpecificationBase.hpp"
#include "dataRepository/Group.hpp"
#include "dataRepository/DataContext.hpp"
@@ -39,7 +38,7 @@ TEST( testXML, testXMLFile )
problemManager.parseInputFile();
// Check that we've read the full XML with all nested includes by inspecting boundary conditions
- EXPECT_TRUE( problemManager.getFieldSpecificationManager().hasGroup< FieldSpecificationBase >( "v0" ) );
+ EXPECT_TRUE( problemManager.getFieldSpecificationManager().hasGroup< FieldSpecification >( "v0" ) );
}
/**
diff --git a/src/coreComponents/mainInterface/ProblemManager.cpp b/src/coreComponents/mainInterface/ProblemManager.cpp
index 8f824fa7b04..bdf792ea36d 100644
--- a/src/coreComponents/mainInterface/ProblemManager.cpp
+++ b/src/coreComponents/mainInterface/ProblemManager.cpp
@@ -1283,7 +1283,7 @@ DomainPartition const & ProblemManager::getDomainPartition() const
void ProblemManager::applyInitialConditions()
{
- m_fieldSpecificationManager->forSubGroups< FieldSpecificationBase >( [&]( FieldSpecificationBase & fs )
+ m_fieldSpecificationManager->forSubGroups< FieldSpecification >( [&]( FieldSpecification & fs )
{
fs.setMeshObjectPath( getDomainPartition().getMeshBodies() );
} );
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp
index 48362c574a6..29c200f034a 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp
@@ -30,6 +30,7 @@
#include "constitutive/relativePermeability/RelativePermeabilitySelector.hpp"
#include "constitutive/solid/SolidInternalEnergy.hpp"
#include "constitutive/thermalConductivity/MultiPhaseThermalConductivitySelector.hpp"
+#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "fieldSpecification/AquiferBoundaryCondition.hpp"
#include "fieldSpecification/EquilibriumInitialCondition.hpp"
#include "fieldSpecification/SourceFluxBoundaryCondition.hpp"
@@ -1867,7 +1868,7 @@ void CompositionalMultiphaseBase::applySourceFluxBC( real64 const time,
arrayView1d< integer const > const ghostRank = subRegion.ghostRank();
// Step 3.1: get the values of the source boundary condition that need to be added to the rhs
- // We don't use FieldSpecificationBase::applyConditionToSystem here because we want to account for the row permutation used in the
+ // We don't use FieldSpecificationImpl::applyConditionToSystem here because we want to account for the row permutation used in the
// compositional solvers
array1d< globalIndex > dofArray( targetSet.size() );
@@ -1878,17 +1879,18 @@ void CompositionalMultiphaseBase::applySourceFluxBC( real64 const time,
RAJA::ReduceSum< parallelDeviceReduce, real64 > massProd( 0.0 );
// note that the dofArray will not be used after this step (simpler to use dofNumber instead)
- fs.computeRhsContribution< FieldSpecificationAdd,
- parallelDevicePolicy<> >( targetSet.toViewConst(),
- time + dt,
- dt,
- subRegion,
- dofNumber,
- rankOffset,
- localMatrix,
- dofArray.toView(),
- rhsContributionArrayView,
- [] GEOS_HOST_DEVICE ( localIndex const )
+ FieldSpecificationImpl::computeRhsContribution< FieldSpecificationAdd,
+ parallelDevicePolicy<> >( fs,
+ targetSet.toViewConst(),
+ time + dt,
+ dt,
+ subRegion,
+ dofNumber,
+ rankOffset,
+ localMatrix,
+ dofArray.toView(),
+ rhsContributionArrayView,
+ [] GEOS_HOST_DEVICE ( localIndex const )
{
return 0.0;
} );
@@ -1973,7 +1975,7 @@ bool CompositionalMultiphaseBase::validateDirichletBC( DomainPartition & domain,
fsManager.apply< ElementSubRegionBase >( time,
mesh,
flow::pressure::key(),
- [&]( FieldSpecificationBase const &,
+ [&]( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const &,
ElementSubRegionBase & subRegion,
@@ -1999,7 +2001,7 @@ bool CompositionalMultiphaseBase::validateDirichletBC( DomainPartition & domain,
fsManager.apply< ElementSubRegionBase >( time,
mesh,
flow::temperature::key(),
- [&]( FieldSpecificationBase const &,
+ [&]( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const &,
ElementSubRegionBase & subRegion,
@@ -2024,7 +2026,7 @@ bool CompositionalMultiphaseBase::validateDirichletBC( DomainPartition & domain,
fsManager.apply< ElementSubRegionBase >( time,
mesh,
flow::globalCompFraction::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const &,
ElementSubRegionBase & subRegion,
@@ -2152,7 +2154,7 @@ void CompositionalMultiphaseBase::applyDirichletBC( real64 const time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
flow::pressure::key(),
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const &,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
@@ -2283,7 +2285,7 @@ void CompositionalMultiphaseBase::applyDirichletBC( real64 const time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
flow::temperature::key(),
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const &,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.hpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.hpp
index 227055bf3ed..d43cca1af06 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.hpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.hpp
@@ -25,7 +25,6 @@
#include "constitutive/fluid/multifluid/Layouts.hpp"
#include "constitutive/relativePermeability/Layouts.hpp"
#include "constitutive/capillaryPressure/Layouts.hpp"
-#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "constitutive/fluid/multifluid/MultiFluidBase.hpp"
#include "constitutive/solid/CoupledSolidBase.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/AccumulationKernel.hpp"
@@ -457,23 +456,6 @@ class CompositionalMultiphaseBase : public FlowSolverBase
*/
void initializeAquiferBC( constitutive::ConstitutiveManager const & cm ) const;
- /**
- * @brief Utility function that encapsulates the call to FieldSpecificationBase::applyFieldValue in BC application
- * @param[in] time_n the time at the beginning of the step
- * @param[in] dt the time step
- * @param[in] mesh the mesh level object
- * @param[in] logMessage the log message issued by the solver if the bc is called
- * @param[in] fieldKey the key of the field specified in the xml file
- * @param[in] boundaryFieldKey the key of the boundary field
- */
- template< typename OBJECT_TYPE >
- void applyFieldValue( real64 const & time_n,
- real64 const & dt,
- MeshLevel & mesh,
- char const logMessage[],
- string const fieldKey,
- string const boundaryFieldKey ) const;
-
/// the max number of fluid phases
integer m_numPhases;
@@ -564,42 +546,6 @@ class CompositionalMultiphaseBase : public FlowSolverBase
};
-template< typename OBJECT_TYPE >
-void CompositionalMultiphaseBase::applyFieldValue( real64 const & time_n,
- real64 const & dt,
- MeshLevel & mesh,
- char const logMessage[],
- string const fieldKey,
- string const boundaryFieldKey ) const
-{
- FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance();
-
- fsManager.apply< OBJECT_TYPE >( time_n + dt,
- mesh,
- fieldKey,
- [&]( FieldSpecificationBase const & fs,
- string const & setName,
- SortedArrayView< localIndex const > const & lset,
- OBJECT_TYPE & targetGroup,
- string const & )
- {
- if( fs.getLogLevel() >= 1 && m_nonlinearSolverParameters.m_numNewtonIterations == 0 )
- {
- globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( lset.size() );
- GEOS_LOG_RANK_0( GEOS_FMT( logMessage,
- getName(), time_n+dt, fs.getCatalogName(), fs.getName(),
- setName, targetGroup.getName(), fs.getScale(), numTargetElems ) );
- }
-
- // Specify the bc value of the field
- fs.applyFieldValue< FieldSpecificationEqual,
- parallelDevicePolicy<> >( lset,
- time_n + dt,
- targetGroup,
- boundaryFieldKey );
- } );
-}
-
template< typename SUBREGION_TYPE >
void CompositionalMultiphaseBase::accumulationAssemblyLaunch( DofManager const & dofManager,
SUBREGION_TYPE const & subRegion,
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp
index 4d3f7ddbbbf..d8a98890142 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp
@@ -1150,7 +1150,7 @@ bool CompositionalMultiphaseFVM::validateFaceDirichletBC( DomainPartition & doma
fsManager.apply< FaceManager >( time,
mesh,
flow::pressure::key(),
- [&]( FieldSpecificationBase const &,
+ [&]( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const &,
FaceManager &,
@@ -1169,7 +1169,7 @@ bool CompositionalMultiphaseFVM::validateFaceDirichletBC( DomainPartition & doma
fsManager.apply< FaceManager >( time,
mesh,
flow::temperature::key(),
- [&]( FieldSpecificationBase const &,
+ [&]( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const &,
FaceManager &,
@@ -1195,7 +1195,7 @@ bool CompositionalMultiphaseFVM::validateFaceDirichletBC( DomainPartition & doma
fsManager.apply< FaceManager >( time,
mesh,
flow::globalCompFraction::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const &,
FaceManager &,
@@ -1309,7 +1309,7 @@ void CompositionalMultiphaseFVM::applyFaceDirichletBC( real64 const time_n,
fsManager.apply< FaceManager >( time_n + dt,
mesh,
flow::pressure::key(), // we have required that pressure is always present
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const &,
FaceManager &,
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp
index c4f33665dd0..6fd5cba3a5c 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp
@@ -27,6 +27,7 @@
#include "constitutive/relativePermeability/RelativePermeabilityBase.hpp"
#include "fieldSpecification/AquiferBoundaryCondition.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "finiteVolume/HybridMimeticDiscretization.hpp"
#include "finiteVolume/MimeticInnerProductDispatch.hpp"
#include "finiteVolume/FluxApproximationBase.hpp"
@@ -207,7 +208,7 @@ void CompositionalMultiphaseHybridFVM::initializePostInitialConditionsPreSubGrou
// isBoundaryFaceView is default-initialized to zero
FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance();
- fsManager.forSubGroups< FieldSpecificationBase >( [&]( FieldSpecificationBase const & fs )
+ fsManager.forSubGroups< FieldSpecification >( [&]( FieldSpecification const & fs )
{
string const & fieldName = fs.getFieldName();
if( fieldName == flow::bcPressure::key() ||
@@ -740,7 +741,7 @@ void CompositionalMultiphaseHybridFVM::applyFaceDirichletBC( real64 const time_n
// Get all face sets that have Dirichlet BCs
std::set< string > bcFaceSets;
- fsManager.forSubGroups< FieldSpecificationBase >( [&]( FieldSpecificationBase const & fs )
+ fsManager.forSubGroups< FieldSpecification >( [&]( FieldSpecification const & fs )
{
string const & fieldName = fs.getFieldName();
if( fieldName == flow::bcPressure::key() ||
@@ -953,19 +954,19 @@ void CompositionalMultiphaseHybridFVM::applyFaceDirichletBC( real64 const time_n
fsManager.apply< FaceManager >( time_n + dt,
mesh,
flow::bcPressure::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const & targetSet,
FaceManager & targetGroup,
string const & )
{
GEOS_UNUSED_VAR( setName );
- // Using the field specification functions to apply the boundary conditions to the system
- fs.applyFieldValue< FieldSpecificationEqual,
- parallelDevicePolicy<> >( targetSet,
- time_n + dt,
- targetGroup,
- flow::bcPressure::key() );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ targetSet,
+ time_n + dt,
+ targetGroup,
+ flow::bcPressure::key() );
forAll< parallelDevicePolicy<> >( targetSet.size(), [=] GEOS_HOST_DEVICE ( localIndex const a )
{
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp
index c98270ee548..3a948b6fee9 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp
@@ -31,6 +31,8 @@
#include "finiteVolume/FiniteVolumeManager.hpp"
#include "finiteVolume/FluxApproximationBase.hpp"
#include "mesh/DomainPartition.hpp"
+#include "mesh/ElementSubRegionBase.hpp"
+#include "mesh/FaceManager.hpp"
#include "physicsSolvers/LogLevelsInfo.hpp"
#include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp"
@@ -1083,4 +1085,57 @@ string FlowSolverBase::BCMessage::notAppliedOnRegion( int componentIndex, string
fieldName, setName );
}
+template< typename OBJECT_TYPE >
+void FlowSolverBase::applyFieldValue( real64 const & time_n,
+ real64 const & dt,
+ MeshLevel & mesh,
+ char const logMessage[],
+ string const fieldKey,
+ string const boundaryFieldKey ) const
+{
+ FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance();
+
+ fsManager.apply< OBJECT_TYPE >( time_n + dt,
+ mesh,
+ fieldKey,
+ [&]( FieldSpecification const & fs,
+ string const & setName,
+ SortedArrayView< localIndex const > const & lset,
+ OBJECT_TYPE & targetGroup,
+ string const & )
+ {
+ if( fs.getLogLevel() >= 1 && m_nonlinearSolverParameters.m_numNewtonIterations == 0 )
+ {
+ globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( lset.size() );
+ GEOS_LOG_RANK_0( GEOS_FMT( logMessage,
+ getName(), time_n+dt, fs.getCatalogName(), fs.getName(),
+ setName, targetGroup.getName(), fs.getScale(), numTargetElems ) );
+ }
+
+ // Specify the bc value of the field
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ lset,
+ time_n + dt,
+ targetGroup,
+ boundaryFieldKey );
+ } );
+}
+
+template void
+FlowSolverBase::applyFieldValue< ElementSubRegionBase >( real64 const & time_n,
+ real64 const & dt,
+ MeshLevel & mesh,
+ char const logMessage[],
+ string const fieldKey,
+ string const boundaryFieldKey ) const;
+
+template void
+FlowSolverBase::applyFieldValue< FaceManager >( real64 const & time_n,
+ real64 const & dt,
+ MeshLevel & mesh,
+ char const logMessage[],
+ string const fieldKey,
+ string const boundaryFieldKey ) const;
+
} // namespace geos
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.hpp b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.hpp
index 0e709372102..75afb4fcd65 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.hpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.hpp
@@ -213,6 +213,23 @@ class FlowSolverBase : public PhysicsSolverBase
protected:
+ /**
+ * @brief Utility function that encapsulates the call to FieldSpecificationImpl::applyFieldValue in BC application
+ * @param[in] time_n the time at the beginning of the step
+ * @param[in] dt the time step
+ * @param[in] mesh the mesh level object
+ * @param[in] logMessage the log message issued by the solver if the bc is called
+ * @param[in] fieldKey the key of the field specified in the xml file
+ * @param[in] boundaryFieldKey the key of the boundary field
+ */
+ template< typename OBJECT_TYPE >
+ void applyFieldValue( real64 const & time_n,
+ real64 const & dt,
+ MeshLevel & mesh,
+ char const logMessage[],
+ string const fieldKey,
+ string const boundaryFieldKey ) const;
+
/**
* @brief Increment the cumulative flux from each aquifer
* @param[in] time the time at the beginning of the time step
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp b/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp
index 6bd4ead9e6b..1531799faeb 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp
@@ -30,6 +30,8 @@
#include "constitutive/relativePermeability/RelativePermeabilitySelector.hpp"
#include "fieldSpecification/EquilibriumInitialCondition.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
+#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "fieldSpecification/SourceFluxBoundaryCondition.hpp"
#include "physicsSolvers/fluidFlow/SourceFluxStatistics.hpp"
#include "physicsSolvers/LogLevelsInfo.hpp"
@@ -685,7 +687,7 @@ bool ImmiscibleMultiphaseFlow::validateDirichletBC( DomainPartition & domain,
fsManager.apply< ElementSubRegionBase >( time,
mesh,
fields::flow::pressure::key(),
- [&]( FieldSpecificationBase const &,
+ [&]( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const &,
ElementSubRegionBase & subRegion,
@@ -708,7 +710,7 @@ bool ImmiscibleMultiphaseFlow::validateDirichletBC( DomainPartition & domain,
fsManager.apply< ElementSubRegionBase >( time,
mesh,
fields::immiscibleMultiphaseFlow::phaseVolumeFraction::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const &,
ElementSubRegionBase & subRegion,
@@ -742,7 +744,6 @@ bool ImmiscibleMultiphaseFlow::validateDirichletBC( DomainPartition & domain,
fsManager.forSubGroups< EquilibriumInitialCondition >( [&] ( EquilibriumInitialCondition const & bc )
{
string_array const & componentNames = bc.getComponentNames();
- GEOS_UNUSED_VAR( componentNames );
GEOS_WARNING( BCMessage::conflictingComposition( comp, componentNames[comp],
regionName, subRegionName, setName,
fields::immiscibleMultiphaseFlow::phaseVolumeFraction::key() )
@@ -822,7 +823,7 @@ void ImmiscibleMultiphaseFlow::applyDirichletBC( real64 const time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
fields::flow::pressure::key(),
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const &,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
@@ -977,17 +978,18 @@ void ImmiscibleMultiphaseFlow::applySourceFluxBC( real64 const time,
RAJA::ReduceSum< parallelDeviceReduce, real64 > massProd( 0.0 );
// note that the dofArray will not be used after this step (simpler to use dofNumber instead)
- fs.computeRhsContribution< FieldSpecificationAdd,
- parallelDevicePolicy<> >( targetSet.toViewConst(),
- time + dt,
- dt,
- subRegion,
- dofNumber,
- rankOffset,
- localMatrix,
- dofArray.toView(),
- rhsContributionArrayView,
- [] GEOS_HOST_DEVICE ( localIndex const )
+ FieldSpecificationImpl::computeRhsContribution< FieldSpecificationAdd,
+ parallelDevicePolicy<> >( fs,
+ targetSet.toViewConst(),
+ time + dt,
+ dt,
+ subRegion,
+ dofNumber,
+ rankOffset,
+ localMatrix,
+ dofArray.toView(),
+ rhsContributionArrayView,
+ [] GEOS_HOST_DEVICE ( localIndex const )
{
return 0.0;
} );
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.hpp b/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.hpp
index 7526130316c..b7229c75b83 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.hpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.hpp
@@ -21,7 +21,6 @@
#define GEOS_PHYSICSSOLVERS_FLUIDFLOW_IMMISCIBLEMULTIPHASEFLOW_HPP_
#include "physicsSolvers/fluidFlow/FlowSolverBase.hpp"
-#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "physicsSolvers/fluidFlow/kernels/immiscibleMultiphase/ImmiscibleMultiphaseKernels.hpp"
namespace geos
@@ -262,23 +261,6 @@ class ImmiscibleMultiphaseFlow : public FlowSolverBase
*/
void updatePhaseMobility( ObjectManagerBase & dataGroup ) const;
- /**
- * @brief Utility function that encapsulates the call to FieldSpecificationBase::applyFieldValue in BC application
- * @param[in] time_n the time at the beginning of the step
- * @param[in] dt the time step
- * @param[in] mesh the mesh level object
- * @param[in] logMessage the log message issued by the solver if the bc is called
- * @param[in] fieldKey the key of the field specified in the xml file
- * @param[in] boundaryFieldKey the key of the boundary field
- */
- template< typename OBJECT_TYPE >
- void applyFieldValue( real64 const & time_n,
- real64 const & dt,
- MeshLevel & mesh,
- char const logMessage[],
- string const fieldKey,
- string const boundaryFieldKey ) const;
-
/// the max number of fluid phases
integer m_numPhases;
@@ -315,42 +297,6 @@ class ImmiscibleMultiphaseFlow : public FlowSolverBase
};
-template< typename OBJECT_TYPE >
-void ImmiscibleMultiphaseFlow::applyFieldValue( real64 const & time_n,
- real64 const & dt,
- MeshLevel & mesh,
- char const logMessage[],
- string const fieldKey,
- string const boundaryFieldKey ) const
-{
- FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance();
-
- fsManager.apply< OBJECT_TYPE >( time_n + dt,
- mesh,
- fieldKey,
- [&]( FieldSpecificationBase const & fs,
- string const & setName,
- SortedArrayView< localIndex const > const & lset,
- OBJECT_TYPE & targetGroup,
- string const & )
- {
- if( fs.getLogLevel() >= 1 && m_nonlinearSolverParameters.m_numNewtonIterations == 0 )
- {
- globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( lset.size() );
- GEOS_LOG_RANK_0( GEOS_FMT( logMessage,
- getName(), time_n+dt, fs.getCatalogName(), fs.getName(),
- setName, targetGroup.getName(), fs.getScale(), numTargetElems ) );
- }
-
- // Specify the bc value of the field
- fs.applyFieldValue< FieldSpecificationEqual,
- parallelDevicePolicy<> >( lset,
- time_n + dt,
- targetGroup,
- boundaryFieldKey );
- } );
-}
-
} // namespace geos
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp
index 29bc7397087..6ba70a82cf5 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp
@@ -22,6 +22,7 @@
#include "constitutive/solid/CoupledSolidBase.hpp"
#include "dataRepository/Group.hpp"
#include "discretizationMethods/NumericalMethodsManager.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "fieldSpecification/SourceFluxBoundaryCondition.hpp"
#include "fieldSpecification/EquilibriumInitialCondition.hpp"
@@ -843,17 +844,18 @@ void ReactiveCompositionalMultiphaseOBL::applySourceFluxBC( real64 const time,
RAJA::ReduceSum< parallelDeviceReduce, real64 > massProd( 0.0 );
// note that the dofArray will not be used after this step (simpler to use dofNumber instead)
- fs.computeRhsContribution< FieldSpecificationAdd,
- parallelDevicePolicy<> >( targetSet.toViewConst(),
- time + dt,
- dt,
- subRegion,
- dofNumber,
- rankOffset,
- localMatrix,
- dofArray.toView(),
- rhsContributionArrayView,
- [] GEOS_HOST_DEVICE ( localIndex const )
+ FieldSpecificationImpl::computeRhsContribution< FieldSpecificationAdd,
+ parallelDevicePolicy<> >( fs,
+ targetSet.toViewConst(),
+ time + dt,
+ dt,
+ subRegion,
+ dofNumber,
+ rankOffset,
+ localMatrix,
+ dofArray.toView(),
+ rhsContributionArrayView,
+ [] GEOS_HOST_DEVICE ( localIndex const )
{
return 0.0;
} );
@@ -923,7 +925,7 @@ bool ReactiveCompositionalMultiphaseOBL::validateDirichletBC( DomainPartition &
fsManager.apply< ElementSubRegionBase >( time,
mesh,
flow::pressure::key(),
- [&]( FieldSpecificationBase const &,
+ [&]( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const &,
ElementSubRegionBase & subRegion,
@@ -947,7 +949,7 @@ bool ReactiveCompositionalMultiphaseOBL::validateDirichletBC( DomainPartition &
fsManager.apply< ElementSubRegionBase >( time,
mesh,
flow::globalCompFraction::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const &,
ElementSubRegionBase & subRegion,
@@ -995,7 +997,7 @@ bool ReactiveCompositionalMultiphaseOBL::validateDirichletBC( DomainPartition &
fsManager.apply< ElementSubRegionBase >( time,
mesh,
flow::temperature::key(),
- [&]( FieldSpecificationBase const &,
+ [&]( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const &,
ElementSubRegionBase & subRegion,
@@ -1082,7 +1084,7 @@ void ReactiveCompositionalMultiphaseOBL::applyDirichletBC( real64 const time,
fsManager.apply< ElementSubRegionBase >( time + dt,
mesh,
flow::pressure::key(),
- [&]( FieldSpecificationBase const & fs,
+ [&]( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
@@ -1098,33 +1100,37 @@ void ReactiveCompositionalMultiphaseOBL::applyDirichletBC( real64 const time,
fs );
}
- fs.applyFieldValue< FieldSpecificationEqual, parallelDevicePolicy<> >( targetSet,
- time + dt,
- subRegion,
- flow::bcPressure::key() );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ targetSet,
+ time + dt,
+ subRegion,
+ flow::bcPressure::key() );
} );
// 2. Apply composition BC (global component fraction), store in a separate field
fsManager.apply< ElementSubRegionBase >( time + dt,
mesh,
flow::globalCompFraction::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const &,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
string const & )
{
- fs.applyFieldValue< FieldSpecificationEqual, parallelDevicePolicy<> >( targetSet,
- time + dt,
- subRegion,
- flow::bcGlobalCompFraction::key() );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ targetSet,
+ time + dt,
+ subRegion,
+ flow::bcGlobalCompFraction::key() );
} );
// 3. Apply temperature Dirichlet BCs, store in a separate field
fsManager.apply< ElementSubRegionBase >( time + dt,
mesh,
flow::temperature::key(),
- [&]( FieldSpecificationBase const & fs,
+ [&]( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
@@ -1140,10 +1146,12 @@ void ReactiveCompositionalMultiphaseOBL::applyDirichletBC( real64 const time,
fs );
}
- fs.applyFieldValue< FieldSpecificationEqual, parallelDevicePolicy<> >( targetSet,
- time + dt,
- subRegion,
- flow::bcTemperature::key() );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ targetSet,
+ time + dt,
+ subRegion,
+ flow::bcTemperature::key() );
} );
globalIndex const rankOffset = dofManager.rankOffset();
@@ -1154,7 +1162,7 @@ void ReactiveCompositionalMultiphaseOBL::applyDirichletBC( real64 const time,
fsManager.apply< ElementSubRegionBase >( time + dt,
mesh,
flow::pressure::key(),
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const &,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp
index 7c1521128b7..562cfae6df4 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp
@@ -29,6 +29,7 @@
#include "constitutive/thermalConductivity/SinglePhaseThermalConductivitySelector.hpp"
#include "fieldSpecification/AquiferBoundaryCondition.hpp"
#include "fieldSpecification/EquilibriumInitialCondition.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "fieldSpecification/SourceFluxBoundaryCondition.hpp"
#include "physicsSolvers/fluidFlow/SourceFluxStatistics.hpp"
@@ -894,18 +895,19 @@ void applyAndSpecifyFieldValue( real64 const & time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
fieldKey,
- [&]( FieldSpecificationBase const & fs,
+ [&]( FieldSpecification const & fs,
string const &,
SortedArrayView< localIndex const > const & lset,
ElementSubRegionBase & subRegion,
string const & )
{
// Specify the bc value of the field
- fs.applyFieldValue< FieldSpecificationEqual,
- parallelDevicePolicy<> >( lset,
- time_n + dt,
- subRegion,
- boundaryFieldKey );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ lset,
+ time_n + dt,
+ subRegion,
+ boundaryFieldKey );
arrayView1d< integer const > const ghostRank = subRegion.ghostRank();
arrayView1d< globalIndex const > const dofNumber =
@@ -1055,17 +1057,18 @@ void SinglePhaseBase::applySourceFluxBC( real64 const time_n,
RAJA::ReduceSum< parallelDeviceReduce, real64 > massProd( 0.0 );
// note that the dofArray will not be used after this step (simpler to use dofNumber instead)
- fs.computeRhsContribution< FieldSpecificationAdd,
- parallelDevicePolicy<> >( targetSet.toViewConst(),
- time_n + dt,
- dt,
- subRegion,
- dofNumber,
- rankOffset,
- localMatrix,
- dofArray.toView(),
- rhsContributionArrayView,
- [] GEOS_HOST_DEVICE ( localIndex const )
+ FieldSpecificationImpl::computeRhsContribution< FieldSpecificationAdd,
+ parallelDevicePolicy<> >( fs,
+ targetSet.toViewConst(),
+ time_n + dt,
+ dt,
+ subRegion,
+ dofNumber,
+ rankOffset,
+ localMatrix,
+ dofArray.toView(),
+ rhsContributionArrayView,
+ [] GEOS_HOST_DEVICE ( localIndex const )
{
return 0.0;
} );
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp
index bff2fbd0f78..b507ea1b22c 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp
@@ -26,6 +26,7 @@
#include "finiteVolume/BoundaryStencil.hpp"
#include "finiteVolume/FiniteVolumeManager.hpp"
#include "finiteVolume/FluxApproximationBase.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "fieldSpecification/AquiferBoundaryCondition.hpp"
#include "linearAlgebra/multiscale/MultiscalePreconditioner.hpp"
@@ -715,7 +716,7 @@ void SinglePhaseFVM< BASE >::applyFaceDirichletBC( real64 const time_n,
fsManager.apply< FaceManager >( time_n + dt,
mesh,
flow::pressure::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const & targetSet,
FaceManager & targetGroup,
@@ -740,18 +741,19 @@ void SinglePhaseFVM< BASE >::applyFaceDirichletBC( real64 const time_n,
pressureSets.insert( setName );
// first, evaluate BC to get primary field values (pressure)
- fs.applyFieldValue< FieldSpecificationEqual,
- parallelDevicePolicy<> >( targetSet,
- time_n + dt,
- targetGroup,
- flow::facePressure::key() );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ targetSet,
+ time_n + dt,
+ targetGroup,
+ flow::facePressure::key() );
} );
// Take BCs defined for "temperature" field and apply values to "faceTemperature"
fsManager.apply< FaceManager >( time_n + dt,
mesh,
flow::temperature::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const & targetSet,
FaceManager & targetGroup,
@@ -775,11 +777,12 @@ void SinglePhaseFVM< BASE >::applyFaceDirichletBC( real64 const time_n,
temperatureSets.insert( setName );
// Specify the bc value of the field
- fs.applyFieldValue< FieldSpecificationEqual,
- parallelDevicePolicy<> >( targetSet,
- time_n + dt,
- targetGroup,
- flow::faceTemperature::key() );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ targetSet,
+ time_n + dt,
+ targetGroup,
+ flow::faceTemperature::key() );
} );
@@ -821,7 +824,7 @@ void SinglePhaseFVM< BASE >::applyFaceDirichletBC( real64 const time_n,
fsManager.apply< FaceManager >( time_n + dt,
mesh,
flow::pressure::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const & targetSet,
FaceManager & targetGroup,
@@ -845,11 +848,12 @@ void SinglePhaseFVM< BASE >::applyFaceDirichletBC( real64 const time_n,
}
// first, evaluate BC to get primary field values (pressure)
- fs.applyFieldValue< FieldSpecificationEqual,
- parallelDevicePolicy<> >( targetSet,
- time_n + dt,
- targetGroup,
- flow::facePressure::key() );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ targetSet,
+ time_n + dt,
+ targetGroup,
+ flow::facePressure::key() );
// TODO: currently we just use model from the first cell in this stencil
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp
index 3c96ad83984..fdaf8496edb 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp
@@ -23,6 +23,7 @@
#include "constitutive/ConstitutivePassThru.hpp"
#include "constitutive/fluid/singlefluid/SingleFluidBase.hpp"
#include "fieldSpecification/AquiferBoundaryCondition.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "discretizationMethods/NumericalMethodsManager.hpp"
#include "finiteVolume/FiniteVolumeManager.hpp"
@@ -371,7 +372,7 @@ void SinglePhaseHybridFVM::applyFaceDirichletBC( real64 const time_n,
fsManager.apply< FaceManager >( time_n + dt,
mesh,
flow::bcPressure::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const & targetSet,
FaceManager & targetGroup,
@@ -392,11 +393,12 @@ void SinglePhaseHybridFVM::applyFaceDirichletBC( real64 const time_n,
// next, we use the field specification functions to apply the boundary conditions to the system
// Populate the face pressure vector at the boundaries of the domain
- fs.applyFieldValue< FieldSpecificationEqual,
- parallelDevicePolicy<> >( targetSet,
- time_n + dt,
- targetGroup,
- flow::bcPressure::key() );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ targetSet,
+ time_n + dt,
+ targetGroup,
+ flow::bcPressure::key() );
// Second, modify the residual/jacobian matrix as needed to impose the boundary conditions
forAll< parallelDevicePolicy<> >( targetSet.size(), [=] GEOS_HOST_DEVICE ( localIndex const a )
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp
index 5d543342aaa..7c2643a52b2 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp
@@ -965,17 +965,18 @@ void SinglePhaseReactiveTransport::applySourceFluxBC( real64 const time_n,
RAJA::ReduceSum< parallelDeviceReduce, real64 > massProd( 0.0 );
// note that the dofArray will not be used after this step (simpler to use dofNumber instead)
- fs.computeRhsContribution< FieldSpecificationAdd,
- parallelDevicePolicy<> >( targetSet.toViewConst(),
- time_n + dt,
- dt,
- subRegion,
- dofNumber,
- rankOffset,
- localMatrix,
- dofArray.toView(),
- rhsContributionArrayView,
- [] GEOS_HOST_DEVICE ( localIndex const )
+ FieldSpecificationImpl::computeRhsContribution< FieldSpecificationAdd,
+ parallelDevicePolicy<> >( fs,
+ targetSet.toViewConst(),
+ time_n + dt,
+ dt,
+ subRegion,
+ dofNumber,
+ rankOffset,
+ localMatrix,
+ dofArray.toView(),
+ rhsContributionArrayView,
+ [] GEOS_HOST_DEVICE ( localIndex const )
{
return 0.0;
} );
@@ -1069,7 +1070,7 @@ void SinglePhaseReactiveTransport::applyDirichletBC( real64 const time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
fields::flow::pressure::key(),
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const &,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
@@ -1111,7 +1112,7 @@ void SinglePhaseReactiveTransport::applyDirichletBC( real64 const time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
fields::flow::logPrimarySpeciesConcentration::key(),
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const &,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
@@ -1163,7 +1164,7 @@ void SinglePhaseReactiveTransport::applyDirichletBC( real64 const time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
fields::flow::temperature::key(),
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const &,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
@@ -1477,7 +1478,7 @@ void SinglePhaseReactiveTransport::applyFaceDirichletBC( real64 const time_n,
fsManager.apply< FaceManager >( time_n + dt,
mesh,
fields::flow::pressure::key(), // we have required that pressure is always present
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const &,
FaceManager &,
@@ -1528,7 +1529,7 @@ void SinglePhaseReactiveTransport::applyFaceDirichletBC( real64 const time_n,
fsManager.apply< FaceManager >( time_n + dt,
mesh,
fields::flow::pressure::key(), // we have required that pressure is always present
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const &,
FaceManager &,
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.hpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.hpp
index 8ed4b4d47e3..544b0f612f3 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.hpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.hpp
@@ -20,7 +20,6 @@
#ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASEREACTIVETRANSPORT_HPP_
#define GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASEREACTIVETRANSPORT_HPP_
-#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "physicsSolvers/fluidFlow/SinglePhaseBase.hpp"
#include "physicsSolvers/fluidFlow/SinglePhaseFVM.hpp"
#include "physicsSolvers/fluidFlow/SinglePhaseReactiveTransportFields.hpp"
@@ -242,23 +241,6 @@ class SinglePhaseReactiveTransport : public SinglePhaseBase
CRSMatrixView< real64, globalIndex const > const & localMatrix,
arrayView1d< real64 > const & localRhs ) const override;
- /**
- * @brief Utility function that encapsulates the call to FieldSpecificationBase::applyFieldValue in BC application
- * @param[in] time_n the time at the beginning of the step
- * @param[in] dt the time step
- * @param[in] mesh the mesh level object
- * @param[in] logMessage the log message issued by the solver if the bc is called
- * @param[in] fieldKey the key of the field specified in the xml file
- * @param[in] boundaryFieldKey the key of the boundary field
- */
- template< typename OBJECT_TYPE >
- void applyFieldValue( real64 const & time_n,
- real64 const & dt,
- MeshLevel & mesh,
- char const logMessage[],
- string const fieldKey,
- string const boundaryFieldKey ) const;
-
virtual void
applyAquiferBC( real64 const time,
real64 const dt,
@@ -334,41 +316,6 @@ class SinglePhaseReactiveTransport : public SinglePhaseBase
};
-template< typename OBJECT_TYPE >
-void SinglePhaseReactiveTransport::applyFieldValue( real64 const & time_n,
- real64 const & dt,
- MeshLevel & mesh,
- char const logMessage[],
- string const fieldKey,
- string const boundaryFieldKey ) const
-{
- FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance();
-
- fsManager.apply< OBJECT_TYPE >( time_n + dt,
- mesh,
- fieldKey,
- [&]( FieldSpecificationBase const & fs,
- string const & setName,
- SortedArrayView< localIndex const > const & lset,
- OBJECT_TYPE & targetGroup,
- string const & )
- {
- if( fs.getLogLevel() >= 1 && m_nonlinearSolverParameters.m_numNewtonIterations == 0 )
- {
- globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( lset.size() );
- GEOS_LOG_RANK_0( GEOS_FMT( logMessage,
- getName(), time_n+dt, fs.getCatalogName(), fs.getName(),
- setName, targetGroup.getName(), fs.getScale(), numTargetElems ) );
- }
-
- // Specify the bc value of the field
- fs.applyFieldValue< FieldSpecificationEqual,
- parallelDevicePolicy<> >( lset,
- time_n + dt,
- targetGroup,
- boundaryFieldKey );
- } );
-}
} /* namespace geos */
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp
index c0718a19e35..3087c47b322 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp
@@ -29,6 +29,7 @@
#include "constitutive/fluid/singlefluid/ParticleFluidFields.hpp"
#include "constitutive/permeability/PermeabilityFields.hpp"
#include "discretizationMethods/NumericalMethodsManager.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "mesh/DomainPartition.hpp"
#include "mesh/mpiCommunications/CommunicationTools.hpp"
@@ -661,7 +662,7 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
proppant::proppantConcentration::key(),
- [&]( FieldSpecificationBase const & fs,
+ [&]( FieldSpecification const & fs,
string const &,
SortedArrayView< localIndex const > const & lset,
ElementSubRegionBase & subRegion,
@@ -673,15 +674,16 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n,
arrayView1d< real64 const > const
proppantConc = subRegion.getReference< array1d< real64 > >( proppant::proppantConcentration::key() );
- fs.applyBoundaryConditionToSystem< FieldSpecificationEqual,
- parallelDevicePolicy<> >( lset,
- time_n + dt,
- subRegion,
- dofNumber,
- rankOffset,
- localMatrix,
- localRhs,
- proppantConc );
+ FieldSpecificationImpl::applyBoundaryConditionToSystem< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ lset,
+ time_n + dt,
+ subRegion,
+ dofNumber,
+ rankOffset,
+ localMatrix,
+ localRhs,
+ proppantConc );
} );
// Apply Dirichlet BC for component concentration
@@ -692,7 +694,7 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
proppant::proppantConcentration::key(),
- [&]( FieldSpecificationBase const &,
+ [&]( FieldSpecification const &,
string const & setName,
SortedArrayView< localIndex const > const &,
ElementSubRegionBase & subRegion,
@@ -711,7 +713,7 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
proppant::componentConcentration::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
@@ -729,10 +731,11 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n,
getDataContext() );
bcStatusMap[subRegionName][setName][comp] = true;
- fs.applyFieldValue< FieldSpecificationEqual >( targetSet,
- time_n + dt,
- subRegion,
- proppant::bcComponentConcentration::key() );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual >( fs,
+ targetSet,
+ time_n + dt,
+ subRegion,
+ proppant::bcComponentConcentration::key() );
} );
@@ -760,7 +763,7 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
proppant::proppantConcentration::key(),
- [&] ( FieldSpecificationBase const &,
+ [&] ( FieldSpecification const &,
string const &,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
diff --git a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.hpp b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.hpp
index 4b53d67075c..4345675794d 100644
--- a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.hpp
+++ b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.hpp
@@ -31,7 +31,7 @@ namespace dataRepository
{
class Group;
}
-class FieldSpecificationBase;
+class FieldSpecification;
class FiniteElementBase;
class DomainPartition;
diff --git a/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.cpp b/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.cpp
index f614a96c67b..5be2a38d1e0 100644
--- a/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.cpp
+++ b/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.cpp
@@ -29,6 +29,7 @@
#include "physicsSolvers/fluidFlow/FlowSolverBase.hpp"
#include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
@@ -360,7 +361,7 @@ real64 SeismicityRate::updateStresses( real64 const & time_n,
fsManager.apply< ElementSubRegionBase >( time_n + dt,
mesh,
key,
- [&]( FieldSpecificationBase const & fs,
+ [&]( FieldSpecification const & fs,
string const & setName,
SortedArrayView< localIndex const > const & lset,
ElementSubRegionBase & subRegion,
@@ -369,16 +370,17 @@ real64 SeismicityRate::updateStresses( real64 const & time_n,
globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( lset.size() );
GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions,
GEOS_FMT( bcLogMessage,
- this->getName(), time_n+dt, FieldSpecificationBase::catalogName(),
+ this->getName(), time_n+dt, FieldSpecification::catalogName(),
fs.getName(), setName, subRegion.getName(), fs.getScale(), numTargetElems ),
fs );
// Specify the bc value of the field
- fs.applyFieldValue< FieldSpecificationEqual,
- parallelDevicePolicy<> >( lset,
- time_n + dt,
- subRegion,
- key );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelDevicePolicy<> >( fs,
+ lset,
+ time_n + dt,
+ subRegion,
+ key );
} );
}
} );
diff --git a/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp b/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp
index 9b139e775d6..98595748809 100644
--- a/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp
+++ b/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp
@@ -15,8 +15,9 @@
#include "FieldApplicator.hpp"
#include "events/tasks/TasksManager.hpp"
+#include "fieldSpecification/FieldSpecification.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
-#include "fieldSpecification/FieldSpecificationBase.hpp"
#include "common/FieldSpecificationOps.hpp"
#include "mesh/DomainPartition.hpp"
#include "mesh/MeshBody.hpp"
@@ -90,7 +91,7 @@ FieldApplicator::
{
if( fsm.hasGroup( fsName ) )
{
- FieldSpecificationBase const & fs = fsm.getGroup< FieldSpecificationBase >( fsName );
+ FieldSpecification const & fs = fsm.getGroup< FieldSpecification >( fsName );
if( dynamic_cast< EquilibriumInitialCondition const * >( &fs ) != nullptr )
{
hasEquilibriumIC = true;
@@ -158,7 +159,7 @@ FieldApplicator::
fsName ),
InputError, getWrapperDataContext( viewKeyStruct::fieldSpecificationNamesString() ) );
- FieldSpecificationBase const & fs = fsm.getGroup< FieldSpecificationBase >( fsName );
+ FieldSpecification const & fs = fsm.getGroup< FieldSpecification >( fsName );
for( auto & meshBodyPair : domain.getMeshBodies().getSubGroups() )
{
@@ -168,12 +169,14 @@ FieldApplicator::
{
if( MeshLevel * const meshLevel = dynamic_cast< MeshLevel * >( meshLevelPair.second ) )
{
- fs.apply< ElementSubRegionBase >( *meshLevel,
- [&]( FieldSpecificationBase const & bc,
- string const &,
- SortedArrayView< localIndex const > const & targetSet,
- ElementSubRegionBase & subRegion,
- string const fieldName )
+ FieldSpecificationImpl::
+ apply< ElementSubRegionBase >( fs,
+ *meshLevel,
+ [&]( FieldSpecification const & bc,
+ string const &,
+ SortedArrayView< localIndex const > const & targetSet,
+ ElementSubRegionBase & subRegion,
+ string const fieldName )
{
// If targetRegions is specified, only apply to matching regions
if( !m_targetRegions.empty() )
@@ -195,7 +198,11 @@ FieldApplicator::
}
string const targetFieldName = getTargetFieldName( fieldName );
- bc.applyFieldValue< FieldSpecificationEqual >( targetSet, 0.0, subRegion, targetFieldName );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual >( bc,
+ targetSet,
+ 0.0,
+ subRegion,
+ targetFieldName );
} );
}
}
diff --git a/src/coreComponents/physicsSolvers/simplePDE/LaplaceBaseH1.cpp b/src/coreComponents/physicsSolvers/simplePDE/LaplaceBaseH1.cpp
index c0a49eb8bcc..1433c3ac6c0 100644
--- a/src/coreComponents/physicsSolvers/simplePDE/LaplaceBaseH1.cpp
+++ b/src/coreComponents/physicsSolvers/simplePDE/LaplaceBaseH1.cpp
@@ -20,6 +20,7 @@
#include "LaplaceBaseH1.hpp"
#include "dataRepository/InputFlags.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "mainInterface/GeosxState.hpp"
#include "mesh/mpiCommunications/CommunicationTools.hpp"
#include "mesh/DomainPartition.hpp"
@@ -210,21 +211,22 @@ void LaplaceBaseH1::
fsManager.apply< NodeManager >( time,
mesh,
m_fieldName,
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
NodeManager & targetGroup,
string const & GEOS_UNUSED_PARAM( fieldName ) )
{
- bc.applyBoundaryConditionToSystem< FieldSpecificationEqual,
- parallelDevicePolicy< > >( targetSet,
- time,
- targetGroup,
- m_fieldName,
- dofManager.getKey( m_fieldName ),
- dofManager.rankOffset(),
- localMatrix,
- localRhs );
+ FieldSpecificationImpl::applyBoundaryConditionToSystem< FieldSpecificationEqual,
+ parallelDevicePolicy< > >( bc,
+ targetSet,
+ time,
+ targetGroup,
+ m_fieldName,
+ dofManager.getKey( m_fieldName ),
+ dofManager.rankOffset(),
+ localMatrix,
+ localRhs );
} );
} );
}
diff --git a/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.cpp b/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.cpp
index aced6493e37..bfe09b66e6d 100644
--- a/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.cpp
+++ b/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.cpp
@@ -33,6 +33,7 @@
#include "constitutive/solid/Damage.hpp"
#include "physicsSolvers/LogLevelsInfo.hpp"
#include "constitutive/solid/SolidBase.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "finiteElement/FiniteElementDiscretization.hpp"
#include "finiteElement/Kinematics.h"
@@ -590,21 +591,22 @@ void PhaseFieldDamageFEM::applyDirichletBCImplicit( real64 const time,
fsManager.template apply< NodeManager >( time,
mesh,
m_fieldName,
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
NodeManager & targetGroup,
string const GEOS_UNUSED_PARAM( fieldName ) ) -> void
{
- bc.applyBoundaryConditionToSystem< FieldSpecificationEqual,
- parallelDevicePolicy< > >( targetSet,
- time,
- targetGroup,
- m_fieldName,
- dofManager.getKey( m_fieldName ),
- dofManager.rankOffset(),
- localMatrix,
- localRhs );
+ FieldSpecificationImpl::applyBoundaryConditionToSystem< FieldSpecificationEqual,
+ parallelDevicePolicy< > >( bc,
+ targetSet,
+ time,
+ targetGroup,
+ m_fieldName,
+ dofManager.getKey( m_fieldName ),
+ dofManager.rankOffset(),
+ localMatrix,
+ localRhs );
} );
fsManager.applyFieldValue< serialPolicy >( time, mesh, viewKeyStruct::coeffNameString() );
diff --git a/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.hpp b/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.hpp
index 2e69325e94d..d4d0bb5ad93 100644
--- a/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.hpp
+++ b/src/coreComponents/physicsSolvers/simplePDE/PhaseFieldDamageFEM.hpp
@@ -36,7 +36,7 @@ namespace dataRepository
{
class Group;
}
-class FieldSpecificationBase;
+class FieldSpecification;
class FiniteElementBase;
class DomainPartition;
diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp
index 9c919cffa96..2e2ab2d365d 100644
--- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp
+++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp
@@ -30,6 +30,7 @@
#include "constitutive/ConstitutiveManager.hpp"
#include "common/GEOS_RAJA_Interface.hpp"
#include "discretizationMethods/NumericalMethodsManager.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "fieldSpecification/TractionBoundaryCondition.hpp"
#include "finiteElement/FiniteElementDiscretizationManager.hpp"
@@ -636,7 +637,7 @@ real64 SolidMechanicsLagrangianFEM::explicitStep( real64 const & time_n,
fsManager.applyFieldValue( time_n + dt,
mesh,
solidMechanics::totalDisplacement::key(),
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
SortedArrayView< localIndex const > const & targetSet )
{
integer const component = bc.getComponent();
@@ -650,7 +651,7 @@ real64 SolidMechanicsLagrangianFEM::explicitStep( real64 const & time_n,
vel( a, component ) = u( a, component );
} );
},
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
SortedArrayView< localIndex const > const & targetSet )
{
integer const component = bc.getComponent();
@@ -730,21 +731,22 @@ void SolidMechanicsLagrangianFEM::applyDisplacementBCImplicit( real64 const time
fsManager.apply< NodeManager >( time,
mesh,
solidMechanics::totalDisplacement::key(),
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
NodeManager & targetGroup,
string const fieldName )
{
- bc.applyBoundaryConditionToSystem< FieldSpecificationEqual,
- parallelDevicePolicy< > >( targetSet,
- time,
- targetGroup,
- fieldName,
- dofKey,
- dofManager.rankOffset(),
- localMatrix,
- localRhs );
+ FieldSpecificationImpl::applyBoundaryConditionToSystem< FieldSpecificationEqual,
+ parallelDevicePolicy< > >( bc,
+ targetSet,
+ time,
+ targetGroup,
+ fieldName,
+ dofKey,
+ dofManager.rankOffset(),
+ localMatrix,
+ localRhs );
if( targetSet.size() > 0 && bc.getComponent() == 0 )
{
@@ -1261,22 +1263,23 @@ SolidMechanicsLagrangianFEM::
fsManager.apply< NodeManager >( time_n + dt,
mesh,
viewKeyStruct::forceString(),
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
NodeManager & targetGroup,
string const & GEOS_UNUSED_PARAM( fieldName ) )
{
// TODO: fix use of dummy name
- bc.applyBoundaryConditionToSystem< FieldSpecificationAdd,
- parallelDevicePolicy< > >( targetSet,
- time_n + dt,
- targetGroup,
- solidMechanics::totalDisplacement::key(),
- dofKey,
- dofManager.rankOffset(),
- localMatrix,
- localRhs );
+ FieldSpecificationImpl::applyBoundaryConditionToSystem< FieldSpecificationAdd,
+ parallelDevicePolicy< > >( bc,
+ targetSet,
+ time_n + dt,
+ targetGroup,
+ solidMechanics::totalDisplacement::key(),
+ dofKey,
+ dofManager.rankOffset(),
+ localMatrix,
+ localRhs );
} );
} );
diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsEmbeddedFractures.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsEmbeddedFractures.cpp
index 0fe6810a514..49058898c65 100644
--- a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsEmbeddedFractures.cpp
+++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsEmbeddedFractures.cpp
@@ -22,6 +22,7 @@
#include "common/TimingMacros.hpp"
#include "common/GEOS_RAJA_Interface.hpp"
#include "constitutive/contact/FrictionSelector.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
#include "finiteElement/elementFormulations/FiniteElementBase.hpp"
#include "linearAlgebra/utilities/LAIHelperFunctions.hpp"
@@ -528,16 +529,18 @@ void SolidMechanicsEmbeddedFractures::applyTractionBC( real64 const time_n,
fsManager.apply< ElementSubRegionBase >( time_n+ dt,
mesh,
contact::traction::key(),
- [&] ( FieldSpecificationBase const & fs,
+ [&] ( FieldSpecification const & fs,
string const &,
SortedArrayView< localIndex const > const & targetSet,
ElementSubRegionBase & subRegion,
string const & )
{
- fs.applyFieldValue< FieldSpecificationEqual, parallelHostPolicy >( targetSet,
- time_n+dt,
- subRegion,
- contact::traction::key() );
+ FieldSpecificationImpl::applyFieldValue< FieldSpecificationEqual,
+ parallelHostPolicy >( fs,
+ targetSet,
+ time_n+dt,
+ subRegion,
+ contact::traction::key() );
} );
} );
}
diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContactBubbleStab.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContactBubbleStab.cpp
index e3d63a5fed1..34417df75db 100644
--- a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContactBubbleStab.cpp
+++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContactBubbleStab.cpp
@@ -29,6 +29,7 @@
#include "physicsSolvers/LogLevelsInfo.hpp"
#include "finiteElement/FiniteElementDiscretization.hpp"
#include "constitutive/contact/FrictionSelector.hpp"
+#include "fieldSpecification/FieldSpecificationImpl.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
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 51956b4a801..d2ed40b724b 100644
--- a/src/coreComponents/physicsSolvers/wavePropagation/dg/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationDG.cpp
+++ b/src/coreComponents/physicsSolvers/wavePropagation/dg/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationDG.cpp
@@ -409,7 +409,7 @@ void AcousticWaveEquationDG::applyFreeSurfaceBC( real64 const time, DomainPartit
// fsManager.apply< FaceManager >( time,
// domain.getMeshBody( 0 ).getMeshLevel( m_discretizationName ),
// string( "FreeSurface" ),
-// [&]( FieldSpecificationBase const & bc,
+// [&]( FieldSpecification const & bc,
// string const &,
// SortedArrayView< localIndex const > const & targetSet,
// FaceManager &,
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 1dbb298ceca..e56ca81c75c 100644
--- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEM.cpp
+++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEM.cpp
@@ -379,7 +379,7 @@ void AcousticFirstOrderWaveEquationSEM::applyFreeSurfaceBC( real64 const time, D
fsManager.apply< FaceManager >( time,
domain.getMeshBody( 0 ).getMeshLevel( m_discretizationName ),
WaveSolverBase::viewKeyStruct::freeSurfaceString(),
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
FaceManager &,
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 a9a9206afdc..1cd6fafaa2f 100644
--- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEM.cpp
+++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEM.cpp
@@ -389,7 +389,7 @@ void AcousticVTIWaveEquationSEM::precomputeSurfaceFieldIndicator( DomainPartitio
fsManager.apply< FaceManager >( time,
domain.getMeshBody( 0 ).getMeshLevel( m_discretizationName ),
viewKeyStruct::lateralSurfaceString(),
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
FaceManager &,
@@ -422,7 +422,7 @@ void AcousticVTIWaveEquationSEM::precomputeSurfaceFieldIndicator( DomainPartitio
fsManager.apply< FaceManager >( time,
domain.getMeshBody( 0 ).getMeshLevel( m_discretizationName ),
viewKeyStruct::bottomSurfaceString(),
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
FaceManager &,
@@ -479,7 +479,7 @@ void AcousticVTIWaveEquationSEM::applyFreeSurfaceBC( real64 time, DomainPartitio
fsManager.apply< FaceManager >( time,
domain.getMeshBody( 0 ).getMeshLevel( m_discretizationName ),
WaveSolverBase::viewKeyStruct::freeSurfaceString(),
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
FaceManager &,
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 f6613f6c4f4..69c5bdbd525 100644
--- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp
+++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp
@@ -637,7 +637,7 @@ void AcousticWaveEquationSEM::applyFreeSurfaceBC( real64 time, DomainPartition &
fsManager.apply< FaceManager >( time,
domain.getMeshBody( 0 ).getMeshLevel( m_discretizationName ),
string( "FreeSurface" ),
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
FaceManager &,
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 ffc9fc8b4d3..833d8a76c0d 100644
--- a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEM.cpp
+++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEM.cpp
@@ -444,7 +444,7 @@ void ElasticFirstOrderWaveEquationSEM::applyFreeSurfaceBC( real64 const time, Do
fsManager.apply( time,
domain.getMeshBody( 0 ).getMeshLevel( m_discretizationName ),
WaveSolverBase::viewKeyStruct::freeSurfaceString(),
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
Group &,
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 52af88358e0..07f7c4ad5e4 100644
--- a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp
+++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp
@@ -729,7 +729,7 @@ void ElasticWaveEquationSEM::applyFreeSurfaceBC( real64 const time, DomainPartit
fsManager.apply( time,
domain.getMeshBody( 0 ).getMeshLevel( m_discretizationName ),
WaveSolverBase::viewKeyStruct::freeSurfaceString(),
- [&]( FieldSpecificationBase const & bc,
+ [&]( FieldSpecification const & bc,
string const &,
SortedArrayView< localIndex const > const & targetSet,
Group &,
diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd
index 4805f560fa5..8a586eebe36 100644
--- a/src/coreComponents/schema/schema.xsd
+++ b/src/coreComponents/schema/schema.xsd
@@ -1360,7 +1360,7 @@ When set to "silent", no output.
When set to "warning", output a warning.
When set to "error", output a throw.
-->
-
+
@@ -1377,7 +1377,7 @@ A set can be be defined by a 'Geometry' component, or correspond to imported set
-
+
@@ -1399,7 +1399,7 @@ When set to "silent", no output.
When set to "warning", output a warning.
When set to "error", output a throw.
-->
-
+
@@ -1435,7 +1435,7 @@ When set to "silent", no output.
When set to "warning", output a warning.
When set to "error", output a throw.
-->
-
+
@@ -1480,7 +1480,7 @@ When set to "silent", no output.
When set to "warning", output a warning.
When set to "error", output a throw.
-->
-
+
@@ -1515,7 +1515,7 @@ When set to "silent", no output.
When set to "warning", output a warning.
When set to "error", output a throw.
-->
-
+
@@ -1560,7 +1560,7 @@ When set to "silent", no output.
When set to "warning", output a warning.
When set to "error", output a throw.
-->
-
+
@@ -1590,7 +1590,7 @@ When set to "silent", no output.
When set to "warning", output a warning.
When set to "error", output a throw.
-->
-
+