-
Notifications
You must be signed in to change notification settings - Fork 101
feat: add PermeabilitySpecification as an high-level FieldSpecification #4019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
kdrienCG
wants to merge
14
commits into
develop
Choose a base branch
from
feature/kdrienCG/permeabilitySpecification
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0c79a66
add FieldSpecificationABC abstract class
kdrienCG f234750
Move FieldSpecificationBase catalog to FieldSpecificationABC
kdrienCG cf11e8f
add PermeabilitySpecification
kdrienCG 35d9a46
add FieldSpecificationFactory interface
kdrienCG a5ddb58
Add PermeabilitySpecificationFactory
kdrienCG 7098e09
Add specifications factory creation logic to FieldSpecificationManager
kdrienCG dca1b4a
set description for scales wrapper
kdrienCG 1efaccf
change type of m_scales to R1Tensor
kdrienCG e40b8c9
modify for loop type to integer
kdrienCG c736a7d
add RST documentation for PermeabilitySpecification
kdrienCG 42f7c62
uncrustify
kdrienCG 7a2d7e8
Merge branch 'develop' into feature/kdrienCG/permeabilitySpecification
kdrienCG 16f7e43
add missing documentation
kdrienCG 74cda9c
fix parameter name
kdrienCG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/coreComponents/fieldSpecification/FieldSpecificationABC.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * ------------------------------------------------------------------------------------------------------------ | ||
| * SPDX-License-Identifier: LGPL-2.1-only | ||
| * | ||
| * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC | ||
| * Copyright (c) 2018-2024 TotalEnergies | ||
| * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University | ||
| * Copyright (c) 2023-2024 Chevron | ||
| * Copyright (c) 2019- GEOS/GEOSX Contributors | ||
| * All rights reserved | ||
| * | ||
| * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. | ||
| * ------------------------------------------------------------------------------------------------------------ | ||
| */ | ||
|
|
||
| #include "FieldSpecificationABC.hpp" | ||
|
|
||
| namespace geos | ||
| { | ||
| using namespace dataRepository; | ||
|
|
||
| FieldSpecificationABC::FieldSpecificationABC( string const & name, Group * parent ): | ||
| Group( name, parent ) | ||
| {} | ||
|
|
||
| FieldSpecificationABC::~FieldSpecificationABC() | ||
| {} | ||
|
|
||
| FieldSpecificationABC::CatalogInterface::CatalogType & | ||
| FieldSpecificationABC::getCatalog() | ||
| { | ||
| static FieldSpecificationABC::CatalogInterface::CatalogType catalog; | ||
| return catalog; | ||
| } | ||
|
|
||
| } |
107 changes: 107 additions & 0 deletions
107
src/coreComponents/fieldSpecification/FieldSpecificationABC.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| /* | ||
| * ------------------------------------------------------------------------------------------------------------ | ||
| * SPDX-License-Identifier: LGPL-2.1-only | ||
| * | ||
| * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC | ||
| * Copyright (c) 2018-2024 TotalEnergies | ||
| * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University | ||
| * Copyright (c) 2023-2024 Chevron | ||
| * Copyright (c) 2019- GEOS/GEOSX Contributors | ||
| * All rights reserved | ||
| * | ||
| * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. | ||
| * ------------------------------------------------------------------------------------------------------------ | ||
| */ | ||
|
|
||
| /** | ||
| * @file FieldSpecificationABC.hpp | ||
| */ | ||
|
|
||
| #ifndef GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONABC_HPP | ||
| #define GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONABC_HPP | ||
|
|
||
|
|
||
| #include "common/DataTypes.hpp" | ||
| #include "dataRepository/Group.hpp" | ||
| #include "functions/FunctionBase.hpp" | ||
| #include "functions/FunctionManager.hpp" | ||
|
|
||
| namespace geos | ||
| { | ||
| class Function; | ||
|
|
||
|
|
||
| /** | ||
| * @class FieldSpecificationABC | ||
| * | ||
| * Abstract Base Class grouping multiple types of field specifications. | ||
| */ | ||
| class FieldSpecificationABC : public dataRepository::Group | ||
| { | ||
| public: | ||
|
|
||
| /** | ||
| * @defgroup alias and functions to 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ | |
| #include "mesh/MeshObjectPath.hpp" | ||
| #include "functions/FunctionManager.hpp" | ||
| #include "common/GEOS_RAJA_Interface.hpp" | ||
| #include "FieldSpecificationABC.hpp" | ||
|
|
||
| namespace geos | ||
| { | ||
|
|
@@ -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. | ||
|
|
@@ -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 | ||
|
|
@@ -88,10 +72,6 @@ class FieldSpecificationBase : public dataRepository::Group | |
| return FieldSpecificationBase::catalogName(); | ||
| } | ||
|
|
||
| /** | ||
| * @} | ||
| */ | ||
|
|
||
|
|
||
| /** | ||
| * @brief constructor | ||
|
|
@@ -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; | ||
| } | ||
|
Comment on lines
+511
to
+514
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1 liners (only the methods you added, as you did the rest in another PR) |
||
|
|
||
| /** | ||
| * 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 | ||
|
|
||
59 changes: 59 additions & 0 deletions
59
src/coreComponents/fieldSpecification/FieldSpecificationFactory.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /* | ||
| * ------------------------------------------------------------------------------------------------------------ | ||
| * 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 | ||
| * | ||
| * This class provides a way to create FieldSpecification objects using | ||
| * other type of specifications. One could think of those types of | ||
| * specification to blueprints or "high-level" specification | ||
| */ | ||
| 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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.