https://mooseframework.inl.gov
THMSyntax.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 "THMSyntax.h"
11 #include "ActionFactory.h"
12 #include "Syntax.h"
13 
14 namespace THM
15 {
16 
17 void
19 {
20  syntax.registerActionSyntax("THMCreateMeshAction", "Components");
21  syntax.registerActionSyntax("AddComponentAction", "Components/*", "THM:add_component");
22  syntax.registerActionSyntax("AddComponentAction", "Components/*/*", "THM:add_component");
23  syntax.registerActionSyntax("AddClosuresAction", "Closures/*", "THM:add_closures");
24  syntax.registerActionSyntax("THMAddControlAction", "ControlLogic/*", "THM:add_control_logic");
25  syntax.registerTaskName("THM:add_control_logic", "THMControl", false);
26  syntax.registerActionSyntax("AddIterationCountPostprocessorsAction", "Debug");
27  syntax.registerActionSyntax("PostprocessorAsControlAction", "Postprocessors/*");
28  syntax.registerActionSyntax("THMDebugAction", "Debug");
29  syntax.registerActionSyntax("THMPrintComponentLoopsAction", "Debug");
30  syntax.registerActionSyntax("THMOutputVectorVelocityAction", "Outputs");
31  syntax.registerActionSyntax("THMSetupOutputAction", "Outputs");
32  syntax.registerActionSyntax("CoupledHeatTransferAction", "CoupledHeatTransfers/*", "add_bc");
33  syntax.registerActionSyntax(
34  "CoupledHeatTransferAction", "CoupledHeatTransfers/*", "add_user_object");
35  syntax.registerActionSyntax(
36  "CoupledHeatTransferAction", "CoupledHeatTransfers/*", "add_transfer");
37 }
38 
39 void
41 {
42  registerTask("THM:init_simulation", true);
43  registerTask("THM:setup_mesh", true);
44  registerTask("THM:build_mesh", true);
45  registerTask("THM:init_components", true);
46  registerTask("THM:identify_loops", true);
47  registerTask("THM:add_variables", true);
48  registerTask("THM:add_control_logic", true);
49  registerTask("THM:setup_output", true);
50  registerTask("THM:add_component_moose_objects", true);
51  registerTask("THM:integrity_check", true);
52  registerTask("THM:control_data_integrity_check", true);
53  registerTask("THM:preconditioning_integrity_check", true);
54  registerTask("THM:setup_quadrature", true);
55  registerTask("THM:debug_action", false);
56  registerTask("THM:print_component_loops", false);
57  registerTask("THM:output_vector_velocity", true);
58  registerTask("THM:add_relationship_managers", true);
59 
60  registerMooseObjectTask("THM:add_component", Component, false);
61  registerMooseObjectTask("THM:add_closures", Closures, false);
62 
63  try
64  {
65  syntax.addDependency("THM:output_vector_velocity", "setup_mesh");
66  syntax.addDependency("THM:add_closures", "setup_mesh");
67  syntax.addDependency("THM:init_components", "THM:output_vector_velocity");
68  syntax.addDependency("THM:debug_action", "setup_mesh");
69  syntax.addDependency("THM:init_simulation", "THM:add_component");
70  syntax.addDependency("add_mesh_generator", "THM:add_component");
71  syntax.addDependency("THM:identify_loops", "THM:add_component");
72  // Components must specify their blocks to the Physics before it gets initialized
73  syntax.addDependency("init_physics", "THM:init_components");
74  // Fluid properties are retrieved during component initialization
75  syntax.addDependency("THM:init_components", "add_fluid_properties");
76  // Solid material property used in a component needs a function
77  syntax.addDependency("THM:init_components", "add_function");
78  syntax.addDependency("THM:identify_loops", "add_fluid_properties");
79  syntax.addDependency("THM:integrity_check", "THM:init_components");
80  syntax.addDependency("THM:integrity_check", "THM:identify_loops");
81  syntax.addDependency("THM:integrity_check", "THM:debug_action");
82  syntax.addDependency("THM:build_mesh", "THM:init_simulation");
83  syntax.addDependency("add_mesh_generator", "THM:build_mesh");
84  syntax.addDependency("THM:setup_mesh", "create_problem_complete");
85  syntax.addDependency("add_fluid_properties", "THM:setup_mesh");
86  syntax.addDependency("add_elemental_field_variable", "add_fluid_properties");
87  syntax.addDependency("add_aux_variable", "add_fluid_properties");
88  syntax.addDependency("add_variable", "add_fluid_properties");
89  syntax.addDependency("THM:init_components", "THM:add_closures");
90  syntax.addDependency("add_variable", "THM:init_components");
91  syntax.addDependency("THM:setup_output", "add_output");
92  syntax.addDependency("THM:add_component_moose_objects", "add_material");
93  syntax.addDependency("check_output", "THM:add_component_moose_objects");
94  syntax.addDependency("THM:add_control_logic", "add_control");
95  syntax.addDependency("THM:control_data_integrity_check", "check_integrity");
96  syntax.addDependency("add_user_object", "THM:add_variables");
97  syntax.addDependency("add_output_aux_variables", "THM:add_component_moose_objects");
98  syntax.addDependency("add_periodic_bc", "THM:add_variables");
99  syntax.addDependency("THM:print_component_loops", "THM:control_data_integrity_check");
100  syntax.addDependency("THM:preconditioning_integrity_check", "check_integrity");
101  syntax.addDependency("THM:add_relationship_managers", "add_geometric_rm");
102  syntax.addDependency("THM:add_relationship_managers", "THM:add_component");
103  syntax.addDependency("THM:init_simulation", "THM:add_relationship_managers");
104  syntax.addDependency("THM:output_vector_velocity", "THM:add_relationship_managers");
105  syntax.addDependency("THM:add_variables", "THM:integrity_check");
106  }
108  {
109  mooseError("Cyclic Dependency Detected during addDependency() calls");
110  }
111 }
112 }
void addDependency(const std::string &task, const std::string &pre_req)
void mooseError(Args &&... args)
void registerTaskName(const std::string &task, bool should_auto_build=false)
void registerActions(Syntax &syntax)
Definition: THMSyntax.C:40
void registerActionSyntax(const std::string &action, const std::string &syntax, const std::string &task="", const std::string &file="", int line=-1)
void associateSyntax(Syntax &syntax)
Definition: THMSyntax.C:18
Base class for THM components.
Definition: Component.h:28