[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] r4847 - /trunk/getfem/interface/src/gf_mesh_set.cc
From: |
logari81 |
Subject: |
[Getfem-commits] r4847 - /trunk/getfem/interface/src/gf_mesh_set.cc |
Date: |
Tue, 27 Jan 2015 12:36:14 -0000 |
Author: logari81
Date: Tue Jan 27 13:36:14 2015
New Revision: 4847
URL: http://svn.gna.org/viewcvs/getfem?rev=4847&view=rev
Log:
add a mesh object method 'extend_region' to provide the previous functionality
of 'set_region'
Modified:
trunk/getfem/interface/src/gf_mesh_set.cc
Modified: trunk/getfem/interface/src/gf_mesh_set.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/src/gf_mesh_set.cc?rev=4847&r1=4846&r2=4847&view=diff
==============================================================================
--- trunk/getfem/interface/src/gf_mesh_set.cc (original)
+++ trunk/getfem/interface/src/gf_mesh_set.cc Tue Jan 27 13:36:14 2015
@@ -30,12 +30,13 @@
}
}
-static void set_region(getfem::mesh &mesh, getfemint::mexargs_in& in) {
+static void set_region(getfem::mesh &mesh, getfemint::mexargs_in& in,
+ bool do_clear=true) {
unsigned boundary_num = in.pop().to_integer(1);
iarray v = in.pop().to_iarray();
getfem::mesh_region &rg = mesh.region(boundary_num);
- rg.clear();
+ if (do_clear) rg.clear();
if (v.getm() < 1 || v.getm() > 2 || v.getp() != 1 || v.getq() != 1)
THROW_BADARG( "Invalid format for the convex or face list");
@@ -284,10 +285,10 @@
/address@hidden ('region', @int rnum, @dmat CVFIDs)
- Assigns the region number `rnum` to the convex faces (or convexes)
- stored in each column of the matrix `CVFIDs`.
-
- The first row of `CVFIDs` contains a convex #ids, and the second row
+ Assigns the region number `rnum` to the set of convexes or/and convex
+ faces provided in the matrix `CVFIDs`.
+
+ The first row of `CVFIDs` contains convex #ids, and the second row
contains a face number in the convex (or @address@hidden@PYTHON{``-1``}
for the whole convex (regions are usually used to store a list of
convex faces, but you may also use them to store a list of convexes).
@@ -299,6 +300,14 @@
set_region(*pmesh, in);
);
+ /address@hidden ('extend region', @int rnum, @dmat CVFIDs)
+ Extends the region identified by the region number `rnum` to include
+ the set of convexes or/and convex faces provided in the matrix
+ `CVFIDs`, see also 'set_region'@address@hidden/
+ sub_command
+ ("extend region", 2, 2, 0, 0,
+ set_region(*pmesh, in, false);
+ );
/address@hidden ('region intersect', @int r1, @int r2)
Replace the region number `r1` with its intersection with region number
address@hidden/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Getfem-commits] r4847 - /trunk/getfem/interface/src/gf_mesh_set.cc,
logari81 <=