Example 992: Initial example for compressible tissue with contact plate


The comfile run by this example is as follows:

#Example_992  Preliminary compressible mechanics plus CONTACT for lung example.

if (! defined $example) {
    $example = "./";
}
# Drop off the trailing / in the example path
$chopped = chop $example;
if ($chopped ne "/") {
    $example .= $chopped;
}

#$solve_contact = 0;

$solve_contact = 1;

$tissue_region = 1;
$plate_region = 2;

$mechanics_class = 1;

if ($solve_contact==1) {
  $contact_stiffness=10000;
}


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

# define bases function
fem def bases;r;TriCubic_Vol;example;
fem def;add bases;r;BiCubic_Surface;example;
fem def;add bases;r;Pressure;example;
fem def;add bases;r;TriLinear_Vol;example;
fem def;add bases;r;BiLinear_Surface;example;

# define a cube in region $tissue_region
fem def nodes;r;cubeRefined;example region $tissue_region;
fem def elem;r;cubeRefined;example region $tissue_region;
fem def fibr;d region $tissue_region;
fem def elem;d fibre region $tissue_region;

# groups for applying BCs
fem group elements all s1=0 external as s1_0 reg $tissue_region;
fem group elements all s1=1 external as s1_1 reg $tissue_region;
fem group elements all s2=0 external as s2_0 reg $tissue_region;
fem group elements all s2=1 external as s2_1 reg $tissue_region;
fem group elements all s3=0 external as s3_0 reg $tissue_region;
fem group elements all s3=1 external as s3_1 reg $tissue_region;
fem group nodes xi1=0 external element s1_0 as xi1_0 reg $tissue_region;
fem group nodes xi1=1 external element s1_1 as xi1_1 reg $tissue_region;
fem group nodes xi2=0 external element s2_0 as xi2_0 reg $tissue_region;
fem group nodes xi2=1 external element s2_1 as xi2_1 reg $tissue_region;
fem group nodes xi3=0 external element s3_0 as xi3_0 reg $tissue_region;
fem group nodes xi3=1 external element s3_1 as xi3_1 reg $tissue_region;

# export cube
fem export node;cube as cube region $tissue_region;
fem export elem;cube as cube region $tissue_region;

if ($solve_contact==1) {
# define a plate in region $plate_region
  fem def nodes;r;plate;example region $plate_region;
  fem def elem;r;plate;example region $plate_region;
  fem def fibr;d region $plate_region;
  fem def elem;d fibre region $plate_region;

# overlap plate with cube
  fem change node translate by 0,0,0.2 region $plate_region;

# export plate
  fem export node;plate as plate region $plate_region;
  fem export elem;plate as plate region $plate_region;
}

# set up mechanics problem (slave)
if ($solve_contact==1) {
  fem def equa;r;Lee_Comp_fluid_contact;example region $tissue_region class $mechanics_class;  # use compressible + fluid + contact
} else {
  fem def equa;r;Lee_Comp_fluid;example region $tissue_region class $mechanics_class;  # use compressible + fluid
}
fem def mate;r;Lee;example region $tissue_region class $mechanics_class;  # use Lee's strain energy function
#fem def init;r;cube8elements_contact_displ region $tissue_region class $mechanics_class;
fem def init;r;cube8elements_contact_force;example region $tissue_region class $mechanics_class;
fem def solv;r;newton;example reg $tissue_region class $mechanics_class;

# watch deformation
fem def window;c on xy;
fem def window;c on xz;
fem draw lines region $tissue_region,$plate_region;
refresh graphics;

if ($solve_contact==1) {
# set up equation for plate (master)
  fem def equa;r;plate;example region $plate_region;
  fem def mate;r;plate;example region $plate_region;
  fem def init;r;plate;example region $plate_region;

# set up the coupled contact solution method
  fem def solve;r;contact;example coupled region $tissue_region,$plate_region;

  $CONVERGED=0;
  while ($CONVERGED==0) 
  {
######################################Projection

#   copy current configuration from YP(ny,1) into XP
    fem update geom from sol YP_index 1 to 1..3 region $tissue_region,$plate_region;

#   set contact Xi points on specified faces as 8x8 points of the DEFORMABLE BODY
#    fem def xi;c contact_points faces 5 points 8 region $tissue_region; #1x1x1 cube
    fem def xi;c contact_points faces 5,10,15,19 points 8 region $tissue_region; #2x2x2 cube

#   define data at xi positions of the DEFORMABLE BODY
    fem def data;c from_xi;

#   update slave info to DEFORMABLE BODY
    fem update data field to slave;

#   project contact points onto target face of MASTER/TARGET/RIGID BODY
#   MAKE SURE CORRECT CONTACT FACE NUMBERS ARE SELECTED!!
#    fem def xi;c closest_face faces 12 region $plate_region; #1x1x1 cube
    fem def xi;c closest_face faces 42 region $plate_region; #2x2x2 cube

#   store projection gap in data fields of MASTER/TARGET/RIGID BODY
    fem update data field from gap region $plate_region;

#   export data projection
    fem export data;projection as projection error offset 10000;

#   update master info
    fem update data field to master;

#   place undeformed geometry from YP(ny,3) back into XP
    fem update geom from sol YP_index 3 to 1..3 region $tissue_region,$plate_region;
#####################################Mechanics problem

#   solve finite elasticity/contact problem
    fem solve error 0.001 iterate 20 coupled AUGMENTATIONS 0 CONTACT_STIFFNESS $contact_stiffness TIED_STIFFNESS 0.0 region $tissue_region,$plate_region class $mechanics_class;

    fem draw lines deformed dot region $tissue_region,$plate_region;
    refresh graphics;
  } #while

} else {
  fem solve increment 1 iterate 20 error 0.001 class $mechanics_class;
  fem draw lines deformed dot region $tissue_region,$plate_region;
  refresh graphics;
}

fem export node;cube_deformed as cube_deformed field region $tissue_region;
fem export elem;cube_deformed as cube_deformed field region $tissue_region;
fem list elem deform total region $tissue_region basis 1;

Files used by this example are:

Name                                  Modified     Size

example_992.com 28-Feb-2005 5.6k BiCubic_Surface.ipbase 09-Aug-2004 1.5k BiLinear_Surface.ipbase 09-Aug-2004 1.1k BiLinear_Surface.ipmesh 09-Aug-2004 1.3k Lee.ipmate 09-Aug-2004 9.8k Lee_Comp_fluid.ipequa 09-Aug-2004 1.9k Lee_Comp_fluid_contact.ipequa 29-Sep-2004 2.1k Pressure.ipbase 09-Aug-2004 1.1k TriCubic_Vol.ipbase 09-Aug-2004 1.9k TriLinear_Vol.ipbase 09-Aug-2004 1.4k contact.ippara 09-Aug-2004 5.9k contact.ipregi 09-Aug-2004 93 contact.irsolv 16-Aug-2010 2.6k contact.irsolv.old 13-Apr-2007 2.4k cube.exelem 09-Aug-2004 23k cube.exnode 09-Aug-2004 22k cube8elements_contact_displ.ipinit 09-Aug-2004 2.7k cube8elements_contact_force.ipinit 09-Aug-2004 4.0k cubeRefined.ipelem 09-Aug-2004 3.6k cubeRefined.ipnode 09-Aug-2004 48k cube_deformed.exelem 09-Aug-2004 23k cube_deformed.exnode 29-Sep-2004 22k draw.com 09-Aug-2004 216 newton.ipsolv 16-Aug-2010 2.2k newton.ipsolv.old 13-Apr-2007 2.1k plate.exelem 09-Aug-2004 6.4k plate.exnode 09-Aug-2004 2.8k plate.ipelem 09-Aug-2004 536 plate.ipequa 29-Sep-2004 2.2k plate.ipinit 09-Aug-2004 1.4k plate.ipmate 09-Aug-2004 2.3k plate.ipnode 09-Aug-2004 2.2k projection.exdata 29-Sep-2004 25k solve_cube8_contact_compressible.com 09-Aug-2004 5.2k

Download the entire example:

Name                      Modified     Size

examples_9_99_992.tar.gz 17-Aug-2010 33k

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

Input last modified: Mon Aug 16 11:11:30 2010


CMISS Help / Examples / 9 / 99 / 992