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: Sat, 2 Feb 2019 18:31:54 -0500 (EST)

branch: fix-skipped-update-pfp-in-interpolate-filter
commit 72783ed31fd40de93086bc4880e67f83ff84826d
Author: Konstantinos Poulios <address@hidden>
Date:   Sun Feb 3 00:31:38 2019 +0100

    Fix skipped pfp update due to interpolate filter
---
 .../getfem_generic_assembly_compile_and_exec.h     |  1 +
 src/getfem_generic_assembly_compile_and_exec.cc    | 64 +++++++++++++++-------
 2 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/src/getfem/getfem_generic_assembly_compile_and_exec.h 
b/src/getfem/getfem_generic_assembly_compile_and_exec.h
index 6da88d8..e960446 100644
--- a/src/getfem/getfem_generic_assembly_compile_and_exec.h
+++ b/src/getfem/getfem_generic_assembly_compile_and_exec.h
@@ -166,6 +166,7 @@ namespace getfem {
       ga_if_hierarchy current_hierarchy;
       std::map<std::string, base_vector> local_dofs;
       std::map<const mesh_fem *, pfem_precomp> pfps;
+      std::map<const mesh_fem *, std::list<ga_if_hierarchy>> pfp_hierarchy;
       std::map<const mesh_fem *, base_tensor> base;
       std::map<const mesh_fem *, std::list<ga_if_hierarchy>> base_hierarchy;
       std::map<const mesh_fem *, base_tensor> grad;
diff --git a/src/getfem_generic_assembly_compile_and_exec.cc 
b/src/getfem_generic_assembly_compile_and_exec.cc
index 12b4ecc..f70b6d6 100644
--- a/src/getfem_generic_assembly_compile_and_exec.cc
+++ b/src/getfem_generic_assembly_compile_and_exec.cc
@@ -5131,14 +5131,20 @@ namespace getfem {
           }
 
           // An instruction for pfp update
-          if (rmi.pfps.count(mf) == 0) {
+          if (mf->is_uniform()) {
+            if (rmi.pfps.count(mf) == 0) {
+              rmi.pfps[mf] = 0;
+              pgai = std::make_shared<ga_instruction_update_pfp>
+                (*mf, rmi.pfps[mf], gis.ctx, gis.fp_pool);
+              rmi.begin_instructions.push_back(std::move(pgai));
+            }
+          } else if (rmi.pfps.count(mf) == 0 ||
+                     !if_hierarchy.is_compatible(rmi.pfp_hierarchy[mf])) {
+            rmi.pfp_hierarchy[mf].push_back(if_hierarchy);
             rmi.pfps[mf] = 0;
             pgai = std::make_shared<ga_instruction_update_pfp>
               (*mf, rmi.pfps[mf], gis.ctx, gis.fp_pool);
-            if (mf->is_uniform())
-              rmi.begin_instructions.push_back(std::move(pgai));
-            else
-              rmi.instructions.push_back(std::move(pgai));
+            rmi.instructions.push_back(std::move(pgai));
           }
 
           // An instruction for the base value
@@ -5380,14 +5386,20 @@ namespace getfem {
           }
 
           // An instruction for pfp update
-          if (sdi.pfps.count(mf) == 0) {
+          if (mf->is_uniform()) {
+            if (sdi.pfps.count(mf) == 0) {
+              sdi.pfps[mf] = 0;
+              pgai = std::make_shared<ga_instruction_update_pfp>
+                (*mf, sdi.pfps[mf], *pctx, gis.fp_pool);
+              rmi.begin_instructions.push_back(std::move(pgai));
+            }
+          } else if (sdi.pfps.count(mf) == 0 ||
+                     !if_hierarchy.is_compatible(rmi.pfp_hierarchy[mf])) {
+            rmi.pfp_hierarchy[mf].push_back(if_hierarchy);
             sdi.pfps[mf] = 0;
             pgai = std::make_shared<ga_instruction_update_pfp>
               (*mf, sdi.pfps[mf], *pctx, gis.fp_pool);
-            if (mf->is_uniform())
-              rmi.begin_instructions.push_back(std::move(pgai));
-            else
-              rmi.instructions.push_back(std::move(pgai));
+            rmi.instructions.push_back(std::move(pgai));
           }
 
           // An instruction for the base value
@@ -5524,14 +5536,20 @@ namespace getfem {
                       " defined on the same mesh");
 
           // An instruction for pfp update
-          if (rmi.pfps.count(mf) == 0) {
+          if (is_uniform) {
+            if (rmi.pfps.count(mf) == 0) {
+              rmi.pfps[mf] = 0;
+              pgai = std::make_shared<ga_instruction_update_pfp>
+                (*mf, rmi.pfps[mf], gis.ctx, gis.fp_pool);
+              rmi.begin_instructions.push_back(std::move(pgai));
+            }
+          } else if (rmi.pfps.count(mf) == 0 ||
+                     !if_hierarchy.is_compatible(rmi.pfp_hierarchy[mf])) {
+            rmi.pfp_hierarchy[mf].push_back(if_hierarchy);
             rmi.pfps[mf] = 0;
             pgai = std::make_shared<ga_instruction_update_pfp>
               (*mf, rmi.pfps[mf], gis.ctx, gis.fp_pool);
-            if (is_uniform)
-              rmi.begin_instructions.push_back(std::move(pgai));
-            else
-              rmi.instructions.push_back(std::move(pgai));
+            rmi.instructions.push_back(std::move(pgai));
           }
 
           // An instruction for the base value
@@ -5780,14 +5798,20 @@ namespace getfem {
                       " defined on the same mesh for secondary domain");
 
           // An instruction for pfp update
-          if (sdi.pfps.count(mf) == 0) {
+          if (is_uniform) {
+            if (sdi.pfps.count(mf) == 0) {
+              sdi.pfps[mf] = 0;
+              pgai = std::make_shared<ga_instruction_update_pfp>
+                (*mf, sdi.pfps[mf], *pctx, gis.fp_pool);
+              rmi.begin_instructions.push_back(std::move(pgai));
+            }
+          } else if (sdi.pfps.count(mf) == 0 ||
+                     !if_hierarchy.is_compatible(rmi.pfp_hierarchy[mf])) {
+            rmi.pfp_hierarchy[mf].push_back(if_hierarchy);
             sdi.pfps[mf] = 0;
             pgai = std::make_shared<ga_instruction_update_pfp>
               (*mf, sdi.pfps[mf], *pctx, gis.fp_pool);
-            if (is_uniform)
-              rmi.begin_instructions.push_back(std::move(pgai));
-            else
-              rmi.instructions.push_back(std::move(pgai));
+            rmi.instructions.push_back(std::move(pgai));
           }
 
           // An instruction for the base value



reply via email to

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