branch: interpolation_with_projection_into_element
commit dec612c736bc38d8fbe0a385f4a5a211a0a7ab23
Author: lj <l...@plaxis.nl>
Date:   Wed Apr 11 13:22:07 2018 +0200

    Use the project_into_element option when extrapolation of interpolation 
function option is disabled so that points very close to the boundary can be 
handled properly.
---
 src/bgeot_geotrans_inv.cc       | 4 ++++
 src/getfem/bgeot_geotrans_inv.h | 2 ++
 src/getfem_interpolation.cc     | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/src/bgeot_geotrans_inv.cc b/src/bgeot_geotrans_inv.cc
index 5d2744a..ccabaf3 100644
--- a/src/bgeot_geotrans_inv.cc
+++ b/src/bgeot_geotrans_inv.cc
@@ -89,6 +89,10 @@ namespace bgeot
     }
   }
 
+  void geotrans_inv_convex::set_projection_into_element(bool active){
+      nonlinear_storage.project_into_element = active;
+    }
+
   class geotrans_inv_convex_bfgs {
     geotrans_inv_convex &gic;
     base_node xreal;
diff --git a/src/getfem/bgeot_geotrans_inv.h b/src/getfem/bgeot_geotrans_inv.h
index 04d0123..4a460d4 100644
--- a/src/getfem/bgeot_geotrans_inv.h
+++ b/src/getfem/bgeot_geotrans_inv.h
@@ -117,6 +117,8 @@ namespace bgeot {
       init(nodes,pgt_);
     }
 
+    void set_projection_into_element(bool activate);
+
     template<class TAB> void init(const TAB &nodes, pgeometric_trans pgt_);
     
     /**
diff --git a/src/getfem_interpolation.cc b/src/getfem_interpolation.cc
index 73889e7..b47f063 100644
--- a/src/getfem_interpolation.cc
+++ b/src/getfem_interpolation.cc
@@ -67,6 +67,8 @@ namespace getfem {
     npt.add(0, nbpts);
     scalar_type mult = scalar_type(1);
 
+    gic.set_projection_into_element(extrapolation == 0);
+
     do {
       for (dal::bv_visitor j(rg_source.index()); !j.finished(); ++j) {
         if (mult > scalar_type(1) && !(cv_on_bound.is_in(j))) continue;

Reply via email to