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 segmentatio


From: Konstantinos Poulios
Subject: [Getfem-commits] [getfem-commits] branch master updated: Fix segmentation fault in Diff operator and add unit test
Date: Fri, 10 Mar 2023 12:45:27 -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 e74deb32 Fix segmentation fault in Diff operator and add unit test
e74deb32 is described below

commit e74deb32b28c27d032f6c57b25aeccfdc21c9db2
Author: Konstantinos Poulios <logari81@gmail.com>
AuthorDate: Fri Mar 10 18:43:46 2023 +0100

    Fix segmentation fault in Diff operator and add unit test
---
 interface/tests/python/check_asm.py     | 5 +++++
 src/getfem_generic_assembly_semantic.cc | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/interface/tests/python/check_asm.py 
b/interface/tests/python/check_asm.py
index 21519427..fdd05c63 100644
--- a/interface/tests/python/check_asm.py
+++ b/interface/tests/python/check_asm.py
@@ -242,3 +242,8 @@ str = "Hess(u)"; print('\nAssembly string "%s" gives:' % 
str)
 res = gf.asm('expression analysis', str,  mim, 1, md)
 if (res != "(Hess_u)"):
   print("Should be Hess_u"); exit(1)
+
+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]]))"):
+  print("Wrong Diff result"); exit(1)
diff --git a/src/getfem_generic_assembly_semantic.cc 
b/src/getfem_generic_assembly_semantic.cc
index ec3571a2..3106703e 100644
--- a/src/getfem_generic_assembly_semantic.cc
+++ b/src/getfem_generic_assembly_semantic.cc
@@ -182,7 +182,7 @@ namespace getfem {
 
   static void ga_node_expand_expression_in_place_of_test
   (ga_tree &tree, const ga_workspace &workspace,
-   pga_tree_node &pnode, const std::string &varname,
+   pga_tree_node pnode, const std::string &varname,
    pga_tree_node pexpr, ga_tree &grad_expr, ga_tree &hess_expr,
    size_type order, const mesh &me, size_type ref_elt_dim, bool 
eval_fixed_size,
    bool ignore_X, int option) {



reply via email to

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