[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] (no subject)
From: |
Liang Jin Lim |
Subject: |
[Getfem-commits] (no subject) |
Date: |
Tue, 8 Jan 2019 00:37:02 -0500 (EST) |
branch: faster_evaluation_if_sub_convex_is_known
commit b83e2f93ba32530f4affa9148390fe23082fd54f
Author: lj <address@hidden>
Date: Tue Jan 8 06:36:53 2019 +0100
Optional argument of the sub-element, to improve performance by avoiding
space search.
---
src/getfem/bgeot_poly_composite.h | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/getfem/bgeot_poly_composite.h
b/src/getfem/bgeot_poly_composite.h
index 77abaf8..0d0e48a 100644
--- a/src/getfem/bgeot_poly_composite.h
+++ b/src/getfem/bgeot_poly_composite.h
@@ -101,8 +101,8 @@ namespace bgeot {
base_poly default_poly;
public :
-
- template <class ITER> scalar_type eval(const ITER &it) const;
+
+ template <class ITER> scalar_type eval(const ITER &it, size_type l = -1)
const;
void derivative(short_type k);
void set_poly_of_subelt(size_type l, const base_poly &poly);
const base_poly &poly_of_subelt(size_type l) const;
@@ -133,7 +133,16 @@ namespace bgeot {
}
template <class ITER>
- scalar_type polynomial_composite::eval(const ITER &it) const {
+ scalar_type polynomial_composite::eval(const ITER &it, size_type l) const {
+
+ if (l != -1) {
+ if (!local_coordinate) return poly_of_subelt(l).eval(it);
+ base_node p(mp->dim());
+ std::copy(it, it + mp->dim(), p.begin());
+ mult_diff_transposed(mp->gtrans[l], it, mp->orgs[l], p);
+ return poly_of_subelt(l).eval(p.begin());
+ }
+
base_node p0(mp->dim());
std::copy(it, it + mp->dim(), p0.begin());
mesh_structure::ind_cv_ct::const_iterator itc, itce;