Example a/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/advection_diffusion


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 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;

if ($TESTING)
{
	# 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 17-Mar-2014 3.1k COPYRIGHT 17-Mar-2014 504 StaticAdvectionDiffusion.xml 17-Mar-2014 9.3k StaticAdvectionDiffusion_0.4.xml 17-Mar-2014 8.4k plate.component1.bilinearLagrange.connectivity 17-Mar-2014 103k static_advection_diffusion.dependent.dofs.node 17-Mar-2014 64k static_advection_diffusion.geometric.dofs.node 17-Mar-2014 57k static_advection_diffusion.independent.dofs.node 17-Mar-2014 124k static_advection_diffusion.materials.dofs.constant 17-Mar-2014 12 static_advection_diffusion.source.dofs.node 17-Mar-2014 69k

Download the entire example:

Name                                   Modified     Size

examples_a_advection_diffusion.tar.gz 09-Mar-2016 1.0M

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxFailureSun Mar 6 00:05:50 20160
last breakFri Jul 17 00:02:00 20151
cmgui-wx-debugFailureSun Mar 6 00:05:18 20161
last breakFri Jul 17 00:04:00 20151
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:05:19 20160
last breakFri Jul 17 00:15:00 20151
cmgui-wx-debug-valgrindFailureSun Mar 6 00:28:19 201612
last breakSun Mar 6 00:28:00 201612
x86_64-linux
cmgui-wxFailureSun Mar 6 00:06:25 201661
last breakFri Jul 17 00:01:00 20151
cmgui-wx-debugFailureSun Mar 6 00:06:27 201660
last breakFri Jul 17 00:01:00 20151
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:01:29 20160
last breakFri Jul 17 00:02:00 201531
cmgui-wx-debug-valgrindFailureSun Mar 6 00:04:40 201670
last breakSun Mar 6 00:03:00 201670
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:02:49 20169

Testing status by file:


Html last generated: Wed Mar 9 16:01:17 2016

Input last modified: Wed Mar 9 15:49:37 2016


CMISS Help / Examples / a / advection_diffusion