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: use region in r


From: Yves Renard
Subject: [Getfem-commits] [getfem-commits] branch master updated: use region in ref_elt_dim_of_mesh
Date: Tue, 09 Mar 2021 11:47:48 -0500

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

renard pushed a commit to branch master
in repository getfem.

The following commit(s) were added to refs/heads/master by this push:
     new 8eab6bf  use region in ref_elt_dim_of_mesh
8eab6bf is described below

commit 8eab6bfb23b19b3a0ff44f846079907ab073557c
Author: Yves Renard <Yves.Renard@insa-lyon.fr>
AuthorDate: Tue Mar 9 17:47:34 2021 +0100

    use region in ref_elt_dim_of_mesh
---
 src/getfem/getfem_generic_assembly_semantic.h   |  6 +++---
 src/getfem_generic_assembly_compile_and_exec.cc | 10 +++++-----
 src/getfem_generic_assembly_semantic.cc         |  4 ++--
 src/getfem_generic_assembly_workspace.cc        | 16 ++++++++--------
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/getfem/getfem_generic_assembly_semantic.h 
b/src/getfem/getfem_generic_assembly_semantic.h
index 8685524..f3daf1f 100644
--- a/src/getfem/getfem_generic_assembly_semantic.h
+++ b/src/getfem/getfem_generic_assembly_semantic.h
@@ -105,9 +105,9 @@ namespace getfem {
                     const std::string &interpolatename);
   
   // Function of internal use
-  inline size_type ref_elt_dim_of_mesh(const mesh &m) {
-    return m.convex_index().card() ?
-      m.trans_of_convex(m.convex_index().first())->dim() : size_type(0);
+  inline size_type ref_elt_dim_of_mesh(const mesh &m, const mesh_region &rg) {
+    auto v = getfem::mr_visitor(rg, m, true);
+    return v.finished() ? size_type(0) : m.trans_of_convex(v.cv())->dim();
   }
   
 
diff --git a/src/getfem_generic_assembly_compile_and_exec.cc 
b/src/getfem_generic_assembly_compile_and_exec.cc
index 2a49bdb..3d80cc2 100644
--- a/src/getfem_generic_assembly_compile_and_exec.cc
+++ b/src/getfem_generic_assembly_compile_and_exec.cc
@@ -7292,7 +7292,7 @@ namespace getfem {
         const mesh *m = td.m;
         GMM_ASSERT1(m, "Internal error");
         ga_semantic_analysis(gis.trees.back(), workspace, *m,
-                             ref_elt_dim_of_mesh(*m), true, false);
+                             ref_elt_dim_of_mesh(*m, *(td.rg)), true, false);
         pga_tree_node root = gis.trees.back().root;
         if (root) {
           // Compile tree
@@ -7374,8 +7374,8 @@ namespace getfem {
           continue;
         ga_tree tree(*(td.ptree)); // temporary tree (not used later)
         ga_semantic_analysis(tree, workspace, td.mim->linked_mesh(),
-                             ref_elt_dim_of_mesh(td.mim->linked_mesh()),
-                             true, false);
+                            
ref_elt_dim_of_mesh(td.mim->linked_mesh(),*(td.rg)),
+                            true, false);
         pga_tree_node root = tree.root;
         if (root) {
           const bool
@@ -7478,8 +7478,8 @@ namespace getfem {
           trees.push_back(*(td.ptree));
           // Semantic analysis mainly to evaluate fixed size variables and data
           ga_semantic_analysis(trees.back(), workspace, td.mim->linked_mesh(),
-                               ref_elt_dim_of_mesh(td.mim->linked_mesh()),
-                               true, false);
+                            
ref_elt_dim_of_mesh(td.mim->linked_mesh(),*(td.rg)),
+                            true, false);
           pga_tree_node root = trees.back().root;
           if (root) {
             // Compile tree
diff --git a/src/getfem_generic_assembly_semantic.cc 
b/src/getfem_generic_assembly_semantic.cc
index dbb9029..ce38aaa 100644
--- a/src/getfem_generic_assembly_semantic.cc
+++ b/src/getfem_generic_assembly_semantic.cc
@@ -4044,11 +4044,11 @@ namespace getfem {
         ga_tree trans_tree;
         ga_read_string(expr_trans, trans_tree, workspace.macro_dictionary());
         ga_semantic_analysis(trans_tree, workspace, m,
-                             ref_elt_dim_of_mesh(m), false, false, 1);
+                             ref_elt_dim_of_mesh(m, -1), false, false, 1);
         if (trans_tree.root) {
           ga_node_grad(trans_tree, workspace, m, trans_tree.root);
           ga_semantic_analysis(trans_tree, workspace, m,
-                               ref_elt_dim_of_mesh(m), false, false, 1);
+                               ref_elt_dim_of_mesh(m, -1), false, false, 1);
 
           GMM_ASSERT1(trans_tree.root->tensor().sizes().size() == 2,
                       "Problem in transformation" << tname);
diff --git a/src/getfem_generic_assembly_workspace.cc 
b/src/getfem_generic_assembly_workspace.cc
index 2fa936f..38f36ef 100644
--- a/src/getfem_generic_assembly_workspace.cc
+++ b/src/getfem_generic_assembly_workspace.cc
@@ -492,7 +492,7 @@ namespace getfem {
           ftree.root->children.resize(2, nullptr);
           ftree.copy_node(tree.root, ftree.root, ftree.root->children[1]);
           ga_semantic_analysis(ftree, *this, m,
-                               ref_elt_dim_of_mesh(m), false, function_expr);
+                               ref_elt_dim_of_mesh(m,rg), false, 
function_expr);
           found = true;
           break;
         }
@@ -532,7 +532,7 @@ namespace getfem {
             // cout << "Result : " << ga_tree_to_string(dtree) << endl;
             // GA_TOCTIC("Derivative time");
             ga_semantic_analysis(dtree, *this, m,
-                                 ref_elt_dim_of_mesh(m), false, function_expr);
+                                 
ref_elt_dim_of_mesh(m,rg),false,function_expr);
             // GA_TOCTIC("Analysis after Derivative time");
             // cout << "after analysis "  << ga_tree_to_string(dtree) << endl;
             add_tree(dtree, m, mim, rg, expr, add_derivative_order,
@@ -561,7 +561,7 @@ namespace getfem {
     }
     // cout << "read : " << ga_tree_to_string(ltrees[0])  << endl;
     ga_semantic_analysis(ltrees[0], *this, mim.linked_mesh(),
-                         ref_elt_dim_of_mesh(mim.linked_mesh()),
+                         ref_elt_dim_of_mesh(mim.linked_mesh(),rg),
                          false, false, 1);
     // cout << "analysed : " << ga_tree_to_string(ltrees[0]) << endl;
     GA_TOC("First analysis time");
@@ -578,7 +578,7 @@ namespace getfem {
             if (ntest2 > 0) selected_test2 = t2;
             // cout << "analysis with " << selected_test1.first << endl;
             ga_semantic_analysis(*ltree, *this, mim.linked_mesh(),
-                                 ref_elt_dim_of_mesh(mim.linked_mesh()),
+                                 ref_elt_dim_of_mesh(mim.linked_mesh(),rg),
                                  false, false, 2);
             // cout <<"split: "<< ga_tree_to_string(*ltree) << endl;
             if (ltree != ltrees.end()) ++ltree;
@@ -618,7 +618,7 @@ namespace getfem {
     const mesh_region &rg = register_region(m, rg_);
     ga_tree tree;
     ga_read_string(expr, tree, macro_dictionary());
-    ga_semantic_analysis(tree, *this, m, ref_elt_dim_of_mesh(m),
+    ga_semantic_analysis(tree, *this, m, ref_elt_dim_of_mesh(m,rg),
                          false, false);
     if (tree.root) {
       // GMM_ASSERT1(tree.root->nb_test_functions() == 0,
@@ -635,7 +635,7 @@ namespace getfem {
     const mesh_region &rg = register_region(m, rg_);
     ga_tree tree;
     ga_read_string(expr, tree, macro_dictionary());
-    ga_semantic_analysis(tree, *this, m, ref_elt_dim_of_mesh(m),
+    ga_semantic_analysis(tree, *this, m, ref_elt_dim_of_mesh(m,rg),
                          false, false);
     if (tree.root) {
       GMM_ASSERT1(tree.root->nb_test_functions() == 0,
@@ -655,7 +655,7 @@ namespace getfem {
     const mesh_region &rg = register_region(m, rg_);
     ga_tree tree;
     ga_read_string(expr, tree, macro_dictionary());
-    ga_semantic_analysis(tree, *this, m, ref_elt_dim_of_mesh(m), false, false);
+    ga_semantic_analysis(tree, *this, m, 
ref_elt_dim_of_mesh(m,rg),false,false);
     if (tree.root) {
       GMM_ASSERT1(tree.root->nb_test_functions() == 0,
                   "Invalid expression containing test functions");
@@ -1062,7 +1062,7 @@ namespace getfem {
           ga_node_extract_constant_term(local_tree, local_tree.root, *this, m);
         if (local_tree.root)
           ga_semantic_analysis(local_tree, *this, m,
-                               ref_elt_dim_of_mesh(m), false, false);
+                               ref_elt_dim_of_mesh(m,-1), false, false);
         if (local_tree.root && local_tree.root->node_type != GA_NODE_ZERO) {
           constant_term += "-("+ga_tree_to_string(local_tree)+")";
         }



reply via email to

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