This example shows fitting of faces in a volume mesh to a given set of data points. The Volume elements in the mesh are decomposed into faces. These faces are treated as area(2d) elements. Data points are then projected on to the faces such that the distance between a data point to the face is minimum. If the data point is within the purview of the face, the projection is 'orthogonal', otherwise it is non-orthogonal resulting the projection on to a side or on to a vertex of the face. For each face, an objective function is defined as the summation of the distances between each data point to its projection onto the face. Necessary number of linear equations are generated by differentiating the objective function wrt each nodal parameter (i.e. nodal value and derivatives of x,y and z) and equating the resulting expression to zero. In addition to this, Sobelov smoothing is also incorporated to control the arc curvature, arc length and the surface curvature of the face. Once face(element) equations are formulated, they are then assembled to give mesh (global)equations. The assembling is done to satisfy the continuity of the nodal values and nodal derivatives at the nodes common to different elements. For more details of the geometric fitting see Geometric modeling of the human torso using cubic hermite elements, Bradley et. al.
Created by : Kumar Mithraratne. Aug. 2002.
|
|
|
|
Initial Mesh RMS Error = 7.427 mm |
First Fit RMS Error = 1.400 mm Sobelov weights |
Second Fit RMS Error = 1.038 mm Sobelov weights |
Third Fit RMS Error = 0.857 mm Sobelov weights |
$object='twocube'; $off=100; $offi=1000; $offd=0; $tot_itt=3; fem def para;r;$object;example # Declares array dimensions fem def coord;r;$object;example # Defines the coordinate system fem def nodes;r;$object;example # Reads in nodal information fem def bases;r;$object;example # Defines tri-cubic Hermite basis functions fem def element;r;$object;example # Reads in element information 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;${object}_initial as ${object}_initial offset $offi fem export elem;${object}_initial as ${object}_initial offset_node $offi offset_elem $offi #fem def field;r;$object;example # Reads in field variables #fem def elem;r;$object;example field # Defines connectivity of field variables #fem update field from geometry # Updates field # Instead of using the above 3 lines to read in a predefined field # the following could be used to create is automatically. The created # field will have the same topology as the geometry. fem update field from geometry # Updates field fem def elem;d field #fem group faces 1,3..11 as FFFFF # Defines face group # The faces could also be grouped using this command which # avoids having to know what the face numbers are. fem group faces allfaces external as FFFFF # Defines face group fem def data;r;$object;example # Reads in data information fem def xi;c closest_face faces FFFFF # Projects data onto faces # only in group FFFFF. #fem def xi;w;twocube closest_face faces FFFFF # Writes out xi positions # of the projections. fem export data;${object}_initial_error error as ${object}_initial_error # Note that *.ipxi should contain DATA PT. NO., ELEM NO., LOCAL FACE NO., xi1, xi2 and xi3. fem li data error # Lists initial data error # Fitting is done iteratively. In this case three iterations. Since we do linear # fitting, after each fit, scale factors are updated which results in change # in the shape of the fitted mesh. Thus, re-projection of data points onto the # new mesh is required prior to determining the error. Also note that for each # iteration, a new *.ipfit is read in. This helps to relax the Sobelov weights # gradually. for ($fit_itt=1; $fit_itt<=$tot_itt; $fit_itt=$fit_itt+1) { fem def fit;r;${object}_${fit_itt};example geometry faces FFFFF fem fit fem update node fit fem update scale_factor normalise fem de xi;c closest_face faces FFFFF #old fem li data error system "echo ' ================' " system "echo ' ITERATION ${fit_itt} DONE' " system "echo ' ================' " } fem export data;${object}_fitted_error error as ${object}_fitted_error offset $offd fem export nodes;${object}_fitted as ${object}_fitted offset $off fem export elem;${object}_fitted as ${object}_fitted offset_node $off offset_elem $off
fem list nodes
Name Modified Size
example_21g.com 31-Mar-2005 3.0k test_output.com 15-Aug-2002 15 twocube.exdata 15-Aug-2002 42k twocube.ipbase 15-Aug-2002 4.4k twocube.ipcoor 15-Aug-2002 570 twocube.ipdata 15-Aug-2002 53k twocube.ipelem 15-Aug-2002 802 twocube.ipelfd 15-Aug-2002 682 twocube.ipfiel 15-Aug-2002 19k twocube.ipnode 15-Aug-2002 18k twocube.ippara 12-Nov-2002 5.9k twocube.ipxi 15-Aug-2002 66k twocube_1.ipfit 13-Apr-2007 1.9k twocube_2.ipfit 13-Apr-2007 1.9k twocube_3.ipfit 13-Apr-2007 1.9k twocube_fitted.exelem 15-Aug-2002 12k twocube_fitted.exnode 15-Aug-2002 15k twocube_initial.exelem 15-Aug-2002 8.7k twocube_initial.exnode 15-Aug-2002 7.8k viewfit.com 21-Mar-2005 2.5k
Name Modified Size
examples_2_21_21g.tar.gz 21-Feb-2013 111k
Status | Tested | Real time (s) | |
i686-linux | |||
cm | Success | Sun Mar 6 00:02:57 2016 | 2 |
cm-debug | Success | Sat Mar 5 00:14:22 2016 | 5 |
mips-irix | |||
cm | Success | Sun Aug 19 01:46:23 2007 | 15 |
cm-debug | Success | Wed Aug 15 01:51:14 2007 | 60 |
cm-debug-clear-malloc | Success | Sat Aug 18 02:05:50 2007 | 71 |
cm-debug-clear-malloc7 | Success | Mon Aug 20 02:07:10 2007 | 124 |
cm64 | Success | Sun Aug 19 01:47:12 2007 | 16 |
cm64-debug | Success | Tue Aug 21 01:52:06 2007 | 66 |
cm64-debug-clear-malloc | Success | Thu Apr 1 10:11:45 2004 | 33 |
rs6000-aix | |||
cm | Success | Wed Mar 4 01:09:06 2009 | 2 |
cm-debug | Success | Mon Mar 2 01:13:23 2009 | 18 |
cm64 | Success | Wed Mar 4 01:08:48 2009 | 2 |
cm64-debug | Success | Tue Mar 3 01:18:29 2009 | 20 |
x86_64-linux | |||
cm | Success | Sun Mar 6 00:01:01 2016 | 1 |
cm-debug | Success | Sat Mar 5 00:01:51 2016 | 2 |
i686-linux | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
mips-irix | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
Success | cm-debug-clear-malloc: | cmiss_test.log.retain. | |
Success | cm-debug-clear-malloc7: | cmiss_test.log.retain. | |
Success | cm64: | cmiss_test.log.retain. | |
Success | cm64-debug: | cmiss_test.log.retain. | |
Success | cm64-debug-clear-malloc: | 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. |
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. | |
Success | cm64-debug-clear-malloc: | 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. |
Html last generated: Sun Mar 6 05:50:10 2016
Input last modified: Fri Apr 13 10:31:00 2007