Skip to content
Snippets Groups Projects
Commit 286557ce authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent 5dd2228d
No related branches found
No related tags found
No related merge requests found
// $Id: GeoInterpolation.cpp,v 1.37 2008-06-10 12:59:12 remacle Exp $
// $Id: GeoInterpolation.cpp,v 1.38 2008-06-22 06:13:48 geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
......@@ -660,11 +660,14 @@ Vertex InterpolateSurface(Surface *s, double u, double v, int derivee, int u_v)
return T;
}
// use the exact extrusion formula if the surface is extruded
// FIXME: WARNING -- this is a major hack: we use the exact
// extrusion formula if the surface is extruded, so that we create
// exact surfaces of revolution. But this WILL fail if the extruded
// surface is transformed after the extrusion!
if(s->Extrude && s->Extrude->geo.Mode == EXTRUDED_ENTITY &&
s->Typ != MSH_SURF_PLAN)
return InterpolateExtrudedSurface(s, u, v);
switch (s->Typ) {
case MSH_SURF_REGL:
case MSH_SURF_TRIC:
......
# $Id: Makefile,v 1.487 2008-06-20 05:54:08 geuzaine Exp $
# $Id: Makefile,v 1.488 2008-06-22 06:15:09 geuzaine Exp $
#
# Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
#
......@@ -23,7 +23,7 @@ include variables
GMSH_MAJOR_VERSION = 2
GMSH_MINOR_VERSION = 2
GMSH_PATCH_VERSION = 2
GMSH_PATCH_VERSION = 3
GMSH_EXTRA_VERSION =
GMSH_VERSION = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION}
......
h = 96;
c = 100/2;
d = 5;
t = 8;
r = 12;
Include "IPE.geo";
LC = t/2;
LC2 = r/4;
Point(1) = {-c,-h/2,0,LC};
Point(2) = {-c,-h/2+t,0,LC};
Point(3) = {-t/2-r,-h/2+t,0,LC2};
Point(4) = {-t/2,-h/2+t+r,0,LC2};
Point(5) = {-t/2-r,-h/2+t+r,0,LC2};
Point(11) = {-c,h/2,0,LC};
Point(12) = {-c,h/2-t,0,LC};
Point(13) = {-t/2-r,h/2-t,0,LC2};
Point(14) = {-t/2,h/2-t-r,0,LC2};
Point(15) = {-t/2-r,h/2-t-r,0,LC2};
Point(21) = {c,-h/2,0,LC};
Point(22) = {c,-h/2+t,0,LC};
Point(23) = {t/2+r,-h/2+t,0,LC2};
Point(24) = {t/2,-h/2+t+r,0,LC2};
Point(25) = {t/2+r,-h/2+t+r,0,LC2};
Point(31) = {c,h/2,0,LC};
Point(32) = {c,h/2-t,0,LC};
Point(33) = {t/2+r,h/2-t,0,LC2};
Point(34) = {t/2,h/2-t-r,0,LC2};
Point(35) = {t/2+r,h/2-t-r,0,LC2};
Line(1) = {1,21};
Line(2) = {21,22};
Line(3) = {22,23};
Line(4) = {1,2};
Line(5) = {2,3};
Line(6) = {4,14};
Line(7) = {34,24};
Line(8) = {11,31};
Line(9) = {31,32};
Line(10) = {32,33};
Line(11) = {11,12};
Line(12) = {12,13};
Circle(13) = {13,15,14};
Circle(14) = {33,35,34};
Circle(15) = {3,5,4};
Circle(16) = {23,25,24};
Line Loop(17) = {-7,-14,-10,-9,-8,11,12,13,-6,-15,-5,-4,1,2,3,16};
Plane Surface(18) = {17};
Physical Line(19) = {8,9,10,14,7,16,3,2,1,4,5,15,6,13,12,11};
Physical Surface(20) = {18};
Function IPE
// create vertices
p1 = newp; Point(p1) = {0, h, 0, lc};
p2 = newp; Point(p2) = {b, h, 0, lc};
p3 = newp; Point(p3) = {b, h-e, 0, lc};
p4 = newp; Point(p4) = {(0.5*b)+(0.5*a)+r, h-e, 0, lc};
p5 = newp; Point(p5) = {(0.5*b)+(0.5*a)+r, h-e-r, 0, lc};
p6 = newp; Point(p6) = {(0.5*b)+(0.5*a), h-e-r, 0, lc};
p7 = newp; Point(p7) = {(0.5*b)+(0.5*a), e+r, 0, lc};
p8 = newp; Point(p8) = {(0.5*b)+(0.5*a)+r, e+r, 0, lc};
p9 = newp; Point(p9) = {(0.5*b)+(0.5*a)+r, e, 0, lc};
p10 = newp; Point(p10) = {b, e, 0, lc};
p11 = newp; Point(p11) = {b, 0, 0, lc};
p12 = newp; Point(p12) = {0, 0, 0, lc};
p13 = newp; Point(p13) = {0, e, 0, lc};
p14 = newp; Point(p14) = {(0.5*b)-(0.5*a)-r, e, 0, lc};
p15 = newp; Point(p15) = {(0.5*b)-(0.5*a)-r, e+r, 0, lc};
p16 = newp; Point(p16) = {(0.5*b)-(0.5*a), e+r, 0, lc};
p17 = newp; Point(p17) = {(0.5*b)-(0.5*a), h-e-r, 0, lc};
p18 = newp; Point(p18) = {(0.5*b)-(0.5*a)-r, h-e-r, 0, lc};
p19 = newp; Point(p19) = {(0.5*b)-(0.5*a)-r, h-e, 0, lc};
p20 = newp; Point(p20) = {0, h-e, 0, lc};
// create a line from two points;
ligne1 = newl; Line(ligne1) = {p1, p2};
ligne2 = newl; Line(ligne2) = {p2, p3};
ligne3 = newl; Line(ligne3) = {p3, p4};
ligne4 = newl; Line(ligne4) = {p6, p7};
ligne5 = newl; Line(ligne5) = {p9, p10};
ligne6 = newl; Line(ligne6) = {p10, p11};
ligne7 = newl; Line(ligne7) = {p11, p12};
ligne8 = newl; Line(ligne8) = {p12, p13};
ligne9 = newl; Line(ligne9) = {p13, p14};
ligne10 = newl; Line(ligne10) = {p16, p17};
ligne11 = newl; Line(ligne11) = {p19, p20};
ligne12 = newl; Line(ligne12) = {p20, p1};
// create a curve
Arc1 = newl; Circle(Arc1) = {p4, p5 , p6};
Arc2 = newl; Circle(Arc2) = {p7, p8 , p9};
Arc3 = newl; Circle(Arc3) = {p14, p15 , p16};
Arc4 = newl; Circle(Arc4) = {p17, p18 , p19};
// create a wire
wire = newll; Line Loop(wire) = {ligne1, ligne2, ligne3, Arc1, ligne4, Arc2, ligne5, ligne6, ligne7, ligne8, ligne9, Arc3, ligne10, Arc4, ligne11, ligne12};
// create a face
face = news; Plane Surface(face) = {wire};
Return
lc = 10;
b = 200.;
e = 16.;
h = 500.;
a = 10.2;
r = 21.;
Call IPE;
e = 40;
r = 61.;
a = 40.2;
Call IPE;
Translate{300,0,0}{Surface{face};}
This diff is collapsed.
// Gmsh project created on Thu Nov 01 10:31:41 2007
//indenter which has a little blunt radius
Z1 = 0.15; //Z of the sphere tip
D = 1.7; //contact radius
beta = 90 / 2 * Pi / 180; //half the angle of the cone
d = D * Cos(beta); //diameter of the touch of cone and contact sphere
//alpha is the distance from sphere tip to some point on the sphere
//alpha = 0.5 * (D - (D ^ 2 - d ^ 2) ^ 0.5), where d is a diameter at alpha
alpha = 0.5 * (D - (D ^ 2 - d ^ 2) ^ 0.5);
D2 = 4; //pivot diameter
L1 = 0.5 * (D2 - d) / Tan(beta); //length of the cone
L2 = 20; //pivot length
Di = 0.85 * D; //inner sphere diameter for better meshing
//characteristic lengths
l0 = 0.2 * (D - Di); //sphere tip
l1 = 2.0 * l0; //outer sphere
l2 = 0.5 * Di; //inner sphere can be coarse
l3 = 0.5 * D2;
//points
//outer sphere
Point(100) = {0, 0, Z1+0.5*D, l0}; //virtual point - sphere center - for setting sphere surfaces
Point(101) = {0, 0, Z1, l0}; //sphere tip
r = 0.5 * d;
l = l1;
h = alpha;
Point(102) = {0,0,Z1+h,l};
Point(103) = {r,0,Z1+h,l};
tmp104[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/4} { Duplicata{ Point{103}; } } ;
tmp105[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/2} { Duplicata{ Point{103}; } } ;
//cone
h = alpha + L1;
a = 0.5 * D2;
a1 = 0.5 * a;
l = 0.5 * a;
Point(122) = {0,0,Z1+h,l};
Point(123) = {a,0,Z1+h,l};
tmp124[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/4} { Duplicata{ Point{123}; } } ;
tmp125[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/2} { Duplicata{ Point{123}; } } ;
//thick cylinder
H = alpha + L1;
h = L2 * 0.2;
l = 0.5 * D2;
a1 = 0.5 * 0.5 * D2;
Point(142) = {0,0,H+h,l};
Point(143) = {0.5 * D2,0,H+h,l};
tmp144[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/4} { Duplicata{ Point{143}; } } ;
tmp145[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/2} { Duplicata{ Point{143}; } } ;
Point(152) = {0,0,H+2*h,l};
Point(153) = {0.5 * D2,0,H+2*h,l};
tmp154[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/4} { Duplicata{ Point{153}; } } ;
tmp155[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/2} { Duplicata{ Point{153}; } } ;
Point(162) = {0,0,H+3*h,l};
Point(163) = {0.5 * D2,0,H+3*h,l};
tmp164[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/4} { Duplicata{ Point{163}; } } ;
tmp165[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/2} { Duplicata{ Point{163}; } } ;
Point(172) = {0,0,H+4*h,l};
Point(173) = {0.5 * D2,0,H+4*h,l};
tmp174[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/4} { Duplicata{ Point{173}; } } ;
tmp175[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/2} { Duplicata{ Point{173}; } } ;
Point(182) = {0,0,H+5*h,l};
Point(183) = {0.5 * D2,0,H+5*h,l};
tmp184[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/4} { Duplicata{ Point{183}; } } ;
tmp185[] = Rotate {{0, 0, 1}, {0,0,0}, Pi/2} { Duplicata{ Point{183}; } } ;
Circle(1) = {103,102,104};
Circle(2) = {104,102,105};
Circle(3) = {103,100,101};
Circle(4) = {104,100,101};
Circle(5) = {105,100,101};
Circle(6) = {123,122,124};
Circle(7) = {124,122,125};
Circle(8) = {143,142,144};
Circle(9) = {144,142,145};
Circle(10) = {153,152,154};
Circle(11) = {154,152,155};
Circle(12) = {163,162,164};
Circle(13) = {164,162,165};
Circle(14) = {173,172,174};
Circle(15) = {174,172,175};
Circle(16) = {183,182,184};
Circle(17) = {184,182,185};
Line(18) = {103,102};
Line(19) = {104,102};
Line(20) = {105,102};
Line(21) = {123,122};
Line(22) = {124,122};
Line(23) = {125,122};
Line(24) = {143,142};
Line(25) = {144,142};
Line(26) = {145,142};
Line(27) = {153,152};
Line(28) = {154,152};
Line(29) = {155,152};
Line(30) = {163,162};
Line(31) = {164,162};
Line(32) = {165,162};
Line(33) = {173,172};
Line(34) = {174,172};
Line(35) = {175,172};
Line(36) = {183,182};
Line(37) = {184,182};
Line(38) = {185,182};
Line(39) = {101,102};
Line(40) = {102,100};
Line(41) = {100,122};
Line(42) = {122,142};
Line(43) = {142,152};
Line(44) = {152,162};
Line(45) = {162,172};
Line(46) = {172,182};
Line(47) = {103,123};
Line(48) = {123,143};
Line(49) = {143,153};
Line(50) = {153,163};
Line(51) = {163,173};
Line(52) = {173,183};
Line(53) = {104,124};
Line(54) = {124,144};
Line(55) = {144,154};
Line(56) = {154,164};
Line(57) = {164,174};
Line(58) = {174,184};
Line(59) = {125,145};
Line(60) = {145,155};
Line(61) = {155,165};
Line(62) = {165,175};
Line(63) = {175,185};
Line(64) = {105,125};
Line Loop(65) = {5,-4,2};
Ruled Surface(66) = {65};
Line Loop(67) = {4,-3,1};
Ruled Surface(68) = {67};
Line Loop(69) = {64,-7,-53,2};
Ruled Surface(70) = {69};
Line Loop(71) = {53,-6,-47,1};
Ruled Surface(72) = {71};
Line Loop(73) = {48,8,-54,-6};
Ruled Surface(74) = {73};
Line Loop(75) = {54,9,-59,-7};
Ruled Surface(76) = {75};
Line Loop(77) = {8,55,-10,-49};
Ruled Surface(78) = {77};
Line Loop(79) = {55,11,-60,-9};
Ruled Surface(80) = {79};
Line Loop(81) = {10,56,-12,-50};
Ruled Surface(82) = {81};
Line Loop(83) = {56,13,-61,-11};
Ruled Surface(84) = {83};
Line Loop(85) = {51,14,-57,-12};
Ruled Surface(86) = {85};
Line Loop(87) = {57,15,-62,-13};
Ruled Surface(88) = {87};
Line Loop(89) = {52,16,-58,-14};
Ruled Surface(90) = {89};
Line Loop(91) = {58,17,-63,-15};
Ruled Surface(92) = {91};
Line Loop(93) = {3,39,-18};
Plane Surface(94) = {93};
Line Loop(95) = {4,39,-19};
Plane Surface(96) = {95};
Line Loop(97) = {5,39,-20};
Plane Surface(98) = {97};
Line Loop(99) = {18,40,41,-21,-47};
Plane Surface(100) = {99};
Line Loop(101) = {19,40,41,-22,-53};
Plane Surface(102) = {101};
Line Loop(103) = {20,40,41,-23,-64};
Plane Surface(104) = {103};
Line Loop(105) = {21,42,-24,-48};
Plane Surface(106) = {105};
Line Loop(107) = {22,42,-25,-54};
Plane Surface(108) = {107};
Line Loop(109) = {23,42,-26,-59};
Plane Surface(110) = {109};
Line Loop(111) = {24,43,-27,-49};
Plane Surface(112) = {111};
Line Loop(113) = {25,43,-28,-55};
Plane Surface(114) = {113};
Line Loop(115) = {26,43,-29,-60};
Plane Surface(116) = {115};
Line Loop(117) = {27,44,-30,-50};
Plane Surface(118) = {117};
Line Loop(119) = {28,44,-31,-56};
Plane Surface(120) = {119};
Line Loop(121) = {29,44,-32,-61};
Plane Surface(122) = {121};
Line Loop(123) = {30,45,-33,-51};
Plane Surface(124) = {123};
Line Loop(125) = {31,45,-34,-57};
Plane Surface(126) = {125};
Line Loop(127) = {32,45,-35,-62};
Plane Surface(128) = {127};
Line Loop(129) = {33,46,-36,-52};
Plane Surface(130) = {129};
Line Loop(131) = {34,46,-37,-58};
Plane Surface(132) = {131};
Line Loop(133) = {35,46,-38,-63};
Plane Surface(134) = {133};
Line Loop(135) = {18,-19,-1};
Plane Surface(136) = {135};
Line Loop(137) = {19,-20,-2};
Plane Surface(138) = {137};
Line Loop(139) = {21,-22,-6};
Plane Surface(140) = {139};
Line Loop(141) = {22,-23,-7};
Plane Surface(142) = {141};
Line Loop(143) = {24,-25,-8};
Plane Surface(144) = {143};
Line Loop(145) = {25,-26,-9};
Plane Surface(146) = {145};
Line Loop(147) = {27,-28,-10};
Plane Surface(148) = {147};
Line Loop(149) = {28,-29,-11};
Plane Surface(150) = {149};
Line Loop(151) = {30,-31,-12};
Plane Surface(152) = {151};
Line Loop(153) = {31,-32,-13};
Plane Surface(154) = {153};
Line Loop(155) = {33,-34,-14};
Plane Surface(156) = {155};
Line Loop(157) = {34,-35,-15};
Plane Surface(158) = {157};
Line Loop(159) = {36,-37,-16};
Plane Surface(160) = {159};
Line Loop(161) = {37,-38,-17};
Plane Surface(162) = {161};
Surface Loop(163) = {94,68,96,136};
Volume(164) = {163};
Surface Loop(165) = {98,66,138,96};
Volume(166) = {165};
Surface Loop(167) = {136,140,72,100,102};
Volume(168) = {167};
Surface Loop(169) = {142,138,104,70,102};
Volume(170) = {169};
Surface Loop(171) = {74,106,108,144,140};
Volume(172) = {171};
Surface Loop(173) = {76,110,146,142,108};
Volume(174) = {173};
Surface Loop(175) = {78,112,148,144,114};
Volume(176) = {175};
Surface Loop(177) = {150,80,116,146,114};
Volume(178) = {177};
Surface Loop(179) = {82,118,152,148,120};
Volume(180) = {179};
Surface Loop(181) = {84,122,154,150,120};
Volume(182) = {181};
Surface Loop(183) = {86,124,156,152,126};
Volume(184) = {183};
Surface Loop(185) = {88,128,158,154,126};
Volume(186) = {185};
Surface Loop(187) = {90,130,160,156,132};
Volume(188) = {187};
Surface Loop(189) = {92,162,134,158,132};
Volume(190) = {189};
Physical Volume(191) = {164,166,168,170,172,174,176,178,180,182,184,186,188,190};
l1=0.1;
Point(1) = {0,0,0,l1};
Point(2) = {1,0,0,l1};
Point(3) = {1,1,0,l1};
Point(4) = {0,1,0,l1};
Point(5) = {0,0,1,l1};
Point(6) = {0,1,1,l1};
Line(1) = {4,3};
Line(2) = {3,2};
Line(3) = {2,1};
Line(4) = {1,4};
Line Loop(5) = {2,3,4,1};
Ruled Surface(6) = {5};
// This is OK
/*
Line(7) = {6,4};
Line(8) = {1,5};
Line(9) = {5,6};
Line Loop(10) = {7,-4,8,9};
Ruled Surface(11) = {10};
Rotate {{0,1,0}, {0,0,0}, Pi/4} { Surface{6,11}; }
*/
// This will fail, since at the moment we use the extrusion formula to
// interpolate the surface (which is wrong since the surface has been
// transformed). We do this so that we can create exact surfaces of
// revolution... One more shortcoming of our little CAD engine :-)
Extrude {0,0,1}{ Line{4}; }
Rotate {{0,1,0}, {0,0,0}, Pi/4} { Surface{6,10}; }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment