Example d41: FFD mechanics of complete gait cycle

This example illustrates FFD mechanics of a complete gait cycle

Problem setup Solution
Fig. 1 Problem setup Fig. 2 Solution


The comfile run by this example is as follows:


##################################################################
# This example illustrates FFD-mechanics over the full gait 
# cycle for a healthy subject. It includes the lower limb bones
# (foot, femur, tibia and hip) and the semimembranosus and 
# gastrocnemius muscles embedded in host meshes.
# It solves in two steps, (i) a rigid body rotation and (ii)
# finite elasticity to account for deformation while using 
# tied contact to ensure that the attachment points are conserved.
# Due to simulation time, this example only solves for the 
# first 3 load steps.
##################################################################

# get input arguments
$input_file1 = "$example/new_cmiss_rot_tra.txt";

# Open input file1
CORE::open (file1,$input_file1) or die "Error opening ";

################################################

fem def para;r;new;example 
fem def region;r;new;example 
fem def coord 3,1

fem def base;r;bicubic_linear_tricubic;example 

$REG=1;

################ muscle host MESHES ################
# host_list 

@host_list = ('gastrocnemius','semimembranosus');
foreach $component(@host_list)
{ 
# Host mesh
if($REG==1){fem def node;r;new_hgt;example region $REG}
if($REG==2){fem def node;r;new_hsm;example region $REG}
#fem def node;r;host_$component region $REG 
fem def element;r;host_$component;example region $REG

fem up node der 1 linear reg $REG
fem up node der 2 linear reg $REG
fem up node der 3 linear reg $REG
fem update scale_factors normalise reg $REG

if($REG==2){fem group elements 7001,7005 as TEN reg $REG}
if($REG==2){fem group elements 7002..7004 as MUSCLE reg $REG}
if($REG==2){fem group nodes 7001..7004,7009..7028 as FREE reg $REG}

if($REG==1){fem group elements 8001,8002,8005 as TEN2 reg $REG}
if($REG==1){fem group elements 8003,8004 as MUSCLE2 reg $REG}
if($REG==1){fem group nodes 8001,8004,8006..8007,8034..8036,8038,8048..8049,8053..8054,8072,8076,8078..8079,8098,8102..8103,8113,8115,8117,8119,8129 as FREE2 reg $REG}

fem def fibre;r;host_$component;example region $REG
fem def elem;r;host_$component;example fibre region $REG

fem def field;r;host_$component;example region $REG
fem def elem;r;host_$component;example field region $REG

#fem exp nodes;host_zero_$component as host_$component region $REG;
#fem exp elem;host_zero_$component as host_$component region $REG;

# host 
fem def equa;r;host_$component;example reg $REG
fem def mate;r;host_$component;example reg $REG
#fem def init;r;host_$component reg $REG

$REG=$REG+1;
}

################ bone MESHES ################ 

# bone_list 
@bone_list = ('femur','tibia','hip','foot');
foreach $component(@bone_list)
{ 
# Read in bone
fem def node;r;start_$component;example region $REG 
fem def element;r;start_$component;example region $REG

# slight adjustment for hip
if($REG==5){fem change nodes translate by 0,0,-15 reg $REG}

# Field 
fem def field;r;simulate_$component;example region $REG 
fem def elem;r;simulate_$component;example field region $REG 

# Export initial bone
#fem exp nodes;initial_$component as $component region $REG
#fem exp elem;initial_$component as $component region $REG

# put initial geometry into fields 1,2,3
fem update field 1 reg $REG subst geometry x reg $REG;
fem update field 2 reg $REG subst geometry y reg $REG;
fem update field 3 reg $REG subst geometry z reg $REG;
fem update field 4 reg $REG subst geometry x reg $REG;
fem update field 5 reg $REG subst geometry y reg $REG;
fem update field 6 reg $REG subst geometry z reg $REG;
fem update field 7 reg $REG subst geometry x reg $REG;
fem update field 8 reg $REG subst geometry y reg $REG;
fem update field 9 reg $REG subst geometry z reg $REG;

$REG=$REG+1;
}

################ SLAVE_muscles MESH ################ 


# muscle_list
@muscle_list = ('gastrocnemius','semimembranosus')
foreach $component(@muscle_list)
{ 
# Read in muscle
fem def node;r;start_$component;example region $REG
fem def element;r;start_$component;example region $REG

# Field 
fem def field;r;simulate_$component;example region $REG
fem def elem;r;simulate_$component;example field region $REG

# Export initial muscle
#fem exp nodes;initial_$component as $component region $REG
#fem exp elem;initial_$component as $component region $REG

# slave
fem def equa;r;simulate_$component;example reg $REG
fem def mate;r;simulate_$component;example reg $REG
fem def init;r;simulate_$component;example reg $REG

# put initial geometry into fields 1,2,3
fem update field 1 reg $REG subst geometry x reg $REG;
fem update field 2 reg $REG subst geometry y reg $REG;
fem update field 3 reg $REG subst geometry z reg $REG;
fem update field 4 reg $REG subst geometry x reg $REG;
fem update field 5 reg $REG subst geometry y reg $REG;
fem update field 6 reg $REG subst geometry z reg $REG;
fem update field 7 reg $REG subst geometry x reg $REG;
fem update field 8 reg $REG subst geometry y reg $REG;
fem update field 9 reg $REG subst geometry z reg $REG;

#if($REG==7){fem def xi;c nodes contain of $REG in 1 loose by 1000}
#if($REG==7){fem def xi;w;$component nodes contain of $REG in 1}
#if($REG==8){fem def xi;c nodes contain of $REG in 2 loose by 1000}
#if($REG==8){fem def xi;w;$component nodes contain of $REG in 2}

$REG=$REG+1;
}

#######################################

fem def solve;r;contact;example reg 1,2

# Load steps
#for ($j=1;$j<57;$j++) # full gait cycle
for ($j=1;$j<4;$j++) # first 3 load steps
{
# Read in next set of angles
$li = <file1>;
@compnew = split(/\s+/,$li); 

# transformation for tibia
fem change nodes rotate by $compnew[0] about 0,0,0 axis 1,0,0 reg 4
fem change nodes rotate by $compnew[1] about 0,0,0 axis 0,1,0 reg 4
fem change nodes rotate by $compnew[2] about 0,0,0 axis 0,0,1 reg 4
fem change nodes translate by $compnew[3],$compnew[4],$compnew[5] reg 4
# Export new tibia
#fem exp nodes;tibia_$j as tibia region 4
#fem exp elem;tibia_$j as tibia region 4

# transformation for femur
fem change nodes rotate by $compnew[6] about 0,0,0 axis 1,0,0 reg 3
fem change nodes rotate by $compnew[7] about 0,0,0 axis 0,1,0 reg 3
fem change nodes rotate by $compnew[8] about 0,0,0 axis 0,0,1 reg 3
fem change nodes translate by $compnew[9],$compnew[10],$compnew[11] reg 3
# Export new femur
#fem exp nodes;femur_$j as femur region 3
#fem exp elem;femur_$j as femur region 3

# transformation for hip
fem change nodes rotate by $compnew[12] about 0,0,0 axis 1,0,0 reg 5
fem change nodes rotate by $compnew[13] about 0,0,0 axis 0,1,0 reg 5
fem change nodes rotate by $compnew[14] about 0,0,0 axis 0,0,1 reg 5
fem change nodes translate by $compnew[15],$compnew[16],$compnew[17] reg 5
# Export new hip
#fem exp nodes;hip_$j as hip region 5
#fem exp elem;hip_$j as hip region 5

# transformation for foot
fem change nodes rotate by $compnew[18] about 0,0,0 axis 1,0,0 reg 6
fem change nodes rotate by $compnew[19] about 0,0,0 axis 0,1,0 reg 6
fem change nodes rotate by $compnew[20] about 0,0,0 axis 0,0,1 reg 6
fem change nodes translate by $compnew[21],$compnew[22],$compnew[23] reg 6
# Export new foot
#fem exp nodes;foot_$j as foot region 6
#fem exp elem;foot_$j as foot region 6

# Update muscle in host and export
fem list nodes nodes 8001 reg 1
fem update field 1 reg 1 subst geometry x reg 1;
fem update field 2 reg 1 subst geometry y reg 1;
fem update field 3 reg 1 subst geometry z reg 1;
fem list nodes nodes 8001 reg 1
fem update geometry x reg 1 subst field 4 reg 1
fem update geometry y reg 1 subst field 5 reg 1
fem update geometry z reg 1 subst field 6 reg 1
fem def xi;r;gastrocnemius;example nodes contain of 7 in 1 reg 7
fem update mesh position fit of 7 in 1
#fem exp nodes;gastrocnemius_$j as gastrocnemius region 7
fem list nodes nodes 8001 reg 1
fem update geometry x reg 1 subst field 1 reg 1
fem update geometry y reg 1 subst field 2 reg 1
fem update geometry z reg 1 subst field 3 reg 1
fem list nodes nodes 8001 reg 1
fem update field 4 reg 1 subst geometry x reg 1;
fem update field 5 reg 1 subst geometry y reg 1;
fem update field 6 reg 1 subst geometry z reg 1;

# Update muscle in host and export
fem list nodes nodes 7001 reg 2
fem update field 1 reg 2 subst geometry x reg 2;
fem update field 2 reg 2 subst geometry y reg 2;
fem update field 3 reg 2 subst geometry z reg 2;
fem list nodes nodes 7001 reg 2
fem update geometry x reg 2 subst field 4 reg 2
fem update geometry y reg 2 subst field 5 reg 2
fem update geometry z reg 2 subst field 6 reg 2
fem def xi;r;semimembranosus;example nodes contain of 8 in 2 reg 8
fem update mesh position fit of 8 in 2
#fem exp nodes;semimembranosus_$j as semimembranosus reg 8
fem list nodes nodes 7001 reg 2
fem update geometry x reg 2 subst field 1 reg 2
fem update geometry y reg 2 subst field 2 reg 2
fem update geometry z reg 2 subst field 3 reg 2
fem list nodes nodes 7001 reg 2
fem update field 4 reg 2 subst geometry x reg 2;
fem update field 5 reg 2 subst geometry y reg 2;
fem update field 6 reg 2 subst geometry z reg 2;

if ($j>1)
{
# Rotate gastroc_host same as tibia
fem change nodes rotate by $compnew[0] about 0,0,0 axis 1,0,0 reg 1
fem change nodes rotate by $compnew[1] about 0,0,0 axis 0,1,0 reg 1
fem change nodes rotate by $compnew[2] about 0,0,0 axis 0,0,1 reg 1
fem change nodes translate by $compnew[3],$compnew[4],$compnew[5] reg 1
}

if ($j>1)
{
# Rotate semimem_host same as femur
fem change nodes rotate by $compnew[6] about 0,0,0 axis 1,0,0 reg 2
fem change nodes rotate by $compnew[7] about 0,0,0 axis 0,1,0 reg 2
fem change nodes rotate by $compnew[8] about 0,0,0 axis 0,0,1 reg 2
fem change nodes translate by $compnew[9],$compnew[10],$compnew[11] reg 2
}

fem update solution from geometry substitute reg 1,2

#Bottom of SM
#SM Faces:
#8469,8473,8476,8479
#Tibia Faces:
#2955,2958

#Top of SM
#SM Faces:
#8457,8461,8464,8467
#Hip Faces:
#3051,3055,3076,3080

#Top of SM-host nodes
#Nodes:
#7001..7004,7021..7024

#Bottom of SM-host nodes
#Nodes:
#7017..7020,7025..7028

#Bottom of GT
#GT Faces:
#7997,8002,8007,8012,8016,8020,8025,8030
#Foot Faces:
#3534,3560

#Top of GT
#GT Faces:
#8330,8334,8337,8341,8390,8395,8400,8403
#Femur Faces:
#440,444,448,496,499,504,508,512,560,563

#Top of GT-host nodes
#Nodes:
#8001,8004,8006..8007,8034..8036,8038

#Bottom of GT-host nodes
#Nodes:
#8072,8076,8078..8079,8098,8102..8103,8113,8115,8117,8119,8129


# Now solve for top of SM

fem group nodes 7001..7004,7009..7028 as FREE reg 2
fem group nodes 7017..7020,7025..7028 as FIXED reg 2
fem def init;r;host_semimembranosus;example reg 2

# define contact parameters
fem def contact;r;contact;example

fem def solve;r;contact;example reg 1,2

#$CONVERGED=0;
#while ($CONVERGED==0) 
for ($z=1;$z<6;$z++)
{

######################################################contact setup

# Faces at top of GT : 8457,8461,8464,8467
fem def xi;c contact_tied faces 8457,8461,8464,8467 points 4 reg 8

# Define data at xi positions 
fem def data;c from_xi reg 8
# Calculate xi in slave host
#fem def xi;c closest reg 2
fem def xi;r;topSM;example reg 2

# Update slave info
fem update data field to slave reg 2

# Project onto target face (master surface)
#fem def xi;c closest_face external reg 5
fem def xi;r;topSM_target;example closest_face external reg 5
fem list xi reg 5

# store projection gap in data fields
fem update data field from gap reg 8  

# Update master info
fem update data field to master reg 5

######################################################solve

# Place initial geometry YP(ny,3) into XP
FEM up geom from sol YP_index 3 to 1..3 reg 2
fem solve error 0.1 iterate 15 reg 2
# update XP from YP
FEM up geom from sol to 1..3 reg 2


# Update muscle in host and export
fem list nodes nodes 7001 reg 2
fem update field 1 reg 2 subst geometry x reg 2;
fem update field 2 reg 2 subst geometry y reg 2;
fem update field 3 reg 2 subst geometry z reg 2;
fem list nodes nodes 7001 reg 2
fem update geometry x reg 2 subst field 4 reg 2
fem update geometry y reg 2 subst field 5 reg 2
fem update geometry z reg 2 subst field 6 reg 2
fem def xi;r;semimembranosus;example nodes contain of 8 in 2 reg 8
fem update mesh position fit of 8 in 2
#fem exp nodes;semimembranosus_$j as semimembranosus reg 8
fem list nodes nodes 7001 reg 2
fem update geometry x reg 2 subst field 1 reg 2
fem update geometry y reg 2 subst field 2 reg 2
fem update geometry z reg 2 subst field 3 reg 2
fem list nodes nodes 7001 reg 2
fem update field 4 reg 2 subst geometry x reg 2;
fem update field 5 reg 2 subst geometry y reg 2;
fem update field 6 reg 2 subst geometry z reg 2;

}

# Export SM host
fem exp nodes;host_semimembranosus_$j as host_semimembranosus reg 2

	
# Update muscle in host and export
fem list nodes nodes 7001 reg 2
fem update field 1 reg 2 subst geometry x reg 2;
fem update field 2 reg 2 subst geometry y reg 2;
fem update field 3 reg 2 subst geometry z reg 2;
fem list nodes nodes 7001 reg 2
fem update geometry x reg 2 subst field 4 reg 2
fem update geometry y reg 2 subst field 5 reg 2
fem update geometry z reg 2 subst field 6 reg 2
fem def xi;r;semimembranosus;example nodes contain of 8 in 2 reg 8
fem update mesh position fit of 8 in 2
#fem exp nodes;semimembranosus_$j as semimembranosus reg 8
fem list nodes nodes 7001 reg 2
fem update geometry x reg 2 subst field 1 reg 2
fem update geometry y reg 2 subst field 2 reg 2
fem update geometry z reg 2 subst field 3 reg 2
fem list nodes nodes 7001 reg 2
fem update field 4 reg 2 subst geometry x reg 2;
fem update field 5 reg 2 subst geometry y reg 2;
fem update field 6 reg 2 subst geometry z reg 2;


# Now solve for bottom of SM

fem group nodes 7001..7004,7009..7028 as FREE reg 2
fem group nodes 7001..7004,7021..7024 as FIXED reg 2
fem def init;r;host_semimembranosus;example reg 2

fem def solve;r;contact;example reg 1,2


#$CONVERGED=0;
#while ($CONVERGED==0) 
for ($z=1;$z<6;$z++)
{

######################################################contact setup

# Faces at bottom of GT : 8469,8473,8476,8479
fem def xi;c contact_tied faces 8469,8473,8476,8479 points 4 reg 8

# Define data at xi positions 
fem def data;c from_xi reg 8
# Calculate xi in slave host
#fem def xi;c closest reg 2
fem def xi;r;bottomSM;example reg 2

# Update slave info
fem update data field to slave reg 2

# Project onto target face (master surface)
fem group faces 2955,2958 as TARGET reg 4
#fem def xi;c closest_face faces TARGET reg 4
fem def xi;r;bottomSM_target;example closest_face faces TARGET reg 4
fem list xi reg 4

# store projection gap in data fields
fem update data field from gap reg 8  

# Update master info
fem update data field to master reg 4

######################################################solve

# Place initial geometry YP(ny,3) into XP
FEM up geom from sol YP_index 3 to 1..3 reg 2
fem solve error 0.1 iterate 15 reg 2
# update XP from YP
FEM up geom from sol to 1..3 reg 2

# Update muscle in host and export
fem list nodes nodes 7001 reg 2
fem update field 1 reg 2 subst geometry x reg 2;
fem update field 2 reg 2 subst geometry y reg 2;
fem update field 3 reg 2 subst geometry z reg 2;
fem list nodes nodes 7001 reg 2
fem update geometry x reg 2 subst field 4 reg 2
fem update geometry y reg 2 subst field 5 reg 2
fem update geometry z reg 2 subst field 6 reg 2
fem def xi;r;semimembranosus;example nodes contain of 8 in 2 reg 8
fem update mesh position fit of 8 in 2
#fem exp nodes;semimembranosus_$j as semimembranosus reg 8
fem list nodes nodes 7001 reg 2
fem update geometry x reg 2 subst field 1 reg 2
fem update geometry y reg 2 subst field 2 reg 2
fem update geometry z reg 2 subst field 3 reg 2
fem list nodes nodes 7001 reg 2
fem update field 4 reg 2 subst geometry x reg 2;
fem update field 5 reg 2 subst geometry y reg 2;
fem update field 6 reg 2 subst geometry z reg 2;

}

# Export SM host
#fem exp nodes;host_semimembranosus_$j as host_semimembranosus reg 2

# Update muscle in host and export
fem list nodes nodes 7001 reg 2
fem update field 1 reg 2 subst geometry x reg 2;
fem update field 2 reg 2 subst geometry y reg 2;
fem update field 3 reg 2 subst geometry z reg 2;
fem list nodes nodes 7001 reg 2
fem update geometry x reg 2 subst field 4 reg 2
fem update geometry y reg 2 subst field 5 reg 2
fem update geometry z reg 2 subst field 6 reg 2
fem def xi;r;semimembranosus;example nodes contain of 8 in 2 reg 8
fem update mesh position fit of 8 in 2
#fem exp nodes;semimembranosus_$j as semimembranosus reg 8
fem list nodes nodes 7001 reg 2
fem update geometry x reg 2 subst field 1 reg 2
fem update geometry y reg 2 subst field 2 reg 2
fem update geometry z reg 2 subst field 3 reg 2
fem list nodes nodes 7001 reg 2
fem update field 4 reg 2 subst geometry x reg 2;
fem update field 5 reg 2 subst geometry y reg 2;
fem update field 6 reg 2 subst geometry z reg 2;

# Now solve for top of GT

fem group nodes 8001,8004,8006..8007,8034..8036,8038,8048..8049,8053..8054,8072,8076,8078..8079,8098,8102..8103,8113,8115,8117,8119,8129 as FREE2 reg 1
fem group nodes 8072,8076,8078..8079,8098,8102..8103,8113,8115,8117,8119,8129 as FIXED2 reg 1
fem def init;r;host_gastrocnemius;example reg 1
fem def solve;r;contact;example reg 1,2

#$CONVERGED=0;
#while ($CONVERGED==0) 
for ($z=1;$z<6;$z++)
{

######################################################contact setup

# Faces at top of GT : 8330,8334,8337,8341,8390,8395,8400,8403
fem def xi;c contact_tied faces 8330,8334,8337,8341,8390,8395,8400,8403 points 4 reg 7

# Define data at xi positions 
fem def data;c from_xi reg 7
# Calculate xi in slave host
#fem def xi;c closest reg 1
fem def xi;r;topGT;example reg 1

# Update slave info
fem update data field to slave reg 1

# Project onto target face (master surface)
fem group faces 440,444,448,496,499,504,508,512,560,563 as TARGET reg 3
#fem def xi;c closest_face faces TARGET reg 3
fem def xi;r;topGT_target;example closest_face faces TARGET reg 3
fem list xi reg 3

# store projection gap in data fields
fem update data field from gap reg 7  

# Update master info
fem update data field to master reg 3

######################################################solve

# Place initial geometry YP(ny,3) into XP
FEM up geom from sol YP_index 3 to 1..3 reg 1
fem solve error 0.1 iterate 15 reg 1
# update XP from YP
FEM up geom from sol to 1..3 reg 1

# Update muscle in host and export
fem list nodes nodes 8001 reg 1
fem update field 1 reg 1 subst geometry x reg 1;
fem update field 2 reg 1 subst geometry y reg 1;
fem update field 3 reg 1 subst geometry z reg 1;
fem list nodes nodes 8001 reg 1
fem update geometry x reg 1 subst field 4 reg 1
fem update geometry y reg 1 subst field 5 reg 1
fem update geometry z reg 1 subst field 6 reg 1
fem def xi;r;gastrocnemius;example nodes contain of 7 in 1 reg 7
fem update mesh position fit of 7 in 1
#fem exp nodes;gastrocnemius_$j as gastrocnemius region 7
fem list nodes nodes 8001 reg 1
fem update geometry x reg 1 subst field 1 reg 1
fem update geometry y reg 1 subst field 2 reg 1
fem update geometry z reg 1 subst field 3 reg 1
fem list nodes nodes 8001 reg 1
fem update field 4 reg 1 subst geometry x reg 1;
fem update field 5 reg 1 subst geometry y reg 1;
fem update field 6 reg 1 subst geometry z reg 1;

}

# Export GT host
fem exp nodes;host_gastrocnemius_$j as host_gastrocnemius reg 1

# Update muscle in host and export
fem list nodes nodes 8001 reg 1
fem update field 1 reg 1 subst geometry x reg 1;
fem update field 2 reg 1 subst geometry y reg 1;
fem update field 3 reg 1 subst geometry z reg 1;
fem list nodes nodes 8001 reg 1
fem update geometry x reg 1 subst field 4 reg 1
fem update geometry y reg 1 subst field 5 reg 1
fem update geometry z reg 1 subst field 6 reg 1
fem def xi;r;gastrocnemius;example nodes contain of 7 in 1 reg 7
fem update mesh position fit of 7 in 1
#fem exp nodes;gastrocnemius_$j as gastrocnemius region 7
fem list nodes nodes 8001 reg 1
fem update geometry x reg 1 subst field 1 reg 1
fem update geometry y reg 1 subst field 2 reg 1
fem update geometry z reg 1 subst field 3 reg 1
fem list nodes nodes 8001 reg 1
fem update field 4 reg 1 subst geometry x reg 1;
fem update field 5 reg 1 subst geometry y reg 1;
fem update field 6 reg 1 subst geometry z reg 1;


# Now solve for bottom of GT

fem group nodes 8001,8004,8006..8007,8034..8036,8038,8048..8049,8053..8054,8072,8076,8078..8079,8098,8102..8103,8113,8115,8117,8119,8129 as FREE2 reg 1
fem group nodes 8001,8004,8006..8007,8034..8036,8038 as FIXED2 reg 1
fem def init;r;host_gastrocnemius;example reg 1
fem def solve;r;contact;example reg 1,2

#$CONVERGED=0;
#while ($CONVERGED==0) 
for ($z=1;$z<6;$z++)
{

######################################################contact setup

# Faces at bottom of GT : 7997,8002,8007,8012,8016,8020,8025,8030
fem def xi;c contact_tied faces 7997,8002,8007,8012,8016,8020,8025,8030 points 4 reg 7

# Define data at xi positions 
fem def data;c from_xi reg 7
# Calculate xi in slave host
#fem def xi;c closest reg 1
fem def xi;r;bottomGT;example reg 1

# Update slave info
fem update data field to slave reg 1

# Project onto target face (master surface)
fem group faces 3534,3560 as TARGET reg 6
#fem def xi;c closest_face faces TARGET reg 6
fem def xi;r;bottomGT_target;example closest_face faces TARGET reg 6
fem list xi reg 6

# store projection gap in data fields
fem update data field from gap reg 7  

# Update master info
fem update data field to master reg 6

######################################################solve

# Place initial geometry YP(ny,3) into XP
FEM up geom from sol YP_index 3 to 1..3 reg 1
fem solve error 0.1 iterate 15 reg 1
# update XP from YP
FEM up geom from sol to 1..3 reg 1

# Update muscle in host and export
fem list nodes nodes 8001 reg 1
fem update field 1 reg 1 subst geometry x reg 1;
fem update field 2 reg 1 subst geometry y reg 1;
fem update field 3 reg 1 subst geometry z reg 1;
fem list nodes nodes 8001 reg 1
fem update geometry x reg 1 subst field 4 reg 1
fem update geometry y reg 1 subst field 5 reg 1
fem update geometry z reg 1 subst field 6 reg 1
fem def xi;r;gastrocnemius;example nodes example contain of 7 in 1 reg 7
fem update mesh position fit of 7 in 1
#fem exp nodes;gastrocnemius_$j as gastrocnemius region 7
fem list nodes nodes 8001 reg 1
fem update geometry x reg 1 subst field 1 reg 1
fem update geometry y reg 1 subst field 2 reg 1
fem update geometry z reg 1 subst field 3 reg 1
fem list nodes nodes 8001 reg 1
fem update field 4 reg 1 subst geometry x reg 1;
fem update field 5 reg 1 subst geometry y reg 1;
fem update field 6 reg 1 subst geometry z reg 1;

}

# Export GT host
#fem exp nodes;host_gastrocnemius_$j as host_gastrocnemius reg 1

# Update muscle in host and export
fem list nodes nodes 8001 reg 1
fem update field 1 reg 1 subst geometry x reg 1;
fem update field 2 reg 1 subst geometry y reg 1;
fem update field 3 reg 1 subst geometry z reg 1;
fem list nodes nodes 8001 reg 1
fem update geometry x reg 1 subst field 4 reg 1
fem update geometry y reg 1 subst field 5 reg 1
fem update geometry z reg 1 subst field 6 reg 1
fem def xi;r;gastrocnemius;example nodes contain of 7 in 1 reg 7
fem update mesh position fit of 7 in 1
#fem exp nodes;gastrocnemius_$j as gastrocnemius region 7
fem list nodes nodes 8001 reg 1
fem update geometry x reg 1 subst field 1 reg 1
fem update geometry y reg 1 subst field 2 reg 1
fem update geometry z reg 1 subst field 3 reg 1
fem list nodes nodes 8001 reg 1
fem update field 4 reg 1 subst geometry x reg 1;
fem update field 5 reg 1 subst geometry y reg 1;
fem update field 6 reg 1 subst geometry z reg 1;

# Update scale factors so will equal arc-lengths
fem update scale_factors normalise reg 7,8
#fem list lines;lines_$j 

}
# Close the files.
CORE::close file1;

# Mesh line information
# GT muscle Lines:
# 8429,8711,8718,8725,8732
# GT tendon Lines:
# 8292,8337,8370,8397,8674,8683,8690,8697,8704
# SM muscle Lines:
# 8843..8846
# SM tendon Lines:
# 8842,8847




Additional testing commands:



Files used by this example are:

Name                              Modified     Size

example_d41.com 23-Apr-2008 23k FARO.ippara 21-Feb-2008 6.0k FARO.ipregi 15-Nov-2004 93 GT.gp 15-Nov-2004 394 GT_muscle.fig 15-Nov-2004 2.8k GT_muscle.txt 15-Nov-2004 1.8k GT_muscle_norm.txt 15-Nov-2004 0 GT_tendon.fig 15-Nov-2004 2.8k GT_tendon.txt 15-Nov-2004 1.8k GT_tendon_norm.txt 15-Nov-2004 0 GT_total.eps 15-Nov-2004 11k GT_total.fig 15-Nov-2004 3.5k GT_total.txt 15-Nov-2004 1.7k SM.gp 15-Nov-2004 378 SM_muscle.fig 15-Nov-2004 3.1k SM_muscle.txt 15-Nov-2004 1.8k SM_muscle_norm.txt 15-Nov-2004 0 SM_tendon.fig 15-Nov-2004 2.8k SM_tendon.txt 15-Nov-2004 1.8k SM_tendon_norm.txt 15-Nov-2004 0 SM_total.eps 15-Nov-2004 11k SM_total.fig 15-Nov-2004 3.9k SM_total.txt 15-Nov-2004 1.8k bicubic_linear_tricubic.ipbase 15-Nov-2004 11k bottomGT.ipxi 15-Nov-2004 10k bottomGT_target.ipxi 15-Nov-2004 11k bottomSM.ipxi 15-Nov-2004 5.4k bottomSM_target.ipxi 15-Nov-2004 5.7k cmiss_rot_tra.txt 15-Nov-2004 18k contact.ipcont 25-Sep-2008 628 contact.ipdata 15-Nov-2004 46k contact.ipsolv 16-Aug-2010 5.4k contact.ipsolv.old 13-Apr-2007 5.0k contact.ipxi 15-Nov-2004 36k contact.irsolv 16-Aug-2010 5.4k contact.irsolv.old 13-Apr-2007 5.0k contact_slave.ipxi 15-Nov-2004 36k contact_target.ipxi 15-Nov-2004 38k femur_host.ipelfd 15-Nov-2004 709 femur_host.ipfiel 15-Nov-2004 5.7k gait_cycle.com 15-Nov-2004 368 gastrocnemius.ipxi 15-Nov-2004 14k geom_gas.txt 15-Nov-2004 1.8k geom_semi.txt 15-Nov-2004 1.8k hamstring_host.ipelfb 15-Nov-2004 944 hamstring_host.ipelfd 15-Nov-2004 1.9k hamstring_host.ipfibr 15-Nov-2004 25k hamstring_host.ipfiel 15-Nov-2004 75k hamstring_host.ipmate 15-Nov-2004 7.6k host_gastrocnemius.ipelem 15-Nov-2004 2.6k host_gastrocnemius.ipelfb 15-Nov-2004 1.5k host_gastrocnemius.ipelfd 15-Nov-2004 3.1k host_gastrocnemius.ipequa 15-Nov-2004 2.2k host_gastrocnemius.ipfibr 15-Nov-2004 37k host_gastrocnemius.ipfiel 15-Nov-2004 114k host_gastrocnemius.ipinit 15-Nov-2004 5.0k host_gastrocnemius.ipmate 15-Nov-2004 7.5k host_gastrocnemius.ipnode 15-Nov-2004 22k host_hamstring.ipelem 15-Nov-2004 625 host_hamstring.ipequa 15-Nov-2004 2.0k host_hamstring.ipinit 15-Nov-2004 5.0k host_hamstring.ipmate 15-Nov-2004 7.6k host_hamstring.ipnode 15-Nov-2004 2.2k host_semimembranosus.ipelem 15-Nov-2004 2.6k host_semimembranosus.ipelfb 15-Nov-2004 1.5k host_semimembranosus.ipelfd 15-Nov-2004 3.1k host_semimembranosus.ipequa 15-Nov-2004 2.2k host_semimembranosus.ipfibr 15-Nov-2004 37k host_semimembranosus.ipfiel 15-Nov-2004 114k host_semimembranosus.ipinit 15-Nov-2004 5.0k host_semimembranosus.ipmate 15-Nov-2004 7.5k host_semimembranosus.ipnode 15-Nov-2004 22k host_semitendinosus.ipelfb 15-Nov-2004 1.2k host_semitendinosus.ipelfd 15-Nov-2004 2.5k host_semitendinosus.ipequa 15-Nov-2004 2.2k host_semitendinosus.ipfibr 15-Nov-2004 31k host_semitendinosus.ipfiel 15-Nov-2004 93k host_semitendinosus.ipinit 15-Nov-2004 5.0k host_semitendinosus.ipmate 15-Nov-2004 7.6k mesh_semitendinosus.ipelem 15-Nov-2004 18k mesh_semitendinosus.ipnode 15-Nov-2004 44k muscle_arc_length.pl 15-Nov-2004 3.2k new.ippara 21-Feb-2008 6.1k new.ipregi 15-Nov-2004 93 new2_hgt.ipnode 15-Nov-2004 45k new_GT.ipnode 15-Nov-2004 162k new_SM.ipnode 15-Nov-2004 32k new_cmiss_rot_tra.txt 15-Nov-2004 18k new_hgt.ipnode 15-Nov-2004 45k new_hsm.ipnode 15-Nov-2004 45k semimembranosus.ipelem 15-Nov-2004 10k semimembranosus.ipnode 15-Nov-2004 32k semimembranosus.ipxi 15-Nov-2004 2.9k semimembranosus_muscle.txt 15-Nov-2004 1.1k semimembranosus_tendon.txt 15-Nov-2004 1.1k semitendinosus.ipxi 15-Nov-2004 4.2k semitendinosus_muscle.txt 15-Nov-2004 0 semitendinosus_tendon.txt 15-Nov-2004 0 simulate_femur.ipelem 15-Nov-2004 473k simulate_femur.ipelfd 15-Nov-2004 501k simulate_femur.ipfiel 15-Nov-2004 1.8M simulate_femur.ipnode 15-Nov-2004 841k simulate_foot.ipelfd 15-Nov-2004 958k simulate_foot.ipfiel 15-Nov-2004 935k simulate_gastrocnemius.ipelfd 15-Nov-2004 68k simulate_gastrocnemius.ipequa 15-Nov-2004 2.2k simulate_gastrocnemius.ipfiel 15-Nov-2004 400k simulate_gastrocnemius.ipinit 15-Nov-2004 1.0k simulate_gastrocnemius.ipmate 15-Nov-2004 5.5k simulate_hip.ipelem 15-Nov-2004 43k simulate_hip.ipelfd 15-Nov-2004 51k simulate_hip.ipfiel 15-Nov-2004 1.0M simulate_hip.ipnode 15-Nov-2004 407k simulate_semimembranosus.ipelem 15-Nov-2004 12k simulate_semimembranosus.ipelfd 15-Nov-2004 14k simulate_semimembranosus.ipequa 15-Nov-2004 2.2k simulate_semimembranosus.ipfiel 15-Nov-2004 80k simulate_semimembranosus.ipinit 15-Nov-2004 1.0k simulate_semimembranosus.ipmate 15-Nov-2004 5.5k simulate_semimembranosus.ipnode 15-Nov-2004 32k simulate_semitendinosus.ipelem 15-Nov-2004 18k simulate_semitendinosus.ipelfd 15-Nov-2004 22k simulate_semitendinosus.ipequa 15-Nov-2004 2.2k simulate_semitendinosus.ipfiel 15-Nov-2004 113k simulate_semitendinosus.ipinit 15-Nov-2004 1.0k simulate_semitendinosus.ipmate 15-Nov-2004 5.5k simulate_semitendinosus.ipnode 15-Nov-2004 46k simulate_tibia.ipelem 15-Nov-2004 96k simulate_tibia.ipelfd 15-Nov-2004 102k simulate_tibia.ipfiel 15-Nov-2004 402k simulate_tibia.ipnode 15-Nov-2004 180k start_femur.ipelem 15-Nov-2004 433k start_femur.ipnode 15-Nov-2004 734k start_foot.ipelem 15-Nov-2004 815k start_foot.ipnode 15-Nov-2004 365k start_gastrocnemius.ipelem 15-Nov-2004 58k start_gastrocnemius.ipnode 15-Nov-2004 155k start_hip.ipelem 15-Nov-2004 43k start_hip.ipnode 15-Nov-2004 407k start_semimembranosus.ipelem 15-Nov-2004 12k start_semimembranosus.ipnode 15-Nov-2004 31k start_tibia.ipelem 15-Nov-2004 88k start_tibia.ipnode 15-Nov-2004 157k static_host_gastrocnemius.ipnode 15-Nov-2004 22k target_xi.ipxi 15-Nov-2004 48k test.ipelem 15-Nov-2004 10k test.ipnode 15-Nov-2004 32k test_femur.ipelem 15-Nov-2004 473k test_femur.ipnode 15-Nov-2004 924k test_hip.ipelem 15-Nov-2004 43k test_hip.ipnode 15-Nov-2004 419k test_output.com 15-Nov-2004 0 test_tibia.ipelem 15-Nov-2004 96k test_tibia.ipnode 15-Nov-2004 203k topGT.ipxi 15-Nov-2004 10k topGT_target.ipxi 15-Nov-2004 11k topSM.ipxi 15-Nov-2004 5.4k topSM_target.ipxi 15-Nov-2004 5.8k view_gait.com 15-Nov-2004 3.4k

Download the entire example:

Name                      Modified     Size

examples_d_d4_d41.tar.gz 17-Aug-2010 1.5M

Testing status by version:

StatusTestedReal time (s)
rs6000-aix
cm64SuccessSun Mar 13 05:57:58 20051087

Testing status by file:


Html last generated: Sun Mar 6 05:51:26 2016

Input last modified: Mon Aug 16 11:35:06 2010


CMISS Help / Examples / d / d4 / d41