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("AddHeatStructureMaterialAction",
21  "HeatStructureMaterials/*",
22  "THM:add_heat_structure_material");
23  syntax.registerActionSyntax("THMCreateMeshAction", "Components");
24  syntax.registerActionSyntax("AddComponentAction", "Components/*", "THM:add_component");
25  syntax.registerActionSyntax("AddComponentAction", "Components/*/*", "THM:add_component");
26  syntax.registerActionSyntax("AddClosuresAction", "Closures/*", "THM:add_closures");
27  syntax.registerActionSyntax("THMAddControlAction", "ControlLogic/*", "THM:add_control_logic");
28  syntax.registerTaskName("THM:add_control_logic", "THMControl", false);
29  syntax.registerActionSyntax("AddIterationCountPostprocessorsAction", "Debug");
30  syntax.registerActionSyntax("PostprocessorAsControlAction", "Postprocessors/*");
31  syntax.registerActionSyntax("THMDebugAction", "Debug");
32  syntax.registerActionSyntax("THMPrintComponentLoopsAction", "Debug");
33  syntax.registerActionSyntax("THMOutputVectorVelocityAction", "Outputs");
34  syntax.registerActionSyntax("THMSetupOutputAction", "Outputs");
35  syntax.registerActionSyntax("CoupledHeatTransferAction", "CoupledHeatTransfers/*", "add_bc");
36  syntax.registerActionSyntax(
37  "CoupledHeatTransferAction", "CoupledHeatTransfers/*", "add_user_object");
38  syntax.registerActionSyntax(
39  "CoupledHeatTransferAction", "CoupledHeatTransfers/*", "add_transfer");
40 }
41 
42 void
44 {
45  registerTask("THM:init_simulation", true);
46  registerTask("THM:setup_mesh", true);
47  registerTask("THM:build_mesh", true);
48  registerTask("THM:init_components", true);
49  registerTask("THM:identify_loops", true);
50  registerTask("THM:add_variables", true);
51  registerTask("THM:add_control_logic", true);
52  registerTask("THM:setup_output", true);
53  registerTask("THM:add_component_moose_objects", true);
54  registerTask("THM:integrity_check", true);
55  registerTask("THM:control_data_integrity_check", true);
56  registerTask("THM:preconditioning_integrity_check", true);
57  registerTask("THM:setup_quadrature", true);
58  registerTask("THM:debug_action", false);
59  registerTask("THM:print_component_loops", false);
60  registerTask("THM:output_vector_velocity", true);
61  registerTask("THM:add_relationship_managers", true);
62 
63  registerMooseObjectTask("THM:add_component", Component, false);
64  registerMooseObjectTask("THM:add_heat_structure_material", SolidMaterialProperties, false);
65  registerMooseObjectTask("THM:add_closures", Closures, false);
66 
67  try
68  {
69  syntax.addDependency("THM:output_vector_velocity", "setup_mesh");
70  syntax.addDependency("THM:add_closures", "setup_mesh");
71  syntax.addDependency("THM:init_components", "THM:output_vector_velocity");
72  syntax.addDependency("THM:debug_action", "setup_mesh");
73  syntax.addDependency("THM:init_simulation", "THM:add_component");
74  syntax.addDependency("add_mesh_generator", "THM:add_component");
75  syntax.addDependency("THM:identify_loops", "THM:add_component");
76  // Components must specify their blocks to the Physics before it gets initialized
77  syntax.addDependency("init_physics", "THM:init_components");
78  // Fluid properties are retrieved during component initialization
79  syntax.addDependency("THM:init_components", "add_fluid_properties");
80  // Solid material property used in a component needs a function
81  syntax.addDependency("THM:init_components", "add_function");
82  syntax.addDependency("THM:identify_loops", "add_fluid_properties");
83  syntax.addDependency("THM:integrity_check", "THM:init_components");
84  syntax.addDependency("THM:integrity_check", "THM:identify_loops");
85  syntax.addDependency("THM:integrity_check", "THM:debug_action");
86  syntax.addDependency("THM:build_mesh", "THM:init_simulation");
87  syntax.addDependency("add_mesh_generator", "THM:build_mesh");
88  syntax.addDependency("THM:setup_mesh", "create_problem_complete");
89  syntax.addDependency("add_fluid_properties", "THM:setup_mesh");
90  syntax.addDependency("add_elemental_field_variable", "add_fluid_properties");
91  syntax.addDependency("add_aux_variable", "add_fluid_properties");
92  syntax.addDependency("add_variable", "add_fluid_properties");
93  syntax.addDependency("THM:init_components", "THM:add_heat_structure_material");
94  syntax.addDependency("THM:init_components", "THM:add_closures");
95  syntax.addDependency("add_variable", "THM:init_components");
96  syntax.addDependency("THM:setup_output", "add_output");
97  syntax.addDependency("THM:add_component_moose_objects", "add_material");
98  syntax.addDependency("check_output", "THM:add_component_moose_objects");
99  syntax.addDependency("THM:add_control_logic", "add_control");
100  syntax.addDependency("THM:control_data_integrity_check", "check_integrity");
101  syntax.addDependency("add_user_object", "THM:add_variables");
102  syntax.addDependency("add_output_aux_variables", "THM:add_component_moose_objects");
103  syntax.addDependency("add_periodic_bc", "THM:add_variables");
104  syntax.addDependency("THM:print_component_loops", "THM:control_data_integrity_check");
105  syntax.addDependency("THM:preconditioning_integrity_check", "check_integrity");
106  syntax.addDependency("THM:add_relationship_managers", "add_geometric_rm");
107  syntax.addDependency("THM:add_relationship_managers", "THM:add_component");
108  syntax.addDependency("THM:init_simulation", "THM:add_relationship_managers");
109  syntax.addDependency("THM:output_vector_velocity", "THM:add_relationship_managers");
110  syntax.addDependency("THM:add_variables", "THM:integrity_check");
111  }
113  {
114  mooseError("Cyclic Dependency Detected during addDependency() calls");
115  }
116 }
117 }
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:43
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:27