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&
gmsh,
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 order2gmsh_type [11] = {0, 1, 8, 26, 27, 28, 62, 63, 64, 65, 66 };
47 check_macro (my_order <= 10,
"gmsh output: element 'e' order > 10 not yet supported");
48 std::vector<size_type> inod;
50 gmsh << K.dis_ie()+1 <<
" " << order2gmsh_type [my_order] <<
" 2 99 2";
51 for (
size_type iloc = 0, nloc = inod.size(); iloc < nloc; iloc++) {
52 gmsh <<
" " << inod[iloc]+1;
59put_triangle (ostream&
gmsh,
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 order2gmsh_type [11] = {0, 2, 9, 21, 23, 25, 42, 43, 44, 45, 46};
65 check_macro (my_order <= 3,
"gmsh output: element 't' order > 10 not yet supported");
66 std::vector<size_type> inod;
68 gmsh << K.dis_ie()+1 <<
" " << order2gmsh_type [my_order] <<
" 2 99 2";
69 for (
size_type iloc = 0, nloc = inod.size(); iloc < nloc; iloc++) {
70 gmsh <<
" " << inod[iloc]+1;
78put_quadrangle (ostream&
gmsh,
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 gmsh <<
"4\t" << inod[loc_inod00] <<
" "
92 << inod[loc_inod10] <<
" "
93 << inod[loc_inod11] <<
" "
94 << inod[loc_inod01] << endl;
101put_tetrahedron (ostream&
gmsh,
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; i+j < my_order; j++) {
110 for (
size_type k = 0; i+j+k < my_order; k++) {
115 gmsh <<
"4\t" << inod[loc_inod000] <<
" "
116 << inod[loc_inod100] <<
" "
117 << inod[loc_inod010] <<
" "
118 << inod[loc_inod001] << endl;
119 if (i+j+k+2 > my_order)
continue;
124 gmsh <<
"4\t" << inod[loc_inod100] <<
" "
125 << inod[loc_inod101] <<
" "
126 << inod[loc_inod010] <<
" "
127 << inod[loc_inod001] << endl
128 <<
"4\t" << inod[loc_inod010] <<
" "
129 << inod[loc_inod011] <<
" "
130 << inod[loc_inod001] <<
" "
131 << inod[loc_inod101] << endl
132 <<
"4\t" << inod[loc_inod100] <<
" "
133 << inod[loc_inod101] <<
" "
134 << inod[loc_inod110] <<
" "
135 << inod[loc_inod010] << endl
136 <<
"4\t" << inod[loc_inod010] <<
" "
137 << inod[loc_inod110] <<
" "
138 << inod[loc_inod011] <<
" "
139 << inod[loc_inod101] << endl;
141 if (i+j+k+3 > my_order)
continue;
143 gmsh <<
"4\t" << inod[loc_inod111] <<
" "
144 << inod[loc_inod101] <<
" "
145 << inod[loc_inod011] <<
" "
146 << inod[loc_inod110] << endl;
153raw_put_prism (ostream&
gmsh,
154 size_t i000,
size_t i100,
size_t i010,
155 size_t i001,
size_t i101,
size_t i011)
158 gmsh <<
"6\t" << i000 <<
" "
168put_prism (ostream&
gmsh,
const geo_element& K,
const basis_basic<T>& my_numb,
const geo_basic<T,sequential>& omega,
const disarray<point_basic<Float>,sequential>& my_node)
170 typedef typename geo_basic<T,sequential>::size_type
size_type;
171 typedef point_basic<size_type> ilat;
172 std::vector<size_type> inod;
175 for (
size_type k = 0; k < my_order; k++) {
176 for (
size_type j = 0; j < my_order; j++) {
177 for (
size_type i = 0; i+j < my_order; i++) {
191 if (i+j+1 >= my_order)
continue;
208put_hexahedron (ostream&
gmsh,
const geo_element& K,
const basis_basic<T>& my_numb,
const geo_basic<T,sequential>& omega)
210 typedef typename geo_basic<T,sequential>::size_type
size_type;
211 typedef point_basic<size_type> ilat;
212 std::vector<size_type> inod;
215 for (
size_type i = 0; i < my_order; i++) {
216 for (
size_type j = 0; j < my_order; j++) {
217 for (
size_type k = 0; k < my_order; k++) {
226 gmsh <<
"8\t" << inod[loc_inod000] <<
" "
227 << inod[loc_inod100] <<
" "
228 << inod[loc_inod110] <<
" "
229 << inod[loc_inod010] <<
" "
230 << inod[loc_inod001] <<
" "
231 << inod[loc_inod101] <<
" "
232 << inod[loc_inod111] <<
" "
233 << inod[loc_inod011] << endl;
242put (ostream&
gmsh,
const geo_element& K,
const basis_basic<T>& my_numb,
const geo_basic<T,sequential>& omega,
const disarray<point_basic<Float>,sequential>& my_node)
244 switch (K.variant()) {
256 default:
error_macro (
"unsupported element variant `" << K.name() <<
"'");
276 gmsh << setprecision (std::numeric_limits<T>::digits10)
277 <<
"$MeshFormat" << endl
279 <<
"$EndMeshFormat" << endl;
284 gmsh <<
"$Nodes" << endl
285 << my_node.size() << endl;
286 for (
size_type inod = 0, nnod = my_node.size(); inod < nnod; inod++) {
287 gmsh << inod+1 <<
" " << my_node[inod] << endl;
289 gmsh <<
"$EndNodes" << endl;
293 size_type map_dim = omega.map_dimension();
294 gmsh <<
"$Elements" << endl
295 << omega.size() << endl;
296 for (
size_type ie = 0, ne = omega.size(); ie < ne; ie++) {
297 const geo_element& K = omega.get_geo_element (map_dim, ie);
298 put (
gmsh, K, my_numb, omega, my_node);
300 gmsh <<
"$EndElements" << endl;
308 return geo_put_gmsh (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
see the geo_element page for the full documentation
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 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 format format format format gmsh
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.
template odiststream & geo_put_gmsh< Float >(odiststream &, const geo_basic< Float, sequential > &, const basis_basic< Float > &, const disarray< point_basic< Float >, sequential > &)
void put(std::ostream &out, std::string name, const tiny_matrix< T > &a)
odiststream & geo_put_gmsh(odiststream &ods, const geo_basic< T, sequential > &)