[Gmsh] How are the display points of volumes calculated?

Neilen Marais nmarais at sun.ac.za
Fri May 9 23:44:05 CEST 2008


Hi,

I'm a bit confused about how gmsh is displaying volumes (i.e. the yellow 
ball that represents a volume). I always assumed it was put at the 
centroid of the object, but this doesn't seem to be the case (unless my 
math is all wrong).

An example:

Point(1) = {14.5,11.5,9.5,1000000};
Point(2) = {14.5,11.5,19,1000000};
Point(3) = {14.5,23,9.5,1000000};
Point(4) = {14.5,23,19,1000000};
Point(5) = {21.750725,17.25,14.25,1000000};Line(1) = {1,2};
Line(2) = {2,4};
Line(3) = {4,3};
Line(4) = {3,1};
Line(5) = {1,5};
Line(6) = {2,5};
Line(7) = {4,5};
Line(8) = {3,5};
Line(9) = {2,3};
Line Loop(10) = {3,8,-7};
Plane Surface(11) = {10};
Line Loop(12) = {2,7,-6};
Plane Surface(13) = {12};
Line Loop(14) = {6,-8,-9};
Plane Surface(15) = {14};
Line Loop(16) = {5,-8,4};
Plane Surface(17) = {16};
Line Loop(18) = {6,-5,1};
Plane Surface(19) = {18};
Line Loop(20) = {2,3,-9};
Plane Surface(21) = {20};
Line Loop(22) = {1,9,4};
Plane Surface(23) = {22};
Surface Loop(24) = {19,17,23,15};
Volume(25) = {24};
Surface Loop(26) = {15,13,21,11};
Volume(27) = {26};

In this case the two volume points are drawn on top of each other, 
wherease the respective centroids (which for a tets are the average of 
the for vertices) should be [16.31268125,  15.8125    ,  13.0625] and 
[16.31268125,  18.6875    ,  15.4375]

So then, my question is: How is that display point calculated (assuming 
my math is good :)

Thanks
Neilen