PARADISCYL:How-To-Install: Difference between revisions

From Micro and Nano Mechanics Group
Jump to navigation Jump to search
(Chris Edited a few things including removing all references to "BEM")
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<H1 ALIGN="CENTER"><FONT SIZE="-1">Manual 01 for ParaDiS Cylinder Codes</FONT>
<H1 ALIGN="CENTER"><FONT SIZE="-1">Manual 01 for ParaDiS Cylinder Codes</FONT>
<BR>
<br> <br>
How to install and complie</H1>
How to install</H1>
<DIV>
<DIV>


This document describes the extension of the [http://paradis.stanford.edu 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 [[Overview of ParaDiS 2.2 | manual of ParaDiS]] before reading this document.
<P ALIGN="CENTER"><STRONG>Keonwook Kang and Wei Cai</STRONG></P>
</DIV>
<P ALIGN="CENTER">Original date : [[ Oct 1 ]], [[2008]]</P>
<P ALIGN="CENTER">Latest update on [[ Oct 1 ]], [[2008]]</P>
<P>
<BR><HR>
<!--Table of Child-Links-->


----
== Overview ==
TBD


== Library Requirements ==
We recommend that you read [[Overview of ParaDiS 2.2 | the manual of public ParaDiS codes]] beforehand.


Even though the standard ParaDiS distribution can be compiled and run on parallel computers, the cylinder extension currently can run only in serial. To compile the code, you need GNU scientific libraries ('''libgsl''' and '''libgslcblas''') and DFT library ('''libfftw3'''). The code should compile on Linux workstations. Preferably we should use the intel compiler '''icc''' but you may also try to compile it with '''gcc'''. Free evaluation verion of intel compilers can be downloaded from the [http://www.intel.com/cd/software/products/asmo-na/eng/compilers/284132.htm Intel Software Network Site].
----


'''libgsl and libgslcblas'''
== Prerequisite ==
For serial mode, GNU scientific libraries ('''libgsl''' and '''libgslcblas''') and DFT library ('''libfftw3''') are sufficient to run ParaDiS in general linux PC. You will additionally need intel compilers to compile with '''icc''' instead of '''gcc'''. You can download free evaluation verion of intel compilers from [http://www.intel.com/cd/software/products/asmo-na/eng/compilers/284132.htm Intel Software Network Site].


The GNU Scientific library can be downloaded at http://www.gnu.org/software/gsl/. It can be installed by the following commands.
=== libgsl and libgslcblas ===
GNU Scientific library can be downloaded at http://www.gnu.org/software/gsl/.
Install gsl library by the following procedures.


# mv ./gsl-1.9.tar.gz /usr/local/src/
# mv ./gsl-1.9.tar.gz /usr/local/src/
Line 34: Line 24:
# make install
# make install


The libraries will be installed at /usr/local/lib/.
This will intall the gsl libraries will be installed at /usr/local/lib/.


=== libfftw3 ===
'''libfftw3'''

C subroutine library for computing the discrete Fourier transform (DFT). Download from [http://www.fftw.org/ FFTW home page]. To install the library, run the following commands.
The image stress calculation requires the use of discrete Fourier transform (DFT). In particular, we will use the Fastest Fourier Transform in the West (FFTW), the standard in DFT programs, provided by the [http://www.fftw.org/ FFTW] library, which can be installed by the following commands.


# mv ./fftw-3.1.2.tar.gz /usr/local/src/
# mv ./fftw-3.1.2.tar.gz /usr/local/src/
Line 47: Line 38:
# make install
# make install


libfftw3.a and libfftw3.la will be installed at /usr/local/lib/.
This will install library files libfftw3.a and libfftw3.la in /usr/local/lib/.
----
----


== Download ==
== Compile ==
Download the latest ParaDiS codes from micro repository site using subversion checkout command.


First, you need to download the standard ParaDiS distribution from http://paradis.stanford.edu . The cylinder code, however, is in the cylinder/ subdirectory that is not included in the standard ParaDiS distribution. If you have the cylinder code, go to the cylinder/ subdirectory.
<pre>
$ mkdir ParaDiS
$ svn co https://micro.stanford.edu/svn/ParaDiS ./ParaDiS
</pre>


$ cd ParaDiS/cylinder
Note that this version of ParaDiS has branched out from the public ParaDiS codes v.2.2 downloadable from the
[http://paradis.stanford.edu official site]. You see there are extra subdirectories such as '''aniso''', '''cylinder''', '''halfspace''', '''matlab''', '''thinfilm''' and '''fem''' in this version of ParaDiS codes. Each subdirectory contains additional source codes for its own purpose. For example, source codes in '''cylinder''' directory enable to run ParaDiS simulation of dislocations inside cylindrical geometry taking account of the image stress and Yoffe stress.


This directory contains a '''makefile''', which also make references to the standard makefiles '''../makefile.sys''' and '''../makefile.setup''' in the parent directory.
----


'''makefile.sys''' defines system-dependent compilers and compiling options for different systems such as ''linux'', ''aix'', etc. The pre-defined system types and their descriptions are listed at the beginning of the '''makefile.sys''' file.
== MAKE ==
Move into '''cylinder''' subdirectory.


In '''makefile.setup''', you can select various 'make' settings, some of which are explained below.
$ cd ParaDiS/cylinder


::;SYS : select system type. you can use '''SYS = linux'''
There is a make description file, '''makefile''',
::;MODE : set serial or parallel mode. you need to use '''MODE = SERIAL'''
at the top of which, it includes '''../makefile.sys''' and '''../makefile.setup''' from the upper directory.
::;XLIB_MODE : enable or disable xwindow plotting capability. you can use '''XLIB_MODE = ON'''
::;OPT : define optimization level. you can use '''OPT = -O3'''


In '''makefile''', there is an important macro '''DEFS'''. The cylinder codes behave differently depending on how '''DEFS''' is defined.
'''makefile.sys''' defines system-dependent compilers and compiling options for different systems such as ''linux'', ''aix'', etc. The pre-defined system types and their descriptions are listed in the head of '''makefile.sys''' file.


::;DEFS += -D_CYL : Needs to be included to activate cylinder specific functions.
In '''makefile.setup''' file, you can select various 'make' settings and switches, some of which are explained below.
::;DEFS += -D_NOBEMSTRESS : Disables the calculation of the general image stress by our spectral methods. This is a misnomer, there is no boundary element method (BEM) involved
::;DEFS += -D_NOYOFFESTRESS : Disables the Yoffe Image Stress. See Modelling Simul. Mater. Sci. Eng. 14, 1139 (2006) ([http://micro.stanford.edu/~caiwei/papers/Tang06msmse-hybrid.pdf PDF])
::;DEFS += -D_NULLCYLSTRESS : Ignore all image stress calculations (including BEM, Yoffe, Virtual segment contributions).
::;DEFS += -D_NOVIRTUALSEG : No force contribution from virtual segments. Do not use this flag unless you are absolutely sure you know what you are doing!
::;DEFS += -D_CYLMETHOD1 : If defined, analytic expressions using Bessel functions are used for image stress calculation. If not, the Greens function method is used to compute image stress. . <ref>For details of each method, refer C. R. Weinberger and Wei Cai, '''Computing Image Stress in an Elastic Cylinder''', ''Journal of the Mechanics and Physics of Solids'','''55''' (2007) 2027--2054 ([http://micro.stanford.edu/~caiwei/papers/Weinberger07jmps-image.pdf PDF]) </ref>
::;DEFS += -D_WRITENODEFORCE : If defined, code will write nodal force data in '''force.out''' file after the first nodal force evaluation and immediately exit. Each line of the file contains nodal position ''x'', ''y'', ''z'' and nodal force ''f''<sub>x</sub>, ''f''<sub>y</sub> and ''f''<sub>z</sub>.
::;DEFS += -D_PRINTCYLSTRESS : If defined, code will write nodal force data in '''force.out''' and stress field in '''stress.out''' files. Each line of '''stress.out''' contains grid position ''r'', ''&#952;'', ''z'' and stress components ''&#963;''<sub>11</sub>, ''&#963;''<sub>22</sub>, ''&#963;''<sub>33</sub>, ''&#963;''<sub>23</sub>, ''&#963;''<sub>31</sub>, ''&#963;''<sub>12</sub>.


<!--
::;SYS : select system type. ''ex''. '''SYS = linux'''
::;MODE : set serial or parallel mode. ''ex''. '''MODE = SERIAL'''
::;XLIB_MODE : enable or disable xwindow plotting capability. ''ex''. '''XLIB_MODE = ON'''
::;OPT : define optimization level. ''ex''. '''OPT = -O3'''


THIS ISSUE IS RESOLVED!!!
In '''makefile''', there is important macro '''DEFS'''. The cylinder codes behave differently depending on how '''DEFS''' is defined.


Note that currently defining '''DEFS += -D_CYLMETHOD1''' will generate the following error. The issue will be figured out soon. Until that moment, comment out the corresponding line in makefile.
::;DEFS += -D_CYL : Needs to be included for cylinder codes.
::;DEFS += -D_NOBEMSTRESS : No boundary image stress will be considered.
::;DEFS += -D_NOYOFFESTRESS : No Yoffe stress will be considered.
::;DEFS += -D_NULLCYLSTRESS : Ignore all image stress. (BEM, Yoffe, Virtual seg.(??))
::;DEFS += -D_NOVIRTUALSEG : No force contribution from virtual segments.(??)
::;DEFS += -D_CYLMETHOD1 : If defined, grid stress is used for image stress calculation. If not, Green stress is used.<ref>For details of each method, refer C. R. Weinberger and Wei Cai, '''Computing Image Stress in an Elastic Cylinder''', ''Journal of the Mechanics and Physics of Solids'','''55''' (2007) 2027--2054</ref>
::;DEFS += -D_WRITENODEFORCE : Will write nodal force data in '''force.out''' file. Each line of the file contains nodal position ''x'', ''y'', ''z'' and nodal force ''f''<sub>x</sub>, ''f''<sub>y</sub> and ''f''<sub>z</sub>.
::;DEFS += -D_PRINTCYLSTRESS : Will write nodal force in '''force.out''' and stress in '''stress.out''' files. Each line of '''stress.out''' contains grid position ''r'', ''&#952;'', ''z'' and stress components ''&#963;''<sub>11</sub>, ''&#963;''<sub>22</sub>, ''&#963;''<sub>33</sub>, ''&#963;''<sub>12</sub>, ''&#963;''<sub>23</sub>, ''&#963;''<sub>31</sub>. (??)


gsl: bessel_In.c:202: ERROR: overflow
Depending on your need, you can selectively define '''DEFS''' macro.
Default GSL error handler invoked.
Aborted
-->


To compile, type
You can make the executible file, '''paradiscyl''' by simply typing


$ make
$ make


and you will see '''paradiscyl''' in the directory ../bin/.
and executable file '''paradiscyl''' should appear in the directory ../bin/.


----
----

Latest revision as of 18:02, 25 October 2008

Manual 01 for ParaDiS Cylinder Codes

How to install

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.


Library Requirements

Even though the standard ParaDiS distribution can be compiled and run on parallel computers, the cylinder extension currently can run only in serial. To compile the code, you need GNU scientific libraries (libgsl and libgslcblas) and DFT library (libfftw3). The code should compile on Linux workstations. Preferably we should use the intel compiler icc but you may also try to compile it with gcc. Free evaluation verion of intel compilers can be downloaded from the Intel Software Network Site.

libgsl and libgslcblas

The GNU Scientific library can be downloaded at http://www.gnu.org/software/gsl/. It can be installed by the following commands.

# mv ./gsl-1.9.tar.gz /usr/local/src/
# cd /usr/local/src
# tar -zxvf gsl-1.9.tar.gz
# cd gsl-1.9
# ./configure
# make
# make install

This will intall the gsl libraries will be installed at /usr/local/lib/.

libfftw3

The image stress calculation requires the use of discrete Fourier transform (DFT). In particular, we will use the Fastest Fourier Transform in the West (FFTW), the standard in DFT programs, provided by the FFTW library, which can be installed by the following commands.

# mv ./fftw-3.1.2.tar.gz /usr/local/src/
# cd /usr/local/src
# tar -zxvf fftw-3.1.2.tar.gz
# cd fftw-3.1.2
# ./configure
# make 
# make install

This will install library files libfftw3.a and libfftw3.la in /usr/local/lib/.


Compile

First, you need to download the standard ParaDiS distribution from http://paradis.stanford.edu . The cylinder code, however, is in the cylinder/ subdirectory that is not included in the standard ParaDiS distribution. If you have the cylinder code, go to the cylinder/ subdirectory.

$ cd ParaDiS/cylinder

This directory contains a makefile, which also make references to the standard makefiles ../makefile.sys and ../makefile.setup in the parent directory.

makefile.sys defines system-dependent compilers and compiling options for different systems such as linux, aix, etc. The pre-defined system types and their descriptions are listed at the beginning of the makefile.sys file.

In makefile.setup, you can select various 'make' settings, some of which are explained below.

SYS
select system type. you can use SYS = linux
MODE
set serial or parallel mode. you need to use MODE = SERIAL
XLIB_MODE
enable or disable xwindow plotting capability. you can use XLIB_MODE = ON
OPT
define optimization level. you can use OPT = -O3

In makefile, there is an important macro DEFS. The cylinder codes behave differently depending on how DEFS is defined.

DEFS += -D_CYL
Needs to be included to activate cylinder specific functions.
DEFS += -D_NOBEMSTRESS
Disables the calculation of the general image stress by our spectral methods. This is a misnomer, there is no boundary element method (BEM) involved
DEFS += -D_NOYOFFESTRESS
Disables the Yoffe Image Stress. See Modelling Simul. Mater. Sci. Eng. 14, 1139 (2006) (PDF)
DEFS += -D_NULLCYLSTRESS
Ignore all image stress calculations (including BEM, Yoffe, Virtual segment contributions).
DEFS += -D_NOVIRTUALSEG
No force contribution from virtual segments. Do not use this flag unless you are absolutely sure you know what you are doing!
DEFS += -D_CYLMETHOD1
If defined, analytic expressions using Bessel functions are used for image stress calculation. If not, the Greens function method is used to compute image stress. . [1]
DEFS += -D_WRITENODEFORCE
If defined, code will write nodal force data in force.out file after the first nodal force evaluation and immediately exit. Each line of the file contains nodal position x, y, z and nodal force fx, fy and fz.
DEFS += -D_PRINTCYLSTRESS
If defined, code will write nodal force data in force.out and stress field in stress.out files. Each line of stress.out contains grid position r, θ, z and stress components σ11, σ22, σ33, σ23, σ31, σ12.


To compile, type

$ make

and executable file paradiscyl should appear in the directory ../bin/.


Notes

  1. For details of each method, refer C. R. Weinberger and Wei Cai, Computing Image Stress in an Elastic Cylinder, Journal of the Mechanics and Physics of Solids,55 (2007) 2027--2054 (PDF)