[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: |
Wed, 16 May 2018 04:18:03 -0400 (EDT) |
branch: ignore_empty_integration_points
commit d517c0a9b71a7a5926fe7399fc51bb45ff4a0c87
Author: lj <address@hidden>
Date: Wed May 16 10:17:52 2018 +0200
Option to add zero weighted integration points.
---
src/getfem/getfem_integration.h | 3 ++-
src/getfem_generic_assembly_compile_and_exec.cc | 10 +++++-----
src/getfem_integration.cc | 7 +++++--
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/getfem/getfem_integration.h b/src/getfem/getfem_integration.h
index b3212c3..9159d35 100644
--- a/src/getfem/getfem_integration.h
+++ b/src/getfem/getfem_integration.h
@@ -213,7 +213,8 @@ namespace getfem
{ return int_coeffs[repartition[f] + i]; }
void add_point(const base_node &pt, scalar_type w,
- short_type f=short_type(-1));
+ short_type f = short_type(-1),
+ bool include_empty = false);
void add_point_norepeat(const base_node &pt, scalar_type w,
short_type f=short_type(-1));
void add_point_full_symmetric(base_node pt, scalar_type w);
diff --git a/src/getfem_generic_assembly_compile_and_exec.cc
b/src/getfem_generic_assembly_compile_and_exec.cc
index c6e479b..6afb52d 100644
--- a/src/getfem_generic_assembly_compile_and_exec.cc
+++ b/src/getfem_generic_assembly_compile_and_exec.cc
@@ -3953,9 +3953,9 @@ namespace getfem {
bool interpolate;
virtual int exec() {
GA_DEBUG_INFO("Instruction: vector term assembly for fem variable");
- bool empty_weight = false; // (coeff == scalar_type(0));
+ bool empty_weight = (coeff == scalar_type(0));
if (ipt == 0 || interpolate) {
- if (empty_weight && interpolate) elem.resize(0);
+ if (empty_weight) elem.resize(0);
elem.resize(t.size());
if (!empty_weight) {
auto itt = t.begin(); auto it = elem.begin(), ite = elem.end();
@@ -4152,9 +4152,9 @@ namespace getfem {
std::vector<size_type> dofs1, dofs2, dofs1_sort;
virtual int exec() {
GA_DEBUG_INFO("Instruction: matrix term assembly");
- bool empty_weight = false; // (coeff == scalar_type(0));
+ bool empty_weight = (coeff == scalar_type(0));
if (ipt == 0 || interpolate) {
- if (empty_weight && interpolate) elem.resize(0);
+ if (empty_weight) elem.resize(0);
elem.resize(t.size());
if (!empty_weight) {
auto itt = t.begin(); auto it = elem.begin(), ite = elem.end();
@@ -6809,7 +6809,7 @@ namespace getfem {
}
auto ipt_coeff = pai->coeff(first_ind+gis.ipt);
gis.coeff = J * ipt_coeff;
- bool enable_ipt = (gmm::abs(ipt_coeff) > 1e-15 ||
+ bool enable_ipt = (gmm::abs(ipt_coeff) > 0.0 ||
workspace.include_empty_int_points());
if (!enable_ipt) gis.coeff = scalar_type(0);
if (first_gp) {
diff --git a/src/getfem_integration.cc b/src/getfem_integration.cc
index 0f4cf1a..6e4b8f6 100644
--- a/src/getfem_integration.cc
+++ b/src/getfem_integration.cc
@@ -247,10 +247,13 @@ namespace getfem {
/* ********************************************************************* */
void approx_integration::add_point(const base_node &pt,
- scalar_type w,short_type f) {
+ scalar_type w,
+ short_type f,
+ bool include_empty) {
GMM_ASSERT1(!valid, "Impossible to modify a valid integration method.");
- if (gmm::abs(w) > 1.0E-16) {
+ if (gmm::abs(w) > 1.0E-15 || include_empty) {
++f;
+ if (gmm::abs(w) <= 1.0E-15) w = 0.0;
GMM_ASSERT1(f <= cvr->structure()->nb_faces(), "Wrong argument.");
size_type i = pt_to_store[f].search_node(pt);
if (i == size_type(-1)) {