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: Fri, 10 Mar 2023 13:32:28 -0500 (EST)

branch: simplify-Div-derivative
commit 7b3338cb0f118cc9f318fd334bafaac1d210b2f7
Author: Konstantinos Poulios <logari81@gmail.com>
AuthorDate: Fri Mar 10 19:32:13 2023 +0100

    Simplify directional derivative of Div
---
 interface/tests/python/check_asm.py     |  2 +-
 src/getfem_generic_assembly_semantic.cc | 10 +---------
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/interface/tests/python/check_asm.py 
b/interface/tests/python/check_asm.py
index fdd05c63..c2ef06c7 100644
--- a/interface/tests/python/check_asm.py
+++ b/interface/tests/python/check_asm.py
@@ -245,5 +245,5 @@ if (res != "(Hess_u)"):
 
 str = "Diff(u*Div(w),w,3*w)"; print('\nAssembly string "%s" gives:' % str)
 res = gf.asm_expression_analysis(str, mim, md)
-if (res != "(u*((3*Grad_w):[[1,0],[0,1]]))"):
+if (res != "(u*(Trace((3*Grad_w))))"):
   print("Wrong Diff result"); exit(1)
diff --git a/src/getfem_generic_assembly_semantic.cc 
b/src/getfem_generic_assembly_semantic.cc
index 3106703e..11fa0dc2 100644
--- a/src/getfem_generic_assembly_semantic.cc
+++ b/src/getfem_generic_assembly_semantic.cc
@@ -249,15 +249,7 @@ namespace getfem {
           delete pnode; pnode = nullptr;
           tree.copy_node(grad_expr.root, parent, pnode);
           tree.insert_node(pnode, GA_NODE_OP);
-          pnode->parent->op_type = GA_COLON;
-          tree.add_child(pnode->parent, GA_NODE_PARAMS);
-          pga_tree_node pid = pnode->parent->children[1];
-          tree.add_child(pid);
-          tree.add_child(pid);
-          pid->children[0]->node_type = GA_NODE_NAME;
-          pid->children[0]->name = "Id";
-          pid->children[1]->node_type = GA_NODE_CONSTANT;
-          pid->children[1]->init_scalar_tensor(me.dim());
+          pnode->parent->op_type = GA_TRACE;
         }
         break;
       case GA_NODE_INTERPOLATE_VAL_TEST: case GA_NODE_INTERPOLATE_GRAD_TEST:



reply via email to

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