Rheolef  7.1
an efficient C++ finite element environment
field_expr_terminal.cc
Go to the documentation of this file.
1 //
21 //
22 // field_expr_terminal: terminals of nonn-linear expressions
23 // 1) class-function
24 // 1.1) base class for the class-function family
25 // 1.2) general function or class-function
26 // 1.3) normal to a surface
27 // 1.4) h_local
28 // 1.5) penalty
29 // 2) field and such
30 // 2.1) field
31 // 2.2) jump of a field
32 // 3) convected field, as compose(uh,X) where X is a characteristic
33 //
34 #include "rheolef/field_expr_terminal.h"
35 #include "rheolef/geo_domain.h"
36 #include "rheolef/piola_util.h"
37 #include "rheolef/field_evaluate.h"
38 #include "rheolef/memorized_disarray.h"
39 
40 namespace rheolef { namespace details {
41 
42 // ---------------------------------------------------------------------------
43 // 1.1) base class for all class-functions
44 // ---------------------------------------------------------------------------
45 template<class T>
47  : _pops()
48 {
49 }
50 template<class T>
52  : _pops(x._pops)
53 {
54 }
55 template<class T>
56 void
59  const integrate_option& iopt) const
60 {
61  _pops = pops;
62 }
63 template<class T>
64 void
68  const integrate_option& iopt) const
69 {
70  _pops = pops;
71 }
72 // TODO: move as geo::get_side (K, sid) ?
73 template<class T, class M>
74 const geo_element&
76  const geo_basic<T,M>& omega_L,
77  const geo_element& L,
78  const side_information_type& sid)
79 {
81  size_type dis_isid = std::numeric_limits<size_type>::max();
82  switch (sid.dim) {
83  case 0: {
84  size_type dis_inod = L [sid.loc_isid];
85  dis_isid = omega_L.dis_inod2dis_iv (dis_inod);
86  break;
87  }
88  case 1: dis_isid = L.edge (sid.loc_isid); break;
89  case 2: dis_isid = L.face (sid.loc_isid); break;
90  default: error_macro ("domain: unexpected side dimension " << sid.dim);
91  }
92  // TODO: pas tres clair quand on est sur un geo_domain_indirect ou un geo_domain
93  // dans quel systeme de numerotation doit appartenir la face ?
94  if (omega_L.variant() != geo_abstract_base_rep<T>::geo_domain_indirect) {
95  return omega_L.dis_get_geo_element (sid.dim, dis_isid);
96  } else {
97  return omega_L.get_background_geo().dis_get_geo_element (sid.dim, dis_isid);
98  }
99 }
100 template<class T>
101 template<class M>
102 const geo_element&
104  const geo_basic<T,M>& omega_L,
105  const geo_element& L,
106  const side_information_type& sid) const
107 {
108  return global_get_side (omega_L, L, sid);
109 }
110 // ----------------------------------------------------------------------------
111 // 1.3) normal() class-function
112 // ----------------------------------------------------------------------------
113 template<class T>
115  const function_type&)
116  : base(),
117  _is_on_interface (false),
118  _is_inside_on_local_sides(false)
119 {
120 }
121 template<class T>
124  : base(x),
125  _is_on_interface (x._is_on_interface),
126  _is_inside_on_local_sides(x._is_inside_on_local_sides)
127 {
128 }
129 template<class T>
130 void
132  const piola_on_pointset<float_type>& pops,
133  const integrate_option& iopt) const
134 {
135  base::initialize (pops, iopt);
136  _is_on_interface = iopt._is_on_interface;
137  _is_inside_on_local_sides = iopt._is_inside_on_local_sides;
138 }
139 template<class T>
140 void
143  const piola_on_pointset<float_type>& pops,
144  const integrate_option& iopt) const
145 {
146  base::initialize (Xh, pops, iopt);
147  _is_on_interface = iopt._is_on_interface;
148  _is_inside_on_local_sides = iopt._is_inside_on_local_sides;
149 }
150 template<class T>
151 void
153  const geo_basic<float_type,memory_type>& omega_K,
154  const geo_element& K,
155  const T& sign,
156  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
157 {
158  const Eigen::Matrix<piola<float_type>,Eigen::Dynamic,1>& piola = base::_pops.get_piola (omega_K, K);
159  size_type d = omega_K.dimension();
160  size_type loc_nnod = piola.size();
161  value.resize (loc_nnod);
162  for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
163  const point_basic<float_type>& xi = piola[loc_inod].F;
164  value[loc_inod] = sign*normal_from_piola_transformation (omega_K, K, piola[loc_inod].DF, d);
165  }
166 }
167 template<class T>
168 void
170  const geo_basic<float_type,memory_type>& omega_K,
171  const geo_element& K,
172  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
173 {
174  evaluate_internal (omega_K, K, T(1), value);
175 }
176 template<class T>
177 void
179  const geo_basic<float_type,memory_type>& omega_L,
180  const geo_element& L,
181  const side_information_type& sid,
182  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
183 {
184  if (_is_inside_on_local_sides) {
185  T sign = (L.dimension() > 1) ? sid.orient : ((sid.loc_isid == 0) ? -1 : 1);
186  evaluate_internal (omega_L, global_get_side(omega_L, L, sid), sign, value);
187  } else {
188  // BUG_INT_BDR_JUMP: check _is_on_interface and send sign of side in base::_omega
189  evaluate_internal (omega_L, global_get_side(omega_L, L, sid), T(1), value);
190  }
191 }
192 // ----------------------------------------------------------------------------
193 // 1.4) h_local() class-function
194 // ----------------------------------------------------------------------------
195 template<class T>
197  const function_type&)
198  : base()
199 {
200 }
201 template<class T>
204  : base(x)
205 {
206 }
207 template<class T>
208 void
210  const piola_on_pointset<float_type>& pops,
211  const integrate_option& iopt) const
212 {
213  base::initialize (pops, iopt);
214 }
215 template<class T>
216 void
219  const piola_on_pointset<float_type>& pops,
220  const integrate_option& iopt) const
221 {
222  base::initialize (Xh, pops, iopt);
223 }
224 template<class T>
225 void
227  const geo_basic<float_type,memory_type>& omega_K,
228  const geo_element& K,
229  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
230 {
231  const Eigen::Matrix<piola<float_type>,Eigen::Dynamic,1>& piola = base::_pops.get_piola (omega_K, K);
232  size_type loc_nnod = piola.size();
233  value.resize (loc_nnod);
234  size_type K_map_d = K.dimension();
235  if (K_map_d > 0) {
236  // usual case: K is at least one edge
237  reference_element hat_K = K.variant();
238  T meas_hat_K = measure(hat_K);
239  size_type d = omega_K.dimension();
240  for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
241  // TODO DVT_PIOLA_LOOP_ORDER_1: improve: when omega_K.order=1 then DF=constant and value[*]=constant
242  T det_DF_i = det_jacobian_piola_transformation (piola[loc_inod].DF, d, K_map_d);
243  value[loc_inod] = pow (abs(det_DF_i)/meas_hat_K, 1./K_map_d);
244  trace_macro("h_local("<<omega_K.name()<<",K="<<K.name()<<K.dis_ie()<<")="<< value[loc_inod]);
245  }
246  } else {
247  // special case: d == 0 i.e. an "interface" between two edges in 1D
248  // then h_local = average of two edge length
249  size_type L_dis_ie[2] = {K.master(0), K.master(1)};
250  size_t n = (L_dis_ie[0] == std::numeric_limits<size_type>::max()) ? 0 :
251  (L_dis_ie[1] == std::numeric_limits<size_type>::max()) ? 1 : 2;
252  if (n == 0) {
253  // special 0d meshes:
254  // dis_nelt_1d=0: special 0d mesh, e.g. omega["sides"] when omega is 1d
255  // n=0: isolated point(s) in a 0D mesh
256  // => h_local=1 by default
257  value.fill (result_type(1));
258  trace_macro("h_local("<<omega_K.name()<<",K="<<K.name()<<K.dis_ie()<<")=1");
259  } else {
260  size_t dis_nelt_1d = omega_K.sizes().ownership_by_dimension[1].dis_size();
261  check_macro (dis_nelt_1d != 0, "h_local: invalid \""<<omega_K.name()<<"\" mesh with missing 1D connectivity");
262  size_t L_map_d = 1;
263  Float h_loc = 0;
264  for (size_type i = 0; i < n; ++i) {
265  const geo_element& Li = omega_K.dis_get_geo_element (L_map_d, L_dis_ie[i]);
266  const point_basic<float_type>& x0 = omega_K.dis_node (Li[0]);
267  const point_basic<float_type>& x1 = omega_K.dis_node (Li[1]);
268  h_loc += norm (x1-x0)/n;
269  }
270  value.fill (result_type(h_loc));
271  trace_macro("h_local("<<omega_K.name()<<",K="<<K.name()<<K.dis_ie()<<")="<< h_loc);
272  }
273  }
274 }
275 template<class T>
276 void
278  const geo_basic<float_type,memory_type>& omega_L,
279  const geo_element& L,
280  const side_information_type& sid,
281  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
282 {
283  evaluate (omega_L, global_get_side(omega_L, L, sid), value);
284 }
285 // ----------------------------------------------------------------------------
286 // 1.5) penalty() class-function
287 // ----------------------------------------------------------------------------
288 template<class T>
290  const function_type&)
291  : base()
292 {
293 }
294 template<class T>
297  : base(x)
298 {
299 }
300 template<class T>
301 void
303  const piola_on_pointset<float_type>& pops,
304  const integrate_option& iopt) const
305 {
306  base::initialize (pops, iopt);
307 }
308 template<class T>
309 void
312  const piola_on_pointset<float_type>& pops,
313  const integrate_option& iopt) const
314 {
315  base::initialize (Xh, pops, iopt);
316 }
317 template<class T>
318 T
320  const geo_basic<float_type,memory_type>& omega_K,
321  const geo_element& K) const
322 {
323  const Eigen::Matrix<piola<float_type>,Eigen::Dynamic,1>& piola = base::_pops.get_piola (omega_K, K);
324  size_type loc_nnod = piola.size();
325  size_type d = omega_K.dimension();
326  size_type map_d = K.dimension();
327  T meas_max_K = 0;
328  for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
329  // TODO DVT_PIOLA_LOOP_ORDER_1: improve: when omega_K.order=1 then DF=constant and value[*]=constant
330  T meas_K = det_jacobian_piola_transformation (piola[loc_inod].DF, d, map_d);
331  meas_max_K = std::max (meas_max_K, abs(meas_K));
332  }
333 trace_macro("meas("<<omega_K.name()<<",K="<<K.name()<<K.dis_ie()<<")="<< meas_max_K);
334  return meas_max_K;
335 }
336 template<class T>
337 void
339  const geo_basic<float_type,memory_type>& omega_K,
340  const geo_element& K,
341  const geo_element& L,
342  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
343 {
344  // meas(partial L)/meas(L) ~= nside*meas(K)/meas(L) : TODO try to improve it for non-uniform meshes
345  size_type n_sides = L.n_subgeo (K.dimension());
346  T meas_side_L = evaluate_measure (omega_K, K);
347  T meas_L = evaluate_measure (omega_K, L);
348  T result = n_sides*meas_side_L/meas_L;
349 trace_macro("penalty("<<omega_K.name()<<",K="<<K.name()<<K.dis_ie()<<")="<< result);
350  const Eigen::Matrix<piola<float_type>,Eigen::Dynamic,1>& piola = base::_pops.get_piola (omega_K, K);
351  size_type loc_nnod = piola.size();
352  value.resize (loc_nnod);
353  for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
354  value[loc_inod] = result;
355  }
356 }
357 template<class T>
358 void
360  const geo_basic<float_type,memory_type>& omega_K,
361  const geo_element& K,
362  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
363 {
364  size_type L_map_d = K.dimension() + 1;
365  size_type L_dis_ie0 = K.master(0);
366  check_macro (L_dis_ie0 != std::numeric_limits<size_type>::max(),
367  "unexpected isolated side K="<<K.name()<<K.dis_ie()<< " in mesh \""<<omega_K.name()<<"\"");
368  const geo_element& L0 = omega_K.dis_get_geo_element (L_map_d, L_dis_ie0);
369  evaluate_internal (omega_K, K, L0, value);
370  size_type L_dis_ie1 = K.master(1);
371  if (L_dis_ie1 == std::numeric_limits<size_type>::max()) {
372  // K is a boundary side: nothing more to do
373  true;
374  } else {
375  // K is an internal side
376  const geo_element& L1 = omega_K.dis_get_geo_element (L_map_d, L_dis_ie1);
377  Eigen::Matrix<result_type,Eigen::Dynamic,1> value1;
378  evaluate_internal (omega_K, K, L0, value);
379  evaluate_internal (omega_K, K, L1, value1);
380  for (size_type loc_idof = 0, loc_ndof = value.size(); loc_idof < loc_ndof; ++loc_idof) {
381  value[loc_idof] = std::max (value [loc_idof], value1 [loc_idof]);
382  }
383  }
384 }
385 template<class T>
386 void
388  const geo_basic<float_type,memory_type>& omega_L,
389  const geo_element& L,
390  const side_information_type& sid,
391  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
392 {
393  evaluate (omega_L, global_get_side(omega_L, L, sid), value);
394 }
395 // ----------------------------------------------------------------------------
396 // 2) field and such
397 // ----------------------------------------------------------------------------
398 // 2.1) field
399 // ----------------------------------------------------------------------------
400 template<class T, class M, details::differentiate_option::type Diff>
401 void
403  const piola_on_pointset<T>& pops,
404  const integrate_option& iopt) const
405 {
406  _uh.dis_dof_update();
407  _u_test.initialize (pops, iopt);
408 }
409 template<class T, class M, details::differentiate_option::type Diff>
410 void
412  const space_basic<T,M>& Xh,
413  const piola_on_pointset<float_type>& pops,
414  const integrate_option& iopt) const
415 {
416  check_macro (_uh.get_geo().get_background_geo().name() == Xh.get_geo().get_background_geo().name(),
417  "incompatible field on " << _uh.get_geo().get_background_geo().name() << " for evaluation on " << Xh.get_geo().get_background_geo().name());
418  _uh.dis_dof_update();
419  _u_test.initialize (Xh, pops, iopt);
420 }
421 template<class T, class M, details::differentiate_option::type Diff>
422 template<class Value>
423 void
425  const geo_basic<float_type,memory_type>& omega_K,
426  const geo_element& K,
427  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
428 {
429  Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic> diff_phij_xi;
430  _u_test.template evaluate <Value,Diff> (omega_K, K, _gopt, diff_phij_xi);
431  field_evaluate_continued (_uh, omega_K, K, diff_phij_xi, value);
432 }
433 template<class T, class M, details::differentiate_option::type Diff>
434 template<class Value>
435 void
437  const geo_basic<float_type,memory_type>& omega_K,
438  const geo_element& K,
439  const side_information_type& sid,
440  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
441 {
442  Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic> diff_phij_xi;
443  bool do_local_component_assembly = true;
444  _u_test.template evaluate_on_side<Value,Diff> (omega_K, K, sid, _gopt, diff_phij_xi, do_local_component_assembly);
445  field_evaluate_continued (_uh, omega_K, K, diff_phij_xi, value);
446 }
447 template<class T, class M, details::differentiate_option::type Diff>
450 {
451  switch (Diff) {
453  return _uh.valued_tag();
454  }
456  space_constant::valued_type uh_valued_tag = _uh.valued_tag();
457  switch (uh_valued_tag) {
463  default:
464  error_macro ("unsupported "<<uh_valued_tag<< "-valued field for the grad() operator");
466  }
467  }
469  space_constant::valued_type uh_valued_tag = _uh.valued_tag();
470  switch (uh_valued_tag) {
474  return space_constant::vector;
475  default:
476  error_macro ("unsupported "<<uh_valued_tag<< "-valued field for the div() operator");
478  }
479  }
481  space_constant::valued_type uh_valued_tag = _uh.valued_tag();
482  switch (uh_valued_tag) {
484  case space_constant::vector: {
485  size_type d = _uh.get_geo().dimension();
487  }
488  default:
489  error_macro ("unsupported "<<uh_valued_tag<< "-valued field for the curl() operator");
491  }
492  }
493  }
494 }
495 // ----------------------------------------------------------------------------
496 // 2.2) field jump
497 // ----------------------------------------------------------------------------
498 template<class T, class M>
499 void
501  const piola_on_pointset<float_type>& pops,
502  const integrate_option& iopt) const
503 {
504  _expr0.initialize (pops, iopt);
505  _expr1.initialize (pops, iopt);
506 }
507 template<class T, class M>
508 void
511  const piola_on_pointset<float_type>& pops,
512  const integrate_option& iopt) const
513 {
514  _expr0.initialize (Xh, pops, iopt);
515  _expr1.initialize (Xh, pops, iopt);
516 }
517 template<class T, class M>
518 template<class Result>
519 void
521  const geo_basic<float_type,memory_type>& omega_K,
522  const geo_element& K,
523  Eigen::Matrix<Result,Eigen::Dynamic,1>& value) const
524 {
525  size_type L_map_d = K.dimension() + 1;
526  size_type L_dis_ie0, L_dis_ie1;
527  side_information_type sid0, sid1;
528  L_dis_ie0 = K.master(0);
529  const geo_basic<T,M>& omega_L = omega_K.get_background_geo();
530  check_macro (L_dis_ie0 != std::numeric_limits<size_type>::max(),
531  "unexpected isolated mesh side K.dis_ie="<<K.dis_ie());
532  const geo_element& L0 = omega_L.dis_get_geo_element (L_map_d, L_dis_ie0);
533  L0.get_side_informations (K, sid0);
534  _expr0.evaluate_on_side (omega_L, L0, sid0, value);
535  L_dis_ie1 = K.master(1);
536  if (L_dis_ie1 == std::numeric_limits<size_type>::max()) {
537  // K is a boundary side
538  // average (i.e. _c0==0.5): fix it on the boundary where c0=1 : average(v)=v on the boundary
539  Float c0 = (_c0 != 0.5) ? _c0 : 1;
540  // TODO: DVT_EIGEN_BLAS2 : pb when Value=point
541  for (size_type loc_inod = 0, loc_nnod = value.rows(); loc_inod < loc_nnod; ++loc_inod) {
542  for (size_type loc_jdof = 0, loc_ndof = value.cols(); loc_jdof < loc_ndof; ++loc_jdof) {
543  value(loc_inod,loc_jdof) = c0*value(loc_inod,loc_jdof);
544  }}
545  } else {
546  // K is an internal side
547  Eigen::Matrix<Result,Eigen::Dynamic,1> value1;
548  const geo_element& L1 = omega_L.dis_get_geo_element (L_map_d, L_dis_ie1);
549  L1.get_side_informations (K, sid1);
550  _expr1.evaluate_on_side (omega_L, L1, sid1, value1);
551  for (size_type loc_inod = 0, loc_nnod = value.rows(); loc_inod < loc_nnod; ++loc_inod) {
552  for (size_type loc_jdof = 0, loc_ndof = value.cols(); loc_jdof < loc_ndof; ++loc_jdof) {
553  value(loc_inod,loc_jdof) = _c0*value(loc_inod,loc_jdof) + _c1*value1(loc_inod,loc_jdof);
554  }}
555  }
556 }
557 // ---------------------------------------------------------------------------
558 // 3) contains a convected field, as compose(uh,X) where X is a characteristic
559 // ---------------------------------------------------------------------------
560 template<class T, class M, class Value>
561 void
563  const field_basic<T,M>& uh,
564  const disarray<point_basic<T>,M>& x,
565  const disarray<index_set,M>& ie2dis_ix, // K -> list of ix
566  const disarray<point_basic<T>,M>& hat_y, // ix -> hat_y
567  disarray<Value,M>& ux);
568 
569 template<class T, class M>
570 void
572  const piola_on_pointset<float_type>& pops,
573  const integrate_option& iopt) const
574 {
575  // handle the case when omega (destination) is different from _X.get_displacement.get_geo (origin)
576  // as in mesh adaptation loops
577  _uh.dis_dof_update();
578  _fops.initialize (_uh.get_space().get_basis(), pops);
579 
580  // coq is stored in _X : it is independent of _uh ; depend only of _uh.space and quadrature nodes (qopt)
581  const characteristic_on_quadrature<T,M> coq = _X.get_pre_computed (_uh.get_space(), _X.get_displacement(), pops);
582  const characteristic_on_quadrature_rep<T,M>& coq_r = coq.data();
583  switch (_uh.valued_tag()) {
585  _scalar_val.resize (coq_r._yq.ownership());
586  interpolate_pass2_valued (_uh, coq_r._yq, coq_r._ie2dis_ix, coq_r._hat_y, _scalar_val);
587  break;
589  _vector_val.resize (coq_r._yq.ownership());
590  interpolate_pass2_valued (_uh, coq_r._yq, coq_r._ie2dis_ix, coq_r._hat_y, _vector_val);
591  break;
592  default: error_macro("unsupported "<<_uh.valued()<<"-valued charateristic");
593  }
594  _start_q = 0;
595 }
596 template<class T, class M>
597 void
600  const piola_on_pointset<float_type>& pops,
601  const integrate_option& iopt) const
602 {
603  fatal_macro ("characteristic: not supported with interpolate (HINT: use integrate with Gauss-Lobatto quadrature)");
604 }
605 template<class T, class M>
606 template<class Value>
607 void
609  const geo_basic<float_type,memory_type>& omega_K,
610  const geo_element& K,
611  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
612 {
613  const disarray<Value,M>& uq = memorized_disarray<T,Value>().get (*this);
614  typename disarray<Value>::const_iterator uq_K = uq.begin();
615  size_type loc_nnod = _fops.get_piola_on_pointset().get_basis_on_pointset().nnod(K);
616  value.resize (loc_nnod);
617  for (size_type loc_inod = 0; loc_inod < loc_nnod; loc_inod++, _start_q++) {
618  value [loc_inod] = uq_K [_start_q];
619  }
620 }
621 // ----------------------------------------------------------------------------
622 // instanciation in library (v2)
623 // ----------------------------------------------------------------------------
624 #define _RHEOLEF_instanciation_base_seq_only(T) \
625 template class field_expr_v2_nonlinear_terminal_function_base_rep<T>; \
626 template class field_expr_v2_nonlinear_terminal_function_rep< normal_pseudo_function<T> >; \
627 template class field_expr_v2_nonlinear_terminal_function_rep<h_local_pseudo_function<T> >; \
628 template class field_expr_v2_nonlinear_terminal_function_rep<penalty_pseudo_function<T> >; \
629 
630 // extra when Result=tensor3, tensor4
631 #define _RHEOLEF_instanciation_base_both_members_diff(T,M,Result,Diff) \
632 template void field_expr_v2_nonlinear_terminal_field_rep<T,M,Diff>::evaluate ( \
633  const geo_basic<T,M>& omega_K, \
634  const geo_element& K, \
635  Eigen::Matrix<Result,Eigen::Dynamic,1>& value) const; \
636 template void field_expr_v2_nonlinear_terminal_field_rep<T,M,Diff>::evaluate_on_side ( \
637  const geo_basic<T,M>& omega_L, \
638  const geo_element& L, \
639  const side_information_type& sid, \
640  Eigen::Matrix<Result,Eigen::Dynamic,1>& value) const; \
641 
642 #define _RHEOLEF_instanciation_base_both_members_alls(T,M,Result) \
643 _RHEOLEF_instanciation_base_both_members_diff(T,M,Result,details::differentiate_option::none) \
644 _RHEOLEF_instanciation_base_both_members_diff(T,M,Result,details::differentiate_option::gradient) \
645 _RHEOLEF_instanciation_base_both_members_diff(T,M,Result,details::differentiate_option::divergence) \
646 _RHEOLEF_instanciation_base_both_members_diff(T,M,Result,details::differentiate_option::curl) \
647 template void field_expr_v2_nonlinear_terminal_field_o_characteristic_rep<T,M>::evaluate ( \
648  const geo_basic<float_type,memory_type>& omega_K, \
649  const geo_element& K, \
650  Eigen::Matrix<Result,Eigen::Dynamic,1>& value) const; \
651 template void field_expr_v2_nonlinear_terminal_field_dg_rep<T,M>::evaluate ( \
652  const geo_basic<float_type,memory_type>& omega_K, \
653  const geo_element& K, \
654  Eigen::Matrix<Result,Eigen::Dynamic,1>& value) const; \
655 
656 #define _RHEOLEF_instanciation_base_both(T,M) \
657 template const geo_element& global_get_side ( \
658  const geo_basic<T,M>&, const geo_element&, const side_information_type&); \
659 template const geo_element& field_expr_v2_nonlinear_terminal_function_base_rep<T>::get_side ( \
660  const geo_basic<T,M>& omega_L, \
661  const geo_element& L, \
662  const side_information_type& sid) const; \
663 template class field_expr_v2_nonlinear_terminal_field_rep<T,M,details::differentiate_option::none>; \
664 template class field_expr_v2_nonlinear_terminal_field_rep<T,M,details::differentiate_option::gradient>; \
665 template class field_expr_v2_nonlinear_terminal_field_rep<T,M,details::differentiate_option::divergence>; \
666 template class field_expr_v2_nonlinear_terminal_field_rep<T,M,details::differentiate_option::curl>; \
667 template class field_expr_v2_nonlinear_terminal_field_dg_rep<T,M>; \
668 template class field_expr_v2_nonlinear_terminal_field_o_characteristic_rep<T,M>; \
669  _RHEOLEF_instanciation_base_both_members_alls(T,M,T) \
670  _RHEOLEF_instanciation_base_both_members_alls(T,M,point_basic<T>) \
671  _RHEOLEF_instanciation_base_both_members_alls(T,M,tensor_basic<T>) \
672  _RHEOLEF_instanciation_base_both_members_alls(T,M,tensor3_basic<T>) \
673  _RHEOLEF_instanciation_base_both_members_alls(T,M,tensor4_basic<T>) \
674 
675 #define _RHEOLEF_instanciation_seq(T) \
676  _RHEOLEF_instanciation_base_seq_only(T) \
677  _RHEOLEF_instanciation_base_both(T,sequential) \
678 
679 #define _RHEOLEF_instanciation_dis(T) \
680  _RHEOLEF_instanciation_base_both(T,distributed) \
681 
683 #ifdef _RHEOLEF_HAVE_MPI
685 #endif // _RHEOLEF_HAVE_MPI
686 
687 }} // namespace rheolef::details
field::size_type size_type
Definition: branch.cc:425
see the Float page for the full documentation
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
void initialize(const piola_on_pointset< T > &pops, const integrate_option &iopt) const
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
void evaluate_on_side(const geo_basic< float_type, memory_type > &omega_L, const geo_element &L, const side_information_type &sid, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
const geo_element & get_side(const geo_basic< float_type, M > &omega_K, const geo_element &K, const side_information_type &sid) const
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
see the disarray page for the full documentation
Definition: disarray.h:459
rep::base::const_iterator const_iterator
Definition: disarray.h:465
abstract base interface class
Definition: geo.h:248
see the geo_element page for the full documentation
Definition: geo_element.h:102
reference_element::size_type size_type
Definition: geo_element.h:125
size_type dimension() const
Definition: geo_element.h:167
size_type master(bool i) const
Definition: geo_element.h:165
variant_type variant() const
Definition: geo_element.h:161
orientation_type get_side_informations(const geo_element &S, size_type &loc_isid, size_type &shift) const
Definition: geo_element.cc:185
size_type dis_ie() const
Definition: geo_element.h:163
char name() const
Definition: geo_element.h:169
see the integrate_option page for the full documentation
see the reference_element page for the full documentation
the finite element space
Definition: space.h:352
size_t size_type
Definition: basis_get.cc:76
typename details::generic_binary_traits< BinaryFunction >::template result_hint< typename Expr1::result_type, typename Expr2::result_type >::type result_type
rheolef::std value
#define trace_macro(message)
Definition: dis_macros.h:111
#define error_macro(message)
Definition: dis_macros.h:49
#define fatal_macro(message)
Definition: dis_macros.h:33
Expr1::float_type T
Definition: field_expr.h:261
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
#define _RHEOLEF_instanciation_seq(T)
#define _RHEOLEF_instanciation_dis(T)
const geo_element & global_get_side(const geo_basic< T, M > &omega_L, const geo_element &L, const side_information_type &sid)
void interpolate_pass2_valued(const field_basic< T, M > &uh, const disarray< point_basic< T >, M > &x, const disarray< index_set, M > &ie2dis_ix, const disarray< point_basic< T >, M > &hat_y, disarray< Value, M > &ux)
Definition: interpolate.cc:122
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)
This file is part of Rheolef.
T norm(const vec< T, M > &x)
norm(x): see the expression page for the full documentation
Definition: vec.h:387
void evaluate_on_side(const geo_basic< float_type, M > &omega_K, const geo_element &K, const side_information_type &sid, Eigen::Matrix< Result, Eigen::Dynamic, 1 > &value) const
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
Float measure(reference_element hat_K)
T det_jacobian_piola_transformation(const tensor_basic< T > &DF, size_t d, size_t map_d)
Definition: piola_util.cc:137
void evaluate(const geo_basic< float_type, M > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, 1 > &value) const
void field_evaluate_continued(const field_basic< T, M > &uh, const geo_basic< T, M > &omega_K, const geo_element &K, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &phij_xi, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value)
space_mult_list< T, M > pow(const space_basic< T, M > &X, size_t n)
Definition: space_mult.h:120
point_basic< T > normal_from_piola_transformation(const geo_basic< T, M > &omega, const geo_element &S, const tensor_basic< T > &DF, size_t d)
Definition: piola_util.cc:164
disarray< point_basic< T >, M > _hat_y
disarray< point_basic< T >, M > _yq
point_basic< T > F
Definition: piola.h:79
geo_element_indirect::orientation_type orient
Expr1::memory_type M
Definition: vec_expr_v2.h:416