PARADISCYL:Test-Run

From Micro and Nano Mechanics Group
Jump to navigation Jump to search

Manual 02 for ParaDiS Cylinder Codes

How to run test simulations

This document describes the extension of the ParaDiS program that implements the cylindrical free surface boundary condition. This extension is based on Weinberger and Cai, J. Mech. Phys. Solids, 55, 2027 (2007)(PDF). The code is written by Chris Weinberger. It is owned by Chris and is not included in the standard distribution of ParaDiS. Keonwook Kang wrote the first draft of this document, which was later revised by Chris Weinberger and Wei Cai. Please read the manual of ParaDiS before reading this document.

Run a Test Case

The command line to run the ParaDiS Cylinder code is the same as that of the original ParaDiS code. See ParaDiS manual for details. The command line format is:

paradiscyl [-r <numCycles>] [-d dataFile] <controlFile>

where:

      <ctrlFile>       Specifies the name of the ParaDiS control parameter file
      -d <dataFile>       Specifies the base name of the file(s) containing the nodal data for the run. If this file name is not supplied, the code looks for a data file named the same as the control file with the file name suffix (if any) replaced with ".data"
      -r  <numCycles>       Causes the code to execute a series of <numCycles> cycles during which no force calculations or dislocation movement will occur. These cycles will be used strictly for load-balancing purposes and will be done before the normal cycles. This can be useful when a simulation is started with a uniform domain decomposition and needs time to converge on an optimal decomposition as would occur when restarting a simulation on a different number of cpus

Run the following control file, which simulates a dislocation loop inside a cylinder. You will need two input files: one is control file (concentric_loop_test.ctrl) and the other is data file (concentric_loop_test.data). Both files are shown below. See here for details about input files.

$ bin/paradiscyl runs/concentric_loop_test.ctrl

This run requires the following two input files.

concentric_loop_test.ctrl concentric_loop_test.data

If your run is successful, you should see a pop-up window as shown below.


X Window

Default X Window control parameters are given in the file inputs/paradis.xdefaults. You can change window size, line width, rotation of angles, etc by modifying this file.

The 3D View in the X Window can be manipulated by both mouse and keyboard. For example, press r (default) and then move mouse to rotate the object, press s and then move mouse to scale the object. A complete list of hot keys are given below.

YWindow: yview:
Mouse drag to rotate
Hot Keys:
F1        : display this message
Up        : rotate up
Down      : rotate down
Left      : rotate left
Right     : rotate right
PgUp      : rotate counterclockwise
PgDn      : rotate clockwise
Home      : back to initial viewpoint
Space     : stop rotate
p         : toggle pause
t         : translation
s         : scaling
d         : move projection infinity point
r         : rotation
f         : toggle pbc enableness
m         : toggle drawframe
g         : pbc glide
x         : pbc shift in x
y         : pbc shift in y
z         : pbc shift in z
w         : print window specification
F9        : output gif
F10       : output postscript

Tcl script to generate input data

In ParaDiS/tools directory, there is a tcl script create_loop_data.tcl. By typing the following commnad,

$ tools/create_loop_data.tcl

you will get the data file concentric_loop_test.data automatically. By manipulating this tcl script, you can easily create a data file for your own ParaDiS simulation.

create_loop_data.tcl

#!/usr/bin/tclsh

#Read status variable from the first argument (if any)
if { $argc == 0 } {
 set status 0
} elseif { $argc > 0 } {
 set status [lindex $argv 0]
}
puts "status = $status"

set datafile "runs/concentric_loop_test.data"
set version_number 2
set filesegments_number 1

set L 6
set cylinder_radius [expr $L/6]
set loop_rel_radius 0.8
set loop_radius [expr $cylinder_radius * $loop_rel_radius]

set xBoundMin [expr -$L/2]
set yBoundMin [expr -$L/2]
set zBoundMin [expr -$L/2]
set xBoundMax [expr  $L/2]
set yBoundMax [expr  $L/2]
set zBoundMax [expr  $L/2]

set nodes_number 50

set burg_x   1
set burg_y   0
set burg_z   0

set normal_x 0
set normal_y 0
set normal_z 1

set domainID 10

set fileID [open $datafile w]

puts $fileID "#"
puts $fileID "# ParaDiS nodal data file (by create_loop_data.tcl) "
puts $fileID "#"
puts $fileID " "
puts $fileID "#"
puts $fileID "# File version number"
puts $fileID "#"
puts $fileID " "
puts $fileID "$version_number"
puts $fileID " "
puts $fileID "#"
puts $fileID "# Number of data file segments"
puts $fileID "#"
puts $fileID " "
puts $fileID "$filesegments_number"
puts $fileID " "
puts $fileID "#"
puts $fileID "# Minimum coordinate values (x, y, z)"
puts $fileID "#"
puts $fileID ""
puts $fileID "$xBoundMin $yBoundMin $zBoundMin   "
puts $fileID " "
puts $fileID "#"
puts $fileID "# Maximum coordinate values (x, y, z)"
puts $fileID "#"
puts $fileID " "
puts $fileID "$xBoundMax $yBoundMax $zBoundMax   "
puts $fileID " "
puts $fileID "#"
puts $fileID "# Node count"
puts $fileID "#"
puts $fileID " "
puts $fileID "$nodes_number   "
puts $fileID " "
puts $fileID "#"
puts $fileID "# Domain geometry (x, y, z)"
puts $fileID "#"
puts $fileID " "
puts $fileID "1   1   1  "
puts $fileID " "
puts $fileID "#"
puts $fileID "# Domain boundaries (x, y, z)"
puts $fileID "#"
puts $fileID " "
puts $fileID "   $xBoundMin"
puts $fileID "       $yBoundMin"
puts $fileID "           $zBoundMin"
puts $fileID "           $zBoundMax"
puts $fileID "       $yBoundMax"
puts $fileID "   $xBoundMax"
puts $fileID "#"
puts $fileID "# Primary lines: node_tag, x, y, z, num_arms, constraint"
puts $fileID "# Secondary lines: arm_tag, burgx, burgy, burgz, nx, ny, nz"
puts $fileID "#"
puts $fileID "#       length in unit of burgMag"
puts $fileID " "


set minus_burg_x [expr -$burg_x]
set minus_burg_y [expr -$burg_y]
set minus_burg_z [expr -$burg_z]

set Pi 3.1415926535897931

for {set n 0} {$n < $nodes_number} {incr n 1} {
    set x [format %22.16e [expr $loop_radius*cos(2*$Pi*($n+1.0)/$nodes_number)]]
    set y [format %22.16e [expr $loop_radius*sin(2*$Pi*($n+1.0)/$nodes_number)]]
    set z 0
    set arms_number 2
    set flag 0
    set n1 [expr $n+1]    
    set n2 [expr $n-1]
    if { $n1 == $nodes_number } { set n1 0 }
    if { $n2 == -1 } { set n2 [expr $nodes_number - 1 ] }

    puts $fileID "     $domainID,$n      $x $y $z $arms_number $flag"
    puts $fileID "           $domainID,$n1      $burg_x $burg_y $burg_z   "
    puts $fileID "                       $normal_x $normal_y $normal_z"
    puts $fileID "           $domainID,$n2      $minus_burg_x $minus_burg_y $minus_burg_z   "
    puts $fileID "                       $normal_x $normal_y $normal_z"
}

close $fileID

puts "$datafile created."
puts "bye."


Problems and solutions

Cannot open shared library libgsl

If you see the error message below while trying to run ParaDiS cylinder codes,

./bin/paradiscyl: error while loading shared libraries: libgsl.so.0: cannot open
shared object file: No such file or directory

you have to specify the path to the GSL libraries. For example, let's say GSL libraries are in /usr/local/lib directory. Then, you add the following line in ~/.bash_profile

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/

and then type

source ~/.bash_profile

Error in opening input file

When ParaDiS can not locate input files, it shows the following error message.

Fatal: ReadControlFile: Error 2 opening file XXXX

You check whether you gave the correct directory or name of input files.

Overflow error

Currently, if you declare DEFS += -D_CYLMETHOD1 in makefile, ParaDiS issues the following error message.

gsl: bessel_In.c:202: ERROR: overflow
Default GSL error handler invoked.
Aborted

THIS ISSUE IS RESOLVED.

Underflow error

You seem to have old version of codes. You download the latest version or suppres the error message by inserting the following line into cylinder/gridstress.c

gsl_set_error_handler_off();

You need to include the header file at the beginning of gridstress.c.

#include <gsl/gsl_errno.h>

Notes