Example d27: Two host meshes being deformed to ensure no slave overlap

This example illustrates two host meshes being deformed to ensure no slave overlap

Before contact After contact
Fig. 1 Before contact Fig. 2 After contact


The comfile run by this example is as follows:


#####################################################
# This example illustrates two host bodies coming 
# into contact. Finite deformation mechanics is
# solved for the two hosts with constraints activated
# to ensure that the two slave bodies embedded inside
# do not overlap. This example illustrates the idea
# behind the FFD-mechanics problem. Also highlighted
# is the use of augmentations to improve the contact
# problem.
#####################################################

fem def para;r;FARO;example
fem def region;r;FARO;example
fem def coord 3,1
fem def base;r;collapsed;example

$REG=1;

################ MESHES ################

# object_list 

@object_list = ('host_one','host_two','one','two');
foreach $component(@object_list)
{ 
# Mesh
fem def node;r;$component;example region $REG 
fem def element;r;$component;example region $REG

# Align meshes
if($REG==2){fem change nodes translate by -8.5,0,0 reg $REG}
if($REG==4){fem change nodes translate by -8.5,0,0 reg $REG}

# Update node derivatives
fem update node deriv 1 linear reg $REG
fem update node deriv 2 linear reg $REG
fem update node deriv 3 linear reg $REG
fem update scale_factors normalise reg $REG

# Create node groups 
if($REG==1){fem group nodes 201,202,205,206 as PREONE reg $REG}
if($REG==1){fem group nodes 201..208 as ALLONE reg $REG}
if($REG==2){fem group nodes 103,104,107,108 as PRETWO reg $REG}
if($REG==2){fem group nodes 101..108 as ALLTWO reg $REG}

# Define fibres
fem def fibre;r;$component;example region $REG
fem def elem;r;$component;example fibre region $REG

# Define fields
fem def field;r;$component;example region $REG
fem def elem;r;$component;example field region $REG

## Export host mesh
#fem exp nodes;zero_$component as $component region $REG;
#fem exp elem;zero_$component as $component region $REG;

# Define equation, material and initial conditions
# Defining ipequa for slave bodies (reg 3&4) ensures
# they are defined as contact bodies for gap calculations
fem def equa;r;$component;example reg $REG
if($REG==1){fem def mate;r;$component;example reg $REG}
if($REG==2){fem def mate;r;$component;example reg $REG}
if($REG==1){fem def init;r;$component;example reg $REG}
if($REG==2){fem def init;r;$component;example reg $REG}

# Put initial host 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;

# Define slave xi points inside host
if($REG==3){fem def xi;c nodes contain of $REG in 1 loose}
#if($REG==3){fem def xi;w;$component nodes contain of $REG in 1}
if($REG==4){fem def xi;c nodes contain of $REG in 2 loose}
#if($REG==4){fem def xi;w;$component nodes contain of $REG in 2}

$REG=$REG+1;
}

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

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

# Define solve for two host bodies
fem def solve;r;contact;example coupled reg 1,2

# Load steps
for ($j=1;$j<11;$j++)
{
# Control step size
if ($j<5){$k=0.1}
else {$k=0.05}

# Prescribe translation step
fem change nodes translate by $k,0,0 node PREONE reg 1
fem change nodes translate by -$k,0,0 node PRETWO reg 2

# Update slave one in host and export
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 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;one;example nodes contain of 3 in 1 reg 3
fem update mesh position fit of 3 in 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 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 slave two in host and export
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 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;two;example nodes contain of 4 in 2 reg 4
fem update mesh position fit of 4 in 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 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;

fem update solution from geometry substitute reg 1,2

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

######################################################Contact setup
# Define contact points on slave one (face=16)
fem def xi;c contact faces 16 points 6 reg 3

# Define data at xi positions 
fem def data;c from_xi reg 3

# Calculate xi in slave host
fem def xi;c closest reg 1

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

# Project onto target face (master surface)
fem def xi;c closest_face faces 21 reg 4
# Store projection gap in data fields
fem update data field from gap reg 4  

# Change Master object to host
# Create data from xi points
fem def data;c from_xi reg 4

# Generate xi in host
fem def xi;c closest reg 2

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

######################################################Solve mechanics

# Place initial geometry YP(ny,3) into XP
FEM up geom from sol YP_index 3 to 1..3 reg 1,2

if ($j<7){
  fem solve error 0.01 iterate 1 coupled reg 1,2
} else {
  if ($j==7) {fem def contact;r;contact_2;example}
  fem solve error 0.01 iterate 15 coupled reg 1,2
}

# Update XP from YP
FEM up geom from sol to 1..3 reg 1,2

# Update slave one in host and export
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 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;one;example nodes contain of 3 in 1 reg 3
fem update mesh position fit of 3 in 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 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 slave two in host and export
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 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;two;example nodes contain of 4 in 2 reg 4
fem update mesh position fit of 4 in 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 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;

}

## host
#fem exp nodes;host_one_$j as host_one reg 1
#fem exp nodes;host_two_$j as host_two reg 2

# Update slave one in host and export
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 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;one;example nodes contain of 3 in 1 reg 3
fem update mesh position fit of 3 in 1
#fem exp nodes;one_$j as one region 3
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 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 slave two in host and export
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 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;two;example nodes contain of 4 in 2 reg 4
fem update mesh position fit of 4 in 2
#fem exp nodes;two_$j as two reg 4
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 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;

}

Additional testing commands:



Files used by this example are:

Name                 Modified     Size

example_d27.com 23-Apr-2008 9.0k FARO.ippara 21-Feb-2008 6.0k FARO.ipregi 29-Sep-2004 93 collapsed.ipbase 29-Sep-2004 8.7k contact.ipcont 25-Sep-2008 628 contact.ipdata 29-Sep-2004 46k contact.ipsolv 16-Aug-2010 2.7k contact.ipsolv.old 13-Apr-2007 2.5k contact.ipxi 29-Sep-2004 36k contact.irsolv 16-Aug-2010 3.0k contact.irsolv.old 13-Apr-2007 2.8k contact_2.ipcont 25-Sep-2008 625 contact_slave.ipxi 29-Sep-2004 36k contact_target.ipxi 29-Sep-2004 38k host_one.ipelem 29-Sep-2004 548 host_one.ipelfb 29-Sep-2004 400 host_one.ipelfd 29-Sep-2004 733 host_one.ipequa 29-Sep-2004 2.2k host_one.ipfibr 29-Sep-2004 12k host_one.ipfiel 29-Sep-2004 38k host_one.ipinit 29-Sep-2004 5.4k host_one.ipmate 29-Sep-2004 6.7k host_one.ipnode 29-Sep-2004 1.8k host_two.ipelem 29-Sep-2004 548 host_two.ipelfb 29-Sep-2004 400 host_two.ipelfd 29-Sep-2004 733 host_two.ipequa 29-Sep-2004 2.2k host_two.ipfibr 29-Sep-2004 12k host_two.ipfiel 29-Sep-2004 38k host_two.ipinit 29-Sep-2004 5.4k host_two.ipmate 29-Sep-2004 6.7k host_two.ipnode 29-Sep-2004 1.8k one.ipelem 29-Sep-2004 558 one.ipelfb 29-Sep-2004 400 one.ipelfd 29-Sep-2004 733 one.ipequa 29-Sep-2004 2.2k one.ipfibr 29-Sep-2004 12k one.ipfiel 29-Sep-2004 38k one.ipinit 29-Sep-2004 1.0k one.ipmate 29-Sep-2004 6.5k one.ipnode 29-Sep-2004 1.9k one.ipsolv 16-Aug-2010 2.7k one.ipsolv.old 13-Apr-2007 2.5k one.ipxi 29-Sep-2004 688 test_output.com 29-Sep-2004 0 two.ipelem 29-Sep-2004 557 two.ipelfb 29-Sep-2004 400 two.ipelfd 29-Sep-2004 733 two.ipequa 29-Sep-2004 2.2k two.ipfibr 29-Sep-2004 12k two.ipfiel 29-Sep-2004 38k two.ipinit 29-Sep-2004 1.0k two.ipmate 29-Sep-2004 6.5k two.ipnode 29-Sep-2004 1.9k two.ipsolv 16-Aug-2010 2.7k two.ipsolv.old 13-Apr-2007 2.5k two.ipxi 29-Sep-2004 688 view.com 29-Sep-2004 2.8k

Download the entire example:

Name                      Modified     Size

examples_d_d2_d27.tar.gz 17-Aug-2010 81k

Testing status by version:

StatusTestedReal time (s)
hpc_cmo64_irixSuccessSun Jul 31 02:04:43 2005358
rs6000-aix
cm64SuccessWed Mar 4 01:35:50 2009126
x86_64-linux
cmSuccessSun Mar 6 00:03:13 201659

Testing status by file:


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

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


CMISS Help / Examples / d / d2 / d27