Example a_backup/ak: Multicomponent spectrums and data

Shows the use of multicomponent spectrums and data on a cube.

Screenshot of example a_backup/ak


The comfile run by this example is as follows:

#Example_ak: Multi component data and spectrums
#
#----------
#
#
gfx read nodes example cube.exnode
gfx read elements example cube.exelem
#
gfx cre win
gfx modify g_element cube general element_discretization "8*8*8"
#As well as displaying scalar fields spectrums can be used to display 
#multicomponent fields.  A simple example of this is choosing
#coordinates as the data field.
gfx mod g_e cube surfaces data coordinates spectrum default
#This displays a rainbow spectrum (the default) representing the x coordinate.
#but by creating a multicomponent spectrum we can view all three
#components at once.
gfx cre spectrum rgb clear
gfx modify spectrum rgb linear range 0 1 extend_above extend_below red colour_range 0 1 ambient diffuse component 1
gfx modify spectrum rgb linear range 0 1 extend_above extend_below green colour_range 0 1 ambient diffuse component 2
gfx modify spectrum rgb linear range 0 1 extend_above extend_below blue colour_range 0 1 ambient diffuse component 3
#The component numbers specify which of the data components that settings acts
#upon.  Each settings can only act on one component.  If data is not defined
#for a particular component then that settings is ignored.  Conversely if no
#settings in a spectrum uses a component in the data field then that
#component has been ignored, by using the default spectrum on coordinates we
#are ignoring the y and z coordinates which are components 2 and 3.
#
#Change the lines and surfaces to use our new multicomponent spectrum
#and the coordinates as data.
gfx mod g_e cube surfaces data coordinates spectrum rgb
gfx mod g_e cube lines data coordinates spectrum rgb
#Now you see a colour cube.
#Where x=y=z=0 the cube is black.
#Where x=1 and y=z=0 then you see red as it is applied to component 1.
#Where x=y=z=1 the cube is white, full saturation of red, green and blue.
#
#With the spectrum editor you can convieniently examine the different
#components making up your multicomponent spectrum.
gfx edit spectrum rgb
#By toggling the "visiblity" check boxes to the left of each settings
#item and applying these changes you can quickly turn off and on
#the individual components.
#
#This cube example also defined three scalar fields, potential,
#conductivity and temperature.  To view these with a multicomponent
#spectrum they must be combined into a single field.
gfx define field combine_pct composite potential conductivity temperature
#Rescale the spectrum
gfx mod spectrum rgb clear
gfx modify spectrum rgb linear range 0 50 extend_above extend_below red colour_range 0 1 ambient diffuse component 1
gfx modify spectrum rgb linear range 0.12654 0.29643 extend_above extend_below green colour_range 0 1 ambient diffuse component 2
gfx modify spectrum rgb linear range 20.0 20.3 extend_above extend_below blue colour_range 0 1 ambient diffuse component 3
gfx edit spectrum rgb
gfx mod g_e cube surfaces data combine_pct spectrum rgb
gfx mod g_e cube lines data combine_pct spectrum rgb
#
#Have a look at Example aj which uses multicomponent spectrums to show 
#the texture coordinates defined over the surface of the heart.
#
gfx
#
#----------------
#
#Displaying scalars: To show a scalar such as coordinates.x by choosing 
#the coordinate field as data and then using a spectrum that only 
#operates on the first component is wasteful of memory if that is all 
#you want to display because choosing the coordinate field as your data 
#means that all three components of the data field are stored at every 
#vertex.  If you only wanted to show the x component it is better to 
#define a single component field containing that value only and use that
#for your data. i.e.
#gfx define field coordinates.x component coordinates.x
#gfx mod g_e cube surfaces data coordinates.x spectrum default


Files used by this example are:

Name            Modified     Size

example_ak.com 20-Apr-2012 3.7k COPYRIGHT 19-Apr-2012 504 cube.exelem 20-Apr-2012 5.8k cube.exnode 20-Apr-2012 861

Download the entire example:

Name                         Modified     Size

examples_a_backup_ak.tar.gz 12-Aug-2014 127k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxSuccessSun Mar 6 00:10:03 20162
cmgui-wx-debugSuccessSun Mar 6 00:14:20 20162
cmgui-wx-debug-memorycheckSuccessSun Mar 6 00:10:04 20162
cmgui-wx-debug-valgrindFailureSun Mar 6 00:46:23 201635
last breakSun Mar 6 00:45:00 201635
last successTue Feb 10 00:49:00 201533
x86_64-linux
cmgui-wxFailureSun Mar 6 00:01:36 20160
last breakSun Mar 6 00:01:00 20160
last successWed Jun 3 00:04:00 20150
cmgui-wx-debugFailureSun Mar 6 00:01:36 20160
last breakSun Mar 6 00:01:00 20160
last successWed Jun 3 00:04:00 20150
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:01:36 20160
last breakSun Mar 6 00:01:00 20160
last successWed Jun 3 00:04:00 20150
cmgui-wx-debug-valgrindFailureSun Mar 6 00:03:04 201610
last breakSun Mar 6 00:02:00 201610
last successWed Jun 3 00:24:00 201527
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:02:14 20167

Testing status by file:


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

Input last modified: Fri Apr 20 15:56:16 2012


CMISS Help / Examples / a_backup / ak