28 #include "rheolef/geo.h"
29 #include "rheolef/rheostream.h"
30 #include "rheolef/iorheo.h"
45 check_macro (ips.good(),
"bad input stream for vtk");
46 istream& is = ips.is();
63 node.get_values (ips);
64 check_macro (ips.good(),
"bad input stream for vtk");
70 xmin[k] = std::numeric_limits<T>::max();
71 xmax[k] = std::numeric_limits<T>::min();
73 for (
size_t i = 0,
n = node.size(); i <
n; ++i) {
75 xmin[k] = std::min (node[i][k], xmin[k]);
76 xmax[k] = std::max (node[i][k], xmax[k]);
95 if (mark ==
"VERTICES") {
103 if (mark ==
"POLYGONS" || mark ==
"LINES" || mark ==
"CELLS")
break;
104 }
while (is >> ws >> mark);
105 bool have_vtk_cell_type =
false;
106 string mesh_fmt = mark;
109 else if (mesh_fmt ==
"CELLS") { hdr.
map_dimension = 0; have_vtk_cell_type =
true; }
110 else error_macro (
"geo: unexpected `" << mesh_fmt <<
"' in vtk input."
111 <<
" Expect LINES, POLYGONS or CELLS.");
117 std::vector<size_type> cell_trash (ncs);
118 for (
size_type ics = 0; ics < ncs; ics++) {
119 is >> cell_trash [ics];
121 std::vector<size_type> vtk_cell_type (ne);
122 if (have_vtk_cell_type) {
124 check_macro (mark ==
"CELL_TYPES",
"geo: unexpected `" << mark <<
"' in vtk input."
125 <<
" Expect CELL_TYPES.");
128 check_macro (ne == ne2,
"geo: unexpected CELL_TYPES size=`" << ne2 <<
"' , expect size="<<ne);
130 is >> vtk_cell_type [ie];
136 for (
size_type ie = 0, ics = 0; ie < ne; ie++) {
143 for (
size_type iloc = 0 ; iloc < nloc; iloc++, ics++) {
144 elt[ie][iloc] = cell_trash [ics];
155 std::array<disarray_t, reference_element::max_variant> tmp_geo_element;
162 std::array<size_type, 4> counter;
167 tmp_geo_element [
variant] [ige] = elt[ie];
field::size_type size_type
see the point page for the full documentation
see the disarray page for the full documentation
void build_from_data(const geo_header &hdr, const disarray< node_type, sequential > &node, std::array< disarray< geo_element_auto<>, sequential >, reference_element::max_variant > &tmp_geo_element, bool do_upgrade)
generic mesh with rerefence counting
static variant_type last_variant_by_dimension(size_type dim)
static variant_type first_variant_by_dimension(size_type dim)
variant_type variant() const
#define error_macro(message)
#define warning_macro(message)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
size_type nnod(const basis_basic< T > &b, const geo_size &gs, size_type map_dim)
This file is part of Rheolef.
bool scatch(std::istream &in, const std::string &ch, bool full_match=true)
scatch: see the rheostream page for the full documentation
size_t vtk_cell_type2variant(size_t vtk_cell_type)
idiststream & geo_get_vtk(idiststream &ips, geo_basic< T, sequential > &omega)
template idiststream & geo_get_vtk< Float >(idiststream &, geo_basic< Float, sequential > &)