Chi-Tech
volmesher_extruder.h
Go to the documentation of this file.
1#ifndef VOLUME_MESHER_EXTRUDER_H
2#define VOLUME_MESHER_EXTRUDER_H
3
4#include <utility>
5
7#include "mesh/Cell/cell.h"
8
9
10
11//###################################################################
12/**An extruder mesher taking a flat surface and extruding it.*/
14{
15public:
16 enum class TemplateType : int
17 {
18 UNPARTITIONED_MESH = 2
19 };
20 struct MeshLayer
21 {
22 std::string name;
23 double height;
25 };
26private:
28 std::shared_ptr<const UnpartitionedMesh> template_unpartitioned_mesh_ = nullptr;
29
30 std::vector<MeshLayer> input_layers_;
31 std::vector<double> vertex_layers_;
33
34 uint64_t zmax_bndry_id = 4;
35 uint64_t zmin_bndry_id = 5;
36
37public:
38 explicit
39 VolumeMesherExtruder(std::shared_ptr<const chi_mesh::UnpartitionedMesh> in_unpartitioned_mesh) :
41 template_type_(TemplateType::UNPARTITIONED_MESH),
42 template_unpartitioned_mesh_(std::move(in_unpartitioned_mesh))
43 {}
44
45 const std::vector<double>& GetVertexLayers() const {return vertex_layers_;}
46 void AddLayer(const MeshLayer& new_layer) {input_layers_.push_back(new_layer);}
47
48 void Execute() override;
49
50private:
51 //utils
52 void SetupLayers(int default_layer_count=1);
53
55 size_t level);
57
58
59 bool HasLocalScope(
60 const chi_mesh::Cell& template_cell,
61 const chi_mesh::MeshContinuum& template_continuum,
62 size_t z_level);
63
64 std::unique_ptr<chi_mesh::Cell>
65 MakeExtrudedCell(const chi_mesh::Cell& template_cell,
66 const chi_mesh::MeshContinuum& grid,
67 size_t z_level,
68 uint64_t cell_global_id,
69 int partition_id,
70 size_t num_template_cells);
71
72 void CreateLocalNodes(chi_mesh::MeshContinuum& template_grid,
74
75 void ExtrudeCells(chi_mesh::MeshContinuum& template_grid,
77
78};
79
80
81
82#endif //VOLUME_MESHER_EXTRUDER_H
chi_mesh::Vector3 ProjectCentroidToLevel(const chi_mesh::Vector3 &centroid, size_t level)
void CreateLocalNodes(chi_mesh::MeshContinuum &template_grid, chi_mesh::MeshContinuum &grid)
bool HasLocalScope(const chi_mesh::Cell &template_cell, const chi_mesh::MeshContinuum &template_continuum, size_t z_level)
std::shared_ptr< const UnpartitionedMesh > template_unpartitioned_mesh_
int GetCellKBAPartitionIDFromCentroid(chi_mesh::Vector3 &centroid)
const std::vector< double > & GetVertexLayers() const
VolumeMesherExtruder(std::shared_ptr< const chi_mesh::UnpartitionedMesh > in_unpartitioned_mesh)
void ExtrudeCells(chi_mesh::MeshContinuum &template_grid, chi_mesh::MeshContinuum &grid)
void AddLayer(const MeshLayer &new_layer)
std::unique_ptr< chi_mesh::Cell > MakeExtrudedCell(const chi_mesh::Cell &template_cell, const chi_mesh::MeshContinuum &grid, size_t z_level, uint64_t cell_global_id, int partition_id, size_t num_template_cells)
std::vector< MeshLayer > input_layers_
std::vector< double > vertex_layers_
void SetupLayers(int default_layer_count=1)