Rheolef  7.1
an efficient C++ finite element environment
piola_util.cc
Go to the documentation of this file.
1 #include "rheolef/piola_util.h"
22 #include "rheolef/geo_domain.h"
23 #include "rheolef/inv_piola.h"
24 #include "rheolef/damped_newton.h"
25 namespace rheolef {
26 
27 // =========================================================================
28 // part 1. piola transformation
29 // =========================================================================
30 // F_K : hat_K --> K
31 // hat_x --> x
32 //
33 // pre-evaluation of the piola basis on a predefined point set
34 // e.g. quadrature nodes hat_x[q], q=0..nq on hat_K
35 // then, fast transformation of all hat_x[q] into xq on any K
36 //
37 // x = F(hat_x) = sum_j phi_j(hat_x)*xjnod
38 // for all hat_x in the pointset : hat_xi
39 // where xjnod: j-th node of element K in mesh omega
40 //
41 template<class T, class M>
42 void
44  const geo_basic<T,M>& omega,
46  reference_element hat_K,
47  const std::vector<size_t>& dis_inod,
48  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
49 {
50  typedef typename geo_basic<T,M>::size_type size_type;
51  const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& phij_xi = piola_on_pointset.template evaluate<T> (hat_K);
52  size_type loc_nnod = phij_xi.rows();
53  size_type loc_ndof = phij_xi.cols();
54  x.resize (loc_nnod);
55  for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
56  x[loc_inod] = point_basic<T>(0,0,0);
57  }
58  size_type d = omega.dimension();
59  for (size_type loc_jdof = 0; loc_jdof < loc_ndof; ++loc_jdof) {
60  // dis_node: in outer loop: could require more time with external node
61  const point_basic<T>& xjnod = omega.dis_node (dis_inod[loc_jdof]);
62  for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
63  for (size_type alpha = 0; alpha < d; alpha++) {
64  x[loc_inod][alpha] += phij_xi (loc_inod,loc_jdof)*xjnod[alpha];
65  }
66  }
67  }
68 }
69 // ------------------------------------------
70 // jacobian of the piola transformation
71 // at a all quadrature points
72 // ------------------------------------------
73 //
74 // DF(hat_x) = sum_j grad_phi_j(hat_x)*xjnod
75 // for all hat_x in the pointset : hat_xi
76 // where xjnod: j-th node of element K in mesh omega
77 //
78 template<class T, class M>
79 void
81  const geo_basic<T,M>& omega,
83  reference_element hat_K,
84  const std::vector<size_t>& dis_inod,
85  Eigen::Matrix<tensor_basic<T>,Eigen::Dynamic,1>& DF)
86 {
87  typedef typename geo_basic<T,M>::size_type size_type;
88  const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,Eigen::Dynamic>&
89  grad_phij_xi = piola_on_pointset.template grad_evaluate<point_basic<T>>(hat_K);
90  size_type loc_nnod = grad_phij_xi.rows();
91  size_type loc_ndof = grad_phij_xi.cols();
92  DF.resize (loc_nnod);
93  for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
94  DF[loc_inod].fill (0);
95  }
96  size_type d = omega.dimension();
97  size_type map_d = hat_K.dimension();
98  for (size_type loc_jdof = 0; loc_jdof < loc_ndof; ++loc_jdof) {
99  // dis_node: in outer loop: could require more time with external node
100  const point_basic<T>& xjnod = omega.dis_node (dis_inod[loc_jdof]);
101  for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
102  cumul_otimes (DF[loc_inod], xjnod, grad_phij_xi(loc_inod,loc_jdof), d, map_d);
103  }
104  }
105 }
106 // ------------------------------------------
107 // jacobian of the piola transformation
108 // at an aritrarily point hat_x
109 // ------------------------------------------
110 //
111 // DF(hat_x) = sum_j grad_phi_j(hat_x)*xjnod
112 // where xjnod: j-th node of element K in mesh omega
113 //
114 template<class T, class M>
115 void
117  const geo_basic<T,M>& omega,
118  const basis_basic<T>& piola_basis,
119  reference_element hat_K,
120  const std::vector<size_t>& dis_inod,
121  const point_basic<T>& hat_x,
122  tensor_basic<T>& DF)
123 {
124  typedef typename geo_basic<T,M>::size_type size_type;
125  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1> grad_phi_x;
126  piola_basis.grad_evaluate (hat_K, hat_x, grad_phi_x);
127  DF.fill (0);
128  size_type d = omega.dimension();
129  size_type map_d = hat_K.dimension();
130  for (size_type loc_jdof = 0, loc_ndof = dis_inod.size(); loc_jdof < loc_ndof; loc_jdof++) {
131  const point_basic<T>& xjnod = omega.dis_node (dis_inod[loc_jdof]);
132  cumul_otimes (DF, xjnod, grad_phi_x [loc_jdof], d, map_d);
133  }
134 }
135 template <class T>
136 T
137 det_jacobian_piola_transformation (const tensor_basic<T>& DF, size_t d , size_t map_d)
138 {
139  if (d == map_d) {
140  return DF.determinant (map_d);
141  }
142  /* surface jacobian: references:
143  * Spectral/hp element methods for CFD
144  * G. E. M. Karniadakis and S. J. Sherwin
145  * Oxford university press
146  * 1999
147  * page 165
148  */
149  switch (map_d) {
150  case 0: return 1;
151  case 1: return norm(DF.col(0));
152  case 2: return norm(vect(DF.col(0), DF.col(1)));
153  default:
154  error_macro ("det_jacobian_piola_transformation: unsupported element dimension "
155  << map_d << " in " << d << "D mesh.");
156  return 0;
157  }
158 }
159 //
160 // application:
161 //
162 template<class T, class M>
165  const geo_basic<T,M>& omega,
166  const geo_element& S,
167  const tensor_basic<T>& DF,
168  size_t d)
169 {
170  switch (d) {
171  case 1: { // point in 1D: DF[1][0] is empty, so scan S[0] node connectivity
172  typedef typename geo_basic<T,M>::size_type size_type;
173  if (S.dimension() + 1 == omega.map_dimension()) {
174  size_type dis_ie = S.master(0);
175  check_macro (dis_ie != std::numeric_limits<size_type>::max(), "normal: requires neighbours initialization");
176  const geo_element& K = omega.dis_get_geo_element (S.dimension()+1, dis_ie);
177  Float sign = (S[0] == K[1]) ? 1 : -1;
178  return point_basic<T>(sign);
179  }
180  // omega is a domain of sides, as "boundary" or "internal_sides":
181  // for the side orient, we need to go back to its backgound volumic mesh
182  if (omega.variant() == geo_abstract_base_rep<T>::geo_domain_indirect) {
183  size_type dis_isid = S.dis_ie();
184  size_type first_dis_isid = omega.sizes().ownership_by_dimension[S.dimension()].first_index();
185  size_type isid = dis_isid - first_dis_isid;
186  check_macro (dis_isid >= first_dis_isid, "unexpected dis_index "<<dis_isid<<": out of local range");
187  const geo_basic<T,M>* ptr_bgd_omega = 0;
188  if (omega.get_background_geo().map_dimension() == 1) {
189  const geo_basic<T,M>& bgd_omega = omega.get_background_geo();
190  const geo_element& bgd_S = bgd_omega.get_geo_element(0, isid);
191  size_type bgd_dis_ie = bgd_S.master(0);
192  check_macro (bgd_dis_ie != std::numeric_limits<size_type>::max(),
193  "normal: bgd_S.dis_ie={"<<bgd_S.dis_ie()<<"} without neighbours; requires neighbours initialization for mesh " << bgd_omega.name());
194  const geo_element& bgd_K = bgd_omega.dis_get_geo_element (bgd_S.dimension()+1, bgd_dis_ie);
195  Float sign = (bgd_S[0] == bgd_K[1]) ? 1 : -1;
196  return point_basic<T>(sign);
197  } else {
198  // get a 1D geometry at a higher depth, e.g. for HDG 0D "boundary" domain in "square[sides]" 0D geo_domain
199  const geo_basic<T,M>& bgd_omega = omega.get_background_geo();
200  const geo_basic<T,M>& bgd2_omega = bgd_omega.get_background_geo();
201  check_macro (bgd2_omega.dimension() == 1, "unsupported depth for "<<omega.name()<<" in background domain "<<bgd_omega.name());
202  const geo_element& bgd_S = bgd_omega.get_geo_element(0, isid);
203  const geo_element& bgd2_S = bgd_omega.dom2bgd_geo_element (bgd_S);
204  size_type bgd2_dis_ie = bgd2_S.master(0);
205  check_macro (bgd2_dis_ie != std::numeric_limits<size_type>::max(),
206  "normal: bgd2_S.dis_ie={"<<bgd2_S.dis_ie()<<"} without neighbours; requires neighbours initialization for mesh " << bgd2_omega.name());
207  const geo_element& bgd2_K = bgd2_omega.dis_get_geo_element (bgd2_S.dimension()+1, bgd2_dis_ie);
208  Float sign = (bgd2_S[0] == bgd2_K[1]) ? 1 : -1;
209  return point_basic<T>(sign);
210  }
211  } else {
212  size_type dis_isid = S.dis_ie();
213  size_type first_dis_isid = omega.sizes().ownership_by_dimension[S.dimension()].first_index();
214  size_type isid = dis_isid - first_dis_isid;
215  check_macro (dis_isid >= first_dis_isid, "unexpected dis_index "<<dis_isid<<": out of local range");
216  const geo_basic<T,M>& bgd_omega = omega.get_background_geo();
217  const geo_basic<T,M>& bgd_dom = omega.get_background_domain();
218  const geo_element& bgd_S = bgd_dom[isid]; // TODO: pas clair, differe du cas precedent ?
219  size_type bgd_dis_ie = bgd_S.master(0);
220  check_macro (bgd_dis_ie != std::numeric_limits<size_type>::max(),
221  "normal: bgd_S.dis_ie={"<<bgd_S.dis_ie()<<"} without neighbours; requires neighbours initialization for mesh " << bgd_omega.name());
222  const geo_element& bgd_K = bgd_omega.dis_get_geo_element (bgd_S.dimension()+1, bgd_dis_ie);
223  Float sign = (bgd_S[0] == bgd_K[1]) ? 1 : -1;
224  return point_basic<T>(sign);
225  }
226  }
227  case 2: { // edge in 2D
228  // 2D: S=edge(a,b) then t=b-a, DF=[t] and n = (t1,-t0) => det(n,1)=1 : (n,t) is direct
229  // and the normal goes outside on a boundary edge S, when the associated element K is well oriented
230  point_basic<T> t = DF.col(0);
231  t /= norm(t);
232  return point_basic<T>(t[1], -t[0]);
233  }
234  case 3: { // 3D: S=triangle(a,b,c) then t0=b-a, t1=c-a, DF=[t0,t1] and n = t0^t1/|t0^t1|.
235  point_basic<T> t0 = DF.col(0);
236  point_basic<T> t1 = DF.col(1);
237  point_basic<T> n = vect(t0,t1);
238  n /= norm(n);
239  return n;
240  }
241  default:
242  error_macro ("normal: unsupported " << d << "D mesh.");
243  return point_basic<T>();
244  }
245 }
246 // The pseudo inverse extend inv(DF) for face in 3d or edge in 2d
247 // i.e. useful for Laplacian-Beltrami and others surfacic forms.
248 //
249 // pinvDF (hat_xq) = inv DF, if tetra in 3d, tri in 2d, etc
250 // = pseudo-invese, when tri in 3d, edge in 2 or 3d
251 // e.g. on 3d face : pinvDF*DF = [1, 0, 0; 0, 1, 0; 0, 0, 0]
252 //
253 // let DF = [u, v, w], where u, v, w are the column vectors of DF
254 // then det(DF) = mixt(u,v,w)
255 // and det(DF)*inv(DF)^T = [v^w, w^u, u^v] where u^v = vect(u,v)
256 //
257 // application:
258 // if K=triangle(a,b,c) then u=ab=b-a, v=ac=c-a and w = n = u^v/|u^v|.
259 // Thus DF = [ab,ac,n] and det(DF)=|ab^ac|
260 // and inv(DF)^T = [ac^n/|ab^ac|, -ab^n/|ab^ac|, n]
261 // The pseudo-inverse is obtained by remplacing the last column n by zero.
262 //
263 template<class T>
264 tensor_basic<T>
266  const tensor_basic<T>& DF,
267  size_t d,
268  size_t map_d)
269 {
270  if (d == map_d) {
271  return inv(DF, map_d);
272  }
273  tensor_basic<T> invDF;
274  switch (map_d) {
275  case 0: { // point in 1D
276  invDF(0,0) = 1;
277  return invDF;
278  }
279  case 1: { // segment in 2D
280  point_basic<T> t = DF.col(0);
281  invDF.set_row (t/norm2(t), 0, d);
282  return invDF;
283  }
284  case 2: {
285  point_basic<T> t0 = DF.col(0);
286  point_basic<T> t1 = DF.col(1);
287  point_basic<T> n = vect(t0,t1);
288  T det2 = norm2(n);
289  point_basic<T> v0 = vect(t1,n)/det2;
290  point_basic<T> v1 = - vect(t0,n)/det2;
291  invDF.set_row (v0, 0, d);
292  invDF.set_row (v1, 1, d);
293  return invDF;
294  }
295  default:
296  error_macro ("pseudo_inverse_jacobian_piola_transformation: unsupported element dimension "
297  << map_d << " in " << d << "D mesh.");
298  return invDF;
299  }
300 }
301 
302 
303 // axisymetric weight ?
304 // point_basic<T> xq = rheolef::piola_transformation (_omega, _piola_table, K, dis_inod, q);
305 template<class T>
306 T
308 {
309  switch (sys_coord) {
310  case space_constant::axisymmetric_rz: return xq[0];
311  case space_constant::axisymmetric_zr: return xq[1];
312  case space_constant::cartesian: return 1;
313  default: {
314  fatal_macro ("unsupported coordinate system `"
316  return 0;
317  }
318  }
319 }
320 // -------------------------------------------
321 // weight integration: w = det_DF*wq
322 // with optional axisymmetric r*dr factor
323 // -------------------------------------------
324 template<class T, class M>
325 void
327  const geo_basic<T,M>& omega,
328  const basis_on_pointset<T>& piola_on_quad,
329  reference_element hat_K,
330  const std::vector<size_t>& dis_inod,
331  bool ignore_sys_coord,
332  Eigen::Matrix<tensor_basic<T>,Eigen::Dynamic,1>& DF,
333  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x,
334  Eigen::Matrix<T,Eigen::Dynamic,1>& w)
335 {
336  typedef typename geo_basic<T,M>::size_type size_type;
337  jacobian_piola_transformation (omega, piola_on_quad, hat_K, dis_inod, DF);
338  size_type loc_nnod = piola_on_quad.nnod (hat_K);
339  w.resize (loc_nnod);
340  if (omega.coordinate_system() == space_constant::cartesian || ignore_sys_coord) {
341  w.fill (T(1));
342  } else {
343  piola_transformation (omega, piola_on_quad, hat_K, dis_inod, x);
344  size_t k = (omega.coordinate_system() == space_constant::axisymmetric_rz) ? 0 : 1;
345  for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
346  w[loc_inod] = x[loc_inod][k];
347  }
348  }
349  size_type d = omega.dimension();
350  size_type map_d = hat_K.dimension();
351  const quadrature<T>& quad = piola_on_quad.get_quadrature();
353  first_quad = quad.begin(hat_K),
354  last_quad = quad.end (hat_K);
355  for (size_type q = 0; first_quad != last_quad; ++first_quad, ++q) {
356  T det_DF = det_jacobian_piola_transformation (DF[q], d, map_d);
357  T wq = det_DF*(*first_quad).w;
358  if (! ignore_sys_coord) {
359  w[q] = wq*w[q];
360  } else {
361  w[q] = wq;
362  }
363  }
364 }
365 // calcul P = I - nxn
366 template<class T>
367 void
369  const tensor_basic<T>& DF,
370  size_t d,
371  size_t map_d,
372  tensor_basic<T>& P)
373 {
375  switch (map_d) {
376  case 1: {
377  point_basic<Float> t = DF.col(0);
378  check_macro (d == map_d+1, "unexpected dimension map_d="<<map_d<<" and d="<<d);
379  n = point_basic<T>(t[1],-t[0]);
380  break;
381  }
382  case 2: {
383  point_basic<Float> t0 = DF.col(0);
384  point_basic<Float> t1 = DF.col(1);
385  n = vect(t0,t1);
386  break;
387  }
388  default:
389  error_macro ("unexpected dimension "<<map_d);
390  }
391  n = n/norm(n);
392  for (size_t l = 0; l < d; l++) {
393  for (size_t m = 0; m < d; m++) {
394  P(l,m) = - n[l]*n[m];
395  }
396  P(l,l) += 1;
397  }
398 }
399 // =========================================================================
400 // part 2. inverse piola transformation
401 // =========================================================================
402 // F_K^{-1} : K --> hat(K)
403 // x --> hat(x)
404 // TODO: non-linear case
405 template<class T>
406 static
407 inline
409 inv_piola_e (
410  const point_basic<T>& x,
411  const point_basic<T>& a,
412  const point_basic<T>& b)
413 {
414  return point_basic<T>((x[0]-a[0])/(b[0]-a[0]));
415 }
416 template<class T>
417 static
418 inline
420 inv_piola_t (
421  const point_basic<T>& x,
422  const point_basic<T>& a,
423  const point_basic<T>& b,
424  const point_basic<T>& c)
425 {
426  T t9 = 1/(-b[0]*c[1]+b[0]*a[1]+a[0]*c[1]+c[0]*b[1]-c[0]*a[1]-a[0]*b[1]);
427  T t11 = -a[0]+x[0];
428  T t15 = -a[1]+x[1];
429  return point_basic<T>((-c[1]+a[1])*t9*t11-(-c[0]+a[0])*t9*t15,
430  ( b[1]-a[1])*t9*t11-( b[0]-a[0])*t9*t15);
431 }
432 template<class T>
433 static
434 inline
436 inv_piola_T (
437  const point_basic<T>& x,
438  const point_basic<T>& a,
439  const point_basic<T>& b,
440  const point_basic<T>& c,
441  const point_basic<T>& d)
442 {
443  tensor_basic<T> A;
444  point_basic<T> ax;
445  for (size_t i = 0; i < 3; i++) {
446  ax[i] = x[i]-a[i];
447  A(i,0) = b[i]-a[i];
448  A(i,1) = c[i]-a[i];
449  A(i,2) = d[i]-a[i];
450  }
451  tensor_basic<T> inv_A;
452  bool is_singular = ! invert_3x3 (A, inv_A);
453  check_macro(!is_singular, "inv_piola: singular transformation in a tetrahedron");
454  point_basic<T> hat_x = inv_A*ax;
455  return hat_x;
456 }
457 template<class T, class M>
460  const geo_basic<T,M>& omega,
461  const reference_element& hat_K,
462  const std::vector<size_t>& dis_inod,
463  const point_basic<T>& x)
464 {
465  check_macro (omega.order() == 1, "inverse piola: mesh order > 1: not yet");
466  if (omega.order() == 1) {
467  switch (hat_K.variant()) {
468  case reference_element::e: return inv_piola_e (x, omega.dis_node(dis_inod [0]),
469  omega.dis_node(dis_inod [1]));
470  case reference_element::t: return inv_piola_t (x, omega.dis_node(dis_inod [0]),
471  omega.dis_node(dis_inod [1]),
472  omega.dis_node(dis_inod [2]));
473  case reference_element::T: return inv_piola_T (x, omega.dis_node(dis_inod [0]),
474  omega.dis_node(dis_inod [1]),
475  omega.dis_node(dis_inod [2]),
476  omega.dis_node(dis_inod [3]));
477  }
478  }
479  // non-linear transformation: q,P,H or high order > 1 => use Newton
480  inv_piola<T> F;
481  F.reset (omega, hat_K, dis_inod);
482  F.set_x (x);
483  point_basic<T> hat_x = F.initial();
484  size_t max_iter = 500, n_iter = max_iter;
485  T tol = std::numeric_limits<Float>::epsilon(), r = tol;
486  int status = damped_newton (F, hat_x, r, n_iter);
487  check_macro (status == 0, "inv_piola: newton failed (residue="<<r<<", n_iter="<<n_iter<<")");
488  return hat_x;
489 }
490 // ----------------------------------------------------------------------------
491 // instanciation in library
492 // ----------------------------------------------------------------------------
493 #define _RHEOLEF_instanciation1(T) \
494 template \
495 T \
496 det_jacobian_piola_transformation ( \
497  const tensor_basic<T>& DF, \
498  size_t d, \
499  size_t map_d); \
500 template \
501 tensor_basic<T> \
502 pseudo_inverse_jacobian_piola_transformation ( \
503  const tensor_basic<T>& DF, \
504  size_t d, \
505  size_t map_d); \
506 template \
507 T \
508 weight_coordinate_system ( \
509  space_constant::coordinate_type sys_coord, \
510  const point_basic<T>& xq); \
511 template \
512 void \
513 map_projector ( \
514  const tensor_basic<T>& DF, \
515  size_t d, \
516  size_t map_d, \
517  tensor_basic<T>& P); \
518 
519 
520 #define _RHEOLEF_instanciation2(T,M) \
521 template \
522 void \
523 piola_transformation ( \
524  const geo_basic<T,M>& omega, \
525  const basis_on_pointset<T>& piola_on_pointset, \
526  reference_element hat_K, \
527  const std::vector<size_t>& dis_inod, \
528  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x); \
529 template \
530 point_basic<T> \
531 inverse_piola_transformation ( \
532  const geo_basic<T,M>& omega, \
533  const reference_element& hat_K, \
534  const std::vector<size_t>& dis_inod, \
535  const point_basic<T>& x); \
536 template \
537 void \
538 jacobian_piola_transformation ( \
539  const geo_basic<T,M>& omega, \
540  const basis_basic<T>& piola_basis, \
541  reference_element hat_K, \
542  const std::vector<size_t>& dis_inod, \
543  const point_basic<T>& hat_x, \
544  tensor_basic<T>& DF); \
545 template \
546 void \
547 jacobian_piola_transformation ( \
548  const geo_basic<T,M>& omega, \
549  const basis_on_pointset<T>& piola_on_pointset, \
550  reference_element hat_K, \
551  const std::vector<size_t>& dis_inod, \
552  Eigen::Matrix<tensor_basic<T>,Eigen::Dynamic,1>& DF); \
553 template \
554 point_basic<T> \
555 normal_from_piola_transformation ( \
556  const geo_basic<T,M>& omega, \
557  const geo_element& S, \
558  const tensor_basic<T>& DF, \
559  size_t d); \
560 template \
561 void \
562 piola_transformation_and_weight_integration ( \
563  const geo_basic<T,M>& omega, \
564  const basis_on_pointset<T>& piola_on_pointset, \
565  reference_element hat_K, \
566  const std::vector<size_t>& dis_inod, \
567  bool ignore_sys_coord, \
568  Eigen::Matrix<tensor_basic<T>,Eigen::Dynamic,1>& DF, \
569  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x, \
570  Eigen::Matrix<T,Eigen::Dynamic,1>& w); \
571 
572 
575 #ifdef _RHEOLEF_HAVE_MPI
577 #endif // _RHEOLEF_HAVE_MPI
578 
579 } // namespace rheolef
field::size_type size_type
Definition: branch.cc:425
see the Float page for the full documentation
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
Definition: basis.h:875
size_type nnod(reference_element hat_K) const
const quadrature< T > & get_quadrature() const
abstract base interface class
Definition: geo.h:248
see the geo_element page for the full documentation
Definition: geo_element.h:102
size_type dimension() const
Definition: geo_element.h:167
size_type master(bool i) const
Definition: geo_element.h:165
size_type dis_ie() const
Definition: geo_element.h:163
void set_x(const value_type &x1)
Definition: inv_piola.h:41
void reset(const geo_basic< T, M > &omega, const reference_element &hat_K, const std::vector< size_t > &dis_inod)
Definition: inv_piola.h:77
value_type initial() const
Definition: inv_piola.h:89
rep::const_iterator const_iterator
Definition: quadrature.h:195
const_iterator end(reference_element hat_K) const
Definition: quadrature.h:219
const_iterator begin(reference_element hat_K) const
Definition: quadrature.h:218
see the reference_element page for the full documentation
static const variant_type e
variant_type variant() const
static const variant_type T
static const variant_type t
point_basic< T > col(size_type i) const
Definition: tensor.cc:323
T determinant(size_type d=3) const
Definition: tensor.cc:288
void fill(const T &init_val)
Definition: tensor.h:252
void set_row(const point_basic< T > &r, size_t i, size_t d=3)
Definition: tensor.h:435
size_t size_type
Definition: basis_get.cc:76
point_basic< T >
Definition: piola_fem.h:135
#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)")
Float alpha[pmax+1][pmax+1]
Definition: bdf.icc:28
string sys_coord
Definition: mkgeo_grid.sh:171
std::string coordinate_system_name(coordinate_type i)
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.
tensor_basic< T > inv(const tensor_basic< T > &a, size_t d)
Definition: tensor.cc:219
void map_projector(const tensor_basic< T > &DF, size_t d, size_t map_d, tensor_basic< T > &P)
Definition: piola_util.cc:368
T norm(const vec< T, M > &x)
norm(x): see the expression page for the full documentation
Definition: vec.h:387
void cumul_otimes(tensor_basic< T > &t, const point_basic< T > &a, const point_basic< T > &b, size_t na, size_t nb)
Definition: tensor.cc:305
point_basic< T > vect(const point_basic< T > &v, const point_basic< T > &w)
Definition: point.h:265
T det_jacobian_piola_transformation(const tensor_basic< T > &DF, size_t d, size_t map_d)
Definition: piola_util.cc:137
T norm2(const vec< T, M > &x)
norm2(x): see the expression page for the full documentation
Definition: vec.h:379
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:459
bool invert_3x3(const tensor_basic< T > &A, tensor_basic< T > &result)
Definition: tensor.cc:333
_RHEOLEF_instanciation1(Float) _RHEOLEF_instanciation2(Float
void jacobian_piola_transformation(const geo_basic< T, M > &omega, const basis_on_pointset< T > &piola_on_pointset, reference_element hat_K, const std::vector< size_t > &dis_inod, Eigen::Matrix< tensor_basic< T >, Eigen::Dynamic, 1 > &DF)
Definition: piola_util.cc:80
tensor_basic< T > pseudo_inverse_jacobian_piola_transformation(const tensor_basic< T > &DF, size_t d, size_t map_d)
Definition: piola_util.cc:265
T weight_coordinate_system(space_constant::coordinate_type sys_coord, const point_basic< T > &xq)
Definition: piola_util.cc:307
void piola_transformation_and_weight_integration(const geo_basic< T, M > &omega, const basis_on_pointset< T > &piola_on_quad, reference_element hat_K, const std::vector< size_t > &dis_inod, bool ignore_sys_coord, Eigen::Matrix< tensor_basic< T >, Eigen::Dynamic, 1 > &DF, Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &w)
Definition: piola_util.cc:326
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
void piola_transformation(const geo_basic< T, M > &omega, const basis_on_pointset< T > &piola_on_pointset, reference_element hat_K, const std::vector< size_t > &dis_inod, Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &x)
Definition: piola_util.cc:43
int damped_newton(const Problem &P, const Preconditioner &T, Field &u, Real &tol, Size &max_iter, odiststream *p_derr=0)
see the damped_newton page for the full documentation
#define _RHEOLEF_instanciation2(T, M)
Definition: piola_util.cc:520
Float epsilon