geo(3)
NAME
geo - the finite element mesh class
SYNOPSYS
The geo class defines a container for a finite element mesh. This
describes the nodes coordinates and the connectivity. geo can contains
domains, usefull for boundary condition setting.
EXAMPLE
- A sample usage of the geo class writes
- #include "rheolef/rheolef.h"
void main () {geo g;
cin >> g;
cout << plotmtv << g; - }
DESCRIPTION
- The empty constructor makes an empty geo. A string argument, as
- geo g("square");
- will recursively look for a `square.geo[.gz]' file in the directory mentionned by the RHEOPATH environment variable, while gzip decompression is assumed. If the file starts with `.' as `./square' or with a `/' as in `/home/oscar/square', no search occurs. Also, if the environment variable RHEOPATH is not set, the default value is the current directory.
- Input and output on streams are available, and manipulators works for text or graphic output (see geo(1)).
- Finally, an STL-like interface provides efficient accesses to nodes, elements and domains.
MESH ADAPTATION
The geo_adapt functions performs a mesh adaptation to improve the
P1-Lagrange interpolation of the field given in argument (see
field(3)).
AXISYMETRIC GEOMETRY
The coordinate_system and set_coordinate_system members supports both
cartesian, rz and zr (axisymmetric) coordinate systems. This information is used by the form class (see form(3)).
ACCESS TO CONNECTIVITY
- The folowing code prints triangle vertex numbers
- geo omega ("circle");
for (geo::const_iterator i = g.begin(); i != i.end(); i++) {const geo_element& K = *i;
if (K.name() != 't') continue;
for (geo::size_type j = 0; j < 3; j++)cout << K [j] << " ";cout << endl; - }
- See . geo_element internal}'.
ACCESS TO VERTICE COORDINATES
- The folowing code prints vertices coordinate
- for (geo::const_iterator_vertex i = g.begin_vertex(); i != g.end_node(); i++) {
const point& xi = *i;
for (geo::size_type j = 0; j < g.dimension(); j++)cout << xi [j] << " ";cout << endl; - }
ACCESS TO DOMAINS
- The following code prints edges on domain:
- for (geo::const_iterator_domain i = g.begin_domain(); i != i.end_domain(); i++) {
const domain& dom = *i;
if (dom.dimension() != 2) continue;
for (domain::const_iterator j = dom.begin(); j < dom.end(); j++) {const geo_element& E = *j;
cout << E [0] << " " << E[1] << endl;}
cout << endl; - }
- See domain(3).
ENVIRONS
RHEOPATH: search path for geo data file. Also form(3).
IMPLEMENTATION
class geo : public smart_pointer<georep> {
public:
- // typedefs:
- typedef georep::plot_options plot_options;
void write_gnuplot_postscript_options (std::ostream& plot, const plot_options& opt) const; - typedef georep::iterator iterator;
typedef georep::const_iterator const_iterator;
typedef georep::elemlist_type elemlist_type;
typedef georep::nodelist_type nodelist_type;
typedef georep::size_type size_type;
typedef georep::domlist_type domlist_type; - typedef georep::const_iterator_node const_iterator_node;
typedef georep::const_iterator_vertex const_iterator_vertex;
typedef georep::const_iterator_domain const_iterator_domain;
typedef georep::iterator_node iterator_node;
typedef georep::iterator_vertex iterator_vertex;
typedef georep::iterator_domain iterator_domain; - // allocators/deallocators:
explicit geo (const std::string& filename, const std::string& coord_sys = "cartesian");
geo(const geo& g, const domain& d);
geo(const nodelist_type& p, const geo& g);
geo();- friend geo geo_adapt (const class field& criteria, const Float& hcoef,
bool reinterpolate_criteria = false);
- friend geo geo_adapt (const class field& criteria,
const adapt_option_type& = adapt_option_type(),
bool reinterpolate_criteria = false); - friend geo geo_metric_adapt (const field& mh,
const adapt_option_type& = adapt_option_type());
- // input/output:
friend std::istream& operator >> (std::istream&, geo&);
friend std::ostream& operator << (std::ostream&, const geo&);
void save () const;
void use_double_precision_in_saving();
std::ostream& dump (std::ostream& s = std::cerr) const;
std::ostream& put_mtv_domains (std::ostream&, size_type=0) const;- // accessors:
const point& vertex (size_type i) const;
const geo_element& element (size_type K_idx) const;
Float measure (const geo_element& K) const;- std::string name() const;
std::string basename() const;
// Family name plus number
std::string familyname() const;
// For moving boundary problems
size_type number() const;
// Number of moving boundary mesh
size_type version() const;
// Refinment iteration for the current mesh number
size_type dimension() const;
size_type map_dimension() const;
std::string coordinate_system () const; // "cartesian", "rz", "zr"
fem_helper::coordinate_type coordinate_system_type() const; - size_type serial_number() const;
- const domain& boundary() const;
void build_subregion(const domain& start_from, const domain& dont_cross,std::string name, std::string name_of_complement=""); - // Builds a new domain on the side of domain `dont_cross' on which `start_from' // lies. These must have no intersection.
- size_type size() const;
size_type n_element() const; // same as size()
size_type n_vertex() const;
size_type n_vertice() const;
size_type n_node() const; // same as n_vertex()
size_type n_edge() const ;
size_type n_face() const ;
size_type n_triangle() const ;
size_type n_quadrangle() const ;
size_type n_volume() const ;
size_type n_tetraedra() const ;
size_type n_prism() const ;
size_type n_hexaedra() const ;
size_type n_subgeo(size_type d) const ;
size_type n_element(reference_element::enum_type t) const; - Float hmin() const;
Float hmax() const;
const point& xmin() const;
const point& xmax() const; - meshpoint hatter (const point& x, size_type K) const;
point dehatter (const meshpoint& S) const;
point dehatter (const point& x_hat, size_type e) const; - const_iterator begin() const;
const_iterator end() const;
const_iterator_node begin_node() const;
const_iterator_node end_node() const;
const_iterator_vertex begin_vertex() const;
const_iterator_vertex end_vertex() const; - // localizer:
bool localize (const point& x, geo_element::size_type& element) const;
void localize_nearest (const point& x, point& y, geo_element::size_type& element) const;
bool trace (const point& x0, const point& v, point& x, Float& t, size_type& element) const; - // access to domains:
const domain& get_domain(size_type i) const;
size_type n_domain() const;
bool has_domain (const std::string& domname) const;
const domain& operator[] (const std::string& domname) const;
const_iterator_domain begin_domain() const;
const_iterator_domain end_domain() const; - point normal (const geo_element& S) const;
point normal (const geo_element& K, georep::size_type side_idx) const;
void
sort_interface(const domain&, const interface&) const;
class field
normal (const class space& Nh, const domain& d,const std::string& region="") const; - class field
normal (const class space& Nh, const domain& d, const interface& bc) const;
class field
tangent (const class space& Nh, const domain& d,const std::string& region="") const; - class field
tangent (const class space& Nh, const domain& d, const interface& bc) const;// Gives normal to d in discontinuous space Nh (P0 or P1d) and can // initialize orientation of domain through `bc' data structure.
// Currently limited to straight-sided elements. - class field
tangent_spline (const space& Nh, const domain& d, const interface& bc) const;
class field
plane_curvature (const space& Nh, const domain& d,const interface& bc) const; - // Gives curvature of d in the (x,y) or (r,z) plane.
// Currently limited to straight-sided elements. - class field
plane_curvature_spline (const space& Nh, const domain& d, - const interface& bc) const;
- // Gives curvature of d in the (x,y) or (r,z) plane based on a spline interpolation.
- class field
plane_curvature_quadratic (const space& Nh, const domain& d, - const interface& bc) const;
- // Gives curvature of d in the (x,y) or (r,z) plane based on a local quadratic interpolation.
- class field
axisymmetric_curvature (const class space& Nh, const domain& d) const;
class field
axisymmetric_curvature (const class space& Nh, const domain& d, - const interface& bc) const;
- // Specific to "rz" and "zr" coordinate systems:
// Gives curvature of d in a plane orthogonal to the (r,z) plane.
// Can also initialize orientation of domain through `bc' data structure. // Currently limited to straight-sided elements. - void
interface_process (const domain& d, const interface& bc, - geometric_event& event) const;
- // Detects event along domain d sorted according to bc's.
- // construction of jump-interface domain data:
void jump_interface(const domain& interface, const domain& subgeo, - std::map<size_type, tiny_vector<size_type> >& special_elements, std::map<size_type,size_type>& node_global_to_interface) const;
- // comparator:
bool operator == (const geo&) const;
bool operator != (const geo&) const;- // modifiers
void set_name (const std::string&);
void set_coordinate_system (const std::string&); // "cartesian", "rz", "zr" void upgrade();
void label_interface(const domain& dom1, const domain& dom2, const std::string& name);- // modify domains
void erase_domain (const std::string& name);
void insert_domain (const domain&); - // accessors to internals:
- bool localizer_initialized () const;
void init_localizer (const domain& boundary, Float tolerance=-1, int list_size=0) const;
const size_type* get_geo_counter() const;
const size_type* get_element_counter() const; - // TO BE REMOVED
int gnuplot2d (const std::string& basename,plot_options& opt) const; - // check consistency
void check() const;- protected:
friend class spacerep;
friend class field;- void may_have_version_2() const; // fatal if not !
- // modifiers to internals:
void set_dimension (size_type d);
iterator begin();
iterator end();
iterator_node begin_node();
iterator_node end_node();
iterator_vertex begin_vertex();
iterator_vertex end_vertex();- };