This example covers:
FaroInitialisationFile serial_port 2 baud_rate 9600 _D1This file enables the Faro Arm to be initialized when CMGUI is started so that you can obtain points directly via a CMGUI session. You need to ensure that only one CMGUI session at a time is using the Faro Arm.
GFX create 3d_digitizer
.
gfx cre ngroup femur
) and then switch on the input device (click over `Input Device' in the Data Grabber window). You will now be able to obtain node points to add to the group you have selected in `Group'.
gfx cre dgroup femur
) and instead of `Data as Node', select `Data as Point'.
gfx edit graph groupName apply
when you are satisfied that your data and mesh are closely aligned and then write out the transformed data.
cm
to fit the initial mesh to the data using cubic Hermite basis functions. The command file and necessary files for this process are given in the example below.
cmConvert
.Typing cmConvert
on the command line will provide help on this utility.
#!/usr/bin/perl -i.nov #Description: Takes an .ipnode file not containing versions and adds a #default one version for each node in nj=1, nj=2, nj=3. Also asks for #prompting for different versions. #usage: addversions.pl file.ipnode while (<>) { if (/Do you want prompting for different/) { s/ N/ Y/; } if (/The Xj.1./) { s/The Xj.1./The number of versions for nj=1 is [1]: 1\n The Xj(1)/; } if (/The Xj.2./) { s/The Xj.2./The number of versions for nj=2 is [1]: 1\n The Xj(2)/; } if (/The Xj.3./) { s/The Xj.3./The number of versions for nj=3 is [1]: 1\n The Xj(3)/; } print; }
#!/usr/bin/perl -i.old while (<>) { if (/derivatives/) { s/: 0/: 3/; } print; if (/Xj/) { print <<EOF; The derivative wrt direction 1 is [ 0.00000D+00]: 0.00000D+00 The derivative wrt direction 2 is [ 0.00000D+00]: 0.00000D+00 The derivative wrt directions 1 & 2 is [ 0.00000D+00]: 0.00000D+00 EOF } }
$MULTIPLEFITS=0 { eval { require Time::HiRes }; if( $@ ) { print "warning: $@"; } else { import Time::HiRes qw(time); } } sub cpu_time() { # Add user/system parent/child cpu_times. my $result = 0; map { $result += $_ } times; $result; } sub print_timing($$$) { my ($message,$wall,$cpu) = @_; printf "%s: %.3fs wall, %.3fs cpu.\n", $message, $wall, $cpu; } sub print_memory_use() { # Different operating systems have different data and ps uses different # arguments so try a series of commands in an attempt to collect the # information. system qw(ps -o vsz -p), $$; system qw(ps -l -p), $$; system qw(ps v), $$; } FEM def para;r;femur;example FEM def coor;r;femur;example FEM def base;r;femur;example # # Reads in an initial mesh and calculates linear approximations # for the derivatives # FEM def node;r;femur;example FEM def elem;r;femur;example FEM up node deriv 1 linear node 2..401 FEM up node deriv 2 linear node 2..401 FEM update scale_factor normalise # # The initial mesh # FEM export node;femur_init as femur_init offset 10000 FEM export elem;femur_init as femur_init offset_elem 10000 # # Calculate the intial xi projections # FEM def data;r;femur;example FEM def xi;c close #FEM def xi;w;femur FEM li data err FEM export data;femur_data as femur_data error # # Setup the fitting problem # FEM up field from geometry FEM def fit;r;femur;example geometry ($wall_setup,$cpu_setup) = (time, cpu_time); print_timing 'setup', $wall_setup - $^T, $cpu_setup; # # First fit # FEM fit FEM update node fit FEM update scale_factor normalise FEM def xi;c close old FEM li data err FEM export data;femur_data_1 as femur_data_1 error FEM export node;fitted_femur_1 as fitted_femur_1 offset 20000 FEM export elem;fitted_femur_1 as fitted_femur_1 offset_elem 20000 if( $TESTING ) { fem list data;fitted1 errors; fem list node;fitted1 } if ($MULTIPLEFITS==1) { # # Second fit # FEM def fit;r;femur_2;example geometry FEM fit FEM update node fit FEM update scale_factor normalise FEM def xi;c close old FEM li data err FEM export data;femur_data_2 as femur_data_2 error FEM export node;fitted_femur_2 as fitted_femur_2 offset 30000 FEM export elem;fitted_femur_2 as fitted_femur_2 offset_elem 30000 # # Third fit # FEM fit FEM update node fit FEM update scale_factor normalise FEM def xi;c close old FEM li data err FEM export data;femur_data_3 as femur_data_3 error FEM export node;fitted_femur_3 as fitted_femur_3 offset 40000 FEM export elem;fitted_femur_3 as fitted_femur_3 offset_elem 40000 # # Fourth fit # FEM fit FEM update node fit FEM update scale_factor normalise FEM def xi;c close old FEM li data err FEM export data;femur_data_4 as femur_data_4 error FEM export node;fitted_femur_4 as fitted_femur_4 offset 50000 FEM export elem;fitted_femur_4 as fitted_femur_4 offset_elem 50000 # # Fifth fit # FEM fit FEM update node fit FEM update scale_factor normalise FEM def xi;c close old FEM li data err FEM export data;femur_data_5 as femur_data_5 error FEM export node;fitted_femur_5 as fitted_femur_5 offset 60000 FEM export elem;fitted_femur_5 as fitted_femur_5 offset_elem 60000 # # Sixth fit # FEM fit FEM update node fit FEM update scale_factor normalise FEM def xi;c close old FEM li data err FEM export data;femur_data_6 as femur_data_6 error FEM export node;fitted_femur_6 as fitted_femur_6 offset 70000 FEM export elem;fitted_femur_6 as fitted_femur_6 offset_elem 70000 FEM def no;w;fitted_femur_6 FEM def elem;w;fitted_femur_6 } ($wall_solve,$cpu_solve) = (time, cpu_time); print_timing 'solve', $wall_solve - $wall_setup, $cpu_solve - $cpu_setup; print_memory_use;
Name Modified Size
example_21d.com 29-Sep-2005 3.6k femur.ipbase 23-Aug-2002 1.5k femur.ipcoor 23-Aug-2002 688 femur.ipdata 23-Aug-2002 206k femur.ipelem 23-Aug-2002 147k femur.ipfit 13-Apr-2007 3.8k femur.ipnode 23-Aug-2002 393k femur.ippara 28-Sep-2005 5.9k femur_2.ipfit 13-Apr-2007 15k
Name Modified Size
examples_2_21_21d.tar.gz 27-Aug-2010 815k
Status | Tested | Real time (s) | |
hpc_cm64_irix | Success | Thu Apr 1 14:19:18 2004 | 358 |
hpc_cm_irix | Success | Fri Jul 29 01:54:39 2005 | 309 |
hpc_cmo64_irix | Success | Thu Apr 1 14:16:51 2004 | 201 |
hpc_cmo_irix | Success | Sun Jul 31 01:48:17 2005 | 166 |
rs6000-aix | |||
cm | Success | Wed Mar 4 01:19:50 2009 | 21 |
cm-debug | Success | Mon Mar 2 01:40:41 2009 | 176 |
cm64 | Success | Wed Mar 4 01:20:06 2009 | 23 |
cm64-debug | Success | Tue Mar 3 01:46:57 2009 | 192 |
x86_64-linux | |||
cm | Success | Sun Mar 6 00:01:22 2016 | 6 |
cm-debug | Success | Sat Mar 5 00:05:16 2016 | 27 |
Success | hpc_cm64_irix: | cmiss_test.log.retain. | |
Success | hpc_cm_irix: | cmiss_test.log.retain. | |
Success | hpc_cmo64_irix: | cmiss_test.log.retain. | |
Success | hpc_cmo_irix: | cmiss_test.log.retain. | |
rs6000-aix | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
Success | cm64: | cmiss_test.log.retain. | |
Success | cm64-debug: | cmiss_test.log.retain. | |
x86_64-linux | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. |
Success | hpc_cm64_irix: | ndiff test: no significant differences with generic answer. |
Success | hpc_cm_irix: | ndiff test: no significant differences with generic answer. |
Success | hpc_cmo64_irix: | ndiff test: no significant differences with generic answer. |
Success | hpc_cmo_irix: | 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. |
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:50:10 2016
Input last modified: Thu Aug 26 13:09:40 2010