Hi Vladimir, thanks for looking into that! If we want to have that code around, we should also think of updating it to the naming conventions etc. r. On 02/14/2016 10:14 PM, Vladimir Lukes wrote:
Hi Adolfo and Robert,
sagfaults are due to the incorrectly defined geometry in mesh_from_geo.py. After some changes in the code (the modified code is attached, changed lines are labelled by "#!!!") it generates meshgen.1.* files, but these files are not loaded by gen_mesh_from_goem(). I will try to solve it in the following days.
Regards Vladimir
On 02/13/2016 11:51 PM, Robert Cimrman wrote:
Hi Adolfo,
the diff below removes the error, but I cannot verify that the generated mesh is correct - I have something wrong with tetgen installation, as it segfaults.
Anyway, that code is very old and IMHO not used by anyone I am aware of. It needs either to be fixed (with added tests) or removed. If you do not mind, create an issue with this problem, so that it is not forgotten.
Any users of that around?
r.
diff --git a/sfepy/mesh/geom_tools.py b/sfepy/mesh/geom_tools.py index bacc657..3c52d6b 100644 --- a/sfepy/mesh/geom_tools.py +++ b/sfepy/mesh/geom_tools.py @@ -211,8 +211,10 @@ class geometry(object): s = "# nodes\n%d %d 0 0\n" % (len(nodes), self.dim) if self.dim == 2: ptstr = " %d %f %f\n" + ptstr2 = " %d %f %f %d\n" else: ptstr = " %d %f %f %f\n" + ptstr2 = " %d %f %f %f %d\n"
for n, x in enumerate(nodes): s += ptstr % tuple([n + 1] + list(x)) @@ -294,7 +296,7 @@ class geometry(object):
regions.append(v.getinsidepoint().getxyz()+[x.getn()]) s += "# regions\n%d\n" % len(regions) for i, x in enumerate(regions): - s += ptstr % tuple([i + 1], list(x)) + s += ptstr2 % tuple([i + 1] + list(x))
open(filename, "w").write(s)
On 02/12/2016 10:53 PM, Adolfo Rodriguez wrote:
I am trying to generate a mesh from geometry but it does not seem to be working. Does anybody have experience with this option? I am attaching a sample code.