Example a_backup/time: Time.

This example shows how to read in multiple sets of nodal values at different times and display these with a single definition of the elements. The graphics update with time keeper.

Screenshot of example a_backup/time


The comfile run by this example is as follows:

# Interactively displaying time varying meshes
# --------------------------------------------
#
# Read in the undeformed positions
gfx read node $example/undeformed_cube.exnode;
# Read in the deformed positions at different times
gfx read node $example/deformed_cube.exnode time 1;
gfx read node $example/deformed_cube3.exnode time 2;
gfx read node $example/deformed_cube2.exnode time 3;
#The differing values are all stored in an array.
gfx lis node 8;
#Read in a constant element definition.  These cannot
#currently change with time.
gfx read element $example/deformed_cube.exelem;
gfx read element $example/undeformed_cube.exelem;
#Define a magnitude computed field.
gfx def field mag magnitude field deformed_coordinates;
#Extend the range of the default spectrum.
gfx modify spectrum default clear overwrite_colour;
gfx modify spectrum default linear reverse range -1 1 extend_above extend_below rainbow colour_range 0 1 ambient diffuse component 1;
#Show a whole bunch of graphics.
gfx create material jade ambient 0.1 0.56 0 diffuse 0.1 0.39 0 emission 0 0 0 specular 0.8 0.8 0.8 alpha 1 shininess 0.8
gfx modify g_element cube general clear circle_discretization 6 default_coordinate deformed_coordinates element_discretization "8*8*8" native_discretization none;
gfx modify g_element cube node_points as node_spheres glyph sphere_hires general size "0.2*0.2*0.2" centre 0,0,0 select_on material jade data deformed_coordinates spectrum default selected_material default_selected;
gfx modify g_element cube cylinders as cylinders constant_radius 0.02 select_on material default data deformed_coordinates spectrum default selected_material default_selected;
gfx modify g_element cube surfaces as surface face xi3_0 select_on material default data deformed_coordinates spectrum default selected_material default_selected render_shaded;
gfx modify g_element cube iso_surfaces as iso_surface iso_scalar mag iso_value 1.2 use_elements select_on material default data deformed_coordinates spectrum default selected_material default_selected render_shaded;
gfx modify g_element cube streamlines as streamline xi 0.5,0.5,0.5 ellipse vector deformed_coordinates length 1 width 0.05 travel_scalar select_on material default selected_material default_selected;
gfx modify g_element cube element_points as element_point glyph point general size "1*1*1" centre 0,0,0 use_elements cell_centres discretization "3*3*3" native_discretization NONE select_on material default data deformed_coordinates spectrum default selected_material default_selected;
if ($TESTING)
{
  #Test the rendering of the scene at various times interpolating the original values.
  gfx timekeeper default set 1.2;
  gfx export vrml file deformed_1_2.wrl
  gfx timekeeper default set 2.8;
  gfx export vrml file deformed_2_8.wrl
} else
{
#Hide most of the graphics objects so that it runs fast even on a slow computer
  gfx modify g_element cube node_points as node_spheres glyph sphere_hires general size "0.2*0.2*0.2" centre 0,0,0 select_on material jade data deformed_coordinates spectrum default selected_material default_selected invisible;
  gfx modify g_element cube cylinders as cylinders constant_radius 0.02 select_on material default data deformed_coordinates spectrum default selected_material default_selected invisible;
  gfx modify g_element cube surfaces as surface face xi3_0 select_on material default data deformed_coordinates spectrum default selected_material default_selected render_shaded invisible;
  gfx modify g_element cube streamlines as streamline xi 0.5,0.5,0.5 ellipse vector deformed_coordinates length 1 width 0.05 travel_scalar select_on material default selected_material default_selected invisible;
  gfx modify g_element cube element_points as element_point glyph point general size "1*1*1" centre 0,0,0 use_elements cell_centres discretization "3*3*3" native_discretization NONE select_on material default data deformed_coordinates spectrum default selected_material default_selected invisible;
#Display the scene
  gfx create win 1;
#Set up and start the time keeper
  gfx timekeeper default swing;
  gfx timekeeper default play;
  gfx create time_editor;
#Show the scene editor.  Now while it is playing you can adjust the rendition
#of the cube and change the visibility of the various graphics.
  gfx edit scene;
}

Files used by this example are:

Name                    Modified     Size

time.com 20-Apr-2012 4.2k COPYRIGHT 19-Apr-2012 504 deformed_cube.exelem 20-Apr-2012 3.4k deformed_cube.exnode 20-Apr-2012 683 deformed_cube2.exnode 20-Apr-2012 683 deformed_cube3.exnode 20-Apr-2012 683 undeformed_cube.exelem 20-Apr-2012 3.4k undeformed_cube.exnode 20-Apr-2012 685

Download the entire example:

Name                           Modified     Size

examples_a_backup_time.tar.gz 12-Aug-2014 27k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxSuccessSun Mar 6 00:06:51 20160
cmgui-wx-debugSuccessSun Mar 6 00:06:52 20161
cmgui-wx-debug-memorycheckSuccessSun Mar 6 00:06:53 20161
cmgui-wx-debug-valgrindSuccessSun Mar 6 00:37:23 201621
x86_64-linux
cmgui-wxSuccessThu Jan 7 00:01:31 20160
cmgui-wx-debugSuccessThu Jan 7 00:01:31 20160
cmgui-wx-debug-memorycheckSuccessThu Jan 7 00:01:31 20160
cmgui-wx-debug-valgrindFailureSun Mar 6 00:04:04 201618
last breakSun Mar 6 00:03:00 201618
last successWed Jun 3 00:17:00 201517
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:04:59 201617

Testing status by file:


Html last generated: Sun Mar 6 05:51:03 2016

Input last modified: Fri Apr 20 16:02:43 2012


CMISS Help / Examples / a_backup / time