-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathFieldSpecificationBase.cpp
More file actions
129 lines (104 loc) · 5.77 KB
/
FieldSpecificationBase.cpp
File metadata and controls
129 lines (104 loc) · 5.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
* ------------------------------------------------------------------------------------------------------------
* 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 "FieldSpecificationBase.hpp"
#include "fieldSpecification/FieldSpecificationManager.hpp"
namespace geos
{
using namespace dataRepository;
FieldSpecificationBase::FieldSpecificationBase( string const & name, Group * parent ):
FieldSpecificationABC( name, parent )
{
setInputFlags( InputFlags::OPTIONAL_NONUNIQUE );
registerWrapper( viewKeyStruct::setNamesString(), &m_setNames ).
setRTTypeName( rtTypes::CustomTypes::groupNameRefArray ).
setInputFlag( InputFlags::REQUIRED ).
setSizedFromParent( 0 ).
setDescription( "Names of sets that the boundary condition is applied to.\n"
"A set can contain heterogeneous elements in the mesh (volumes, nodes, faces, edges).\n"
"A set can be be defined by a 'Geometry' component, or correspond to imported sets in case of an external mesh" );
registerWrapper( viewKeyStruct::objectPathString(), &m_objectPath ).
setRTTypeName( rtTypes::CustomTypes::groupNameRef ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Path to the target field" );
registerWrapper( viewKeyStruct::fieldNameString(), &m_fieldName ).
setRTTypeName( rtTypes::CustomTypes::groupNameRef ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Name of field that boundary condition is applied to.\n"
"A field can represent a physical variable. (pressure, temperature, global composition fraction of the fluid, ...)" );
registerWrapper( viewKeyStruct::componentString(), &m_component ).
setApplyDefaultValue( -1 ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Component of field (if tensor) to apply boundary condition to.\n"
"The component must use the order in which the phaseNames have been defined in the Constitutive Element." );
registerWrapper( viewKeyStruct::directionString(), &m_direction ).
setApplyDefaultValue( {0, 0, 0} ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Direction to apply boundary condition to." );
registerWrapper( viewKeyStruct::functionNameString(), &m_functionName ).
setRTTypeName( rtTypes::CustomTypes::groupNameRef ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Name of function that specifies variation of the boundary condition." );
registerWrapper( viewKeyStruct::bcApplicationTableNameString(), &m_bcApplicationFunctionName ).
setRTTypeName( rtTypes::CustomTypes::groupNameRef ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Name of table that specifies the on/off application of the boundary condition." );
registerWrapper( viewKeyStruct::scaleString(), &m_scale ).
setApplyDefaultValue( 0.0 ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Apply a scaling factor for the value of the boundary condition." );
registerWrapper( viewKeyStruct::initialConditionString(), &m_initialCondition ).
setApplyDefaultValue( 0 ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Boundary condition is applied as an initial condition." );
registerWrapper( viewKeyStruct::beginTimeString(), &m_beginTime ).
setApplyDefaultValue( -1.0e99 ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Time at which the boundary condition will start being applied." );
registerWrapper( viewKeyStruct::endTimeString(), &m_endTime ).
setApplyDefaultValue( 1.0e99 ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Time at which the boundary condition will stop being applied." );
registerWrapper( viewKeyStruct::errorSetModeString(), &m_emptySetErrorMode ).
setInputFlag( InputFlags::OPTIONAL ).
setApplyDefaultValue( SetErrorMode::error ).
setDescription( GEOS_FMT( "Set the log state when a “set” does not target any region\n"
"When set to \"{}\", no output.\n"
"When set to \"{}\", output a warning.\n"
"When set to \"{}\", output a throw.\n",
EnumStrings< SetErrorMode >::toString( SetErrorMode::silent ),
EnumStrings< SetErrorMode >::toString( SetErrorMode::warning ),
EnumStrings< SetErrorMode >::toString( SetErrorMode::error ) ));
}
FieldSpecificationBase::~FieldSpecificationBase()
{}
void FieldSpecificationBase::setMeshObjectPath( Group const & meshBodies )
{
try
{
m_meshObjectPaths = std::make_unique< MeshObjectPath >( m_objectPath, meshBodies );
}
catch( std::exception const & e )
{
ErrorLogger::global().modifyCurrentExceptionMessage()
.addToMsg( getWrapperDataContext( viewKeyStruct::objectPathString() ).toString() +
" is a wrong objectPath: " + m_objectPath + "\n" )
.addContextInfo( getWrapperDataContext( viewKeyStruct::objectPathString() ).getContextInfo()
.setPriority( 2 ) );
throw InputError( e, getWrapperDataContext( viewKeyStruct::objectPathString() ).toString() +
" is a wrong objectPath: " + m_objectPath + "\n" );
}
}
REGISTER_CATALOG_ENTRY( FieldSpecificationABC, FieldSpecificationBase, string const &, Group * const )
}