OGS
Project.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <memory>
7#include <vector>
8
9#include "GeoLib/GEOObjects.h"
10
11#include "MeshLib/Mesh.h"
12
15
16//namespace MeshLib {
17// class Mesh;
18//}
19
20namespace DataHolderLib
21{
22
28class Project final
29{
30public:
32 Project() = default;
33
34 Project(Project&) = delete;
35
36 ~Project() = default;
37
40
43 void addMesh(std::unique_ptr<MeshLib::Mesh> mesh);
44
47 const MeshLib::Mesh* getMesh(const std::string &name) const;
48
50 const std::vector<std::unique_ptr<MeshLib::Mesh>>& getMeshObjects() const
51 {
52 return _mesh_vec;
53 }
54
58 bool removeMesh(const std::string &name);
59
61 void addBoundaryCondition(std::unique_ptr<BoundaryCondition> bc)
62 {
63 _boundary_conditions.push_back(std::move(bc));
64 }
65
67 void addSourceTerm(std::unique_ptr<SourceTerm> st)
68 {
69 _source_terms.push_back(std::move(st));
70 }
71
73 std::vector<std::unique_ptr<BoundaryCondition>> const&
75 {
77 }
78
80 std::vector<std::unique_ptr<SourceTerm>> const& getSourceTerms() const
81 {
82 return _source_terms;
83 }
84
86 void removePrimaryVariable(std::string const& primary_var_name);
87
89 void removeBoundaryCondition(std::string const& primary_var_name,
90 std::string const& param_name);
91
93 void removeSourceTerm(std::string const& primary_var_name,
94 std::string const& param_name);
95
96private:
100 bool getUniqueName(std::string &name) const;
101
103 std::vector<std::unique_ptr<MeshLib::Mesh>>::const_iterator findMeshByName(
104 std::string const& name) const;
105 std::vector<std::unique_ptr<MeshLib::Mesh>>::iterator findMeshByName(
106 std::string const& name);
107
109 std::vector<std::unique_ptr<MeshLib::Mesh>> _mesh_vec;
110 std::vector<std::unique_ptr<BoundaryCondition>> _boundary_conditions;
111 std::vector<std::unique_ptr<SourceTerm>> _source_terms;
112};
113
114} // namespace DataHolderLib
void addBoundaryCondition(std::unique_ptr< BoundaryCondition > bc)
Adds a boundary condition to the project.
Definition Project.h:61
void removeSourceTerm(std::string const &primary_var_name, std::string const &param_name)
Remove one source term.
Definition Project.cpp:132
GeoLib::GEOObjects _geoObjects
Definition Project.h:108
const std::vector< std::unique_ptr< MeshLib::Mesh > > & getMeshObjects() const
Returns all the meshes with their respective names.
Definition Project.h:50
bool removeMesh(const std::string &name)
Definition Project.cpp:42
std::vector< std::unique_ptr< SourceTerm > > _source_terms
Definition Project.h:111
Project(Project &)=delete
void addMesh(std::unique_ptr< MeshLib::Mesh > mesh)
Definition Project.cpp:14
GeoLib::GEOObjects & getGEOObjects()
Returns the GEOObjects containing all points, polylines and surfaces.
Definition Project.h:39
void removePrimaryVariable(std::string const &primary_var_name)
Removes a primary variable incl. all associated conditions.
Definition Project.cpp:93
const MeshLib::Mesh * getMesh(const std::string &name) const
Definition Project.cpp:36
std::vector< std::unique_ptr< SourceTerm > > const & getSourceTerms() const
Returns the vector of source terms.
Definition Project.h:80
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:23
void addSourceTerm(std::unique_ptr< SourceTerm > st)
Adds a source term to the project.
Definition Project.h:67
Project()=default
Constructor.
std::vector< std::unique_ptr< BoundaryCondition > > const & getBoundaryConditions() const
Returns the vector of boundary conditions.
Definition Project.h:74
void removeBoundaryCondition(std::string const &primary_var_name, std::string const &param_name)
Removes one boundary condition.
Definition Project.cpp:116
bool getUniqueName(std::string &name) const
Definition Project.cpp:54
std::vector< std::unique_ptr< BoundaryCondition > > _boundary_conditions
Definition Project.h:110
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
Definition Project.h:109
Container class for geometric objects.
Definition GEOObjects.h:46