Skip to content
Snippets Groups Projects
Select Git revision
  • f6f7b3d7964b09730c2dc49394fe1fd22dc867f7
  • master default protected
  • alphashapes
  • quadMeshingTools
  • cygwin_conv_path
  • macos_arm64
  • add-transfiniteautomatic-to-geo
  • patch_releases_4_10
  • HierarchicalHDiv
  • isuruf-master-patch-63355
  • hyperbolic
  • hexdom
  • hxt_update
  • jf
  • 1618-pythonocc-and-gmsh-api-integration
  • octreeSizeField
  • hexbl
  • alignIrregularVertices
  • getEdges
  • patch_releases_4_8
  • isuruf-master-patch-51992
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
  • gmsh_4_8_4
  • gmsh_4_8_3
  • gmsh_4_8_2
  • gmsh_4_8_1
  • gmsh_4_8_0
  • gmsh_4_7_1
  • gmsh_4_7_0
41 results

meshGRegionLocalMeshMod.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    t8.geo 3.75 KiB
    // -----------------------------------------------------------------------------
    //
    //  Gmsh GEO tutorial 8
    //
    //  Post-processing, image export and animations
    //
    // -----------------------------------------------------------------------------
    
    // In addition to creating geometries and meshes, GEO scripts can also be used
    // to manipulate post-processing datasets (called "views" in Gmsh).
    
    // We first include `t1.geo' as well as some post-processing views:
    
    Include "t1.geo";
    Include "view1.pos";
    Include "view1.pos";
    Include "view4.pos";
    
    // Gmsh can read post-processing views in various formats. Here the `view1.pos'
    // and `view4.pos' files are in the Gmsh "parsed" format, which is interpreted
    // directly by the GEO script parser. The parsed format should only be used for
    // relatively small datasets of course: for larger datasets using e.g. MSH files
    // is much more efficient.
    
    // 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;
    
    // 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;
    View[v0].ShowScale = 0;
    View[v0].SmoothNormals = 1;
    
    View[v1].IntervalsType = 1;
    View[v1].ColorTable = { Green, Blue };
    View[v1].NbIso = 10;
    View[v1].ShowScale = 0;
    
    View[v2].Name = "Test...";
    View[v2].Axes = 1;
    View[v2].Color.Axes = Black;
    View[v2].IntervalsType = 2;
    View[v2].Type = 2;
    View[v2].IntervalsType = 2;
    View[v2].AutoPosition = 0;
    View[v2].PositionX = 85;
    View[v2].PositionY = 50;
    View[v2].Width = 200;
    View[v2].Height = 130;
    
    View[v3].Visible = 0;
    
    // You can save an MPEG movie directly by selecting `File->Export' in the
    // GUI. Several predefined animations are setup, for looping on all the time
    // steps in views, or for looping between views.
    
    // But a script can be used to build much more complex animations, by changing
    // options at run-time and re-rendering the graphics. Each frame can then be
    // saved to disk as an image, and multiple frames can be encoded to form a
    // movie. Below is an example of such a custom animation.
    
    t = 0; // Initial step
    
    // Loop on num from 1 to 3
    For num In {1:3}
    
      View[v0].TimeStep = t; // Set time step
      View[v1].TimeStep = t;
      View[v2].TimeStep = t;
      View[v3].TimeStep = t;
    
      t = (View[v0].TimeStep < View[v0].NbTimeStep-1) ? t+1 : 0; // Increment
    
      View[v0].RaiseZ += 0.01/View[v0].Max * t; // Raise view v0
    
      If (num == 3)
        // Resize the graphics when num == 3, to create 640x480 frames
        General.GraphicsWidth = General.MenuWidth + 640;
        General.GraphicsHeight = 480;
      EndIf
    
      frames = 50;
    
      // Loop on num2 from 1 to frames
      For num2 In {1:frames}
    
        // Incrementally rotate the scene
        General.RotationX += 10;
        General.RotationY = General.RotationX / 3;
        General.RotationZ += 0.1;
    
        // Sleep for 0.01 second
        Sleep 0.01;
    
        // Draw the scene (one could use `DrawForceChanged' instead to force the
        // reconstruction of the vertex arrays, e.g. if changing element clipping)
        Draw;
    
        If (num == 3)
          // Uncomment the following lines to save each frame to an image file (the
          // `Print' command saves the graphical window; the `Sprintf' function
          // permits to create the file names on the fly):
    
          // Print Sprintf("t8-%g.gif", num2);
          // Print Sprintf("t8-%g.ppm", num2);
          // Print Sprintf("t8-%g.jpg", num2);
        EndIf
    
      EndFor
    
      If(num == 3)
        // Here we could make a system call to generate a movie. For example, with
        // ffmpeg:
    
        // System "ffmpeg -i t8-%d.jpg t8.mpg"
      EndIf
    
    EndFor