Nalu
Nalu: a generalized unstructured massively parallel low Mach flow code designed to support a variety of energy applications of interest (most notably Wind ECP) built on the Sierra Toolkit and Trilinos solver Tpetra/Epetra stack. The open source BSD, clause 3 license model has been chosen for the code base. See LICENSE for more information. http://NaluCFD.org
EquationSystems.h
Go to the documentation of this file.
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2014 Sandia Corporation. */
3 /* This software is released under the license detailed */
4 /* in the file, LICENSE, which is located in the top-level Nalu */
5 /* directory structure */
6 /*------------------------------------------------------------------------*/
7 
8 
9 #ifndef EquationSystems_h
10 #define EquationSystems_h
11 
12 #include <Enums.h>
13 
14 // yaml for parsing..
15 #include <yaml-cpp/yaml.h>
16 #include<NaluParsing.h>
17 
18 // stk
19 namespace stk{
20 namespace mesh{
21 class Part;
22 }
23 }
24 
25 #include <map>
26 #include <string>
27 #include <vector>
28 
29 namespace YAML {
30  class Node;
31 }
32 
33 #include<vector>
34 #include<string>
35 
36 namespace sierra{
37 namespace nalu{
38 
39 class Realm;
40 class EquationSystem;
41 class PostProcessingData;
42 class Simulation;
44 
45 typedef std::vector<EquationSystem *> EquationSystemVector;
46 
57 {
58  public:
59 
61  Realm &realm);
62  ~EquationSystems();
63 
64  void load(const YAML::Node & node);
65 
66  std::string get_solver_block_name(
67  const std::string eqName);
68 
69  void breadboard();
70 
71  Simulation *root();
72  Realm *parent();
73 
74  // ease of access methods to particular equation system
75  size_t size() {return equationSystemVector_.size();}
76  EquationSystem *operator[](int i) { return equationSystemVector_[i];}
77 
78  void register_nodal_fields(
79  const std::vector<std::string> targetNames);
80 
81  void register_edge_fields(
82  const std::vector<std::string> targetNames);
83 
84  void register_element_fields(
85  const std::vector<std::string> targetNames);
86 
87  void register_interior_algorithm(
88  const std::vector<std::string> targetNames);
89 
90  void register_wall_bc(
91  const std::string targetName,
92  const WallBoundaryConditionData &wallBCData);
93 
94  void register_inflow_bc(
95  const std::string targetName,
96  const InflowBoundaryConditionData &inflowBCData);
97 
98  void register_open_bc(
99  const std::string targetName,
100  const OpenBoundaryConditionData &openBCData);
101 
102  void register_symmetry_bc(
103  const std::string targetName,
104  const SymmetryBoundaryConditionData &symmetryBCData);
105 
106  void register_periodic_bc(
107  const std::string targetNameMaster,
108  const std::string targetNameSlave,
109  const PeriodicBoundaryConditionData &periodicBCData);
110 
111  void register_overset_bc(
112  const OversetBoundaryConditionData &oversetBCData);
113 
114  void register_non_conformal_bc(
115  const NonConformalBoundaryConditionData &nonConformalBCData);
116 
117  void register_surface_pp_algorithm(
118  const PostProcessingData &theData);
119 
120  void register_initial_condition_fcn(
121  stk::mesh::Part *part,
122  const UserFunctionInitialConditionData &fcnIC);
123 
124  void initialize();
125  void reinitialize_linear_system();
126  void post_adapt_work();
127  void populate_derived_quantities();
128  void initial_work();
129 
160  bool solve_and_update();
161  double provide_system_norm();
162  double provide_mean_system_norm();
163 
164  void predict_state();
165  void populate_boundary_data();
166  void boundary_data_to_state_data();
167  void provide_output();
168  void dump_eq_time();
169  void pre_timestep_work();
170  void post_converged_work();
171  void evaluate_properties();
172 
178  void pre_iter_work();
179 
186  void post_iter_work();
187 
189  std::string name_;
191 
192  EquationSystemVector equationSystemVector_;
193  std::map<std::string, std::string> solverSpecMap_;
194 
196  std::vector<AlgorithmDriver*> preIterAlgDriver_;
197 
199  std::vector<AlgorithmDriver*> postIterAlgDriver_;
200 };
201 
202 } // namespace nalu
203 } // namespace Sierra
204 
205 #endif
std::vector< AlgorithmDriver * > preIterAlgDriver_
A list of tasks to be performed before all EquationSystem solve_and_update.
Definition: EquationSystems.h:196
Definition: Simulation.h:28
std::vector< EquationSystem * > EquationSystemVector
Definition: EquationSystems.h:43
Definition: ABLForcingAlgorithm.C:26
int maxIterations_
Definition: EquationSystems.h:190
void initialize(int N, aligned_vector &x, aligned_vector &y)
Definition: UnitTestSimdBasic.C:37
size_t size()
Definition: EquationSystems.h:75
std::map< std::string, std::string > solverSpecMap_
Definition: EquationSystems.h:193
Definition: NaluParsing.h:320
Realm & realm_
Definition: EquationSystems.h:188
Definition: Algorithm.h:14
EquationSystemVector equationSystemVector_
Definition: EquationSystems.h:192
A collection of Equations to be solved on a Realm.
Definition: EquationSystems.h:56
EquationSystem * operator[](int i)
Definition: EquationSystems.h:76
Definition: NaluParsing.h:325
Definition: NaluParsing.h:305
Base class representation of a PDE.
Definition: EquationSystem.h:46
std::string name_
Definition: EquationSystems.h:189
Definition: NaluParsing.C:400
Definition: NaluParsing.h:330
Definition: NaluParsing.h:310
Definition: NaluParsing.h:315
Definition: AlgorithmDriver.h:22
std::vector< AlgorithmDriver * > postIterAlgDriver_
A list of tasks to be performed after all EquationSystem solve_and_update.
Definition: EquationSystems.h:199
Definition: PostProcessingData.h:18
Tpetra::Map< LocalOrdinal, GlobalOrdinal >::node_type Node
Definition: LinearSolver.h:32
Definition: Realm.h:82