Chi-Tech
chi_meshhandler.h
Go to the documentation of this file.
1#ifndef CHI_MESHHANDLER_H
2#define CHI_MESHHANDLER_H
3
4#include <utility>
5#include <vector>
6
7#include"../chi_mesh.h"
8
9
10
11/**Object for containing all mesh related variables.*/
13{
14protected:
15 std::shared_ptr<chi_mesh::SurfaceMesher> surface_mesher_ = nullptr;
16 std::shared_ptr<chi_mesh::VolumeMesher> volume_mesher_ = nullptr;
17
18public:
19 /**Obtains the grid from the volume mesher.*/
21
22 /**Returns true if the surface mesher has been set.*/
23 bool HasSurfaceMesher() const {return surface_mesher_ != nullptr;}
24
25 /**Returns true if the volume mesher has been set.*/
26 bool HasVolumeMesher() const {return volume_mesher_ != nullptr;}
27
28 /**Obtains a reference to the surface mesher. If not set, will throw
29 * `std::logic_error`.*/
31
32 /**Obtains a reference to the volume mesher. If not set, will throw
33 * `std::logic_error`.*/
35
36 /**Obtains a const reference to the surface mesher. If not set, will throw
37 * `std::logic_error`.*/
39
40 /**Obtains a const reference to the volume mesher. If not set, will throw
41 * `std::logic_error`.*/
43
44 /**Sets the active surface mesher.*/
45 void SetSurfaceMesher(std::shared_ptr<chi_mesh::SurfaceMesher> surface_mesher)
46 {surface_mesher_ = std::move(surface_mesher);}
47
48 /**Sets the active volume mesher.*/
49 void SetVolumeMesher(std::shared_ptr<chi_mesh::VolumeMesher> volume_mesher)
50 {volume_mesher_ = std::move(volume_mesher);}
51
52 /**Defaulted constructor.*/
53 MeshHandler() = default;
54
55 MeshHandler(const MeshHandler&) = delete;
57};
58
59#endif//CHI_MESHHANDLER_H
void SetVolumeMesher(std::shared_ptr< chi_mesh::VolumeMesher > volume_mesher)
MeshHandler & operator=(const MeshHandler &)=delete
chi_mesh::SurfaceMesher & GetSurfaceMesher()
std::shared_ptr< chi_mesh::VolumeMesher > volume_mesher_
bool HasVolumeMesher() const
chi_mesh::MeshContinuumPtr & GetGrid() const
bool HasSurfaceMesher() const
void SetSurfaceMesher(std::shared_ptr< chi_mesh::SurfaceMesher > surface_mesher)
MeshHandler(const MeshHandler &)=delete
chi_mesh::VolumeMesher & GetVolumeMesher()
std::shared_ptr< chi_mesh::SurfaceMesher > surface_mesher_
std::shared_ptr< MeshContinuum > MeshContinuumPtr
Definition: chi_mesh.h:44