Reference documentation for deal.II version 8.5.1
manifold.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2017 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #include <deal.II/base/tensor.h>
17 #include <deal.II/base/table.h>
18 #include <deal.II/grid/manifold.h>
19 #include <deal.II/grid/tria.h>
20 #include <deal.II/grid/tria_iterator.h>
21 #include <deal.II/grid/tria_accessor.h>
22 #include <deal.II/fe/fe_q.h>
23 #include <cmath>
24 
25 DEAL_II_NAMESPACE_OPEN
26 
27 using namespace Manifolds;
28 
29 // This structure is used as comparison function for std::sort when sorting
30 // points according to their weight.
31 struct CompareWeights
32 {
33 public:
34  CompareWeights(const std::vector<double> &weights)
35  :
36  compare_weights(weights)
37  {}
38 
39  bool operator() (unsigned int a, unsigned int b) const
40  {
41  return compare_weights[a] < compare_weights[b];
42  }
43 
44 private:
45  const std::vector<double> &compare_weights;
46 };
47 
48 /* -------------------------- Manifold --------------------- */
49 
50 template <int dim, int spacedim>
52 {}
53 
54 
55 
56 template <int dim, int spacedim>
59 project_to_manifold (const std::vector<Point<spacedim> > &,
60  const Point<spacedim> &) const
61 {
62  Assert (false, ExcPureFunctionCalled());
63  return Point<spacedim>();
64 }
65 
66 
67 
68 template <int dim, int spacedim>
72  const Point<spacedim> &p2,
73  const double w) const
74 {
75  std::vector<Point<spacedim> > vertices;
76  vertices.push_back(p1);
77  vertices.push_back(p2);
78  return project_to_manifold(vertices, w * p2 + (1-w)*p1 );
79 }
80 
81 
82 
83 template <int dim, int spacedim>
87 {
88  return get_new_point(quad.get_points(),quad.get_weights());
89 }
90 
91 
92 
93 template <int dim, int spacedim>
96 get_new_point (const std::vector<Point<spacedim> > &surrounding_points,
97  const std::vector<double> &weights) const
98 {
99  const double tol = 1e-10;
100  const unsigned int n_points = surrounding_points.size();
101 
102  Assert(n_points > 0,
103  ExcMessage("There should be at least one point."));
104 
105  Assert(n_points == weights.size(),
106  ExcMessage("There should be as many surrounding points as weights given."));
107 
108  Assert(std::abs(std::accumulate(weights.begin(), weights.end(), 0.0)-1.0) < tol,
109  ExcMessage("The weights for the individual points should sum to 1!"));
110 
111  // First sort points in the order of their weights. This is done to
112  // produce unique points even if get_intermediate_points is not
113  // associative (as for the SphericalManifold).
114  unsigned int permutation_short[30];
115  std::vector<unsigned int> permutation_long;
116  unsigned int *permutation;
117  if (n_points > 30)
118  {
119  permutation_long.resize(n_points);
120  permutation = &permutation_long[0];
121  }
122  else
123  permutation = &permutation_short[0];
124 
125  for (unsigned int i=0; i<n_points; ++i)
126  permutation[i] = i;
127 
128  std::sort(permutation,
129  permutation + n_points,
130  CompareWeights(weights));
131 
132  // Now loop over points in the order of their associated weight
133  Point<spacedim> p = surrounding_points[permutation[0]];
134  double w = weights[permutation[0]];
135 
136  for (unsigned int i=1; i<n_points; ++i)
137  {
138  double weight = 0.0;
139  if ( (weights[permutation[i]] + w) < tol )
140  weight = 0.0;
141  else
142  weight = w/(weights[permutation[i]] + w);
143 
144  if (std::abs(weight) > 1e-14)
145  p = get_intermediate_point(p, surrounding_points[permutation[i]],1.0 - weight );
146  w += weights[permutation[i]];
147  }
148 
149  return p;
150 }
151 
152 
153 
154 template <int dim, int spacedim>
155 void
157 add_new_points (const std::vector<Point<spacedim> > &surrounding_points,
158  const Table<2,double> &weights,
159  std::vector<Point<spacedim> > &new_points) const
160 {
161  AssertDimension(surrounding_points.size(), weights.size(1));
162  Assert(&surrounding_points != &new_points,
163  ExcMessage("surrounding_points and new_points cannot be the same "
164  "array"));
165 
166  const unsigned int n_points = surrounding_points.size();
167  std::vector<double> local_weights(n_points);
168  for (unsigned int row=0; row<weights.size(0); ++row)
169  {
170  for (unsigned int i=0; i<n_points; ++i)
171  local_weights[i] = weights(row,i);
172  new_points.push_back(get_new_point(surrounding_points, local_weights));
173  }
174 }
175 
176 
177 
178 template <>
182  const Point<2> &p) const
183 {
184  const int spacedim=2;
185 
186  // get the tangent vector from the point 'p' in the direction of the further
187  // one of the two vertices that make up the face of this 2d cell
188  const Tensor<1,spacedim> tangent
189  = ((p-face->vertex(0)).norm_square() > (p-face->vertex(1)).norm_square() ?
190  -get_tangent_vector(p, face->vertex(0)) :
191  get_tangent_vector(p, face->vertex(1)));
192 
193  // then rotate it by 90 degrees
194  const Tensor<1,spacedim> normal = cross_product_2d(tangent);
195  return normal/normal.norm();
196 }
197 
198 
199 
200 template<>
204  const Point<3> &p) const
205 {
206  const int spacedim=3;
207  Tensor<1,spacedim> t1,t2;
208 
209  // Take the difference between p and all four vertices
210  unsigned int min_index=0;
211  double min_distance = (p-face->vertex(0)).norm_square();
212 
213  for (unsigned int i=1; i<4; ++i)
214  {
215  const Tensor<1,spacedim> dp = p-face->vertex(i);
216  double distance = dp.norm_square();
217  if (distance < min_distance)
218  {
219  min_index = i;
220  min_distance = distance;
221  }
222  }
223  // Verify we have a valid vertex index
224  AssertIndexRange(min_index, 4);
225 
226  // Now figure out which vertices are best to compute tangent vectors.
227  // We split the cell in a central diamond of points closer to the
228  // center than to any of the vertices, and the 4 triangles in the
229  // corner. The central diamond is split into its upper and lower
230  // half. For each of these 6 cases, the following encodes a list
231  // of two vertices each to which we compute the tangent vectors,
232  // and then take the cross product. See the documentation of this
233  // function for exact details.
234  if ((p-face->center()).norm_square() < min_distance)
235  {
236  // we are close to the face center: pick two consecutive vertices,
237  // but not the closest one. We make sure the direction is always
238  // the same.
239  if (min_index < 2)
240  {
241  t1 = get_tangent_vector(p, face->vertex(3));
242  t2 = get_tangent_vector(p, face->vertex(2));
243  }
244  else
245  {
246  t1 = get_tangent_vector(p, face->vertex(0));
247  t2 = get_tangent_vector(p, face->vertex(1));
248  }
249  }
250  else
251  {
252  // we are closer to one of the vertices than to the
253  // center of the face
254  switch (min_index)
255  {
256  case 0:
257  {
258  t1 = get_tangent_vector(p, face->vertex(1));
259  t2 = get_tangent_vector(p, face->vertex(2));
260  break;
261  }
262  case 1:
263  {
264  t1 = get_tangent_vector(p, face->vertex(3));
265  t2 = get_tangent_vector(p, face->vertex(0));
266  break;
267  }
268  case 2:
269  {
270  t1 = get_tangent_vector(p, face->vertex(0));
271  t2 = get_tangent_vector(p, face->vertex(3));
272  break;
273  }
274  case 3:
275  {
276  t1 = get_tangent_vector(p, face->vertex(2));
277  t2 = get_tangent_vector(p, face->vertex(1));
278  break;
279  }
280  default:
281  Assert(false, ExcInternalError());
282  break;
283  }
284  }
285 
286  const Tensor<1,spacedim> normal = cross_product_3d(t1,t2);
287  return normal/normal.norm();
288 }
289 
290 
291 
292 template <int dim, int spacedim>
296  const Point<spacedim> &/*p*/) const
297 {
298  Assert(false, ExcPureFunctionCalled());
299  return Tensor<1,spacedim>();
300 }
301 
302 
303 
304 template <>
305 void
308  FaceVertexNormals &n) const
309 {
310  n[0] = cross_product_2d(get_tangent_vector(face->vertex(0), face->vertex(1)));
311  n[1] = -cross_product_2d(get_tangent_vector(face->vertex(1), face->vertex(0)));
312 
313  for (unsigned int i=0; i<2; ++i)
314  {
315  Assert(n[i].norm() != 0, ExcInternalError("Something went wrong. The "
316  "computed normals have "
317  "zero length."));
318  n[i] /= n[i].norm();
319  }
320 }
321 
322 
323 
324 template <>
325 void
328  FaceVertexNormals &n) const
329 {
330  n[0] = cross_product_3d
331  (get_tangent_vector(face->vertex(0), face->vertex(1)),
332  get_tangent_vector(face->vertex(0), face->vertex(2)));
333 
334  n[1] = cross_product_3d
335  (get_tangent_vector(face->vertex(1), face->vertex(3)),
336  get_tangent_vector(face->vertex(1), face->vertex(0)));
337 
338  n[2] = cross_product_3d
339  (get_tangent_vector(face->vertex(2), face->vertex(0)),
340  get_tangent_vector(face->vertex(2), face->vertex(3)));
341 
342  n[3] = cross_product_3d
343  (get_tangent_vector(face->vertex(3), face->vertex(2)),
344  get_tangent_vector(face->vertex(3), face->vertex(1)));
345 
346  for (unsigned int i=0; i<4; ++i)
347  {
348  Assert(n[i].norm() != 0, ExcInternalError("Something went wrong. The "
349  "computed normals have "
350  "zero length."));
351  n[i] /=n[i].norm();
352  }
353 }
354 
355 
356 
357 template <int dim, int spacedim>
358 void
361  FaceVertexNormals &n) const
362 {
363  for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
364  {
365  n[v] = normal_vector(face, face->vertex(v));
366  n[v] /= n[v].norm();
367  }
368 }
369 
370 
371 
372 template <int dim, int spacedim>
375 get_new_point_on_line (const typename Triangulation<dim, spacedim>::line_iterator &line) const
376 {
377  const std::pair<std::vector<Point<spacedim> >, std::vector<double> > points_weights(get_default_points_and_weights(line));
378  return get_new_point (points_weights.first,points_weights.second);
379 }
380 
381 
382 
383 template <int dim, int spacedim>
386 get_new_point_on_quad (const typename Triangulation<dim, spacedim>::quad_iterator &quad) const
387 {
388  const std::pair<std::vector<Point<spacedim> >, std::vector<double> > points_weights(get_default_points_and_weights(quad));
389  return get_new_point (points_weights.first,points_weights.second);
390 }
391 
392 
393 
394 template <int dim, int spacedim>
398 {
399  Assert (dim>1, ExcImpossibleInDim(dim));
400 
401  switch (dim)
402  {
403  case 2:
404  return get_new_point_on_line (face);
405  case 3:
406  return get_new_point_on_quad (face);
407  }
408 
409  return Point<spacedim>();
410 }
411 
412 
413 
414 template <int dim, int spacedim>
418 {
419  switch (dim)
420  {
421  case 1:
422  return get_new_point_on_line (cell);
423  case 2:
424  return get_new_point_on_quad (cell);
425  case 3:
426  return get_new_point_on_hex (cell);
427  }
428 
429  return Point<spacedim>();
430 }
431 
432 
433 
434 template <>
435 Point<1>
438 {
439  Assert (false, ExcImpossibleInDim(1));
440  return Point<1>();
441 }
442 
443 
444 
445 template <>
446 Point<2>
449 {
450  Assert (false, ExcImpossibleInDim(1));
451  return Point<2>();
452 }
453 
454 
455 
456 template <>
457 Point<3>
460 {
461  Assert (false, ExcImpossibleInDim(1));
462  return Point<3>();
463 }
464 
465 
466 
467 template <>
468 Point<1>
470 get_new_point_on_quad (const Triangulation<1,1>::quad_iterator &) const
471 {
472  Assert (false, ExcImpossibleInDim(1));
473  return Point<1>();
474 }
475 
476 
477 
478 template <>
479 Point<2>
481 get_new_point_on_quad (const Triangulation<1,2>::quad_iterator &) const
482 {
483  Assert (false, ExcImpossibleInDim(1));
484  return Point<2>();
485 }
486 
487 
488 
489 template <>
490 Point<3>
492 get_new_point_on_quad (const Triangulation<1,3>::quad_iterator &) const
493 {
494  Assert (false, ExcImpossibleInDim(1));
495  return Point<3>();
496 }
497 
498 
499 
500 template <int dim, int spacedim>
503 get_new_point_on_hex (const typename Triangulation<dim, spacedim>::hex_iterator &/*hex*/) const
504 {
505  Assert (false, ExcImpossibleInDim(dim));
506  return Point<spacedim>();
507 }
508 
509 
510 
511 template <>
512 Point<3>
514 get_new_point_on_hex (const Triangulation<3, 3>::hex_iterator &hex) const
515 {
516  const std::pair<std::vector<Point<3> >, std::vector<double> > points_weights(get_default_points_and_weights(hex,true));
517  return get_new_point (points_weights.first,points_weights.second);
518 }
519 
520 
521 
522 template <int dim, int spacedim>
525  const Point<spacedim> &x2) const
526 {
527  const double epsilon = 1e-8;
528 
529  std::vector<Point<spacedim> > q;
530  q.push_back(x1);
531  q.push_back(x2);
532 
533  std::vector<double> w;
534  w.push_back(epsilon);
535  w.push_back(1.0-epsilon);
536 
537  const Tensor<1,spacedim> neighbor_point = get_new_point (q, w);
538  return (neighbor_point-x1)/epsilon;
539 }
540 
541 /* -------------------------- FlatManifold --------------------- */
542 
543 
544 template <int dim, int spacedim>
546  const double tolerance)
547  :
548  periodicity(periodicity),
549  tolerance(tolerance)
550 {}
551 
552 
553 
554 template <int dim, int spacedim>
558 {
559  return get_new_point(quad.get_points(),quad.get_weights());
560 }
561 
562 
563 
564 template <int dim, int spacedim>
567 get_new_point (const std::vector<Point<spacedim> > &surrounding_points,
568  const std::vector<double> &weights) const
569 {
570  Assert(std::abs(std::accumulate(weights.begin(), weights.end(), 0.0)-1.0) < 1e-10,
571  ExcMessage("The weights for the individual points should sum to 1!"));
572 
573  Point<spacedim> p;
574 
575  // if there is no periodicity, use a shortcut
576  if (periodicity == Tensor<1,spacedim>())
577  {
578  for (unsigned int i=0; i<surrounding_points.size(); ++i)
579  p += surrounding_points[i] * weights[i];
580  }
581  else
582  {
583  Tensor<1,spacedim> minP = periodicity;
584 
585  for (unsigned int d=0; d<spacedim; ++d)
586  if (periodicity[d] > 0)
587  for (unsigned int i=0; i<surrounding_points.size(); ++i)
588  {
589  minP[d] = std::min(minP[d], surrounding_points[i][d]);
590  Assert( (surrounding_points[i][d] < periodicity[d]+tolerance*periodicity[d]) ||
591  (surrounding_points[i][d] >= -tolerance*periodicity[d]),
592  ExcPeriodicBox(d, surrounding_points[i], periodicity[i]));
593  }
594 
595  // compute the weighted average point, possibly taking into account periodicity
596  for (unsigned int i=0; i<surrounding_points.size(); ++i)
597  {
598  Point<spacedim> dp;
599  for (unsigned int d=0; d<spacedim; ++d)
600  if (periodicity[d] > 0)
601  dp[d] = ( (surrounding_points[i][d]-minP[d]) > periodicity[d]/2.0 ?
602  -periodicity[d] : 0.0 );
603 
604  p += (surrounding_points[i]+dp)*weights[i];
605  }
606 
607  // if necessary, also adjust the weighted point by the periodicity
608  for (unsigned int d=0; d<spacedim; ++d)
609  if (periodicity[d] > 0)
610  if (p[d] < 0)
611  p[d] += periodicity[d];
612  }
613 
614  return project_to_manifold(surrounding_points, p);
615 }
616 
617 
618 
619 template <int dim, int spacedim>
620 void
622 add_new_points (const std::vector<Point<spacedim> > &surrounding_points,
623  const Table<2,double> &weights,
624  std::vector<Point<spacedim> > &new_points) const
625 {
626  AssertDimension(surrounding_points.size(), weights.size(1));
627  if (weights.size(0) == 0)
628  return;
629 
630  const unsigned int n_points = surrounding_points.size();
631 
632  Tensor<1,spacedim> minP = periodicity;
633  for (unsigned int d=0; d<spacedim; ++d)
634  if (periodicity[d] > 0)
635  for (unsigned int i=0; i<n_points; ++i)
636  {
637  minP[d] = std::min(minP[d], surrounding_points[i][d]);
638  Assert( (surrounding_points[i][d] < periodicity[d]+tolerance*periodicity[d]) ||
639  (surrounding_points[i][d] >= -tolerance*periodicity[d]),
640  ExcPeriodicBox(d, surrounding_points[i], periodicity[i]));
641  }
642 
643  // check whether periodicity shifts some of the points. Only do this if
644  // necessary to avoid memory allocation
645  const Point<spacedim> *surrounding_points_start = &surrounding_points[0];
646  std::vector<Point<spacedim> > modified_points;
647  bool adjust_periodicity = false;
648  for (unsigned int d=0; d<spacedim; ++d)
649  if (periodicity[d] > 0)
650  for (unsigned int i=0; i<n_points; ++i)
651  if ((surrounding_points[i][d]-minP[d]) > periodicity[d]/2.0)
652  {
653  adjust_periodicity = true;
654  break;
655  }
656  if (adjust_periodicity == true)
657  {
658  modified_points = surrounding_points;
659  for (unsigned int d=0; d<spacedim; ++d)
660  if (periodicity[d] > 0)
661  for (unsigned int i=0; i<n_points; ++i)
662  if ((surrounding_points[i][d]-minP[d]) > periodicity[d]/2.0)
663  modified_points[i][d] -= periodicity[d];
664  surrounding_points_start = &modified_points[0];
665  }
666 
667  // Now perform the interpolation
668  for (unsigned int row=0; row<weights.size(0); ++row)
669  {
670  Assert(std::abs(std::accumulate(&weights(row,0), &weights(row,0)+n_points, 0.0)-1.0) < 1e-10,
671  ExcMessage("The weights for the individual points should sum to 1!"));
672  Point<spacedim> new_point;
673  for (unsigned int p=0; p<n_points; ++p)
674  new_point += surrounding_points_start[p] * weights(row,p);
675 
676  // if necessary, also adjust the weighted point by the periodicity
677  for (unsigned int d=0; d<spacedim; ++d)
678  if (periodicity[d] > 0)
679  if (new_point[d] < 0)
680  new_point[d] += periodicity[d];
681 
682  new_points.push_back(project_to_manifold(surrounding_points, new_point));
683  }
684 }
685 
686 
687 
688 template <int dim, int spacedim>
691  const Point<spacedim> &candidate) const
692 {
693  return candidate;
694 }
695 
696 
697 
698 template <int dim, int spacedim>
699 const Tensor<1,spacedim> &
701 {
702  return periodicity;
703 }
704 
705 
706 
707 template <int dim, int spacedim>
710  const Point<spacedim> &x2) const
711 {
712  Tensor<1,spacedim> direction = x2-x1;
713 
714  // see if we have to take into account periodicity. if so, we need
715  // to make sure that if a distance in one coordinate direction
716  // is larger than half of the box length, then go the other way
717  // around (i.e., via the periodic box)
718  for (unsigned int d=0; d<spacedim; ++d)
719  if (periodicity[d] > tolerance)
720  {
721  if (direction[d] < -periodicity[d]/2)
722  direction[d] += periodicity[d];
723  else if (direction[d] > periodicity[d]/2)
724  direction[d] -= periodicity[d];
725  }
726 
727  return direction;
728 }
729 
730 
731 
732 /* -------------------------- ChartManifold --------------------- */
733 
734 template <int dim, int spacedim, int chartdim>
736 {}
737 
738 
739 
740 template <int dim, int spacedim, int chartdim>
742  :
743  sub_manifold(periodicity)
744 {}
745 
746 
747 
748 template <int dim, int spacedim, int chartdim>
752 {
753  return get_new_point(quad.get_points(),quad.get_weights());
754 }
755 
756 
757 
758 template <int dim, int spacedim, int chartdim>
761 get_new_point (const std::vector<Point<spacedim> > &surrounding_points,
762  const std::vector<double> &weights) const
763 {
764  std::vector<Point<chartdim> > chart_points(surrounding_points.size());
765 
766  for (unsigned int i=0; i<surrounding_points.size(); ++i)
767  chart_points[i] = pull_back(surrounding_points[i]);
768 
769  const Point<chartdim> p_chart = sub_manifold.get_new_point(chart_points,weights);
770 
771  return push_forward(p_chart);
772 }
773 
774 
775 
776 template <int dim, int spacedim, int chartdim>
777 void
779 add_new_points (const std::vector<Point<spacedim> > &surrounding_points,
780  const Table<2,double> &weights,
781  std::vector<Point<spacedim> > &new_points) const
782 {
783  Assert(weights.size(0) > 0, ExcEmptyObject());
784  AssertDimension(surrounding_points.size(), weights.size(1));
785 
786  const unsigned int n_points = surrounding_points.size();
787 
788  std::vector<Point<chartdim> > chart_points(n_points);
789  for (unsigned int i=0; i<n_points; ++i)
790  chart_points[i] = pull_back(surrounding_points[i]);
791 
792  std::vector<Point<chartdim> > new_points_on_chart;
793  new_points_on_chart.reserve(weights.size(0));
794  sub_manifold.add_new_points(chart_points, weights, new_points_on_chart);
795 
796  for (unsigned int row=0; row<weights.size(0); ++row)
797  new_points.push_back(push_forward(new_points_on_chart[row]));
798 }
799 
800 
801 
802 template <int dim, int spacedim, int chartdim>
806 {
807  // function must be implemented in a derived class to be usable,
808  // as discussed in this function's documentation
809  Assert (false, ExcPureFunctionCalled());
811 }
812 
813 
814 
815 template <int dim, int spacedim, int chartdim>
819  const Point<spacedim> &x2) const
820 {
821  const DerivativeForm<1,chartdim,spacedim> F_prime = push_forward_gradient(pull_back(x1));
822 
823  // ensure that the chart is not singular by asserting that its
824  // derivative has a positive determinant. we need to make this
825  // comparison relative to the size of the derivative. since the
826  // determinant is the product of chartdim factors, take the
827  // chartdim-th root of it in comparing against the size of the
828  // derivative
829  Assert (std::pow(std::abs(F_prime.determinant()), 1./chartdim) >= 1e-12 * F_prime.norm(),
830  ExcMessage("The derivative of a chart function must not be singular."));
831 
832  const Tensor<1,chartdim> delta = sub_manifold.get_tangent_vector(pull_back(x1),
833  pull_back(x2));
834 
835  Tensor<1,spacedim> result;
836  for (unsigned int i=0; i<spacedim; ++i)
837  result[i] += F_prime[i] * delta;
838 
839  return result;
840 }
841 
842 
843 
844 template <int dim, int spacedim, int chartdim>
845 const Tensor<1, chartdim> &
847 {
848  return sub_manifold.get_periodicity();
849 }
850 
851 // explicit instantiations
852 #include "manifold.inst"
853 
854 DEAL_II_NAMESPACE_CLOSE
virtual void add_new_points(const std::vector< Point< spacedim > > &surrounding_points, const Table< 2, double > &weights, std::vector< Point< spacedim > > &new_points) const
Definition: manifold.cc:622
static ::ExceptionBase & ExcPureFunctionCalled()
FlatManifold(const Tensor< 1, spacedim > &periodicity=Tensor< 1, spacedim >(), const double tolerance=1e-10)
Definition: manifold.cc:545
virtual Tensor< 1, spacedim > get_tangent_vector(const Point< spacedim > &x1, const Point< spacedim > &x2) const
Definition: manifold.cc:709
#define AssertDimension(dim1, dim2)
Definition: exceptions.h:1146
const std::vector< Point< dim > > & get_points() const
const std::vector< double > & get_weights() const
const Tensor< 1, spacedim > & get_periodicity() const
Definition: manifold.cc:700
virtual Point< spacedim > get_new_point_on_hex(const typename Triangulation< dim, spacedim >::hex_iterator &hex) const
Definition: manifold.cc:503
#define AssertIndexRange(index, range)
Definition: exceptions.h:1170
std::pair< std::vector< Point< MeshIteratorType::AccessorType::space_dimension > >, std::vector< double > > get_default_points_and_weights(const MeshIteratorType &iterator, const bool with_laplace=false)
numbers::NumberTraits< Number >::real_type norm() const
Definition: tensor.h:991
virtual Point< spacedim > get_new_point(const Quadrature< spacedim > &quad) const 1
Definition: manifold.cc:86
static ::ExceptionBase & ExcMessage(std::string arg1)
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const
Definition: manifold.cc:375
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
virtual Point< spacedim > project_to_manifold(const std::vector< Point< spacedim > > &points, const Point< spacedim > &candidate) const
Definition: manifold.cc:690
virtual Tensor< 1, spacedim > get_tangent_vector(const Point< spacedim > &x1, const Point< spacedim > &x2) const
Definition: manifold.cc:524
virtual DerivativeForm< 1, chartdim, spacedim > push_forward_gradient(const Point< chartdim > &chart_point) const
Definition: manifold.cc:805
virtual void add_new_points(const std::vector< Point< spacedim > > &surrounding_points, const Table< 2, double > &weights, std::vector< Point< spacedim > > &new_points) const
Definition: manifold.cc:779
#define Assert(cond, exc)
Definition: exceptions.h:313
virtual Point< spacedim > project_to_manifold(const std::vector< Point< spacedim > > &surrounding_points, const Point< spacedim > &candidate) const
Definition: manifold.cc:59
numbers::NumberTraits< Number >::real_type norm_square() const
Definition: tensor.h:1000
virtual Point< spacedim > get_new_point(const Quadrature< spacedim > &quad) const 1
Definition: manifold.cc:751
const Tensor< 1, chartdim > & get_periodicity() const
Definition: manifold.cc:846
numbers::NumberTraits< Number >::real_type norm() const
double determinant() const
virtual Point< spacedim > get_intermediate_point(const Point< spacedim > &p1, const Point< spacedim > &p2, const double w) const
Definition: manifold.cc:71
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
virtual Tensor< 1, spacedim > get_tangent_vector(const Point< spacedim > &x1, const Point< spacedim > &x2) const
Definition: manifold.cc:818
virtual void add_new_points(const std::vector< Point< spacedim > > &surrounding_points, const Table< 2, double > &weights, std::vector< Point< spacedim > > &new_points) const
Definition: manifold.cc:157
double norm(const FEValuesBase< dim > &fe, const VectorSlice< const std::vector< std::vector< Tensor< 1, dim > > > > &Du)
Definition: divergence.h:532
virtual Point< spacedim > get_new_point(const Quadrature< spacedim > &quad) const 1
Definition: manifold.cc:557
Definition: mpi.h:41
virtual ~Manifold()
Definition: manifold.cc:51
virtual Point< spacedim > get_new_point_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad) const
Definition: manifold.cc:386
static ::ExceptionBase & ExcEmptyObject()
unsigned int size(const unsigned int i) const
virtual Tensor< 1, spacedim > normal_vector(const typename Triangulation< dim, spacedim >::face_iterator &face, const Point< spacedim > &p) const
Definition: manifold.cc:295
virtual ~ChartManifold()
Definition: manifold.cc:735
ChartManifold(const Tensor< 1, chartdim > &periodicity=Tensor< 1, chartdim >())
Definition: manifold.cc:741
Point< spacedim > get_new_point_on_face(const typename Triangulation< dim, spacedim >::face_iterator &face) const
Definition: manifold.cc:397
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, FaceVertexNormals &face_vertex_normals) const
Definition: manifold.cc:360
static ::ExceptionBase & ExcInternalError()
Point< spacedim > get_new_point_on_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
Definition: manifold.cc:417