getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] [getfem-commits] branch master updated: Fix GWFL incons


From: Konstantinos Poulios
Subject: [Getfem-commits] [getfem-commits] branch master updated: Fix GWFL inconsistency in slicing of tensors with single element leading dimensions
Date: Mon, 21 Dec 2020 04:48:13 -0500

This is an automated email from the git hooks/post-receive script.

logari81 pushed a commit to branch master
in repository getfem.

The following commit(s) were added to refs/heads/master by this push:
     new 91fb8d3  Fix GWFL inconsistency in slicing of tensors with single 
element leading dimensions
91fb8d3 is described below

commit 91fb8d39aac4fbe4ecaed49f57b2bdac9643057e
Author: Konstantinos Poulios <logari81@gmail.com>
AuthorDate: Mon Dec 21 10:48:02 2020 +0100

    Fix GWFL inconsistency in slicing of tensors with single element leading 
dimensions
---
 src/getfem_generic_assembly_compile_and_exec.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/getfem_generic_assembly_compile_and_exec.cc 
b/src/getfem_generic_assembly_compile_and_exec.cc
index 56ffbd1..0344b65 100644
--- a/src/getfem_generic_assembly_compile_and_exec.cc
+++ b/src/getfem_generic_assembly_compile_and_exec.cc
@@ -7126,13 +7126,13 @@ namespace getfem {
 
       } else { // Access to a component of the tensor
         bgeot::multi_index mi1(size0.size()), indices;
+        size_type nb_test = pnode->nb_test_functions();
         if (pnode->tensor().size() == 1) {
           for (size_type i = 0; i < child0->tensor_order(); ++i)
-            mi1[i] = size_type(round(pnode->children[i+1]->tensor()[0])-1);
+            mi1[i+nb_test] = 
size_type(round(pnode->children[i+1]->tensor()[0])-1);
           pgai = std::make_shared<ga_instruction_copy_scalar>
             (pnode->tensor()[0], child0->tensor()(mi1));
         } else {
-          size_type nb_test = pnode->nb_test_functions();
           for (size_type i = 0; i < nb_test; ++i) indices.push_back(i);
           for (size_type i = 0; i < child0->tensor_order(); ++i) {
             if (pnode->children[i+1]->node_type != GA_NODE_ALLINDICES)



reply via email to

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