geo_seq_put.cc
Go to the documentation of this file.
#include "rheolef/geo.h"
#include "rheolef/geo_domain.h"
#include "rheolef/rheostream.h"
#include "rheolef/iorheo.h"
namespace rheolef {
// external graphic drivers:
template <class T> odiststream& visu_gnuplot (odiststream&, const geo_basic<T,sequential>&);
template <class T> odiststream& visu_vtk_paraview (odiststream&, const geo_basic<T,sequential>&);
template <class T> odiststream& geo_put_gmsh (odiststream&, const geo_basic<T,sequential>&);
template <class T> odiststream& geo_put_bamg (odiststream&, const geo_basic<T,sequential>&);
template <class T>
odiststream&
geo_basic<T,sequential>::put (odiststream& ops) const {
iorheo::flag_type format = iorheo::flags(ops.os()) & iorheo::format_field;
if (format [iorheo::gnuplot]) { return visu_gnuplot (ops,*this); }
if (format [iorheo::paraview]){ return visu_vtk_paraview (ops,*this); }
if (format [iorheo::gmsh]) { return geo_put_gmsh (ops,*this); }
if (format [iorheo::bamg]) { return geo_put_bamg (ops,*this); }
return base::data().put (ops); // in .geo format
}
template <class T>
odiststream&
geo_rep<T,sequential>::put_geo (odiststream& ops) const {
using namespace std;
size_type n_vert = base::_node.dis_size ();
size_type n_elt = base::_gs.ownership_by_dimension[base::_gs._map_dimension].dis_size ();
//
// put header
//
ops << setprecision(numeric_limits<T>::digits10)
<< "#!geo" << endl
<< endl
<< "mesh" << endl
<< base::_version;
if (base::_version == 4) {
geo_header h;
h.dimension = base::_dimension;
h.sys_coord = base::_sys_coord;
h.order = base::order();
h.dis_size_by_variant [0] = base::_node.dis_size();
if (base::_have_connectivity) {
// put all
for (size_type variant = 1; variant < reference_element::max_variant; variant++) {
h.dis_size_by_variant [variant] = base::_geo_element [variant].dis_size();
}
} else {
// put only d-dimensional elements, as was the input
for (size_type variant = reference_element::first_variant_by_dimension(base::_gs._map_dimension);
variant < reference_element:: last_variant_by_dimension(base::_gs._map_dimension); variant++) {
h.dis_size_by_variant [variant] = base::_geo_element [variant].dis_size();
}
}
ops << endl << h << endl;
}
//
// put nodes
//
T rounding_prec = iorheo::getrounding_precision(ops.os());
if (rounding_prec == 0) {
base::_node.put_values (ops, _point_put<T>(base::_dimension));
} else {
base::_node.put_values (ops, _round_point_put<T>(base::_dimension, rounding_prec));
}
ops << endl;
//
// put elements
//
if (base::_gs._map_dimension > 0) {
for (size_type variant = reference_element::first_variant_by_dimension(base::_gs._map_dimension);
variant < reference_element:: last_variant_by_dimension(base::_gs._map_dimension); variant++) {
base::_geo_element [variant].put_values (ops);
}
ops << endl;
}
//
// put faces & edges
//
if (base::_gs._map_dimension > 1 && base::_have_connectivity) {
for (size_type side_dim = base::_gs._map_dimension - 1; side_dim >= 1; side_dim--) {
for (size_type variant = reference_element::first_variant_by_dimension(side_dim);
variant < reference_element:: last_variant_by_dimension(side_dim); variant++) {
base::_geo_element [variant].put_values (ops);
}
}
}
//
// put domains
//
for (typename std::vector<domain_indirect_basic<sequential> >::const_iterator
iter = base::_domains.begin(), last = base::_domains.end();
iter != last; ++iter) {
ops << endl;
(*iter).put (ops);
}
return ops;
}
// ----------------------------------------------------------------------------
// instanciation in library
// ----------------------------------------------------------------------------
template class geo_rep <Float,sequential>;
template odiststream& geo_basic<Float,sequential>::put (odiststream&) const;
} // namespace rheolef
rheolef::reference_element::last_variant_by_dimension
static variant_type last_variant_by_dimension(size_type dim)
Definition: reference_element.h:150
put
void put(idiststream &in, odiststream &out, bool do_proj, bool do_lumped_mass, bool def_fill_opt, size_type extract_id, const Float &scale_value, const std::pair< Float, Float > &u_range, render_type render)
Definition: branch.cc:500
paraview
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format format format format format format format format format format format format format format format format format format paraview
Definition: iorheo-members.h:125
mkgeo_contraction.h
h
Definition: mkgeo_contraction.sh:179
rheolef::geo_abstract_base_rep::size_type
geo_element_hack::size_type size_type
Definition: geo.h:260
mkgeo_ball.order
order
Definition: mkgeo_ball.sh:343
rheolef::geo_rep
sequential mesh representation
Definition: domain_indirect.h:63
rheolef::visu_vtk_paraview
odiststream & visu_vtk_paraview(odiststream &, const field_basic< T, sequential > &)
Definition: field_seq_visu_vtk_paraview.cc:47
rheolef::odiststream::os
std::ostream & os()
Definition: diststream.h:236
rheolef::reference_element::first_variant_by_dimension
static variant_type first_variant_by_dimension(size_type dim)
Definition: reference_element.h:148
rheolef::geo_put_gmsh
odiststream & geo_put_gmsh(odiststream &ods, const geo_basic< T, sequential > &)
Definition: geo_seq_put_gmsh.cc:305
bamg
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format bamg
Definition: iorheo-members.h:71
mkgeo_ball.variant
variant
Definition: mkgeo_ball.sh:149
gmsh
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format format format gmsh
Definition: iorheo-members.h:83
rheolef::geo_iterator
geo iterator
Definition: geo.h:193
gnuplot
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format format format format format format format format format format format format format format format format gnuplot
Definition: iorheo-members.h:121
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::odiststream
odiststream: see the diststream page for the full documentation
Definition: diststream.h:126
rheolef::visu_gnuplot
odiststream & visu_gnuplot(odiststream &, const field_basic< T, sequential > &)
Definition: field_seq_visu_gnuplot.cc:461
rheolef::reference_element::max_variant
static const variant_type max_variant
Definition: reference_element.h:82
rheolef::domain_indirect_basic< sequential >
Definition: domain_indirect.h:342
rheolef::space_constant::vector
@ vector
Definition: space_constant.h:137
rheolef::_point_put
point output helper
Definition: geo.h:163
rheolef::_round_point_put
point output helper, with rounding feature
Definition: geo.h:171
rheolef::std
Definition: vec_expr_v2.h:391
rheolef::geo_header
Definition: geo_header.h:32
rheolef::geo_put_bamg
odiststream & geo_put_bamg(odiststream &, const geo_basic< T, sequential > &)
Definition: geo_seq_put_bamg.cc:195
T
Expr1::float_type T
Definition: field_expr.h:218