Example 21a: Using data points to redefine deforming 2D planar mesh

This example uses data points to define the deformation of a 2D mesh. Stresses and strains are calculated based upon these deformations.

The comfile run by this example is as follows:

# Example_21a Using data points to redefine deforming 2D planar mesh

fem define node;r;datafit;example   #Define 9 nodes for initial square mesh.
fem define base;r;;example          #Define a bilinear basis function.
fem define element;r;;example       #Define 4 elements.
fem define fibre;d
fem define element;r;;example fibre
fem define field;r;;example         #Define 2 field variables.
fem define element;r;;example field #Define field elements
fem define data;r;;example          #Define 19 data points (geom only).
fem define xi;c internal            #Calculate Xi locations on initial mesh.
fem list data                       #List data x,y and Xi positions.
fem define fit;r;;example geom      #Linear fit with no constraints.
fem define window         
fem draw line                       #Draw the initial square mesh.
fem draw data trace                 #Draw Xi locations on initial mesh.
fem define data;r;datafit_def;example #Read in new data positions.
fem draw data                       #Draw new data set.
fem fit                             #Fit nodes (--> Xi points close to data pts).
fem list node                       #Note field values have new nodal positions.
#fem draw line field                 !New mesh drawn from nodal field values.

fem define equation;r;datafit;example #Define finite elasticity problem.
fem update solution field 1,2
fem list strain                     #Strain calculated from XP and ZP.   
fem draw strain vectors scale 0.1   #Strain eigenvectors.

fem update geometry from field      #This overwrites original mesh.
fem draw data trace                 #Draw Xi positions on new mesh.
fem draw data projections           #Data pts projected to new mesh.
fem list data errors                #Errors in fit.
fem draw lines
fem draw nodes
fem draw elements
fem export nodes
fem export elements

Additional testing commands:

FEM list node
FEM list data error

Files used by this example are:

Name                   Modified     Size

example_21a.com 07-Jun-2000 1.8k datafit.exelem 10-Apr-2000 3.0k datafit.exnode 10-Apr-2000 1.4k datafit.ipbase 10-Apr-2000 1.1k datafit.ipdata 10-Apr-2000 2.5k datafit.ipelem 10-Apr-2000 1.1k datafit.ipelfb 10-Apr-2000 640 datafit.ipelfd 10-Apr-2000 868 datafit.ipequa 02-May-2004 1.7k datafit.ipfiel 10-Apr-2000 1.7k datafit.ipfit 13-Apr-2007 1.7k datafit.ipnode 10-Apr-2000 1.4k datafit.ipxi 10-Apr-2000 665 datafit_def.ipdata 10-Apr-2000 2.5k example_21a.cmgui_com 10-Apr-2000 581 test_output.com 10-Apr-2000 34

Download the entire example:

Name                      Modified     Size

examples_2_21_21a.tar.gz 27-Aug-2010 7.0k

Testing status by version:

StatusTestedReal time (s)
cmSuccessSun Mar 6 00:01:37 20160
cm-debugSuccessSat Mar 5 00:01:55 20160
cmSuccessSun Aug 19 01:26:40 20074
cm-debugSuccessWed Aug 15 01:22:11 20075
cm-debug-clear-mallocSuccessSat Aug 18 01:24:22 200710
cm-debug-clear-malloc7SuccessMon Aug 20 01:23:14 20079
cm64SuccessSun Aug 19 01:28:18 20073
cm64-debugSuccessTue Aug 21 01:22:28 20076
cm64-debug-clear-mallocSuccessThu Apr 1 10:11:03 20043
cmSuccessWed Mar 4 01:06:51 20091
cm-debugSuccessMon Mar 2 01:06:15 20091
cm64SuccessWed Mar 4 01:06:51 20091
cm64-debugSuccessTue Mar 3 01:11:36 20091
cmSuccessSun Mar 6 00:01:00 20160
cm-debugSuccessSat Mar 5 00:01:12 20160

Testing status by file:

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

Input last modified: Thu Aug 26 13:06:54 2010

CMISS Help / Examples / 2 / 21 / 21a