28#include "rheolef/geo.h"
29#include "rheolef/space_numbering.h"
30#include "rheolef/piola_util.h"
31#include "rheolef/rheostream.h"
32#include "rheolef/iorheo.h"
42put_edge (ostream& bamg,
const geo_element& K,
const basis_basic<T>& my_numb,
const geo_basic<T,sequential>& omega)
44 typedef typename geo_basic<T,sequential>::size_type
size_type;
45 static size_type order2bamg_type [11] = {0, 1, 8, 26, 27, 28, 62, 63, 64, 65, 66 };
47 check_macro (my_order <= 10,
"bamg output: element 'e' order > 10 not yet supported");
48 std::vector<size_type> inod;
50 bamg << K.dis_ie()+1 <<
" " << order2bamg_type [my_order] <<
" 2 99 2";
51 for (
size_type iloc = 0, nloc = inod.size(); iloc < nloc; iloc++) {
52 bamg <<
" " << inod[iloc]+1;
59put_triangle (ostream& bamg,
const geo_element& K,
const basis_basic<T>& my_numb,
const geo_basic<T,sequential>& omega)
61 typedef typename geo_basic<T,sequential>::size_type
size_type;
62 static size_type order2bamg_type [11] = {0, 2, 9, 21, 23, 25, 42, 43, 44, 45, 46};
65 check_macro (my_order <= 3,
"bamg output: element 't' order > 10 not yet supported");
66 std::vector<size_type> inod;
68 bamg << K.dis_ie()+1 <<
" " << order2bamg_type [my_order] <<
" 2 99 2";
69 for (
size_type iloc = 0, nloc = inod.size(); iloc < nloc; iloc++) {
70 bamg <<
" " << inod[iloc]+1;
78put_quadrangle (ostream& bamg,
const geo_element& K,
const basis_basic<T>& my_numb,
const geo_basic<T,sequential>& omega)
80 typedef typename geo_basic<T,sequential>::size_type
size_type;
81 typedef point_basic<size_type> ilat;
82 std::vector<size_type> inod;
85 for (
size_type i = 0; i < my_order; i++) {
86 for (
size_type j = 0; j < my_order; j++) {
91 bamg <<
"4\t" << inod[loc_inod00] <<
" "
92 << inod[loc_inod10] <<
" "
93 << inod[loc_inod11] <<
" "
94 << inod[loc_inod01] << endl;
101put_hexahedron (ostream& bamg,
const geo_element& K,
const basis_basic<T>& my_numb,
const geo_basic<T,sequential>& omega)
103 typedef typename geo_basic<T,sequential>::size_type
size_type;
104 typedef point_basic<size_type> ilat;
105 std::vector<size_type> inod;
108 for (
size_type i = 0; i < my_order; i++) {
109 for (
size_type j = 0; j < my_order; j++) {
110 for (
size_type k = 0; k < my_order; k++) {
119 bamg <<
"8\t" << inod[loc_inod000] <<
" "
120 << inod[loc_inod100] <<
" "
121 << inod[loc_inod110] <<
" "
122 << inod[loc_inod010] <<
" "
123 << inod[loc_inod001] <<
" "
124 << inod[loc_inod101] <<
" "
125 << inod[loc_inod111] <<
" "
126 << inod[loc_inod011] << endl;
135put (ostream& bamg,
const geo_element& K,
const basis_basic<T>& my_numb,
const geo_basic<T,sequential>& omega,
const disarray<point_basic<Float>,sequential>& my_node)
137 switch (K.variant()) {
149 default:
error_macro (
"unsupported element variant `" << K.name() <<
"'");
166 check_macro (omega.dimension() == 2,
"geo: unexpected "<<omega.dimension()<<
"d mesh for bamg output");
170 bamg << setprecision (std::numeric_limits<T>::digits10)
171 <<
"MeshVersionFormated" << endl
172 <<
"0" << endl << endl
173 <<
"Identifier" << endl
174 <<
"\"G=" << omega.familyname() <<
".bamgcad;1, Date: 01/02/28 19:43 29s\"" << endl << endl
175 <<
"Geometry" << endl
176 <<
"\"" << omega.familyname() <<
".bamgcad\"" << endl << endl;
181 bamg <<
"Vertices" << endl
182 << my_node.size() << endl;
183 for (
size_type inod = 0, nnod = my_node.size(); inod < nnod; inod++) {
184 bamg << my_node[inod][0] <<
" " << my_node[inod][1] <<
" 1" << endl;
198 return geo_put_bamg (ops, omega, my_numb, omega.get_nodes());
field::size_type size_type
see the disarray page for the full documentation
generic mesh with rerefence counting
odiststream: see the diststream page for the full documentation
static size_type ilat2loc_inod(size_type order, const point_basic< size_type > &ilat)
static size_type ilat2loc_inod(size_type order, const point_basic< size_type > &ilat)
static const variant_type H
static const variant_type q
static const variant_type e
static const variant_type p
static const variant_type T
static const variant_type P
static const variant_type t
#define error_macro(message)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format bamg
void dis_idof(const basis_basic< T > &b, const geo_size &gs, const geo_element &K, typename std::vector< size_type >::iterator dis_idof_tab)
This file is part of Rheolef.
odiststream & geo_put_bamg(odiststream &, const geo_basic< T, sequential > &)
void put(std::ostream &out, std::string name, const tiny_matrix< T > &a)
template odiststream & geo_put_bamg< Float >(odiststream &, const geo_basic< Float, sequential > &, const basis_basic< Float > &, const disarray< point_basic< Float >, sequential > &)