OGS
Project.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <memory>
14 #include <vector>
15 
16 #include "GeoLib/GEOObjects.h"
17 
18 #include "MeshLib/Mesh.h"
19 
22 
23 //namespace MeshLib {
24 // class Mesh;
25 //}
26 
27 namespace DataHolderLib
28 {
29 
35 class Project final
36 {
37 public:
39  Project() = default;
40 
41  Project(Project&) = delete;
42 
43  ~Project() = default;
44 
47 
50  void addMesh(std::unique_ptr<MeshLib::Mesh> mesh);
51 
54  const MeshLib::Mesh* getMesh(const std::string &name) const;
55 
57  const std::vector<std::unique_ptr<MeshLib::Mesh>>& getMeshObjects() const
58  {
59  return _mesh_vec;
60  }
61 
65  bool removeMesh(const std::string &name);
66 
68  void addBoundaryCondition(std::unique_ptr<BoundaryCondition> bc)
69  {
70  _boundary_conditions.push_back(std::move(bc));
71  }
72 
74  void addSourceTerm(std::unique_ptr<SourceTerm> st)
75  {
76  _source_terms.push_back(std::move(st));
77  }
78 
80  std::vector<std::unique_ptr<BoundaryCondition>> const&
82  {
83  return _boundary_conditions;
84  }
85 
87  std::vector<std::unique_ptr<SourceTerm>> const& getSourceTerms() const
88  {
89  return _source_terms;
90  }
91 
93  void removePrimaryVariable(std::string const& primary_var_name);
94 
96  void removeBoundaryCondition(std::string const& primary_var_name,
97  std::string const& param_name);
98 
100  void removeSourceTerm(std::string const& primary_var_name,
101  std::string const& param_name);
102 
103 private:
107  bool getUniqueName(std::string &name) const;
108 
110  std::vector<std::unique_ptr<MeshLib::Mesh>>::const_iterator findMeshByName(
111  std::string const& name) const;
112  std::vector<std::unique_ptr<MeshLib::Mesh>>::iterator findMeshByName(
113  std::string const& name);
114 
116  std::vector<std::unique_ptr<MeshLib::Mesh>> _mesh_vec;
117  std::vector<std::unique_ptr<BoundaryCondition>> _boundary_conditions;
118  std::vector<std::unique_ptr<SourceTerm>> _source_terms;
119 };
120 
121 } // namespace DataHolderLib
Definition of the GEOObjects class.
Definition of the Mesh class.
GeoLib::GEOObjects & getGEOObjects()
Returns the GEOObjects containing all points, polylines and surfaces.
Definition: Project.h:46
void addBoundaryCondition(std::unique_ptr< BoundaryCondition > bc)
Adds a boundary condition to the project.
Definition: Project.h:68
void removeSourceTerm(std::string const &primary_var_name, std::string const &param_name)
Remove one source term.
Definition: Project.cpp:139
GeoLib::GEOObjects _geoObjects
Definition: Project.h:115
bool removeMesh(const std::string &name)
Definition: Project.cpp:49
std::vector< std::unique_ptr< SourceTerm > > _source_terms
Definition: Project.h:118
const std::vector< std::unique_ptr< MeshLib::Mesh > > & getMeshObjects() const
Returns all the meshes with their respective names.
Definition: Project.h:57
Project(Project &)=delete
void addMesh(std::unique_ptr< MeshLib::Mesh > mesh)
Definition: Project.cpp:21
std::vector< std::unique_ptr< BoundaryCondition > > const & getBoundaryConditions() const
Returns the vector of boundary conditions.
Definition: Project.h:81
void removePrimaryVariable(std::string const &primary_var_name)
Removes a primary variable incl. all associated conditions.
Definition: Project.cpp:100
const MeshLib::Mesh * getMesh(const std::string &name) const
Definition: Project.cpp:43
std::vector< std::unique_ptr< SourceTerm > > const & getSourceTerms() const
Returns the vector of source terms.
Definition: Project.h:87
std::vector< std::unique_ptr< MeshLib::Mesh > >::const_iterator findMeshByName(std::string const &name) const
Returns an iterator to the first found mesh with the given name.
Definition: Project.cpp:30
void addSourceTerm(std::unique_ptr< SourceTerm > st)
Adds a source term to the project.
Definition: Project.h:74
Project()=default
Constructor.
void removeBoundaryCondition(std::string const &primary_var_name, std::string const &param_name)
Removes one boundary condition.
Definition: Project.cpp:123
bool getUniqueName(std::string &name) const
Definition: Project.cpp:61
std::vector< std::unique_ptr< BoundaryCondition > > _boundary_conditions
Definition: Project.h:117
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
Definition: Project.h:116
Container class for geometric objects.
Definition: GEOObjects.h:61