GEOS
FieldSpecification.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_FIELDSPECIFICATION_FIELDSPECIFICATION_HPP
21 #define GEOS_FIELDSPECIFICATION_FIELDSPECIFICATION_HPP
22 
23 
24 #include "common/DataTypes.hpp"
26 #include "dataRepository/Group.hpp"
27 #include "mesh/MeshObjectPath.hpp"
28 
29 namespace geos
30 {
31 class Function;
32 
33 
39 {
40 public:
41 
51  string const &,
52  dataRepository::Group * const >;
57  enum class SetErrorMode : integer
58  {
59  silent,
60  error,
61  warning
62  };
63 
69 
74  static string catalogName() { return "FieldSpecification"; }
75 
80  virtual const string getCatalogName() const
82 
93  FieldSpecification( string const & name, dataRepository::Group * parent );
94 
98  virtual ~FieldSpecification() override;
99 
100 
103 
106 
109 
112 
117  {
119  constexpr static char const * setNamesString() { return "setNames"; }
121  constexpr static char const * constitutivePathString() { return "constitutivePath"; }
123  constexpr static char const * objectPathString() { return "objectPath"; }
125  constexpr static char const * fieldNameString() { return "fieldName"; }
127  constexpr static char const * dataTypeString() { return "dataType"; }
129  constexpr static char const * componentString() { return "component"; }
131  constexpr static char const * directionString() { return "direction"; }
133  constexpr static char const * bcApplicationTableNameString() { return "bcApplicationTableName"; }
135  constexpr static char const * scaleString() { return "scale"; }
137  constexpr static char const * functionNameString() { return "functionName"; }
139  constexpr static char const * initialConditionString() { return "initialCondition"; }
141  constexpr static char const * beginTimeString() { return "beginTime"; }
143  constexpr static char const * endTimeString() { return "endTime"; }
145  constexpr static char const * errorSetModeString() { return "errorSetMode"; }
146  };
147 
152  string const & getFunctionName() const
153  { return m_functionName; }
154 
159  virtual const string & getObjectPath() const
160  { return m_objectPath; }
161 
166  virtual const string & getFieldName() const
167  { return m_fieldName; }
168 
173  virtual int getComponent() const
174  { return m_component; }
175 
180  virtual R1Tensor const & getDirection() const
181  { return m_direction; }
182 
188  { return m_beginTime; }
189 
195  { return m_endTime; }
196 
201  string_array const & getSetNames() const
202  { return m_setNames; }
203 
208  int initialCondition() const
209  { return m_initialCondition; }
210 
215  real64 getScale() const
216  { return m_scale; }
217 
222  void setFieldName( string const & fieldName )
223  { m_fieldName = fieldName; }
224 
229  void setObjectPath( string const & objectPath )
230  { m_objectPath = objectPath; }
231 
236  void setScale( real64 const & scale )
237  { m_scale = scale; }
238 
243  void initialCondition( bool isInitialCondition )
244  { m_initialCondition = isInitialCondition; }
245 
250  void addSetName( string const & setName )
251  { m_setNames.emplace_back( setName ); }
252 
258  void setMeshObjectPath( Group const & meshBodies );
259 
266  { return *(m_meshObjectPaths.get()); }
267 
268 
269 protected:
270 
271 
272 private:
273 
274 
276  string_array m_setNames;
277 
279  string m_objectPath;
280 
281  std::unique_ptr< MeshObjectPath > m_meshObjectPaths;
282 
285  string m_fieldName;
286 
287 
289  int m_component;
290 
292  R1Tensor m_direction;
293 
295  int m_initialCondition;
296 
298  string m_functionName;
299 
301  real64 m_scale;
302 
304  real64 m_beginTime;
305 
307  real64 m_endTime;
308 
310  string m_bcApplicationFunctionName;
311 
313  SetErrorMode m_emptySetErrorMode;
314 };
315 
320  "silent",
321  "error",
322  "warning" );
323 
324 }
325 
326 #endif //GEOS_FIELDSPECIFICATION_FIELDSPECIFICATION_HPP
virtual ~FieldSpecification() override
void initialCondition(bool isInitialCondition)
FieldSpecification(FieldSpecification &&)=default
Defaulted move constructor.
void addSetName(string const &setName)
FieldSpecification(string const &name, dataRepository::Group *parent)
constructor
virtual const string & getObjectPath() const
void setScale(real64 const &scale)
string const & getFunctionName() const
virtual const string & getFieldName() const
void setObjectPath(string const &objectPath)
string_array const & getSetNames() const
FieldSpecification & operator=(FieldSpecification const &)=delete
deleted copy assignment
void setFieldName(string const &fieldName)
FieldSpecification(FieldSpecification const &)=delete
Deleted copy constructor.
virtual int getComponent() const
void setMeshObjectPath(Group const &meshBodies)
Set the Mesh Object Path object.
virtual R1Tensor const & getDirection() const
MeshObjectPath const & getMeshObjectPaths() const
Get the Mesh Object Paths object.
FieldSpecification & operator=(FieldSpecification &&)=delete
deleted move assignement
Class to hold the path to a collection of mesh objects.
This class provides the base class/interface for the catalog value objects.
std::unordered_map< std::string, std::unique_ptr< CatalogInterface< BASETYPE, ARGS... > > > CatalogType
This is the type that will be used for the catalog. The catalog is actually instantiated in the BASET...
static CatalogInterface::CatalogType & getCatalog()
static function to return static catalog.
static string catalogName()
Static Factory Catalog Functions.
SetErrorMode
Indicate the error handling mode.
virtual const string getCatalogName() const
return the catalog name
stdVector< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:361
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
int integer
Signed integer type.
Definition: DataTypes.hpp:81
ENUM_STRINGS(LinearSolverParameters::SolverType, "direct", "cg", "gmres", "fgmres", "bicgstab", "richardson", "preconditioner")
Declare strings associated with enumeration values.
constexpr static char const * componentString()
constexpr static char const * errorSetModeString()
constexpr static char const * initialConditionString()
constexpr static char const * setNamesString()
constexpr static char const * fieldNameString()
constexpr static char const * endTimeString()
constexpr static char const * constitutivePathString()
constexpr static char const * directionString()
constexpr static char const * scaleString()
constexpr static char const * objectPathString()
constexpr static char const * beginTimeString()
constexpr static char const * dataTypeString()
constexpr static char const * bcApplicationTableNameString()
constexpr static char const * functionNameString()