Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ AquiferBoundaryCondition::KernelWrapper AquiferBoundaryCondition::createKernelWr
pressureInfluenceFunction.createKernelWrapper() );
}

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


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

#
Expand All @@ -39,12 +43,15 @@ set( fieldSpecification_headers
set( fieldSpecification_sources
DirichletBoundaryCondition.cpp
EquilibriumInitialCondition.cpp
FieldSpecificationABC.cpp
FieldSpecificationBase.cpp
FieldSpecificationManager.cpp
SourceFluxBoundaryCondition.cpp
TractionBoundaryCondition.cpp
AquiferBoundaryCondition.cpp
PerfectlyMatchedLayer.cpp
PermeabilitySpecification.cpp
PermeabilitySpecificationFactory.cpp
)

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



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

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

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


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

#include "FieldSpecificationABC.hpp"

namespace geos
{
using namespace dataRepository;

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

FieldSpecificationABC::~FieldSpecificationABC()
{}

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

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

/**
* @file FieldSpecificationABC.hpp
*/

#ifndef GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONABC_HPP
#define GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONABC_HPP


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

namespace geos
{
class Function;


/**
* @class FieldSpecificationABC
*/
class FieldSpecificationABC : public dataRepository::Group
{
public:

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

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

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

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

/**
* @}
*/


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

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


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

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

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

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

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

};

}

#endif //GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONABC_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace geos
using namespace dataRepository;

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

Expand Down Expand Up @@ -102,13 +102,6 @@ FieldSpecificationBase::FieldSpecificationBase( string const & name, Group * par
FieldSpecificationBase::~FieldSpecificationBase()
{}

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



void FieldSpecificationBase::setMeshObjectPath( Group const & meshBodies )
Expand All @@ -131,6 +124,6 @@ void FieldSpecificationBase::setMeshObjectPath( Group const & meshBodies )



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

}
42 changes: 20 additions & 22 deletions src/coreComponents/fieldSpecification/FieldSpecificationBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "mesh/MeshObjectPath.hpp"
#include "functions/FunctionManager.hpp"
#include "common/GEOS_RAJA_Interface.hpp"
#include "FieldSpecificationABC.hpp"

namespace geos
{
Expand All @@ -41,21 +42,10 @@ class Function;
* @class FieldSpecificationBase
* A class to hold values for and administer a single boundary condition
*/
class FieldSpecificationBase : public dataRepository::Group
class FieldSpecificationBase : public FieldSpecificationABC
{
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.
Expand All @@ -67,12 +57,6 @@ class FieldSpecificationBase : public dataRepository::Group
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
Expand All @@ -88,10 +72,6 @@ class FieldSpecificationBase : public dataRepository::Group
return FieldSpecificationBase::catalogName();
}

/**
* @}
*/


/**
* @brief constructor
Expand Down Expand Up @@ -524,6 +504,24 @@ class FieldSpecificationBase : public dataRepository::Group
m_scale = scale;
}

/**
* Mutator
* @param[in] component The component index
*/
void setComponent( int component )
{
m_component = component;
}

/**
* Mutator
* @param[in] functionName The name of the function
*/
void setFunctionName( string const & functionName )
{
m_functionName = functionName;
}

/**
* Mutator
* @param[in] isInitialCondition Logical value to indicate if it is an initial condition
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2024 TotalEnergies
* Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2023-2024 Chevron
* Copyright (c) 2019- GEOS/GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/**
* @file FieldSpecificationFactory.hpp
*/

#ifndef GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONFACTORY_HPP
#define GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONFACTORY_HPP


#include "common/DataTypes.hpp"
#include "dataRepository/Group.hpp"
#include "FieldSpecificationABC.hpp"

namespace geos
{

/**
* @class FieldSpecificationFactory
*/
class FieldSpecificationFactory
{
public:

/// @brief Generate FieldSpecifications based on the given "higher-level"
/// specification
/// @param specification The higher-level specification used as a blueprint
/// to create FieldSpecification
/// @param manager The parent to store the created FieldSpecifications
virtual void generate( FieldSpecificationABC const & specification,
dataRepository::Group & manager ) const = 0;

/// @return The key that represents the element this factory is about.
/// Purpose: link the factory to the specification it uses.
virtual string const getKey() const = 0;

};

}


#endif //GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONFACTORY_HPP
Loading
Loading