www.mooseframework.org
SolidMechanicsApp.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "SolidMechanicsApp.h"
11 #include "Moose.h"
12 #include "AppFactory.h"
13 #include "MooseSyntax.h"
14 
17 {
18  auto params = MooseApp::validParams();
19  params.set<bool>("automatic_automatic_scaling") = false;
20  params.set<bool>("use_legacy_material_output") = false;
21  params.set<bool>("use_legacy_initial_residual_evaluation_bahavior") = false;
22  params.addCommandLineParam<bool>("parse_neml2_only",
23  "--parse-neml2-only",
24  false,
25  "Executes the [NEML2] block in the input file and terminate.");
26  return params;
27 }
28 
29 registerKnownLabel("SolidMechanicsApp");
30 
32 {
34 }
35 
37 
38 void
40 {
42 
43  if (getParam<bool>("parse_neml2_only"))
44  {
45  // Let parse_neml2 run before anything else, and stop after that.
46  syntax().addDependency("determine_system_type", "parse_neml2");
47  actionWarehouse().setFinalTask("parse_neml2");
48  }
49 }
50 
51 void
53 {
55 
56  if (getParam<bool>("parse_neml2_only"))
57  _ready_to_exit = true;
58 }
59 
60 static void
61 associateSyntaxInner(Syntax & syntax, ActionFactory & /*action_factory*/)
62 {
63  registerSyntax("EmptyAction", "BCs/CavityPressure");
64  registerSyntax("CavityPressureAction", "BCs/CavityPressure/*");
65  registerSyntax("CavityPressurePPAction", "BCs/CavityPressure/*");
66  registerSyntax("CavityPressureUOAction", "BCs/CavityPressure/*");
67 
68  registerDeprecatedSyntax("LegacyTensorMechanicsAction",
69  "Kernels/TensorMechanics",
70  "The 'Kernels/TensorMechanics' syntax is deprecated. Please use "
71  "'Physics/SolidMechanics/QuasiStatic' instead.");
72  registerDeprecatedSyntax("LegacyDynamicTensorMechanicsAction",
73  "Kernels/DynamicTensorMechanics",
74  "The 'Kernels/DynamicTensorMechanics' syntax is deprecated. Please use "
75  "'Physics/SolidMechanics/Dynamic' instead.");
76  // For convenience, since the Kernels/XYZMechanics syntax is still around
77  registerDeprecatedSyntax("LegacyTensorMechanicsAction",
78  "Kernels/SolidMechanics",
79  "The 'Kernels/SolidMechanics' syntax is deprecated. Please use "
80  "'Physics/SolidMechanics/QuasiStatic' instead.");
81  registerDeprecatedSyntax("LegacyDynamicTensorMechanicsAction",
82  "Kernels/DynamicSolidMechanics",
83  "The 'Kernels/DynamicSolidMechanics' syntax is deprecated. Please use "
84  "'Physics/SolidMechanics/Dynamic' instead.");
85  registerSyntax("PoroMechanicsAction", "Kernels/PoroMechanics");
86 
87  registerSyntax("EmptyAction", "BCs/Pressure");
88  registerSyntax("PressureAction", "BCs/Pressure/*");
89  registerSyntax("EmptyAction", "BCs/InclinedNoDisplacementBC");
90  registerSyntax("InclinedNoDisplacementBCAction", "BCs/InclinedNoDisplacementBC/*");
91  registerSyntax("EmptyAction", "BCs/CoupledPressure");
92  registerSyntax("CoupledPressureAction", "BCs/CoupledPressure/*");
93 
94  // Deprecated Modules/TensorMechanics syntax
95  registerDeprecatedSyntax("GeneralizedPlaneStrainAction",
96  "Modules/TensorMechanics/GeneralizedPlaneStrain/*",
97  "The 'Modules/TensorMechanics' syntax is deprecated. Please use "
98  "'Physics/SolidMechanics' instead.");
99  registerDeprecatedSyntax("GlobalStrainAction",
100  "Modules/TensorMechanics/GlobalStrain/*",
101  "The 'Modules/TensorMechanics' syntax is deprecated. Please use "
102  "'Physics/SolidMechanics' instead.");
103  registerDeprecatedSyntax("CommonSolidMechanicsAction",
104  "Modules/TensorMechanics/Master",
105  "The 'Modules/TensorMechanics/Master' syntax is deprecated. Please use "
106  "'Physics/SolidMechanics/QuasiStatic' instead.");
107  registerDeprecatedSyntax(
108  "CommonSolidMechanicsAction",
109  "Modules/TensorMechanics/DynamicMaster",
110  "The 'Modules/TensorMechanics/DynamicMaster' syntax is deprecated. Please use "
111  "'Physics/SolidMechanics/Dynamic' instead.");
112  registerDeprecatedSyntax("QuasiStaticSolidMechanicsPhysics",
113  "Modules/TensorMechanics/Master/*",
114  "The 'Modules/TensorMechanics/Master' syntax is deprecated. Please use "
115  "'Physics/SolidMechanics/QuasiStatic' instead.");
116  registerDeprecatedSyntax(
117  "DynamicSolidMechanicsPhysics",
118  "Modules/TensorMechanics/DynamicMaster/*",
119  "The 'Modules/TensorMechanics/DynamicMaster' syntax is deprecated. Please use "
120  "'Physics/SolidMechanics/Dynamic' instead.");
121 
122  registerDeprecatedSyntax(
123  "CommonLineElementAction",
124  "Modules/TensorMechanics/LineElementMaster",
125  "The 'Modules/TensorMechanics/LineElementMaster' syntax is deprecated. Please use "
126  "'Physics/SolidMechanics/LineElement/QuasiStatic' instead.");
127  registerDeprecatedSyntax(
128  "LineElementAction",
129  "Modules/TensorMechanics/LineElementMaster/*",
130  "The 'Modules/TensorMechanics/LineElementMaster' syntax is deprecated. Please use "
131  "'Physics/SolidMechanics/LineElement/QuasiStatic' instead.");
132 
133  registerDeprecatedSyntax(
134  "CommonCohesiveZoneAction",
135  "Modules/TensorMechanics/CohesiveZoneMaster",
136  "The 'Modules/TensorMechanics/CohesiveZoneMaster' syntax is deprecated. Please use "
137  "'Physics/SolidMechanics/CohesiveZone' instead.");
138  registerDeprecatedSyntax(
139  "CohesiveZoneAction",
140  "Modules/TensorMechanics/CohesiveZoneMaster/*",
141  "The 'Modules/TensorMechanics/CohesiveZoneMaster' syntax is deprecated. Please use "
142  "'Physics/SolidMechanics/CohesiveZone' instead.");
143 
144  registerDeprecatedSyntax("EmptyAction",
145  "Modules/TensorMechanics/MaterialVectorBodyForce",
146  "The 'Modules/TensorMechanics' syntax is deprecated. Please use "
147  "'Physics/SolidMechanics' instead.");
148  registerDeprecatedSyntax("MaterialVectorBodyForceAction",
149  "Modules/TensorMechanics/MaterialVectorBodyForce/*",
150  "The 'Modules/TensorMechanics' syntax is deprecated. Please use "
151  "'Physics/SolidMechanics' instead.");
152 
153  // New Physics syntax
154  registerSyntax("GeneralizedPlaneStrainAction", "Physics/SolidMechanics/GeneralizedPlaneStrain/*");
155  registerSyntax("GlobalStrainAction", "Physics/SolidMechanics/GlobalStrain/*");
156  registerSyntax("CommonSolidMechanicsAction", "Physics/SolidMechanics/QuasiStatic");
157  registerSyntax("CommonSolidMechanicsAction", "Physics/SolidMechanics/Dynamic");
158  registerSyntax("QuasiStaticSolidMechanicsPhysics", "Physics/SolidMechanics/QuasiStatic/*");
159  registerSyntax("DynamicSolidMechanicsPhysics", "Physics/SolidMechanics/Dynamic/*");
160 
161  registerSyntax("CommonLineElementAction", "Physics/SolidMechanics/LineElement/QuasiStatic");
162  registerSyntax("LineElementAction", "Physics/SolidMechanics/LineElement/QuasiStatic/*");
163 
164  registerSyntax("CommonCohesiveZoneAction", "Physics/SolidMechanics/CohesiveZone");
165  registerSyntax("CohesiveZoneAction", "Physics/SolidMechanics/CohesiveZone/*");
166 
167  registerSyntax("EmptyAction", "Physics/SolidMechanics/MaterialVectorBodyForce");
168  registerSyntax("MaterialVectorBodyForceAction",
169  "Physics/SolidMechanics/MaterialVectorBodyForce/*");
170 
171  registerSyntaxTask("DomainIntegralAction", "DomainIntegral", "add_user_object");
172  registerSyntaxTask("DomainIntegralAction", "DomainIntegral", "add_aux_variable");
173  registerSyntaxTask("DomainIntegralAction", "DomainIntegral", "add_aux_kernel");
174  registerSyntaxTask("DomainIntegralAction", "DomainIntegral", "add_postprocessor");
175  registerSyntaxTask("DomainIntegralAction", "DomainIntegral", "add_vector_postprocessor");
176  registerSyntaxTask("DomainIntegralAction", "DomainIntegral", "add_material");
177 
178  registerTask("validate_coordinate_systems", /*is_required=*/false);
179  addTaskDependency("validate_coordinate_systems", "create_problem_complete");
180  addTaskDependency("setup_postprocessor_data", "validate_coordinate_systems");
181 
182  registerTask("parse_neml2", /*required=*/true);
183  syntax.addDependency("add_material", "parse_neml2");
184  syntax.addDependency("add_user_object", "parse_neml2");
185  registerSyntax("NEML2Action", "NEML2");
186 }
187 
188 void
190 {
191  Registry::registerObjectsTo(f, {"SolidMechanicsApp"});
192  Registry::registerActionsTo(af, {"SolidMechanicsApp"});
193  associateSyntaxInner(s, af);
194  registerDataFilePath();
195 }
196 
197 void
199 {
200  registerApp(SolidMechanicsApp);
201 }
202 
203 void
205 {
206  mooseDeprecated("use registerAll instead of registerObjects");
207  Registry::registerObjectsTo(factory, {"SolidMechanicsApp"});
208 }
209 
210 void
212 {
213  mooseDeprecated("use registerAll instead of associateSyntax");
214  Registry::registerActionsTo(action_factory, {"SolidMechanicsApp"});
215  associateSyntaxInner(syntax, action_factory);
216 }
217 
218 void
220 {
221  mooseDeprecated("Do not use registerExecFlags, apps no longer require flag registration");
222 }
223 
224 extern "C" void
226 {
228 }
229 extern "C" void
231 {
233 }
virtual void setupOptions()
registerKnownLabel("SolidMechanicsApp")
virtual ~SolidMechanicsApp()
void addDependency(const std::string &task, const std::string &pre_req)
static void registerAll(Factory &f, ActionFactory &af, Syntax &s)
void setFinalTask(const std::string &task)
virtual void setupOptions() override
static void registerObjectsTo(Factory &f, const std::set< std::string > &labels)
static void registerApps()
Syntax _syntax
Syntax & syntax()
static InputParameters validParams()
static void registerObjects(Factory &factory)
SolidMechanicsApp(const InputParameters &parameters)
static InputParameters validParams()
static void associateSyntaxInner(Syntax &syntax, ActionFactory &)
static void registerActionsTo(ActionFactory &f, const std::set< std::string > &labels)
Real f(Real x)
Test function for Brents method.
ActionFactory _action_factory
ActionWarehouse & actionWarehouse()
void mooseDeprecated(Args &&... args)
void SolidMechanicsApp_registerApps()
static void associateSyntax(Syntax &syntax, ActionFactory &action_factory)
static void registerExecFlags(Factory &factory)
virtual void runInputFile()
virtual void runInputFile() override
Factory _factory
void SolidMechanicsApp__registerAll(Factory &f, ActionFactory &af, Syntax &s)
bool _ready_to_exit