30 std::vector<double> boundary_coords;
31 std::vector<int> physical_tags;
32 std::vector<int> bounding_tags;
34 EntityEntry(std::size_t tag, std::vector<double>&& boundary_coords,
35 std::vector<int>&& physical_tags, std::vector<int>&& bounding_tags)
37 boundary_coords(std::move(boundary_coords)),
38 physical_tags(std::move(physical_tags)),
39 bounding_tags(std::move(bounding_tags)) {}
40 EntityEntry(std::size_t tag, std::vector<double>&& boundary_coords,
41 std::vector<int>&& physical_tags)
43 boundary_coords(std::move(boundary_coords)),
44 physical_tags(std::move(physical_tags)) {}
54struct PhysicalNamesSection {
55 int num_physical_names{};
56 std::vector<int> dimensions{};
57 std::vector<int> physical_tags{};
58 std::vector<std::string> names{};
60 PhysicalNamesSection() =
default;
61 PhysicalNamesSection(
int num_physical_names, std::vector<int>&& dimensions,
62 std::vector<int>&& physical_tags, std::vector<std::string>&& names)
63 : num_physical_names(num_physical_names),
64 dimensions(std::move(dimensions)),
65 physical_tags(std::move(physical_tags)),
66 names(std::move(names)) {};
73 std::size_t num_nodes_in_block;
74 std::vector<std::size_t> node_tags;
75 std::vector<double> node_coords;
77 NodesBlock(
int entity_dim,
int entity_tag,
int parametric, std::size_t num_nodes_in_block,
78 std::vector<std::size_t>&& node_tags, std::vector<double>&& node_coords)
79 : entity_dim(entity_dim),
80 entity_tag(entity_tag),
81 parametric(parametric),
82 num_nodes_in_block(num_nodes_in_block),
83 node_tags(std::move(node_tags)),
84 node_coords(std::move(node_coords)) {}
88 std::size_t num_entity_blocks{};
89 std::size_t num_nodes{};
90 std::size_t min_node_tag{};
91 std::size_t max_node_tag{};
92 std::vector<NodesBlock> blocks{};
94 NodesSection() =
default;
95 NodesSection(std::size_t num_entity_blocks, std::size_t num_nodes, std::size_t min_node_tag,
96 std::size_t max_node_tag, std::vector<NodesBlock>&& blocks)
97 : num_entity_blocks(num_entity_blocks),
99 min_node_tag(min_node_tag),
100 max_node_tag(max_node_tag),
101 blocks(std::move(blocks)) {}
108 std::size_t num_elements_in_block;
109 std::vector<std::size_t> data;
111 ElementBlock(
int entity_dim,
int entity_tag,
int element_type, std::size_t num_elements_in_block,
112 std::vector<std::size_t>&& data)
113 : entity_dim(entity_dim),
114 entity_tag(entity_tag),
115 element_type(element_type),
116 num_elements_in_block(num_elements_in_block),
117 data(std::move(data)) {}
120struct ElementSection {
121 std::size_t num_element_blocks{};
122 std::size_t num_elements{};
123 std::size_t min_element_tag{};
124 std::size_t max_element_tag{};
125 std::vector<ElementBlock> blocks{};
127 ElementSection() =
default;
128 ElementSection(std::size_t num_element_blocks, std::size_t num_elements,
129 std::size_t min_element_tag, std::size_t max_element_tag,
130 std::vector<ElementBlock>&& blocks)
131 : num_element_blocks(num_element_blocks),
132 num_elements(num_elements),
133 min_element_tag(min_element_tag),
134 max_element_tag(max_element_tag),
135 blocks(std::move(blocks)) {}
143 : mesh_format_section(std::move(mesh_format_section)),
144 physical_names_section(std::move(physical_names_section)),
145 entities_section(std::move(entities_section)),
146 nodes_section(std::move(nodes_section)),
147 elements_section(std::move(elements_section)) {}
149 explicit GMSHFile(std::istream& f_handler) { read(f_handler); }
158 void read(std::istream& f_handler);