Example a/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/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 17-Mar-2014 4.2k COPYRIGHT 17-Mar-2014 504 deformed_cube.exelem 17-Mar-2014 3.4k deformed_cube.exnode 17-Mar-2014 683 deformed_cube2.exnode 17-Mar-2014 683 deformed_cube3.exnode 17-Mar-2014 683 undeformed_cube.exelem 17-Mar-2014 3.4k undeformed_cube.exnode 17-Mar-2014 685

Download the entire example:

Name                    Modified     Size

examples_a_time.tar.gz 09-Mar-2016 26k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxFailureSun Mar 6 00:06:04 20160
last breakMon Aug 25 13:12:00 20141
cmgui-wx-debugFailureSun Mar 6 00:06:05 20161
last breakMon Aug 25 13:13:00 20142
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:06:06 20161
last breakMon Aug 25 13:13:00 20142
cmgui-wx-debug-valgrindFailureSun Mar 6 00:36:34 201624
last breakTue Feb 24 00:07:00 201521
x86_64-linux
cmgui-wxFailureSun Mar 6 00:01:34 20160
last breakFri Aug 15 00:53:00 20140
cmgui-wx-debugFailureSun Mar 6 00:01:34 20160
last breakFri Aug 15 00:53:00 20140
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:01:35 20161
last breakFri Aug 15 00:53:00 20141
cmgui-wx-debug-valgrindFailureSun Mar 6 00:04:07 201618
last breakSun Mar 6 00:03:00 201618
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:04:55 201617

Testing status by file:


Html last generated: Wed Mar 9 16:02:53 2016

Input last modified: Wed Mar 9 15:49:33 2016


CMISS Help / Examples / a / time