Example a_backup/element_constants:
Read per-element constant fields.
Read and view per-element constant fields.
This example reads in a per-element constant field 'temperature' and
colours element surfaces with it using a spectrum. It also tests reading
and writing field a 'velocity_pressure' field which aggregates 3 nodally
interpolated velocity components with a per-element constant pressure component.
Note: The mesh in this example uses all the main 3-D element shapes: cube,
tetrahedron and the three orientations of triangle*line or wedge elements
to test evaluation of constant fields in each shape. Field values are made up.

The comfile run by this example is as follows:
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is CMISS Element Constants example.
#
# The Initial Developer of the Original Code is
# Auckland Uniservices Ltd, Auckland, New Zealand.
# Portions created by the Initial Developer are Copyright (C) 2010
# the Initial Developer. All Rights Reserved.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# This example requires cmgui version 2.7 (April 2010) or later.
# Set the default tessellation to use 4 segments in each element direction.
# This command does not exist on older versions of cmgui. It is safe to ignore errors.
gfx define tessellation default minimum_divisions "4" refinement_factors "1";
# Read mesh containing the main 3-D element shapes
gfx read nodes $example/allshapes.exnode;
gfx read elements $example/allshapes.exelem;
# Read a per-element constant field 'temperature':
gfx read elements $example/allshapes_temperature.exelem;
# Read 4-component velocity_pressure field which is an
# aggregation of 3 nodally interpolated velocity components u, v, w
# and per-element constant p. Note that it is inefficient to
# put these together as currently all components are evaluated
# even if only the pressure component is wanted.
# Also, current limitations require nodal 'p' component values
# values to be stored even though they are not used.
gfx read elements $example/allshapes_velocity_pressure.exfile;
# Extract the velocity and pressure fields from the aggregate velocity_pressure:
gfx define field allshapes/velocity composite velocity_pressure.u velocity_pressure.v velocity_pressure.w;
gfx define field allshapes/pressure composite velocity_pressure.p;
# create spectrums for colouring by pressure and temperature:
gfx create spectrum pressure_spectrum;
gfx modify spectrum pressure_spectrum clear overwrite_colour;
gfx modify spectrum pressure_spectrum linear reverse range 21 26 extend_above extend_below rainbow colour_range 0 1 component 1;
gfx create spectrum temperature_spectrum;
gfx modify spectrum temperature_spectrum clear overwrite_colour;
gfx modify spectrum temperature_spectrum linear reverse range 11.5 48 extend_above extend_below rainbow colour_range 0 1 component 1;
# View surfaces coloured by spectrum from temperature field:
gfx modify g_element allshapes general clear;
gfx modify g_element allshapes lines coordinate coordinates select_on material default selected_material default_selected;
gfx modify g_element allshapes surfaces coordinate coordinates as "surf" select_on material default data temperature spectrum temperature_spectrum selected_material default_selected render_shaded;
gfx modify g_element allshapes element_points coordinate coordinates as "arrows" invisible glyph arrow_line general size "0*0.1*0.1" centre 0,0,0 font default orientation velocity scale_factors "0.2*0*0" use_elements cell_centres discretization "2*2*2" native_discretization NONE select_on material gold data pressure spectrum pressure_spectrum selected_material default_selected;
# ensure the spectrum maps the full range of the temperature field:
gfx modify spectrum pressure_spectrum autorange;
gfx modify spectrum temperature_spectrum autorange;
if ($TESTING) {
gfx write elements temperature_out.exelem field temperature;
gfx write elements nodes velocity_pressure_out.exfile field velocity_pressure;
gfx define tessellation default minimum_divisions "1";
gfx export vrml file element_constants.wrl;
gfx modify g_element allshapes surfaces as "surf" invisible;
gfx modify g_element allshapes element_points as "arrows" visible;
gfx export vrml file velocity_pressure.wrl;
gfx define tessellation default minimum_divisions "4";
} else {
gfx create window 1;
gfx modify window 1 view perspective eye_point 4.99717 5.45307 4.39887 interest_point 0.633125 0.636193 0.397697 up_vector -0.375514 -0.366798 0.851146 view_angle 31.6892 near_clipping_plane 0.076326 far_clipping_plane 27.2763;
}
Files used by this example are:
Name Modified Size
element_constants.com 20-Apr-2012 5.2k
COPYRIGHT 20-Apr-2012 504
allshapes.exelem 20-Apr-2012 10k
allshapes.exnode 20-Apr-2012 1.1k
allshapes_temperature.exelem 20-Apr-2012 1.3k
allshapes_velocity_pressure.exfile 20-Apr-2012 10k
Download the entire example:
Name Modified Size
examples_a_backup_element_constants.tar.gz 12-Aug-2014 34k
Testing status by version:
Testing status by file:
- cmiss_test.log
- element_constants.wrl
i686-linux | | | |
Success | cmgui-wx: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-memorycheck: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-valgrind: | ndiff test: no significant differences with
generic answer.
|
x86_64-linux | | | |
Success | cmgui-wx: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-memorycheck: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-valgrind: | ndiff test: no significant differences with
generic answer.
|
- temperature_out.exelem
i686-linux | | | |
Success | cmgui-wx: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-memorycheck: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-valgrind: | ndiff test: no significant differences with
generic answer.
|
x86_64-linux | | | |
Success | cmgui-wx: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-memorycheck: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-valgrind: | ndiff test: no significant differences with
generic answer.
|
- velocity_pressure.wrl
i686-linux | | | |
Success | cmgui-wx: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-memorycheck: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-valgrind: | ndiff test: no significant differences with
generic answer.
|
x86_64-linux | | | |
Success | cmgui-wx: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-memorycheck: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-valgrind: | ndiff test: no significant differences with
generic answer.
|
- velocity_pressure_out.exfile
i686-linux | | | |
Success | cmgui-wx: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-memorycheck: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-valgrind: | ndiff test: no significant differences with
generic answer.
|
x86_64-linux | | | |
Success | cmgui-wx: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-memorycheck: | ndiff test: no significant differences with
generic answer.
|
Success | cmgui-wx-debug-valgrind: | ndiff test: no significant differences with
generic answer.
|
Html last generated: Sun Mar 6 05:50:55 2016
Input last modified: Thu Oct 11 23:52:55 2012
CMISS Help /
Examples /
a_backup /
element_constants