PARADISCYL:Test-Run: Difference between revisions
m (→X Window) |
No edit summary |
||
| (7 intermediate revisions by one other user not shown) | |||
| Line 4: | Line 4: | ||
<DIV> |
<DIV> |
||
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)([http://micro.stanford.edu/~caiwei/papers/Weinberger07jmps-image.pdf PDF]). The code is written by Chris Weinberger |
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)([http://micro.stanford.edu/~caiwei/papers/Weinberger07jmps-image.pdf PDF]). The code is written by Chris Weinberger and Wei Cai 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. Questions on this document should be addressed to [[Chris Weinberger]]. Please read the manual of ParaDiS before reading this document. |
||
== Run a Test Case == |
== Run a Test Case == |
||
| Line 55: | Line 55: | ||
-------- |
-------- |
||
== X Window == |
== X Window Control == |
||
Default X Window '''control parameters''' are given in the file '''inputs/paradis.xdefaults'''. |
Default X Window '''control parameters''' are given in the file '''inputs/paradis.xdefaults'''. |
||
| Line 92: | Line 92: | ||
---- |
---- |
||
== Tcl script to generate |
== Tcl script to generate input data == |
||
The input data file '''concentric_loop_test.data''' is generated by the tcl script[[media:create_loop_data.tcl.txt | create_loop_data.tcl]] in the ParaDiS/tools directory, which can run by typing |
|||
$ tools/create_loop_data.tcl |
$ tools/create_loop_data.tcl |
||
You can easily modify this tcl script to change the resulting input dislocation structure, such as the radius of the dislocation loop. |
|||
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 |
|||
<pre> |
|||
#!/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." |
|||
</pre> |
|||
---- |
---- |
||
| Line 238: | Line 106: | ||
=== Cannot open shared library libgsl === |
=== Cannot open shared library libgsl === |
||
Sometimes the code may compile successfully but throws the following error message when you try to run it. |
|||
./bin/paradiscyl: error while loading shared libraries: libgsl.so.0: cannot open |
./bin/paradiscyl: error while loading shared libraries: libgsl.so.0: cannot open |
||
shared object file: No such file or directory |
shared object file: No such file or directory |
||
you |
This means you need to specify the path to the GSL libraries, which are dynamically linked to the executable. For example, if your GSL library files are located in /usr/local/lib, then you can add the following line in your '''~/.bash_profile''' file |
||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ |
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ |
||
| Line 253: | Line 121: | ||
When ParaDiS can not locate input files, it shows the following error message. |
When ParaDiS can not locate input files, it shows the following error message. |
||
Fatal: ReadControlFile: Error 2 opening file XXXX |
Fatal: ReadControlFile: Error 2 opening file XXXX |
||
Check whether you gave the correct path for your input file. |
|||
<!-- |
|||
=== Overflow error === |
=== Overflow error === |
||
| Line 261: | Line 130: | ||
Default GSL error handler invoked. |
Default GSL error handler invoked. |
||
Aborted |
Aborted |
||
Do not use method 1 temporarily. |
|||
THIS ISSUE IS RESOLVED. |
THIS ISSUE IS RESOLVED. |
||
--> |
|||
=== Underflow error === |
=== Underflow error === |
||
In the old version of Cylinder code, you may get an underflow error message. This can be avoided by downloading the latest version or by inserting the following line into '''cylinder/gridstress.c''' |
|||
gsl_set_error_handler_off(); |
gsl_set_error_handler_off(); |
||
You need to include the header file at the beginning of '''gridstress.c'''. |
You also need to include the following header file at the beginning of '''gridstress.c'''. |
||
#include <gsl/gsl_errno.h> |
#include <gsl/gsl_errno.h> |
||
Latest revision as of 17:02, 27 October 2008
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 and Wei Cai 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. Questions on this document should be addressed to Chris Weinberger. 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 Control
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
The input data file concentric_loop_test.data is generated by the tcl script create_loop_data.tcl in the ParaDiS/tools directory, which can run by typing
$ tools/create_loop_data.tcl
You can easily modify this tcl script to change the resulting input dislocation structure, such as the radius of the dislocation loop.
Problems and solutions
Sometimes the code may compile successfully but throws the following error message when you try to run it.
./bin/paradiscyl: error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory
This means you need to specify the path to the GSL libraries, which are dynamically linked to the executable. For example, if your GSL library files are located in /usr/local/lib, then you can add the following line in your ~/.bash_profile file
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
Check whether you gave the correct path for your input file.
Underflow error
In the old version of Cylinder code, you may get an underflow error message. This can be avoided by downloading the latest version or by inserting the following line into cylinder/gridstress.c
gsl_set_error_handler_off();
You also need to include the following header file at the beginning of gridstress.c.
#include <gsl/gsl_errno.h>