Example a_backup/advection_diffusion: Read fields in FieldML format

This example reads fields describing a 2-D advection-diffusion solution in FieldML 0.5 format.

A key feature of the FieldML format is the separation of bulk data from the description in the XML. This makes it a more efficient format for partial reading and for assessing compatibility of field descriptions before merging into existing data in memory.

Here the input file contents are as follows:

StaticAdvectionDiffusion.xml The main FieldML input file
plate.component1.bilinearLagrange.connectivity Indexes of 4 global nodes per element where parameters
for basis interpolator.2d.unit.bilinearLagrange are
obtained. These points are understood as embedded in the
2-D element chart at xi = (0,0), (1,0), (0,1), (1,1)
static_advection_diffusion.*.dofs.node Nodal parameters for geometric, independent, source
and dependent fields
static_advection_diffusion.materials.dofs.constant Constant parameters for the material field
Note: these cannot be read into cmgui yet.

In addition to text files and inline string resources, the FieldML API has support for HDF5 bulk data stores.

NOTE: This example uses the new FieldML 0.5 file format, which is only supported in development versions of Cmgui. Users of Cmgui 2.8 can change the comfile to read StaticAdvectionDiffusion_0.4.xml in FieldML 0.4 format.

Screenshot of example a_backup/advection_diffusion

The comfile run by this example is as follows:

# 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 advection diffusion visualisation 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 *****
# Read a solution to a 2-D advection-diffusion problem in FieldML format.
gfx create region advection;
# Cmgui 2.8 users should replace the following with StaticAdvectionDiffusion_0.4.xml in FieldML 0.4 format
gfx read region $example/StaticAdvectionDiffusion.xml region advection;

# The input files do not describe faces, so create them here so we can
# visualise lines.
gfx define face egroup advection;

# Create some graphics

gfx modify g_element advection general clear;
gfx modify g_element advection lines coordinate static_advection_diffusion.geometric select_on invisible material default selected_material default_selected;
gfx modify g_element advection surfaces coordinate static_advection_diffusion.geometric select_on material default data static_advection_diffusion.dependent spectrum default selected_material default_selected render_shaded;
gfx modify spectrum default autorange;

	# Save the model in EX format
	gfx write elements nodes advection_diffusion.exelem;
	# Write the scene to vrml
	gfx export vrml file advection_diffusion.wrl scene default;
} else {
	gfx create window 1;
	gfx modify window 1 view perspective eye_point -2.61085 -0.266493 2.7133 interest_point 0.864045 0.53799 -0.129906 up_vector 0.555315 0.317668 0.768578 view_angle 29.6542 near_clipping_plane 0.0456135 far_clipping_plane 16.3007 relative_viewport ndc_placement -1 1 2 2 viewport_coordinates 0 0 1 1;

Files used by this example are:

Name                                                Modified     Size

advection_diffusion.com 20-Apr-2012 3.1k COPYRIGHT 20-Apr-2012 504 StaticAdvectionDiffusion.xml 20-Apr-2012 9.3k StaticAdvectionDiffusion_0.4.xml 20-Apr-2012 8.4k plate.component1.bilinearLagrange.connectivity 20-Apr-2012 103k static_advection_diffusion.dependent.dofs.node 20-Apr-2012 64k static_advection_diffusion.geometric.dofs.node 20-Apr-2012 57k static_advection_diffusion.independent.dofs.node 20-Apr-2012 124k static_advection_diffusion.materials.dofs.constant 20-Apr-2012 12 static_advection_diffusion.source.dofs.node 20-Apr-2012 69k

Download the entire example:

Name                                          Modified     Size

examples_a_backup_advection_diffusion.tar.gz 12-Aug-2014 1.0M

Testing status by version:

StatusTestedReal time (s)
cmgui-wxFailureSun Mar 6 00:06:15 20161
last breakFri Jul 17 00:02:00 20151
last successThu Jul 16 00:02:00 20151
cmgui-wx-debugFailureSun Mar 6 00:06:15 20161
last breakFri Jul 17 00:05:00 20150
last successThu Jul 16 00:05:00 20152
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:06:21 20161
last breakFri Jul 17 00:16:00 20151
last successThu Jul 16 00:16:00 20158
cmgui-wx-debug-valgrindFailureSun Mar 6 00:27:34 201615
last breakSun Mar 6 00:27:00 201615
last successThu Jul 16 01:12:00 201570
cmgui-wxFailureSun Mar 6 00:05:25 20160
last breakFri Jul 17 00:01:00 201560
last successThu Jul 16 00:01:00 20151
cmgui-wx-debugFailureSun Mar 6 00:06:31 201661
last breakFri Jul 17 00:01:00 201560
last successThu Jul 16 00:01:00 20151
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:06:37 201660
last breakFri Jul 17 00:02:00 201561
last successThu Jul 16 00:01:00 20154
cmgui-wx-debug-valgrindFailureSun Mar 6 00:03:39 201611
last breakSun Mar 6 00:03:00 201611
last successWed Jun 3 00:44:00 201560
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:02:43 201610

Testing status by file:

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

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

CMISS Help / Examples / a_backup / advection_diffusion