]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement ChartManifold::get_intermediate_point.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 2 Nov 2017 12:57:39 +0000 (13:57 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 2 Nov 2017 12:57:39 +0000 (13:57 +0100)
include/deal.II/grid/manifold.h
source/grid/manifold.cc

index b2942a514d1e990a316599c4dc981214eb5bee81..02dd9a4214dd6fe9979876e1004d050696b20436 100644 (file)
@@ -930,6 +930,16 @@ public:
    */
   virtual ~ChartManifold () = default;
 
+  /**
+   * Refer to the general documentation of this class and the documentation of
+   * the base class for more information.
+   */
+  virtual
+  Point<spacedim>
+  get_intermediate_point (const Point<spacedim> &p1,
+                          const Point<spacedim> &p2,
+                          const double w) const override;
+
   /**
    * Refer to the general documentation of this class and the documentation of
    * the base class for more information.
index 5175500f25bb442685244b63d117eac74a4c47b3..5940478ad5b1d8e6a874bc6f7e68e3bc63ef19c2 100644 (file)
@@ -693,6 +693,21 @@ ChartManifold<dim,spacedim,chartdim>::ChartManifold (const Tensor<1,chartdim> &p
 
 
 
+template <int dim, int spacedim, int chartdim>
+Point<spacedim>
+ChartManifold<dim,spacedim,chartdim>::
+get_intermediate_point (const Point<spacedim> &p1,
+                        const Point<spacedim> &p2,
+                        const double w) const
+{
+  const std::array<Point<spacedim>, 2> points({{p1, p2}});
+  const std::array<double, 2> weights({{1.-w, w}});
+  return get_new_point(make_array_view(points.begin(), points.end()),
+                       make_array_view(weights.begin(), weights.end()));
+}
+
+
+
 template <int dim, int spacedim, int chartdim>
 Point<spacedim>
 ChartManifold<dim,spacedim,chartdim>::

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.