Example a_backup/ab: Simplex element example

This example demonstrates displaying a simple mesh of simplex elements.

Screenshot of example a_backup/ab


The comfile run by this example is as follows:

#Example_ab: Simplex element mesh
#
# Reads in a very simple 2-D simplex mesh, sets an appropriate view of it and
# turns on node numbers.
#
#----------
#
# Create some materials for use in this example.
gfx create material blue ambient 0.2 0.2 1 diffuse 0.2 0.2 1
gfx create material orange ambient 0.9 0.2 0 diffuse 0.9 0.2 0
#
# Open and set up 3D viewing window
gfx create window 1
gfx modify window 1 view parallel interest_point -0.2 0.15 0 eye_point -0.2 0.1 4 up_vector 0 1 0 view_angle 35 near_clipping 0.1 far_clipping 10        
#
# Draw axes with an appropriate colour and size.
gfx modify g_element "/" point as 1 glyph axes_xyz general size "0.5*0.5*0.5" select_on material blue selected_material default;
#
# Read in nodes and elements defining the mesh created in example 1371. The
# element and node groups have also been called 'example_1371'.
gfx read nodes example example_1371.exnode
gfx read elements example example_1371.exelem
#
# Create initial view with node numbers.
# First ensure tessellation is good enough to see colours later
gfx define tessellation default minimum_divisions "8" refinement_factors "1";
gfx modify g_element example_1371 general clear;
gfx modify g_element example_1371 lines coordinate coordinates material default;
gfx modify g_element example_1371 node_points coordinate coordinates material orange label cmiss_number;
#
#----------
#
# Now we use a spectrum to display the xi coordinates.
# Firstly, define the fields so that they are available in the scene editor.
gfx define field xi1 component xi.1
gfx define field xi2 component xi.2
# Now compute the "fictional" xi3 coordinate.
# In simplex coordinates, there are actually three basis coordinates, but
# only two of them are needed.  The third can be derived.
# In this case, xi3 = 1 - xi1 - xi2.
# 
gfx define field xi3_intermediate_a add fields xi1 xi2
gfx define field one constant 1
gfx define field xi3 add fields one xi3_intermediate_a scale_factors 1 -1
# The surfaces can now be added using the scene editor.
# That is how this was originally done.
# The "command line" to do this was then obtained by "reverse engineering", 
# i.e. getting cmgui to spit out the line that represents the current state
# of an object, like this: gfx list g_element
# The surfaces line was then copied and pasted into this script.
gfx modify g_element example_1371 surfaces coordinate coordinates select_on material default data xi1 spectrum default selected_material default_selected render_shaded;
# It is educational to change the spectrum data to xi2 and xi3
# to get an intuitive feeling for how these coordinates work.
# If you do this via the scene editor, you can select the
# "Data" drop-down, and then use the keyboard cursor keys to 
# alternate amongst xi1, xi2 and xi3.
# For example, you will notice that in this mesh, 
# the red part of each triangle rotates from vertex to vertex 
# in the same rotational direction in all elements.
#
# Finally, surfaces and lines co-exist better with perturbation on.
gfx modify window 1 set perturb_lines

Files used by this example are:

Name                 Modified     Size

example_ab.com 20-Apr-2012 3.0k COPYRIGHT 19-Apr-2012 504 example_1371.exelem 20-Apr-2012 9.4k example_1371.exnode 20-Apr-2012 2.2k

Download the entire example:

Name                         Modified     Size

examples_a_backup_ab.tar.gz 12-Aug-2014 340k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxSuccessSun Mar 6 00:11:23 20162
cmgui-wx-debugSuccessSun Mar 6 00:11:37 20162
cmgui-wx-debug-memorycheckSuccessSun Mar 6 00:10:30 20163
cmgui-wx-debug-valgrindFailureSun Mar 6 00:53:06 201634
last breakSun Mar 6 00:52:00 201634
last successTue Feb 10 00:52:00 201539
x86_64-linux
cmgui-wxFailureSun Mar 6 00:01:35 20160
last breakSun Mar 6 00:01:00 20160
last successWed Jun 3 00:05:00 20151
cmgui-wx-debugFailureSun Mar 6 00:01:35 20160
last breakSun Mar 6 00:01:00 20160
last successWed Jun 3 00:04:00 20151
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:01:35 20160
last breakSun Mar 6 00:01:00 20160
last successWed Jun 3 00:04:00 20151
cmgui-wx-debug-valgrindFailureSun Mar 6 00:02:29 201610
last breakSun Mar 6 00:02:00 201610
last successWed Jun 3 00:26:00 201530
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:02:20 20167

Testing status by file:


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

Input last modified: Fri Apr 20 15:55:55 2012


CMISS Help / Examples / a_backup / ab