Rheolef  7.2
an efficient C++ finite element environment
field.cc
Go to the documentation of this file.
1 #include "rheolef/field_wdof_sliced.h" // TODO: should be cleaned after rdof
22 #include "rheolef/field.h"
23 #include "rheolef/rheostream.h"
24 #include "rheolef/iorheo.h"
25 #include "rheolef/piola_util.h"
26 #include "rheolef/field_expr.h"
27 
28 namespace rheolef {
29 
30 // ---------------------------------------------------------------------------
31 // allocators
32 // ---------------------------------------------------------------------------
33 // TODO: DVT_EXPR_CTE_VEC : init_value as point or tensor
34 template <class T, class M>
36  const space_type& V,
37  const T& init_value)
38  : _V (V),
39  _u (),
40  _b (),
41  _dis_dof_indexes_requires_update(true),
42  _dis_dof_assembly_requires_update(true)
43 {
44  _u.resize (_V.iu_ownership(), init_value);
45  _b.resize (_V.ib_ownership(), init_value);
46 }
47 template <class T, class M>
48 void
50  const space_type& V,
51  const T& init_value)
52 {
53  if (_V == V) return;
54  _V = V;
55  _u.resize (_V.iu_ownership(), init_value);
56  _b.resize (_V.ib_ownership(), init_value);
57  dis_dof_indexes_requires_update();
58  dis_dof_assembly_requires_update();
59 }
60 // ---------------------------------------------------------------------------
61 // input
62 // ---------------------------------------------------------------------------
63 template <class T, class M>
64 static
65 void
66 get_field_recursive (
67  idiststream& ids,
68  vec<T,M>& u_io,
69  const space_constitution<T,M>& constit,
70  distributor::size_type& comp_start_dis_idof,
71  distributor::size_type& comp_start_ios_idof,
72  bool read_header = false)
73 {
74  using namespace std;
76  if (! constit.is_hierarchical()) {
77  // non-hierarchical case:
78  const space_constitution_terminal<T,M>& terminal_constit = constit.get_terminal();
79  size_type comp_dis_ndof = constit.dis_ndof();
80 #ifdef TODO
81  // conserve a copy of V[i_comp].ios_ownership()
82  const distributor& comp_ios_ownership = terminal_constit.ios_ownership();
83  size_type comp_ios_ndof = comp_ios_ownership.size();
84 #else // TODO
85  // recompute V[i_comp].ios_ownership() with comms and risks of errors
86  size_type comp_ios_ndof = constit.ios_ndof();
87  distributor comp_ios_ownership (comp_dis_ndof, ids.comm(), comp_ios_ndof);
88 #endif // TODO
89  if (read_header) {
90  check_macro (dis_scatch(ids, comp_ios_ownership.comm(), "\nfield"), "read field failed");
91  size_type version, dis_size1;
92  std::string geo_name, approx;
93  ids >> version >> dis_size1 >> geo_name >> approx;
94  // TODO: some checks here: geo.name, size, approx
95  }
96  vec<T,M> u_comp_io (comp_ios_ownership, std::numeric_limits<T>::max());
97  u_comp_io.get_values (ids);
98  size_type ios_ndof = u_io.size();
99  for (size_type comp_ios_idof = 0; comp_ios_idof < comp_ios_ndof; comp_ios_idof++) {
100  size_type ios_idof = comp_start_ios_idof + comp_ios_idof;
101  assert_macro (ios_idof < ios_ndof, "ios_idof="<<ios_idof<<" out of range [0:"<<ios_ndof<<"[");
102  u_io [ios_idof] = u_comp_io [comp_ios_idof];
103  }
104  comp_start_dis_idof += comp_dis_ndof;
105  comp_start_ios_idof += comp_ios_ndof;
106  return;
107  }
108  // hierarchical case:
109  typedef typename space_constitution<T,M>::hierarchy_type hier_t;
110  const hier_t& hier_constit = constit.get_hierarchy();
111  for (typename hier_t::const_iterator iter = hier_constit.begin(), last = hier_constit.end(); iter != last; ++iter) {
112  const space_constitution<T,M>& curr_constit = *iter;
113  get_field_recursive (ids, u_io, curr_constit, comp_start_dis_idof, comp_start_ios_idof, true);
114  }
115 }
116 // extern: defined in space_constitution_old_get.cc
117 template<class T, class M>
118 void space_constitution_old_get (idiststream& ids, space_constitution<T,M>& constit);
119 
120 template <class T, class M>
121 idiststream&
123 {
124  using namespace std;
125  dis_dof_indexes_requires_update();
126  communicator comm = ids.comm();
127  if ( ! dis_scatch (ids, comm, "\nfield")) {
128  error_macro ("read field failed");
129  return ids;
130  }
132  ids >> version;
133  check_macro (version <= 3, "unexpected field version " << version);
134  space_constitution<T,M> constit;
135  std::string constit_name_input;
136  if (version == 1) {
137  // scalar case
138  size_type dis_size1;
139  std::string geo_name, approx;
140  ids >> dis_size1
141  >> geo_name
142  >> approx;
143  geo_type omega;
144  if (_V.get_geo().name() == geo_name) {
145  omega = _V.get_geo(); // reuse the previous mesh
146  } else {
147  omega = geo_type (geo_name); // load a new mesh
148  }
149  // TODO: get directly "P1" as a space_constitution by: "ids >> constit"; as for the version 2 format
150  constit = space_constitution<T,M>(omega, approx);
151  } else {
152  // version=2,3: multi-field header
153  // version == 2 : old format, hierarchical for vector & tensor valued fields
154  // version == 3 : new format, hierarchical for only heterogeneous fields based on spaces product
155  bool have_constit = false;
156  std::string label;
157  ids >> label;
158  check_macro (label == "header", "field file format version "<< version << ": \"header\" keyword not found");
159  while (ids.good()) {
160  ids >> label;
161  if (label == "end") {
162  break;
163  } else if (label == "size") {
164  size_type dummy_sz;
165  ids >> dummy_sz;
166  } else if (label == "constitution") {
167  ids >> constit_name_input;
168  std::istringstream istrstr (constit_name_input);
169  idiststream idiststrstr (istrstr);
170  if (version == 3) {
171  idiststrstr >> constit;
172  } else {
173  space_constitution_old_get (idiststrstr, constit);
174  }
175  have_constit = true;
176  } else {
177  error_macro ("unexpected field header member: \""<<label<<"\"");
178  }
179  }
180  ids >> label;
181  check_macro (label == "header", "field file format version "<< version << ": \"end header\" keyword not found");
182  check_macro (have_constit, "field file format version "<< version << ": \"constitution\" keyword not found");
183  }
184  // TODO: do not load mesh when we re-use _V: read only string constit and compare to _V.name()
185  if (!(_V.get_constitution() == constit)) {
186  // here cannot re-use _V: build a new space and resize the field
187  resize (space_type(constit));
188  }
189  size_type dis_ndof = _V.ownership().dis_size();
190  size_type my_proc = comm.rank();
191  size_type io_proc = ids.io_proc();
192  vec<T,M> u_io (_V.ios_ownership(), std::numeric_limits<T>::max());
193  vec<T,M> u_dof (_V.ownership(), std::numeric_limits<T>::max());
194  size_type comp_start_ios_idof = 0;
195  size_type comp_start_dis_idof = 0;
196  u_io.get_values (ids);
197  for (size_type ios_idof = 0, ios_ndof = _V.ios_ownership().size(); ios_idof < ios_ndof; ios_idof++) {
198  const T& value = u_io [ios_idof];
199  size_type dis_idof = _V.ios_idof2dis_idof (ios_idof);
200  u_dof.dis_entry (dis_idof) = value;
201  }
202  // here dispatch: communications:
203  u_dof.dis_entry_assembly();
204  // then copy vector into field (unknown, blocked) without comms
205  bool need_old2new_convert
206  = (version == 2
207  && constit.valued_tag() != space_constant::scalar
208  && constit.valued_tag() != space_constant::mixed);
209  if (!need_old2new_convert) {
210  for (size_type idof = 0, ndof = _V.ownership().size(); idof < ndof; idof++) {
211  dof(idof) = u_dof [idof];
212  }
213  return ids;
214  }
215  // automatically convert vector/tensor to version 3 by grouping components
216  std::string valued = constit.valued();
217  std::string approx = constit[0].get_basis().name();
218  std::string geo_name = constit.get_geo().name();
219  size_type n_comp = constit.size();
220  std::string new_constit_name_input = valued + "(" + approx + "){" + geo_name + "}";
221  std::istringstream new_istrstr (new_constit_name_input);
222  idiststream new_idiststrstr (new_istrstr);
223  space_constitution<T,M> new_constit;
224  new_idiststrstr >> new_constit;
225  resize (space_type(new_constit));
226  size_type ndof = u_dof.size();
227  size_type comp_ndof = ndof/n_comp;
228  // convert: new vector/tensor dof numbering have grouped components
229  for (size_type i_comp = 0; i_comp < n_comp; i_comp++) {
230  for (size_type comp_idof = 0; comp_idof < comp_ndof; comp_idof++) {
231  size_type new_idof = comp_idof*n_comp + i_comp;
232  size_type old_idof = i_comp*comp_ndof + comp_idof;
233  dof(new_idof) = u_dof [old_idof];
234  }
235  }
236  return ids;
237 }
238 // ---------------------------------------------------------------------------
239 // output
240 // ---------------------------------------------------------------------------
241 template <class T, class M>
242 static
243 void
244 put_field_recursive (
245  odiststream& ods,
246  const field_basic<T,M>& uh,
247  const space_constitution<T,M>& constit,
248  distributor::size_type& comp_start_idof,
249  distributor::size_type& comp_start_dis_idof,
250  bool write_header = false)
251 {
252  using namespace std;
254  if (! constit.is_hierarchical()) {
255  // non-hierarchical case:
256  // 1) merge distributed blocked and non-blocked and apply iso_dof permutation:
257  size_type comp_ndof = constit.ndof();
258  size_type comp_dis_ndof = constit.dis_ndof();
259  communicator comm = constit.comm();
260  const space_constitution_terminal<T,M>& terminal_constit = constit.get_terminal();
261  size_type io_proc = odiststream::io_proc();
262  size_type my_proc = comm.rank();
263  distributor comp_ios_ownership (comp_dis_ndof, comm, (my_proc == io_proc ? comp_dis_ndof : 0));
264  vec<T,M> comp_u_io (comp_ios_ownership, std::numeric_limits<T>::max());
265  for (size_type comp_idof = 0; comp_idof < comp_ndof; comp_idof++) {
266  size_type idof = comp_start_idof + comp_idof;
267  T value = uh.dof (idof);
268  size_type ios_dis_idof = uh.get_space().idof2ios_dis_idof (idof);
269  assert_macro (ios_dis_idof >= comp_start_dis_idof, "invalid comp ios index");
270  size_type comp_ios_dis_idof = ios_dis_idof - comp_start_dis_idof;
271  comp_u_io.dis_entry (comp_ios_dis_idof) = value;
272  }
273  comp_u_io.dis_entry_assembly();
274  // 2) then output the current field component
275  size_type old_prec = ods.os().precision();
276  ods << setprecision(std::numeric_limits<Float>::digits10);
277  if (write_header) {
278  ods << "field" << endl
279  << "1 " << comp_dis_ndof << endl
280  << terminal_constit.get_geo().name() << endl
281  << terminal_constit.get_basis().name() << endl
282  << endl;
283  }
284  ods << comp_u_io
285  << setprecision(old_prec);
286  comp_start_idof += comp_ndof;
287  comp_start_dis_idof += comp_dis_ndof;
288  if (comp_start_dis_idof != uh.dis_ndof()) {
289  ods << endl;
290  }
291  return;
292  }
293  // hierarchical case:
294  typedef typename space_constitution<T,M>::hierarchy_type hier_t;
295  const hier_t& hier_constit = constit.get_hierarchy();
296  for (typename hier_t::const_iterator iter = hier_constit.begin(), last = hier_constit.end(); iter != last; ++iter) {
297  const space_constitution<T,M>& curr_constit = *iter;
298  put_field_recursive (ods, uh, curr_constit, comp_start_idof, comp_start_dis_idof, false);
299  }
300 }
301 template <class T, class M>
304 {
305  using namespace std;
306  bool need_header = (get_space().get_constitution().is_hierarchical());
307  if (need_header) {
308  // multi-field header or non-equispaced node set
309  ods << "field" << endl
310  << "3" << endl
311  << "header" << endl
312  << " constitution " << get_space().get_constitution().name() << endl
313  << " size " << get_space().get_constitution().dis_ndof() << endl
314  << "end header" << endl
315  << endl;
316  } else {
317  // scalar-field header and equispaced node set
318  const space_constitution_terminal<T,M>& terminal_constit = get_space().get_constitution().get_terminal();
319  ods << "field" << endl
320  << "1 " << dis_ndof() << endl
321  << terminal_constit.get_geo().name() << endl
322  << terminal_constit.get_basis().name() << endl
323  << endl;
324  }
325  size_type comp_start_idof = 0;
326  size_type comp_start_dis_idof = 0;
327  put_field_recursive (ods, *this, get_space().get_constitution(), comp_start_idof, comp_start_dis_idof);
328  return ods;
329 }
330 // ----------------------------------------------------------------------------
331 // graphic output switch
332 // ----------------------------------------------------------------------------
333 // class-member template partial specialization 'field<T, M>::put(ods)' is not allowed
334 // here, we want to specialize for M=seq & M=dist since only seq graphic is vailable yet:
335 template <class T> odiststream& visu_gnuplot (odiststream&, const field_basic<T,sequential>&);
336 template <class T> odiststream& visu_gmsh (odiststream&, const field_basic<T,sequential>&);
338 template <class T> odiststream& field_put_gmsh (odiststream&, const field_basic<T,sequential>&, std::string);
341 
342 // => use an intermediate class-function with full class specialization
343 template <class T, class M>
344 struct field_put {
345  odiststream& operator() (odiststream& ods, const field_basic<T, M>& uh) const {
346  return uh.put_field (ods);
347  }
348 };
349 // now, we can specialize the full class when M=seq:
350 template <class T>
351 struct field_put<T,sequential> {
352  odiststream& operator() (odiststream& ods, const field_basic<T,sequential>& uh) const
353  {
354  iorheo::flag_type format = iorheo::flags(ods.os()) & iorheo::format_field;
355  if (format [iorheo::gnuplot]) { return visu_gnuplot (ods,uh); }
356  if (format [iorheo::paraview]){ return visu_vtk_paraview (ods,uh); }
357  if (format [iorheo::gmsh]) { return visu_gmsh (ods,uh); }
358  // if (format [iorheo::gmsh]) { return field_put_gmsh (ods,uh,""); }
359  if (format [iorheo::gmsh_pos]){ return field_put_gmsh_pos(ods,uh); }
360  if (format [iorheo::bamg]) { return field_put_bamg_bb (ods,uh); }
361  return uh.put_field (ods);
362  }
363 };
364 // finally, the field::put member function uses the class-function
365 template <class T, class M>
366 odiststream&
368 {
369  field_put<T,M> put_fct;
370  return put_fct (ods, *this);
371 }
372 // ----------------------------------------------------------------------------
373 // access to non-local dofs
374 // ----------------------------------------------------------------------------
375 template <class T, class M>
376 const T&
378 {
380  if (_dis_dof_indexes_requires_update || _dis_dof_assembly_requires_update) {
381  size_type nproc = comm().size();
382  check_macro (nproc == 1, "field::dis_dof_update() need to be called before field::dis_dof(dis_idof)");
383  }
384  }
385  if (ownership().is_owned (dis_idof)) {
386  size_type first_idof = ownership().first_index ();
387  size_type idof = dis_idof - first_idof;
388  return dof (idof);
389  }
390  // here dis_idof is owned by another proc
391  space_pair_type blk_dis_iub = _V.data()._idof2blk_dis_iub.dis_at (dis_idof); // TODO: write a better access !
392  size_type dis_iub = blk_dis_iub.dis_iub();
393  const T& value = (! blk_dis_iub.is_blocked()) ? _u.dis_at (dis_iub) : _b.dis_at (dis_iub);
394  return value;
395 }
396 template <class T, class M>
399 {
400  dis_dof_assembly_requires_update();
401  const space_pair_type& blk_dis_iub = _V.data()._idof2blk_dis_iub.dis_at (dis_idof); // TODO: write a better access !
402  size_type dis_iub = blk_dis_iub.dis_iub();
403  if (! blk_dis_iub.is_blocked()) {
404  return _u.dis_entry (dis_iub);
405  } else {
406  return _b.dis_entry (dis_iub);
407  }
408 }
409 // ----------------------------------------------------------------------------
410 // evaluation
411 // ----------------------------------------------------------------------------
412 template <class T, class M>
413 T
414 field_basic<T,M>::evaluate (const geo_element& K, const point_basic<T>& hat_x, size_type i_comp) const
415 {
416  const basis_basic<T>& b = _V.get_basis();
417  size_type loc_ndof = b.ndof (K.variant()) ;
418  std::vector<size_type> dis_idof1 (loc_ndof);
419  _V.dis_idof (K, dis_idof1);
420 
421  std::vector<T> dof (loc_ndof);
422  for (size_type loc_idof = 0; loc_idof < loc_ndof; loc_idof++) {
423  dof [loc_idof] = dis_dof (dis_idof1 [loc_idof]);
424  }
425  // WARNING: not efficient since it evaluate the hat_basis at each hat_x
426  // when hat_x is on a repetitive pattern, such as quadrature nodes or Lagrange basis nodes
427  // TODO: evaluate basis one time for all on hat_K
428  Eigen::Matrix<T,Eigen::Dynamic,1> b_value (loc_ndof);
429  b.evaluate (K, hat_x, b_value);
430 
431  T value = 0;
432  for (size_type loc_idof = 0; loc_idof < loc_ndof; loc_idof++) {
433  value += dof [loc_idof] * b_value[loc_idof]; // sum_i w_coef(i)*hat_phi(hat_x)
434  }
435  return value;
436 }
437 template <class T, class M>
438 T
440 {
441  dis_dof_update();
442  const geo_basic<T,M>& omega = _V.get_geo();
443  size_type dis_ie = omega.dis_locate (x);
444  check_macro (dis_ie != std::numeric_limits<size_type>::max(), "x="<<x<<" is outside the domain");
445  // only the proc owner of dis_ie compute the value; other procs are waiting for the value
446  T value = std::numeric_limits<T>::max();
447  size_type map_dim = omega.map_dimension();
448  const distributor& ownership = omega.geo_element_ownership(map_dim);
449  size_type ie_proc = ownership.find_owner(dis_ie);
450  size_type my_proc = ownership.comm().rank();
451  std::vector<size_type> dis_inod;
452  if (my_proc == ie_proc) {
453  size_type first_dis_ie = ownership.first_index();
454  size_type ie = dis_ie - first_dis_ie;
455  const geo_element& K = omega[ie];
456  omega.dis_inod (K, dis_inod);
457  point_basic<T> hat_x = inverse_piola_transformation (_V.get_geo(), K, dis_inod, x);
458  value = evaluate (K, hat_x, i_comp);
459  }
460 #ifdef _RHEOLEF_HAVE_MPI
462  mpi::broadcast (mpi::communicator(), value, ie_proc);
463  }
464 #endif // _RHEOLEF_HAVE_MPI
465  return value;
466 }
467 template <class T, class M>
470 {
471  fatal_macro ("dis_vector_evaluate: not yet");
472  return point_basic<T>();
473 }
474 // ----------------------------------------------------------------------------
475 // tensor component access: sigma_h(i,j)
476 // ----------------------------------------------------------------------------
477 #ifdef TO_CLEAN
478 template <class T, class M>
481 {
482  space_constant::coordinate_type sys_coord = get_geo().coordinate_system();
483  size_type ij_comp = space_constant::tensor_index (valued_tag(), sys_coord, i_comp, j_comp);
484  return details::field_rdof_sliced_const<field_basic<T,M>> (*this, ij_comp);
485 }
486 template <class T, class M>
487 details::field_wdof_sliced<field_basic<T,M>>
489 {
490  space_constant::coordinate_type sys_coord = get_geo().coordinate_system();
491  size_type ij_comp = space_constant::tensor_index (valued_tag(), sys_coord, i_comp, j_comp);
492  return details::field_wdof_sliced<field_basic<T,M>> (*this, ij_comp);
493 }
494 #endif // TO_CLEAN
495 // ----------------------------------------------------------------------------
496 // instanciation in library
497 // ----------------------------------------------------------------------------
498 #define _RHEOLEF_instanciation_base(T,M) \
499 template class field_basic<T,M>; \
500 template odiststream& operator<< (odiststream&, const field_basic<T,M>&);
501 
502 #ifdef TODO
503 #define _RHEOLEF_instanciation(T,M) \
504 _RHEOLEF_instanciation_base(T,M) \
505 _RHEOLEF_instanciation_base(std::complex<T>,M)
506 #else // TODO
507 #define _RHEOLEF_instanciation(T,M) \
508 _RHEOLEF_instanciation_base(T,M)
509 #endif // TODO
510 
511 _RHEOLEF_instanciation(Float,sequential)
512 #ifdef _RHEOLEF_HAVE_MPI
513 _RHEOLEF_instanciation(Float,distributed)
514 #endif // _RHEOLEF_HAVE_MPI
515 
516 } // namespace rheolef
field::size_type size_type
Definition: branch.cc:430
see the Float page for the full documentation
typename field_traits< Derived >::size_type size_type
Definition: field_rdof.h:45
see the distributor page for the full documentation
Definition: distributor.h:69
size_type find_owner(size_type dis_i) const
find iproc associated to a global index dis_i: CPU=log(nproc)
Definition: distributor.cc:106
size_type size(size_type iproc) const
Definition: distributor.h:170
size_type first_index(size_type iproc) const
global index range and local size owned by ip-th process
Definition: distributor.h:158
std::allocator< int >::size_type size_type
Definition: distributor.h:74
const communicator_type & comm() const
Definition: distributor.h:152
const space_type & get_space() const
Definition: field.h:270
vec< T, M > _u
Definition: field.h:477
vec< T, M > _b
Definition: field.h:478
size_type dis_ndof() const
Definition: field.h:299
space_type _V
Definition: field.h:476
size_type size() const
Definition: field.h:441
T & dof(size_type idof)
Definition: field.h:738
odiststream & put_field(odiststream &ops) const
Definition: field.cc:303
void resize(const space_type &V, const T &init_value=std::numeric_limits< T >::max())
Definition: field.cc:49
std::size_t size_type
Definition: field.h:225
see the geo_element page for the full documentation
Definition: geo_element.h:102
variant_type variant() const
Definition: geo_element.h:161
idiststream: see the diststream page for the full documentation
Definition: diststream.h:336
static size_type io_proc()
This routine returns the rank of a process that can perform i/o.
Definition: diststream.cc:64
bool good() const
Definition: diststream.cc:124
const communicator & comm() const
Definition: diststream.h:356
odiststream: see the diststream page for the full documentation
Definition: diststream.h:137
std::ostream & os()
Definition: diststream.h:247
const geo_basic< T, M > & get_geo() const
const basis_basic< T > & get_basis() const
const valued_type & valued_tag() const
const geo_basic< T, M > & get_geo() const
const space_constitution_terminal< T, M > & get_terminal() const
const std::string & valued() const
const hierarchy_type & get_hierarchy() const
const basis_basic< T > & get_basis() const
void resize(const distributor &ownership, const T &init_val=std::numeric_limits< T >::max())
Definition: vec.h:199
#define assert_macro(ok_condition, message)
Definition: dis_macros.h:113
#define error_macro(message)
Definition: dis_macros.h:49
#define fatal_macro(message)
Definition: dis_macros.h:33
void get_geo(istream &in, my_geo &omega)
Expr1::float_type T
Definition: field_expr.h:230
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
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
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
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
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
#define _RHEOLEF_instanciation(T, M)
Definition: field.cc:507
string sys_coord
Definition: mkgeo_grid.sh:171
size_type tensor_index(valued_type valued_tag, coordinate_type sys_coord, size_type i, size_type j)
valued_type valued_tag(const std::string &name)
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)
void dis_inod(const basis_basic< T > &b, const geo_size &gs, const geo_element &K, typename std::vector< size_type >::iterator dis_inod_tab)
size_type dis_ndof(const basis_basic< T > &b, const geo_size &gs, size_type map_dim)
size_type ndof(const basis_basic< T > &b, const geo_size &gs, size_type map_dim)
This file is part of Rheolef.
void put(std::ostream &out, std::string name, const tiny_matrix< T > &a)
Definition: tiny_lu.h:155
odiststream & field_put_gmsh_pos(odiststream &, const field_basic< T, sequential > &)
t operator()(const t &a, const t &b)
Definition: space.cc:386
odiststream & field_put_gmsh(odiststream &, const field_basic< T, sequential > &, std::string)
void space_constitution_old_get(idiststream &ids, space_constitution< T, M > &constit)
odiststream & field_put_bamg_bb(odiststream &, const field_basic< T, sequential > &)
void evaluate(const geo_basic< float_type, M > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, 1 > &value) const
point_basic< T > inverse_piola_transformation(const geo_basic< T, M > &omega, const reference_element &hat_K, const std::vector< size_t > &dis_inod, const point_basic< T > &x)
Definition: piola_util.cc:473
bool dis_scatch(idiststream &ips, const communicator &comm, std::string ch)
distributed version of scatch(istream&,string)
Definition: diststream.cc:44
odiststream & visu_gnuplot(odiststream &, const field_basic< T, sequential > &)
odiststream & visu_vtk_paraview(odiststream &, const field_basic< T, sequential > &)
odiststream & visu_gmsh(odiststream &, const field_basic< T, sequential > &)
size_type dis_iub() const
Definition: space.h:126
bool is_blocked() const
Definition: space.h:125