Example 211: 2D line element fitted to rectangular cartesian data

Fits a single linear element to 8 data points using iterative linear finite element fitting. The data points are recalculated after each fit to maintain orthogonal projections.

Shown below are the initial and the final fitted mesh. The dark blue pluses represent the data points, the dashed black lines the orthogonal projections and the cyan circles the xi positions on the mesh.

Intial_Mesh Final_Mesh


The comfile run by this example is as follows:

# Example_211 2D line element fitted to rectangular cartesian data


fem de node;r;test;example        #2 nodes
fem de base;r;test;example        #linear 1D basis
fem de elem;r;test;example        #1 element
fem de fiel;r;test;example        #create field positions for fitted coords
fem de elem;r;test;example field  #basis for field is linear
fem de data;r;test;example        #8 data points
fem li data                       #data points only
fem de wind
fem dr line
fem dr node
fem dr data
fem de xi;c close                 #find Xi coords by projecting onto closest element
fem li data                       #note elements & Xi locations now defined
fem dr data trace                 #show Xi positions
fem dr data projection            #draw projections
fem up field from geom            #put initial geom into field positions

fem de fit;r;test;example geom    #all Q's defaulted so both geom vars in one fitting problem
fem li fit                        #note one fitting problem with both x & y included

Additional testing commands:




#
#----- 1st fit -----
#
fem fit 
fem up node fit        #puts fitted nodes in field position into coord position
fem dr node            #show new node coords
fem dr line
fem dr data trace      
fem dr data projection #then try zooming in. 
#                      !Note that the projections are no longer orthogonal

#
#----- 2nd fit -----
#
fem de xi;c close old  #recalculate Xi positions but use old ones as starting point
fem dr data trace      
fem dr data projection #the projections are again orthogonal

fem fit 

fem up node fit        
fem dr node            
fem dr line
fem dr data trace      
fem dr data projection #then try zooming in. 
#                      !Note that the projections are closer to orthogonal

fem li data err


Files used by this example are:

Name             Modified     Size

example_211.com 25-Jul-2001 1.0k test.ipbase 25-Jul-2001 893 test.ipdata 25-Jul-2001 899 test.ipelem 25-Jul-2001 332 test.ipelfd 25-Jul-2001 278 test.ipfiel 25-Jul-2001 680 test.ipfit 13-Apr-2007 1.7k test.ipnode 25-Jul-2001 603 test_output.com 25-Jul-2001 748

Download the entire example:

Name                      Modified     Size

examples_2_21_211.tar.gz 27-Aug-2010 7.5k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:01:37 20160
cm-debugSuccessSat Mar 5 00:01:54 20161
mips-irix
cmSuccessSun Aug 19 01:23:06 20073
cm-debugSuccessWed Aug 15 01:21:33 20075
cm-debug-clear-mallocSuccessSat Aug 18 01:26:20 20078
cm-debug-clear-malloc7SuccessMon Aug 20 01:20:39 20079
cm64SuccessSun Aug 19 01:24:27 20073
cm64-debugSuccessTue Aug 21 01:19:16 20075
cm64-debug-clear-mallocSuccessThu Apr 1 10:10:55 20043
rs6000-aix
cmSuccessWed Mar 4 01:06:50 20090
cm-debugSuccessMon Mar 2 01:06:04 20091
cm64SuccessWed Mar 4 01:06:50 20090
cm64-debugSuccessTue Mar 3 01:11:34 20091
x86_64-linux
cmSuccessSun Mar 6 00:01:00 20160
cm-debugSuccessSat Mar 5 00:01:11 20160

Testing status by file:


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

Input last modified: Thu Aug 26 13:00:07 2010


CMISS Help / Examples / 2 / 21 / 211