getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] r5271 - in /trunk/getfem/src: bgeot_mesh_structure.cc g


From: Yves . Renard
Subject: [Getfem-commits] r5271 - in /trunk/getfem/src: bgeot_mesh_structure.cc getfem/bgeot_mesh_structure.h
Date: Thu, 31 Mar 2016 16:28:53 -0000

Author: renard
Date: Thu Mar 31 18:28:52 2016
New Revision: 5271

URL: http://svn.gna.org/viewcvs/getfem?rev=5271&view=rev
Log:
a proposition for neighbours_of_convex(ic, ftab, s)

Modified:
    trunk/getfem/src/bgeot_mesh_structure.cc
    trunk/getfem/src/getfem/bgeot_mesh_structure.h

Modified: trunk/getfem/src/bgeot_mesh_structure.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/bgeot_mesh_structure.cc?rev=5271&r1=5270&r2=5271&view=diff
==============================================================================
--- trunk/getfem/src/bgeot_mesh_structure.cc    (original)
+++ trunk/getfem/src/bgeot_mesh_structure.cc    Thu Mar 31 18:28:52 2016
@@ -223,6 +223,30 @@
       size_type icv = points_tab[pt[0]][i];
       if (icv != ic && is_convex_having_points(icv, short_type(pt.size()),
                                                pt.begin())
+          && (convex_tab[ic].cstruct->dim()==convex_tab[icv].cstruct->dim()))
+        s.push_back(icv);
+    }
+  }
+
+
+  void mesh_structure::neighbours_of_convex(size_type ic,
+                                           const std::vector<short_type> &ftab,
+                                           ind_set &s) const {
+    s.resize(0);
+    size_type nb = nb_points_of_convex(ic);
+    const mesh_convex_structure &q = convex_tab[ic];
+    std::vector<size_type> cpt(nb, size_type(0)), ipt(nb);
+    for (short_type iff : ftab)
+      for (short_type i : q.cstruct->ind_points_of_face(iff))
+       cpt[i]++;
+    ipt.resize(0);
+    for (size_type i = 0; i < nb; ++i)
+      if (cpt[i] == ftab.size()) ipt.push_back(q.pts[i]);
+
+    for (size_type i = 0; i < points_tab[ipt[0]].size(); ++i) {
+      size_type icv = points_tab[ipt[0]][i];
+      if (icv != ic && is_convex_having_points(icv, short_type(ipt.size()),
+                                               ipt.begin())
           && (convex_tab[ic].cstruct->dim()==convex_tab[icv].cstruct->dim()))
         s.push_back(icv);
     }

Modified: trunk/getfem/src/getfem/bgeot_mesh_structure.h
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/bgeot_mesh_structure.h?rev=5271&r1=5270&r2=5271&view=diff
==============================================================================
--- trunk/getfem/src/getfem/bgeot_mesh_structure.h      (original)
+++ trunk/getfem/src/getfem/bgeot_mesh_structure.h      Thu Mar 31 18:28:52 2016
@@ -195,7 +195,17 @@
         @param f the face number of the convex.
         @param s the resulting ind_set.
      */
-    void neighbours_of_convex(size_type ic, short_type iff, ind_set &s) const;
+    void neighbours_of_convex(size_type ic, short_type f, ind_set &s) const;
+
+    /** Return in s a list of neighbours of a given convex sharing the
+       intersection of a given list of faces
+        @param ic the convex id.
+        @param f the face number of the convex.
+        @param s the resulting ind_set.
+     */
+    void neighbours_of_convex(size_type ic,
+                             const std::vector<short_type> &ftab,
+                             ind_set &s) const;
 
     /** Return a list of neighbours of a given convex.
         @param ic the convex id.




reply via email to

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