iorheo.cc
Go to the documentation of this file.
//
// Input/Output option management
//
// author: Pierre.Saramito@imag.fr
//
// date: 4 february 1997
//
// HOW TO ADD NEW OPTION ?
//
// 1st case: it's only a boolean flag, e.g.
// cout << color
// => add it
// a) as an enumerate flag in `enum fmt_mode'
// b) and in the `boolean' iorheo.h declaration
// Jocelyn: also add it below in "force intialization" !!!
//
// 2nd case: you want to store e.g. a string or an int. e.g.
// cout << ncolor(10)
// => add it
// a) in iorheo.h in `scalar' declaration
// b) in iorheo.c in `RHEO_SCALAR'
// c) in iorheo constructor initializer
//
# include "rheolef/iorheo.h"
namespace rheolef {
using namespace std;
//
// RHEO_SCALAR's
//
# define boolean(stream,name)
# define member(stream,name,groupe)
# define i_scalar(t,a) iorheobase_io_scalar_body_macro(iorheo,t,a)
# define o_scalar(t,a) iorheobase_io_scalar_body_macro(iorheo,t,a)
# define io_scalar(t,a) iorheobase_io_scalar_body_macro(iorheo,t,a)
# include "rheolef/iorheo-members.h"
# undef boolean
# undef member
# undef i_scalar
# undef o_scalar
# undef io_scalar
//
// static member declaration:
//
iorheo::flag_type iorheo::static_field;
iorheo::flag_type iorheo::color_field;
iorheo::flag_type iorheo::format_field;
iorheo::flag_type iorheo::render_field;
iorheo::flag_type iorheo::default_f;
iorheo::flag_type iorheo::globals_;
//
// initialization of static data member
//
#define IORHEO_PREFIX
iorheo::force_initialization::force_initialization() {
IORHEO_PREFIX default_f [verbose] = true;
IORHEO_PREFIX default_f [execute] = true;
IORHEO_PREFIX default_f [clean] = true;
IORHEO_PREFIX default_f [rheo] = true;
IORHEO_PREFIX default_f [color] = true;
IORHEO_PREFIX default_f [fill] = true;
IORHEO_PREFIX default_f [fastfieldload] = true;
IORHEO_PREFIX default_f [bezieradapt] = true;
IORHEO_PREFIX static_field [verbose] = true;
IORHEO_PREFIX static_field [execute] = true;
IORHEO_PREFIX static_field [clean] = true;
IORHEO_PREFIX color_field [black_and_white] = true;
IORHEO_PREFIX color_field [gray] = true;
IORHEO_PREFIX color_field [color] = true;
IORHEO_PREFIX format_field [rheo] = true;
IORHEO_PREFIX format_field [hb] = true;
IORHEO_PREFIX format_field [matrix_market] = true;
IORHEO_PREFIX format_field [ml] = true;
IORHEO_PREFIX format_field [matlab] = true;
IORHEO_PREFIX format_field [sparse_matlab] = true;
IORHEO_PREFIX format_field [dump] = true;
IORHEO_PREFIX format_field [bamg] = true;
IORHEO_PREFIX format_field [peschetola] = true;
IORHEO_PREFIX format_field [grummp] = true;
IORHEO_PREFIX format_field [gmsh] = true;
IORHEO_PREFIX format_field [gmsh_pos] = true;
IORHEO_PREFIX format_field [mmg3d] = true;
IORHEO_PREFIX format_field [tetgen] = true;
IORHEO_PREFIX format_field [qmg] = true;
IORHEO_PREFIX format_field [vtkdata] = true;
IORHEO_PREFIX format_field [vtkpolydata] = true;
IORHEO_PREFIX format_field [ps] = true;
IORHEO_PREFIX format_field [gnuplot] = true;
IORHEO_PREFIX format_field [plotmtv] = true;
IORHEO_PREFIX format_field [vtk] = true;
IORHEO_PREFIX format_field [paraview] = true;
IORHEO_PREFIX format_field [geomview] = true;
IORHEO_PREFIX format_field [x3d] = true;
IORHEO_PREFIX format_field [atom] = true;
IORHEO_PREFIX render_field [logscale] = true;
IORHEO_PREFIX render_field [grid] = true;
IORHEO_PREFIX render_field [domains] = true;
IORHEO_PREFIX render_field [fill] = true;
IORHEO_PREFIX render_field [tube] = true;
IORHEO_PREFIX render_field [ball] = true;
IORHEO_PREFIX render_field [shrink] = true;
IORHEO_PREFIX render_field [full] = true;
IORHEO_PREFIX render_field [stereo] = true;
IORHEO_PREFIX render_field [cut] = true;
IORHEO_PREFIX render_field [iso] = true;
IORHEO_PREFIX render_field [split] = true;
IORHEO_PREFIX render_field [volume] = true;
IORHEO_PREFIX render_field [velocity] = true;
IORHEO_PREFIX render_field [deformation] = true;
IORHEO_PREFIX render_field [lattice] = true;
IORHEO_PREFIX render_field [showlabel] = true;
IORHEO_PREFIX render_field [skipvtk] = false;
IORHEO_PREFIX render_field [reader_on_stdin] = true;
IORHEO_PREFIX globals_ = default_f & static_field;
}
static iorheo::force_initialization dummy;
//
// constructor and destructor, copy and assignement
//
iorheo::iorheo()
:
rhstype_(string("")),
rhsfmt_(string("")),
nrhs_(0),
ivec_(0),
nptr_(0),
nidx_(0),
line_no_(0),
subdivide_(0),
ncolor_(0),
basename_(string("")),
image_format_(string("")),
mark_(string("")),
label_(string("")),
isovalue_(std::numeric_limits<Float>::max()),
n_isovalue_(15),
n_isovalue_negative_(0),
vectorscale_(1),
anglecorner_(0),
rounding_precision_(0),
branch_counter_(0),
flags_()
{
// initialized may be called before main() starts
// constructor of global variable "dummy" is used for that
// but some compiler/linker do not call constructor of global vars
check_macro (default_f != flag_type(), "static data member not initialized");
flags_ = default_f;
}
iorheo::~iorheo()
{
// trace_macro ("iorheo::dstor");
}
// ---------------------------------------------------------------------
// trivial memory handler instanciation
// ---------------------------------------------------------------------
// static variable initialization in template class:
template <>
list<iorheo*> *iorheobase_memory_handler<iorheo>::pointer_list = 0;
// class instanciation:
template class iorheobase_memory_handler<iorheo>;
iorheo*
iorheo::get_pointer (ios& s)
{
return iorheobase_memory_handler<iorheo>::get_pointer(s);
}
// ---------------------------------------------------------------------
// flags
// ---------------------------------------------------------------------
iorheo::flag_type
iorheo::flags () const
{
flag_type ret_f = (globals_ & static_field) | (flags_ & (~static_field));
return ret_f;
}
iorheo::flag_type
iorheo::flags (flag_type f1)
{
flag_type old_f = flags();
globals_ = f1 & static_field;
flags_ = f1 & (~static_field);
return old_f;
}
iorheo::flag_type
iorheo::setf (size_type i_add)
{
flag_type new_f = flags();
new_f [i_add] = true;
return flags(new_f);
}
iorheo::flag_type
iorheo::setf (size_type i_add, flag_type field)
{
flag_type new_f = flags() & (~field);
new_f [i_add] = field [i_add];
return flags(new_f);
}
iorheo::flag_type
iorheo::unsetf (size_type i_del)
{
flag_type new_f = flags();
new_f [i_del] = false;
return flags(new_f);
}
//
// for extern usage at application level
//
iorheo::flag_type
iorheo::flags (ios& s)
{
return iorheo::get_pointer(s) -> flags();
}
iorheo::flag_type
iorheo::flags (ios& s, flag_type f)
{
return iorheo::get_pointer(s) -> flags(f);
}
iorheo::flag_type
iorheo::setf (ios& s, size_type i_add)
{
return iorheo::get_pointer(s) -> setf (i_add);
}
iorheo::flag_type
iorheo::setf (ios& s, size_type i_add, flag_type field)
{
return iorheo::get_pointer(s) -> setf (i_add, field);
}
iorheo::flag_type
iorheo::unsetf (ios& s, size_type i_del)
{
return iorheo::get_pointer(s) -> unsetf (i_del);
}
} // namespace rheolef
peschetola
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format peschetola
Definition: iorheo-members.h:68
tetgen
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format format tetgen
Definition: iorheo-members.h:80
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
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
vtkdata
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 vtkdata
Definition: iorheo-members.h:91
field
see the field page for the full documentation
matrix_market
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 matrix_market
Definition: iorheo-members.h:103
rheolef::dummy
static iorheo::force_initialization dummy
Definition: iorheo.cc:147
dump
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 dump
Definition: iorheo-members.h:119
IORHEO_PREFIX
#define IORHEO_PREFIX
Definition: iorheo.cc:76
ml
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 ml
Definition: iorheo-members.h:106
hb
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 hb
Definition: iorheo-members.h:100
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
matlab
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 matlab
Definition: iorheo-members.h:109
x3d
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 x3d
Definition: iorheo-members.h:123
vtk
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 vtk
Definition: iorheo-members.h:113
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
mkgeo_ball.clean
clean
Definition: mkgeo_ball.sh:335
mmg3d
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format mmg3d
Definition: iorheo-members.h:77
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
gray
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin gray
Definition: iorheo-members.h:62
grummp
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format grummp
Definition: iorheo-members.h:74
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
qmg
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 qmg
Definition: iorheo-members.h:88
Float
see the Float page for the full documentation
mkgeo_ball.verbose
verbose
Definition: mkgeo_ball.sh:133
rheolef::iorheobase_memory_handler
Definition: iorheobase.h:144
size_type
field::size_type size_type
Definition: branch.cc:425
vtkpolydata
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 vtkpolydata
Definition: iorheo-members.h:94
rheo
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color rheo
Definition: iorheo-members.h:65
f
Definition: cavity_dg.h:29
gmsh_pos
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 gmsh_pos
Definition: iorheo-members.h:85
split
void split(const geo &omega)
Definition: geo_split.cc:28
geomview
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 geomview
Definition: iorheo-members.h:116