Example 21h: Face-fitting in volume elements with collapsed nodes

This example illustrates face-fitting of a volume element which has collapsed nodes (top two nodes). Figure 2 depicts the fitted mesh with single version for the derivatives of the collapsed nodes. The fitted mesh shown in the figure 3 has multiple versions for the derivatives of the collpased nodes. Currently CMISS is capable of face-fitting in volume meshes containing nodes collapsed at any xi location (xi1=0.0, xi1=1.0 ... etc.) and in any xi directions.
Note how the derivatives of the collapsed nodes with multiple versions are fixed in the *.ipfit files and see the note in the com file.

Created by: Kumar Mithraratne Aug. 2002.

Fig. 1 Initial Mesh.


RMS Error = 9.97 mm

FIg. 2 Fitted Mesh with out multiple versions for collapsed nodes.

RMS Error = 1.95 mm

Fig. 3 Fitted mesh with multiple versions for collapsed nodes.

RMS Error = 1.18 mm


The comfile run by this example is as follows:

$name = 'collapse';
$tot_itt=2;
$off=1000;
$offi=100;
$offd=0

fem def para;r;${name};example          # Declares array dimensions 
fem def coord;r;${name};example         # Defines the coordinate system
fem def base;r;${name}_cubic;example    # Reads in nodal information
fem def node;r;${name}_version;example  # Defines tri-cubic Hermite basis funcs.
fem def elem;r;${name}_version;example

fem update nodes derivative 1 linear;   # Updates the derivatives in all three
fem update nodes derivative 2 linear;   # xi directions
fem update nodes derivative 3 linear;   #

fem export node;${name}_initial as ${name}_initial offset $offi;
fem export elem;${name}_initial as ${name}_initial offset_node $offi offset_elem $offi;

fem def field;r;${name}_version;example      # Reads in field variables
fem def elem;r;${name}_version;example field # Defines connectivity of fld. var.
fem update field from geometry               # Updates field 

fem group faces 1,2,3,4,5 as FFFFF           # Defines face group

fem def data;r;${name};example          # Reads in data information

fem def xi;c closest_face search_start 3 faces FFFFF   
# Projects data onto faces, the search_start N option controls the number
# of faces that will be searched to find the closest. The faces to
# be searched are chosen by measuring the distance from the data point
# to a seed point or points on every face then the closest N are used
# to do an orthogonal projection and the closest one of those is
# selected. It is done this way because it is computationally more
# efficient to measure the distance to a point on the face than it is
# to do an orthogonal projection. For this small example problem it's
# not an issue but for larger meshes it could be.
# The number of faces to include in the search can be specfied using the
# search_start option and number of seed points to use (actually the number
# you specify is the square root of the no of seed points)  
# can be specified using the seed_points option. However using too many 
# seed points can be slower than using a large search_start value. It may
# take a bit of trial and error to figure out the best combination. The
# brute force "can't fail" approach is to make the search value equal
# to the number of faces in the problem then the command will attempt
# an orthogonal projection onto every face and will choose the closest.

#fem def xi;w;${name} closest_face faces FFFFF   # only in group FFFFF.
fem li data error;                              # Writes out xi positions

fem export data;${name}_initial_error error as ${name}_initial_error

for ($fit_itt=1; $fit_itt<=$tot_itt; $fit_itt=$fit_itt+1)
  {
   # Note that the node position and Xi1 derivative are fixed in the ipfit
   # file. This means that the collapsed Xi1 line, connecting nodes 5 and 6
   # does not get fitted. If either of these is unfixed then the positions
   # and Xi1 derivatives for each version are not consistent and the mesh
   # has "holes" in it. Fixing none of the fit variables causes cm to crash.
   fem def fit;r;${name}_${fit_itt};example geometry faces FFFFF
   fem fit
   fem update node fit
   fem update scale_factor normalise
   fem def xi;c closest_face search_start 3 faces FFFFF #old

   system "echo ' ======================================================' "    
   fem li data error
   system "echo ' ITERATION ${fit_itt} DONE' "
   system "echo ' ======================================================' "
  }
fem export data;${name}_fitted_error error as ${name}_fitted_error offset $offd 
fem export nodes;${name}_fitted as ${name}_fitted offset $off;
fem export elem;${name}_fitted as ${name}_fitted offset_node $off offset_elem $off;

Additional testing commands:

fem list nodes

Files used by this example are:

Name                       Modified     Size

example_21h.com 09-Apr-2005 3.6k collapse.exdata 16-Aug-2002 21k collapse.ipcoor 16-Aug-2002 570 collapse.ipdata 16-Aug-2002 26k collapse.ippara 12-Nov-2002 5.9k collapse.ipxi 16-Aug-2002 33k collapse_1.ipfit 13-Apr-2007 8.0k collapse_2.ipfit 13-Apr-2007 8.0k collapse_cubic.ipbase 16-Aug-2002 4.4k collapse_fitted.exelem 16-Aug-2002 9.6k collapse_fitted.exnode 16-Aug-2002 11k collapse_initial.exelem 16-Aug-2002 6.1k collapse_initial.exnode 16-Aug-2002 5.7k collapse_nover_1.ipfit 13-Apr-2007 1.8k collapse_nover_2.ipfit 13-Apr-2007 1.8k collapse_noversion.ipelem 16-Aug-2002 404 collapse_noversion.ipelfd 16-Aug-2002 389 collapse_noversion.ipfiel 16-Aug-2002 10k collapse_noversion.ipnode 16-Aug-2002 9.5k collapse_version.ipelem 16-Aug-2002 1.3k collapse_version.ipelfd 16-Aug-2002 1.2k collapse_version.ipfiel 16-Aug-2002 14k collapse_version.ipnode 16-Aug-2002 13k test_output.com 16-Aug-2002 15 viewfit.com 21-Mar-2005 2.6k

Download the entire example:

Name                      Modified     Size

examples_2_21_21h.tar.gz 14-Apr-2007 84k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:01:39 20161
cm-debugSuccessSat Mar 5 00:08:21 20163
mips-irix
cmSuccessSun Aug 19 01:37:42 20079
cm-debugSuccessWed Aug 15 01:36:56 200730
cm-debug-clear-mallocSuccessSat Aug 18 01:48:36 200742
cm-debug-clear-malloc7SuccessMon Aug 20 01:43:41 200739
cm64SuccessSun Aug 19 01:38:19 200710
cm64-debugSuccessTue Aug 21 01:36:54 200732
cm64-debug-clear-mallocSuccessThu Apr 1 10:11:59 200414
rs6000-aix
cmSuccessWed Mar 4 01:08:47 20091
cm-debugSuccessMon Mar 2 01:10:44 20099
cm64SuccessWed Mar 4 01:08:00 20092
cm64-debugSuccessTue Mar 3 01:15:27 200911
x86_64-linux
cmSuccessSun Mar 6 00:01:01 20161
cm-debugSuccessSat Mar 5 00:01:40 20162

Testing status by file:


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

Input last modified: Fri Apr 13 10:31:03 2007


CMISS Help / Examples / 2 / 21 / 21h