getfem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-commits] (no subject)


From: Konstantinos Poulios
Subject: [Getfem-commits] (no subject)
Date: Mon, 7 Aug 2017 10:47:04 -0400 (EDT)

branch: devel-logari81
commit d8548b7c6eee2dfe887d244bda7bd509f6316034
Author: Konstantinos Poulios <address@hidden>
Date:   Mon Aug 7 16:46:54 2017 +0200

    add missing implementation of geotrans_interpolation_context::cv_center()
---
 src/bgeot_geometric_trans.cc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/bgeot_geometric_trans.cc b/src/bgeot_geometric_trans.cc
index 2886324..5880685 100644
--- a/src/bgeot_geometric_trans.cc
+++ b/src/bgeot_geometric_trans.cc
@@ -305,6 +305,20 @@ namespace bgeot {
     return xreal_;
   }
 
+  const base_node& geotrans_interpolation_context::cv_center() const {
+    GMM_ASSERT1(have_G(),
+                "Convex center can be provided only if matrix G is available");
+    if (!have_cv_center_) {
+      cv_center_.resize(G().nrows());
+      size_type nb_pts = G().ncols();
+      for (size_type i=0; i < nb_pts; i++)
+        gmm::add(gmm::mat_col(G(),i), cv_center_);
+      gmm::scale(cv_center_, scalar_type(1)/scalar_type(nb_pts));
+      have_cv_center_ = true;
+    }
+    return cv_center_;
+  }
+
   void geotrans_interpolation_context::compute_J() const {
     GMM_ASSERT1(have_G() && have_pgt(), "Unable to compute J\n");
     size_type P = pgt_->structure()->dim();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]