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

pp

parent 29130a0c
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@
// We have seen in tutorials t3 and t6 that extruded and transfinite
// meshes can be "recombined" into quads/prisms/hexahedra by using the
// "Recombine" keyword. Unstructured meshes can be recombined in the
// same way: let's define a simple geometry with an analytical mesh
// same way. Let's define a simple geometry with an analytical mesh
// size field:
Point(1) = {-1.25, -.5, 0};
......
......@@ -46,6 +46,8 @@ Compound Line(101) = {6, 7, 8};
// Treat surfaces 12, 14 and 16 as a single surface
Compound Surface(200) = {12, 14, 16};
// Hide the original surfaces so we only see the compound
// (cross-patch) mesh
Hide {Surface{12, 14, 16}; }
// More details about the reparametrization technique can be found in
......
......@@ -7,8 +7,8 @@
*********************************************************************/
// Since compound geometrical compute a new parametrization, one can
// also use them to remesh STL files, even if there's only a single
// elementary per compound.
// also use them to remesh STL files, even if in this case there's
// usually only a single elementary geometrical entity per compound.
// Let's merge the mesh that we would like to remesh. This mesh was
// reclassified ("colored") from an initial STL triangulation using
......@@ -48,4 +48,3 @@ Background Field = 1;
Mesh.RemeshAlgorithm = 1; // (0) no split (1) automatic (2) automatic only with metis
Mesh.RemeshParametrization = 1; // (0) harmonic (1) conformal
......@@ -24,37 +24,27 @@ ssin = Sqrt(1 - ccos^2);
// Then we define some points and some lines using these variables:
Point(1) = { -e1-e2, 0.0 , 0.0 , Lc1};
Point(2) = { -e1-e2, h1 , 0.0 , Lc1};
Point(3) = { -e3-r , h1 , 0.0 , Lc2};
Point(4) = { -e3-r , h1+r , 0.0 , Lc2};
Point(5) = { -e3 , h1+r , 0.0 , Lc2};
Point(6) = { -e3 , h1+h2, 0.0 , Lc1};
Point(7) = { e3 , h1+h2, 0.0 , Lc1};
Point(8) = { e3 , h1+r , 0.0 , Lc2};
Point(9) = { e3+r , h1+r , 0.0 , Lc2};
Point(10)= { e3+r , h1 , 0.0 , Lc2};
Point(11)= { e1+e2, h1 , 0.0 , Lc1};
Point(12)= { e1+e2, 0.0 , 0.0 , Lc1};
Point(13)= { e2 , 0.0 , 0.0 , Lc1};
Point(14)= { R1 / ssin , h5+R1*ccos, 0.0 , Lc2};
Point(15)= { 0.0 , h5 , 0.0 , Lc2};
Point(16)= { -R1 / ssin , h5+R1*ccos, 0.0 , Lc2};
Point(17)= { -e2 , 0.0 , 0.0 , Lc1};
Point(18)= { -R2 , h1+h3 , 0.0 , Lc2};
Point(19)= { -R2 , h1+h3+h4, 0.0 , Lc2};
Point(20)= { 0.0 , h1+h3+h4, 0.0 , Lc2};
Point(21)= { R2 , h1+h3+h4, 0.0 , Lc2};
Point(22)= { R2 , h1+h3 , 0.0 , Lc2};
Point(23)= { 0.0 , h1+h3 , 0.0 , Lc2};
Point(24)= { 0 , h1+h3+h4+R2, 0.0 , Lc2};
Point(25)= { 0 , h1+h3-R2, 0.0 , Lc2};
Line(1) = {1 ,17};
Line(2) = {17,16};
Point(1) = {-e1-e2, 0 , 0, Lc1}; Point(2) = {-e1-e2, h1 , 0, Lc1};
Point(3) = {-e3-r , h1 , 0, Lc2}; Point(4) = {-e3-r , h1+r , 0, Lc2};
Point(5) = {-e3 , h1+r , 0, Lc2}; Point(6) = {-e3 , h1+h2, 0, Lc1};
Point(7) = { e3 , h1+h2, 0, Lc1}; Point(8) = { e3 , h1+r , 0, Lc2};
Point(9) = { e3+r , h1+r , 0, Lc2}; Point(10)= { e3+r , h1 , 0, Lc2};
Point(11)= { e1+e2, h1 , 0, Lc1}; Point(12)= { e1+e2, 0 , 0, Lc1};
Point(13)= { e2 , 0 , 0, Lc1};
Point(14)= { R1 / ssin, h5+R1*ccos, 0, Lc2};
Point(15)= { 0 , h5 , 0, Lc2};
Point(16)= {-R1 / ssin, h5+R1*ccos, 0, Lc2};
Point(17)= {-e2 , 0.0 , 0, Lc1};
Point(18)= {-R2 , h1+h3 , 0, Lc2}; Point(19)= {-R2 , h1+h3+h4, 0, Lc2};
Point(20)= { 0 , h1+h3+h4, 0, Lc2}; Point(21)= { R2 , h1+h3+h4, 0, Lc2};
Point(22)= { R2 , h1+h3 , 0, Lc2}; Point(23)= { 0 , h1+h3 , 0, Lc2};
Point(24)= { 0, h1+h3+h4+R2, 0, Lc2}; Point(25)= { 0, h1+h3-R2, 0, Lc2};
Line(1) = {1 , 17};
Line(2) = {17, 16};
// Gmsh provides other curve primitives than stright lines: splines,
// B-splines, circle arcs, ellipse arcs, etc. Here we define a new
......@@ -67,22 +57,12 @@ Circle(3) = {14,15,16};
// Pi. We can then define additional lines and circles, as well as a
// new surface:
Line(4) = {14,13};
Line(5) = {13,12};
Line(6) = {12,11};
Line(7) = {11,10};
Circle(8) = {8,9,10};
Line(9) = {8,7};
Line(10) = {7,6};
Line(11) = {6,5};
Circle(12) = {3,4,5};
Line(13) = {3,2};
Line(14) = {2,1};
Line(15) = {18,19};
Circle(16) = {21,20,24};
Circle(17) = {24,20,19};
Circle(18) = {18,23,25};
Circle(19) = {25,23,22};
Line(4) = {14,13}; Line(5) = {13,12}; Line(6) = {12,11};
Line(7) = {11,10}; Circle(8) = {8,9,10}; Line(9) = {8,7};
Line(10) = {7,6}; Line(11) = {6,5}; Circle(12) = {3,4,5};
Line(13) = {3,2}; Line(14) = {2,1}; Line(15) = {18,19};
Circle(16) = {21,20,24}; Circle(17) = {24,20,19};
Circle(18) = {18,23,25}; Circle(19) = {25,23,22};
Line(20) = {21,22};
Line Loop(21) = {17,-15,18,19,-20,16};
......
......@@ -79,18 +79,12 @@ Function CheeseHole
p6 = newp; Point(p6) = {x, y-r,z, lcar3} ;
p7 = newp; Point(p7) = {x, y, z-r,lcar3} ;
c1 = newreg; Circle(c1) = {p2,p1,p7};
c2 = newreg; Circle(c2) = {p7,p1,p5};
c3 = newreg; Circle(c3) = {p5,p1,p4};
c4 = newreg; Circle(c4) = {p4,p1,p2};
c5 = newreg; Circle(c5) = {p2,p1,p3};
c6 = newreg; Circle(c6) = {p3,p1,p5};
c7 = newreg; Circle(c7) = {p5,p1,p6};
c8 = newreg; Circle(c8) = {p6,p1,p2};
c9 = newreg; Circle(c9) = {p7,p1,p3};
c10 = newreg; Circle(c10) = {p3,p1,p4};
c11 = newreg; Circle(c11) = {p4,p1,p6};
c12 = newreg; Circle(c12) = {p6,p1,p7};
c1 = newreg; Circle(c1) = {p2,p1,p7}; c2 = newreg; Circle(c2) = {p7,p1,p5};
c3 = newreg; Circle(c3) = {p5,p1,p4}; c4 = newreg; Circle(c4) = {p4,p1,p2};
c5 = newreg; Circle(c5) = {p2,p1,p3}; c6 = newreg; Circle(c6) = {p3,p1,p5};
c7 = newreg; Circle(c7) = {p5,p1,p6}; c8 = newreg; Circle(c8) = {p6,p1,p2};
c9 = newreg; Circle(c9) = {p7,p1,p3}; c10 = newreg; Circle(c10) = {p3,p1,p4};
c11 = newreg; Circle(c11) = {p4,p1,p6}; c12 = newreg; Circle(c12) = {p6,p1,p7};
// We need non-plane surfaces to define the spherical holes. Here we
// use ruled surfaces, which can have 3 or 4 sides:
......
......@@ -8,49 +8,43 @@
// We first include `t1.geo' as well as some post-processing views:
Include "t1.geo" ;
Include "view1.pos" ;
Include "view1.pos" ;
Include "view4.pos" ;
Include "t1.geo";
Include "view1.pos";
Include "view1.pos";
Include "view4.pos";
// We then set some general options:
General.Trackball = 0 ;
General.RotationX = 0 ;
General.RotationY = 0 ;
General.RotationZ = 0 ;
General.Color.Background = White ;
General.Color.Foreground = Black ;
General.Color.Text = Black ;
General.Orthographic = 0 ;
General.Axes = 0 ;
General.SmallAxes = 0 ;
General.Trackball = 0;
General.RotationX = 0; General.RotationY = 0; General.RotationZ = 0;
General.Color.Background = White; General.Color.Foreground = Black;
General.Color.Text = Black;
General.Orthographic = 0;
General.Axes = 0; General.SmallAxes = 0;
// We also set some options for each post-processing view:
v0 = PostProcessing.NbViews-4;
v1 = v0+1;
v2 = v0+2;
v3 = v0+3;
View[v0].IntervalsType = 2 ;
View[v0].OffsetZ = 0.05 ;
View[v0].RaiseZ = 0 ;
View[v0].Light = 1 ;
v1 = v0+1; v2 = v0+2; v3 = v0+3;
View[v0].IntervalsType = 2;
View[v0].OffsetZ = 0.05;
View[v0].RaiseZ = 0;
View[v0].Light = 1;
View[v0].ShowScale = 0;
View[v0].SmoothNormals = 1;
View[v1].IntervalsType = 1 ;
View[v1].ColorTable = { Green, Blue } ;
View[v1].NbIso = 10 ;
View[v1].IntervalsType = 1;
View[v1].ColorTable = { Green, Blue };
View[v1].NbIso = 10;
View[v1].ShowScale = 0;
View[v2].Name = "Test..." ;
View[v2].Name = "Test...";
View[v2].Axes = 1;
View[v2].Color.Axes = Black;
View[v2].IntervalsType = 2 ;
View[v2].IntervalsType = 2;
View[v2].Type = 2;
View[v2].IntervalsType = 2 ;
View[v2].IntervalsType = 2;
View[v2].AutoPosition = 0;
View[v2].PositionX = 85;
View[v2].PositionY = 50;
......@@ -64,32 +58,32 @@ View[v3].Visible = 0;
// In {0.5:1.5:0.1}' would increment num from 0.5 to 1.5 with a step
// of 0.1.)
t = 0 ;
t = 0;
//For num In {1:1}
For num In {1:255}
View[v0].TimeStep = t ;
View[v1].TimeStep = t ;
View[v2].TimeStep = t ;
View[v3].TimeStep = t ;
View[v0].TimeStep = t;
View[v1].TimeStep = t;
View[v2].TimeStep = t;
View[v3].TimeStep = t;
t = (View[v0].TimeStep < View[v0].NbTimeStep-1) ? t+1 : 0 ;
t = (View[v0].TimeStep < View[v0].NbTimeStep-1) ? t+1 : 0;
View[v0].RaiseZ += 0.01/View[v0].Max * t ;
View[v0].RaiseZ += 0.01/View[v0].Max * t;
If (num == 3)
// We want to create 320x240 frames when num == 3:
General.GraphicsWidth = 320 ;
General.GraphicsHeight = 240 ;
General.GraphicsWidth = 320;
General.GraphicsHeight = 240;
EndIf
// It is possible to nest loops:
For num2 In {1:50}
General.RotationX += 10 ;
General.RotationY = General.RotationX / 3 ;
General.RotationZ += 0.1 ;
General.RotationX += 10;
General.RotationY = General.RotationX / 3;
General.RotationZ += 0.1;
Sleep 0.01; // sleep for 0.01 second
Draw; // draw the scene
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment