Example e42:
Tri-Cubic Hermite Host Mesh Customisation
A small generic model is customised to a larger specific subject (p111)
with the aid of 9 control parameters. A tri-cubic Hermite host mesh
is used to transform the generic model.
The customised mesh can be visualised
with draw.com.
The comfile run by this example is as follows:
# Example e42
# -----------
#
# Inputs
#
$SLAVEFILES = "pig06"
$CUSTFILES = "pig06_cust"
$SLAVE = "1..6"
$HOST = 7
# Controls
#
$CALCXI = 1
$FITTING = 1
$UPDATE = 1 #Update the slave mesh.
$OUTPUT = 1 #Write out ipnode/elem files.
fem def para;r;fitting;example
fem def regi;r;seven;example
fem def coor 3,1
fem def base;r;bicubic_tricubic;example
if( $CALCXI==1 )
{
fem def node;r;host;example reg $HOST
fem def elem;r;host;example reg $HOST
fem up node deriv 1 reg $HOST
fem up node deriv 2 reg $HOST
fem up node deriv 3 reg $HOST
#
#----------------------------#
# Refine host mesh
#----------------------------#
fem ref xi 3 reg $HOST
#
#----------------------------#
# Export host geometry
#----------------------------#
#
fem export node;host as host offset 1000 reg $HOST
fem export elem;host as host offset_elem 1000 reg $HOST
#
#----------------------------#
# Calculate xi's for data points
#----------------------------#
#
fem def data;r;gen_landmark9;example reg $HOST
fem def xi;c contain reg $HOST
fem export data;gen_landmark as gen_landmark error offset 16000 reg $HOST
fem def xi;w;gen_landmark reg $HOST
#
#----------------------------#
# The slave mesh
#----------------------------#
#
fem def node;r;$SLAVEFILES;example reg $SLAVE
fem def elem;r;$SLAVEFILES;example reg $SLAVE
fem export node;pig_gen as pig_gen offset 10000 reg $SLAVE
fem export elem;pig_gen as pig_gen offset_elem 10000 reg $SLAVE
#
#----------------------------#
# Calculate xi's for node points
# calcs the xi posns of nodes
# in nr2 contained by host in nr1
#----------------------------#
#
fem def xi;c nodes contain of $SLAVE in $HOST
fem def xi;w;generic nodes contain of $SLAVE in $HOST
} #CALCXI
Additional testing commands:
if( $FITTING==1 )
{
#
#----------------------------#
# Fit the host mesh
#----------------------------#
#
fem def data;r;p111_landmark9;example reg $HOST
fem def xi;r;gen_landmark reg $HOST
fem export data;p111_landmark as p111_landmark error offset 17500 reg $HOST
#
#----------------------------#
# Tricubic fitting with 1 elem
#----------------------------#
#
#fem def field;r;host_cub;example reg HOST
#fem def elem;r;host;example field reg HOST
#fem def fit;r;host_tricub;example geom reg HOST
#
#----------------------------#
# Tricubic fitting with 2 elem
#----------------------------#
#
fem def field;r;host_cub_ref;example reg $HOST
fem def elem;r;host_ref;example field reg $HOST
fem def fit;r;host_tricub_ref;example geom reg $HOST
fem list data error reg $HOST #Show starting error.
fem fit reg $HOST
fem update nodes reg $HOST
fem list data error reg $HOST #Show final error.
fem def node;w;host_cust reg $HOST
fem def elem;w;host_cust reg $HOST
#
#----------------------------#
# Export customised host geometry
#----------------------------#
#
fem export nodes;host_cust as host_cust offset 2000 reg $HOST
fem export elements;host_cust as host_cust offset_elem 2000 reg $HOST
fem export data;data_cust as data_cust error offset 18000 reg $HOST
} #FITTING
if( $UPDATE==1 )
{
#
#----------------------------#
# Update the slave mesh
#----------------------------#
#
fem def node;r;host_cust reg $HOST
fem def elem;r;host_cust reg $HOST
fem def node;r;$SLAVEFILES;example reg $SLAVE
fem def elem;r;$SLAVEFILES;example reg $SLAVE
fem def xi;r;generic nodes of $SLAVE in $HOST
#
#----------------------------#
# Moves nodes of reg 2
# according to reg 1
#----------------------------#
#
fem up mesh posit of 1 in $HOST
fem up mesh posit of 6 in $HOST
#
#----------------------------#
# Export customised slave geometry
#----------------------------#
#
fem export node;pig_cust as pig_cust offset 20000 reg $SLAVE
fem export elem;pig_cust as pig_cust offset_elem 20000 reg $SLAVE
fem export elem;skin as skin reg 1 offset_elem 20000 elem 1281..2336
fem export elem;lungs as lungs reg 2..3 offset_elem 20000
fem export elem;lvendo as lvendo reg 4 offset_elem 20000
fem export elem;rvendo as rvendo reg 5 offset_elem 20000
fem export elem;heart as heart reg 6 offset_elem 20000
#
#----------------------------#
# Export electrodes for comparison
#----------------------------#
#
fem def data;r;electrode;example reg 1
fem def xi;c close reg 1
fem list data error reg 1
fem exp data;cust_error as cust_error error offset 24000 reg 1
} #UPDATE
if( $OUTPUT==1 )
{
fem def node;w;$CUSTFILES reg $SLAVE
fem def elem;w;$CUSTFILES reg $SLAVE
} #OUTPUT
Files used by this example are:
Name Modified Size
example_e42.com 06-Apr-2001 1.7k
bicubic_tricubic.ipbase 10-Apr-2000 7.7k
electrode.ipdata 10-Apr-2000 24k
fitting.ippara 12-Nov-2002 5.9k
gen_landmark9.ipdata 10-Apr-2000 748
host.ipelem 10-Apr-2000 432
host.ipelfd 10-Apr-2000 374
host.ipnode 06-Apr-2001 12k
host_cub.ipfiel 10-Apr-2000 6.7k
host_cub_ref.ipfiel 07-Apr-2001 19k
host_ref.ipelfd 10-Apr-2000 654
host_tricub.ipfit 13-Apr-2007 5.0k
host_tricub_ref.ipfit 13-Apr-2007 5.1k
p111_landmark9.ipdata 10-Apr-2000 715
pig06.irelem 10-Apr-2000 1.3M
pig06.irnode 10-Apr-2000 3.5M
seven.ipregi 10-Apr-2000 93
test_output.com 06-Apr-2001 2.7k
Download the entire example:
Name Modified Size
examples_e_e4_e42.tar.gz 19-Aug-2014 3.0M
Testing status by version:
Testing status by file:
- cmiss_test.log
- cmiss_test.out
i686-linux | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
mips-irix | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug-clear-malloc: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug-clear-malloc7: | ndiff test: no significant differences with
generic answer.
|
Success | cm64: | ndiff test: no significant differences with
generic answer.
|
Success | cm64-debug: | ndiff test: no significant differences with
generic answer.
|
rs6000-aix | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cm64: | ndiff test: no significant differences with
generic answer.
|
Success | cm64-debug: | ndiff test: no significant differences with
generic answer.
|
x86_64-linux | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
- cust_error.exdata
- gen_landmark.ipxi
i686-linux | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
mips-irix | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug-clear-malloc: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug-clear-malloc7: | ndiff test: no significant differences with
generic answer.
|
Success | cm64: | ndiff test: no significant differences with
generic answer.
|
Success | cm64-debug: | ndiff test: no significant differences with
generic answer.
|
rs6000-aix | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cm64: | ndiff test: no significant differences with
generic answer.
|
Success | cm64-debug: | ndiff test: no significant differences with
generic answer.
|
x86_64-linux | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
- host_cust.ipnode
i686-linux | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
mips-irix | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug-clear-malloc: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug-clear-malloc7: | ndiff test: no significant differences with
generic answer.
|
Success | cm64: | ndiff test: no significant differences with
generic answer.
|
Success | cm64-debug: | ndiff test: no significant differences with
generic answer.
|
rs6000-aix | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
Success | cm64: | ndiff test: no significant differences with
generic answer.
|
Success | cm64-debug: | ndiff test: no significant differences with
generic answer.
|
x86_64-linux | | | |
Success | cm: | ndiff test: no significant differences with
generic answer.
|
Success | cm-debug: | ndiff test: no significant differences with
generic answer.
|
Graphical output from this problem is given
here.
Html last generated: Sun Mar 6 05:51:27 2016
Input last modified: Mon Aug 18 10:58:19 2014
CMISS Help /
Examples /
e /
e4 /
e42