Example a_backup/triangle_mixed_basis: Triangle element with mixed basis functions

Tests use of linear and quadratic simplex basis functions in the same element.

Screenshot of example a_backup/triangle_mixed_basis


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 triangle mixed basis 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 *****

{

# Test a mix of finite element basis functions over a triangle
#
# Read a single triangle element containing 3 fields:
# * 2-D "coordinates" using a linear simplex basis
# * scalar "pressure" using a linear simplex basis
# * 2-D "velocity" using a quadratic simplex basis
# To complicate the problem, the linear bases use a scale factor set -
# even though all scale factors are 1, while the velocity uses no
# scale factors, so the default unit scale factor is used.
# It is recommended not to use scale factors for simplex and Lagrangian bases.
gfx read nodes example triangle_coordinates_pressure.exnode;
gfx read elements example triangle_coordinates_pressure.exelem;
gfx read nodes example triangle_velocity.exnode;
gfx read elements example triangle_velocity.exelem;
gfx define faces egroup triangle;
gfx modify g_element triangle general clear circle_discretization 6 default_coordinate coordinates element_discretization "10*10*10" native_discretization none;
gfx modify g_element triangle lines select_on material default selected_material default_selected;
gfx modify g_element triangle element_points glyph arrow_solid general size "0*0.02*0.02" centre 0,0,0 font default orientation velocity scale_factors "0.1*0*0" use_elements cell_corners discretization "8*8*8" native_discretization NONE select_on material default selected_material default_selected;
gfx modify g_element triangle surfaces select_on material default data pressure spectrum default selected_material default_selected render_shaded;
gfx modify spectrum default autorange;

if ($TESTING) {
	# Test writing and reading the whole group
	gfx write elements write_triangle.exelem group triangle;
	gfx read elements write_triangle.exelem;
	# Test writing and reading individual fields in the group
	gfx write elements write_triangle_coordinates.exelem group triangle field coordinates;
	gfx write elements write_triangle_pressure_velocity.exelem group triangle fields pressure & velocity;
	gfx read elements write_triangle_coordinates.exelem;
	gfx read elements write_triangle_pressure_velocity.exelem;
	gfx destroy elements all;
	gfx read elements write_triangle_pressure_velocity.exelem;
	gfx read elements write_triangle_coordinates.exelem;
	# Export the graphics
	gfx export vrml file triangle_mixed_basis.wrl;
} else {
	gfx create window 1;
	gfx modify window 1 view perspective eye_point 0.981395 -1.46621 2.02069 interest_point 0.390842 0.457097 -0.0467995 up_vector -0.236346 0.676846 0.697151 view_angle 37.5028 near_clipping_plane 0.0288485 far_clipping_plane 10.3095 relative_viewport ndc_placement -1 1 2 2 viewport_coordinates 0 0 1 1;
}

}


Files used by this example are:

Name                                  Modified     Size

triangle_mixed_basis.com 20-Apr-2012 4.2k COPYRIGHT 20-Apr-2012 504 triangle_coordinates_pressure.exelem 20-Apr-2012 1.4k triangle_coordinates_pressure.exnode 20-Apr-2012 473 triangle_velocity.exelem 20-Apr-2012 1.3k triangle_velocity.exnode 20-Apr-2012 426

Download the entire example:

Name                                           Modified     Size

examples_a_backup_triangle_mixed_basis.tar.gz 12-Aug-2014 91k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxSuccessSun Mar 6 00:06:54 20161
cmgui-wx-debugSuccessSun Mar 6 00:06:54 20161
cmgui-wx-debug-memorycheckSuccessSun Mar 6 00:06:55 20161
cmgui-wx-debug-valgrindSuccessSun Mar 6 00:28:36 201617
x86_64-linux
cmgui-wxSuccessThu Jan 7 00:01:32 20160
cmgui-wx-debugSuccessThu Jan 7 00:01:32 20160
cmgui-wx-debug-memorycheckSuccessThu Jan 7 00:01:32 20160
cmgui-wx-debug-valgrindFailureSun Mar 6 00:03:48 201613
last breakSun Mar 6 00:03:00 201613
last successWed Jun 3 00:13:00 201512
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:04:08 201611

Testing status by file:


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

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


CMISS Help / Examples / a_backup / triangle_mixed_basis