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
Realms.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 Realms_h
10 #define Realms_h
11 
12 #include <Enums.h>
13 
14 // yaml for parsing..
15 #include <yaml-cpp/yaml.h>
16 #include <Realm.h>
17 #include <NaluParsing.h>
18 
19 #include <map>
20 #include <string>
21 #include <algorithm>
22 #include <vector>
23 
24 namespace YAML {
25 class Node;
26 }
27 
28 namespace sierra{
29 namespace nalu{
30 
31 typedef std::vector<Realm *> RealmVector;
32 
33 class Simulation;
34 
35 class Realms {
36 
37 public:
38  Realms(Simulation& sim) : simulation_(sim) {}
39  ~Realms();
40 
41  void load(const YAML::Node & node) ;
42  void breadboard();
43  void initialize();
44  Simulation *root();
45  Simulation *parent();
46  size_t size() {return realmVector_.size();}
47 
48  // find realm with operator
49  struct IsString {
50  IsString(std::string& str) : str_(str) {}
51  std::string& str_;
52  bool operator()(Realm *realm) { return realm->name_ == str_; }
53  };
54 
55  Realm *find_realm(std::string realm_name)
56  {
57  RealmVector::iterator realm_iter
58  = std::find_if(realmVector_.begin(), realmVector_.end(), IsString(realm_name));
59  if (realm_iter != realmVector_.end())
60  return *realm_iter;
61  else
62  return 0;
63  }
64 
66  RealmVector realmVector_;
67 };
68 
69 } // namespace nalu
70 } // namespace Sierra
71 
72 #endif
std::string name_
Definition: Realm.h:362
RealmVector realmVector_
Definition: Realms.h:66
Definition: Simulation.h:28
Definition: ABLForcingAlgorithm.C:26
void initialize(int N, aligned_vector &x, aligned_vector &y)
Definition: UnitTestSimdBasic.C:37
Definition: Realms.h:49
IsString(std::string &str)
Definition: Realms.h:50
size_t size()
Definition: Realms.h:46
Definition: NaluParsing.C:400
Realm * find_realm(std::string realm_name)
Definition: Realms.h:55
std::vector< Realm * > RealmVector
Definition: Realms.h:31
Realms(Simulation &sim)
Definition: Realms.h:38
Definition: Realms.h:35
Tpetra::Map< LocalOrdinal, GlobalOrdinal >::node_type Node
Definition: LinearSolver.h:32
std::string & str_
Definition: Realms.h:51
Definition: Realm.h:82
bool operator()(Realm *realm)
Definition: Realms.h:52
Simulation & simulation_
Definition: Realms.h:65