Chi-Tech
chi_meshhandler.cc
Go to the documentation of this file.
1#include "chi_meshhandler.h"
4
5#include "chi_log.h"
6
7//###################################################################
8/**Obtains a pointer to the last created grid. This method will
9 * get a smart-pointer to a grid object. If a volume-mesher has not
10 * been created, or if a grid is not available, this method will
11 * throw `std::logic_error`.*/
13{
14 if (volume_mesher_ == nullptr)
15 throw std::logic_error("chi_mesh::MeshHandler::GetGrid: Volume mesher "
16 "undefined. This usually means a grid is not defined"
17 " or is incomplete.");
18
19 auto& grid_ptr = volume_mesher_->GetContinuum();
20
21 if (grid_ptr == nullptr)
22 throw std::logic_error("chi_mesh::MeshHandler::GetGrid: Volume mesher has "
23 "no grid available. Make sure the volume mesher has "
24 "been executed.");
25
26 return grid_ptr;
27}
28
29
30//###################################################################
31/**Obtains a reference to the surface mesher.*/
33{
34 if (surface_mesher_ == nullptr)
35 throw std::logic_error("chi_mesh::MeshHandler::GetSurfaceMesher: "
36 "Surface mesher undefined This usually means a "
37 "grid is not defined or is incomplete.");
38 return *surface_mesher_;
39}
40
41
42//###################################################################
43/**Obtains a reference to the surface mesher.*/
45{
46 if (volume_mesher_ == nullptr)
47 throw std::logic_error("chi_mesh::MeshHandler::GetVolumeMesher: "
48 "Volume mesher undefined This usually means a "
49 "grid is not defined or is incomplete.");
50 return *volume_mesher_;
51}
52
53
54//###################################################################
55/**Obtains a reference to the surface mesher.*/
57{
58 if (surface_mesher_ == nullptr)
59 throw std::logic_error("chi_mesh::MeshHandler::GetSurfaceMesher: "
60 "Surface mesher undefined This usually means a "
61 "grid is not defined or is incomplete.");
62 return *surface_mesher_;
63}
64
65//###################################################################
66/**Obtains a reference to the surface mesher.*/
68{
69 if (volume_mesher_ == nullptr)
70 throw std::logic_error("chi_mesh::MeshHandler::GetVolumeMesher: "
71 "Volume mesher undefined This usually means a "
72 "grid is not defined or is incomplete.");
73 return *volume_mesher_;
74}
chi_mesh::SurfaceMesher & GetSurfaceMesher()
std::shared_ptr< chi_mesh::VolumeMesher > volume_mesher_
chi_mesh::MeshContinuumPtr & GetGrid() const
chi_mesh::VolumeMesher & GetVolumeMesher()
std::shared_ptr< MeshContinuum > MeshContinuumPtr
Definition: chi_mesh.h:44