//t1.geo, modified :-)
lc = 1e-1;
Point(1) = {0, 0, 0, lc};
Point(2) = {2, 0, 0, lc} ;
Point(3) = {2, 3, 0, lc} ;
Point(4) = {0, 3, 0, lc} ;

Point(5)={0,0,0.5, lc};
Point(6)={2,0,0.5, lc};
Point(7)={2,3,0.5, lc};
Point(8)={0,3,0.5, lc};

Line(1) = {1,2} ;
Line(2) = {2,3} ;
Line(3) = {3,4} ;
Line(4) = {4,1} ;

Line(5)={5,8};
Line(6)={8,7};
Line(7)={7,6};
Line(8)={6,5};

Line(9)={5,1};
Line(10)={8,4};
Line(11)={7,3};
Line(12)={6,2};

Geometry.PointNumbers=1;

Line Loop(1) = {1,2,3,4} ;
Line Loop(2)={5,6,7,8};

Line Loop(3)={2,-11,7,12};
Line Loop(4)={4,-9,5,10};
Line Loop(5)={1,-12,8,9};
Line Loop(6)={3,-10,6,11};

Plane Surface(1) = {1} ;
Plane Surface(2)={2};

Plane Surface(3)={3};
Plane Surface(4)={4};
Plane Surface(5)={5};
Plane Surface(6)={6};

Surface Loop(1)={1,2,3,4,5,6};

Volume(1)={1};

//From gmsh mailing list: Works! Answer = 17m^2
Mesh 2; // mesh
Plugin(NewView).Run; // create new post-pro view
Plugin(ModifyComponents).View = 0;
Plugin(ModifyComponents).Expression0 = "1"; 
Plugin(ModifyComponents).Run; // assign 1 on this view
Plugin(Integrate).Dimension = 2;
Plugin(Integrate).Run; // integrate 1 (only on 2D elements)
Printf("Area = %g", View[1].Max); // print out the result

//Does not produce 3m^3 :-(
Mesh 3; // mesh
Plugin(NewView).Run; // create new post-pro view
Plugin(ModifyComponents).View = 0;
Plugin(ModifyComponents).Expression0 = "1"; 
Plugin(ModifyComponents).Run; // assign 1 on this view
Plugin(Integrate).Dimension = 3;
Plugin(Integrate).Run; // integrate 1
Printf("Volume = %g", View[1].Max); // print out the result
