[Gmsh] Reverse extrusion in centreline field not working
Abdulhaq Elhouderi
el.ingeniero09 at gmail.com
Tue Mar 26 03:56:21 CET 2013
Hi
I'm using the centreline field to mesh an artery. The stl for the artery
and the centrelines along with the .geo file are attached (250 KB
altogether).
Here's my my geometry file:
//////////////////////////////
Mesh.Algorithm = 6;
Mesh.Algorithm3D = 1;
Mesh.RemeshAlgorithm=1;
Mesh.RemeshParametrization = 1;
Merge "AbdominalAorta.stl";
Field[1] = Centerline;
Field[1].FileName = "VMTKCenterlinesOut.vtk";
Field[1].hLayer = 0.2;
Field[1].nbPoints = 20;
Field[1].closeVolume = 1;
Field[1].extrudeWall = 1;
Field[1].nbElemLayer = 4;
Field[1].hSecondLayer = 0;
Field[1].nbElemSecondLayer = 0;
Field[1].reMesh = 1;
Background Field = 1;
Field[1].run;
///////////////////////////////
I thought if give a negative value for hLayer then the extrusion will
reverse direction, but it doesn't work. So I looked into the relevant
source code and found the following in CenterlineField.cpp
/////////////
//orient extrude direction outward
int dir = 0;
MElement *e = current->getFaceByTag(1)->getMeshElement(0);
SVector3 ne = e->getFace(0).normal();
SVector3 ps(e->getVertex(0)->x(), e->getVertex(0)->y(),
e->getVertex(0)->z());
double xyz[3] = {ps.x(), ps.y(), ps.z()};
kdtree->annkSearch(xyz, 1, index, dist);
SVector3 pc(nodes[index[0]][0], nodes[index[0]][1], nodes[index[0]][2]);
SVector3 nc = ps-pc;
if (dot(ne,nc) < 0) dir = 1;
if (dir ==1 && hLayer > 0 ) hLayer *= -1.0;
/////////////
For testing purposes, I changed the value for dir to 1 (int dir = 1;) and
commented out the conditional statement in the second last line and
recompiled gmsh. Nothing happened, the extrusion is still oriented
outwards. Is this a bug?
Thanks
Abdulhaq
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20130326/703fb073/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: case.tar.gz
Type: application/x-gzip
Size: 251269 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20130326/703fb073/attachment.gz>