Files
CFDEMcoupling-PUBLIC/doc/githubAccess_public.html
2016-05-18 11:38:55 +02:00

285 lines
11 KiB
HTML

<HTML>
<CENTER><A HREF = "http://www.cfdem.com">CFDEMproject WWW Site</A> - <A HREF = "CFDEMcoupling_Manual.html#comm">CFDEM Commands</A>
</CENTER>
<HR>
<H3>githubAccess_public
</H3>
<HR>
<P><B>Description:</B>
</P>
<P>This routine describes how to pull repositories of the CFDEM(R)project from <A HREF = "http://github.com">github.com</A>.
After setting some environment variables, LIGGGHTS(R) and CFDEM(R)coupling can be compiled.
</P>
<P><B>Procedure:</B>
</P>
<P>Basically the following steps have to be performed:
</P>
<UL><LI><I>git clone</I> and setup OpenFOAM
<LI><I>git clone</I> the desired repositories
<LI>update your repositories by <I>git pull</I>
<LI>set environment variables
<LI>compile LIGGGHTS(R) and CFDEM(R)coupling
<LI>run your own cases
</UL>
<P><B><I>git clone</I> and setup OpenFOAM:</B>
</P>
<P>Have a look at the latest compatible OpenFOAM(R)-version in the versionInfo.H file at <A HREF = "https://github.com/CFDEMproject/CFDEMcoupling-PUBLIC/blob/master/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H">github</A>.
This file will later be downloaded as a part of the source-code.
Look for the git commit hashtag in the following line:
</P>
<PRE>word OFversion="&lt;OF-Release&gt;-commit-&lt;commitHashtag&gt;";
</PRE>
<PRE>e.g. word OFversion="2.4.x-commit-3d8da0e960c717ff582f1517a27724144f086b83";
</PRE>
<P>However sometimes even newer versions are supported, please check the <A HREF = "http://www.cfdem.com/node/414">release notes</A> and the "Advanced Settings"-section.
</P>
<P>Basically follow the OpenFOAM(R) git compilation <A HREF = "http://openfoam.org/download/git.php">instructions</A>, with a small number of exceptions:
</P>
<P>When you git clone the repository, replace the release-version with &lt;OF-Release&gt;.
</P>
<P>with git-protocol:
</P>
<PRE>git clone git://github.com/OpenFOAM/OpenFOAM-&lt;OF-Release&gt;.git
</PRE>
<P>or with https:
</P>
<PRE>git clone https://github.com/OpenFOAM/OpenFOAM-&lt;OF-Release&gt;.git
</PRE>
<P>Now change into the new directory and checkout the correct compatible version:
</P>
<PRE>cd OpenFOAM-&lt;OF-Release&gt;
git checkout &lt;commitHashtag&gt;
</PRE>
<P>The result will be a status report, that indicates a 'detached head state'.
Now continue with installing and compiling OpenFOAM(R).
Make sure that OpenFOAM(R) works properly with a parallel Simulation!
</P>
<P>If you want to use an older OpenFOAM(R)-version, please have a look at the "Backwards Compatibility"-section.
</P>
<P><B><I>git clone</I> the desired repositories:</B>
</P>
<P>You may want to take a look around on CFDEMproject on github: github.com/CFDEMproject_gitCFDEM
</P>
<P>If not already done, open a terminal and create a directory for LIGGGHTS(R) in $HOME:
</P>
<PRE>cd
mkdir LIGGGHTS
cd LIGGGHTS
</PRE>
<P>To clone the public LIGGGHTS repository, open a terminal and execute:
with git-protocol:
</P>
<PRE>git clone git://github.com/CFDEMproject/LIGGGHTS-PUBLIC.git LIGGGHTS-PUBLIC
</PRE>
<P>or with https:
</P>
<PRE>git clone https://github.com/CFDEMproject/LIGGGHTS-PUBLIC.git LIGGGHTS-PUBLIC
</PRE>
<P>If not already done, open a terminal and create a directory for CFDEM(R)coupling in $HOME:
</P>
<PRE>cd
mkdir CFDEM
cd CFDEM
</PRE>
<P>To clone the public CFDEM(R)coupling repository, open a terminal and execute:
with git-protocol:
</P>
<PRE>git clone git://github.com/CFDEMproject/CFDEMcoupling-PUBLIC.git CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION
</PRE>
<P>or with https:
</P>
<PRE>git clone https://github.com/CFDEMcoupling-PUBLIC.git CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION
</PRE>
<PRE>Additionally the lpp tool for converting LIGGGHTS dump-files into the paraview readable VTK-format might be of use:
with git-protocol:
git clone git://github.com:CFDEMproject/LPP.git $HOME/LIGGGHTS/mylpp
</PRE>
<PRE>or with https:
git clone https://github.com:CFDEMproject/LPP.git $HOME/LIGGGHTS/mylpp
</PRE>
<P>Please have a look at README and INSTALL.txt in the root directory of LPP for further information.
</P>
<P>Troubles? See Troubleshooting git section below.
</P>
<P><B>Update your repositories by <I>git pull</I>:</B>
</P>
<P>To get the latest version, open a terminal, go to the location of your local installation and type:
<I>Warning: git stash will remove your changes in $HOME/CFDEM/CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION !</I>
</P>
<PRE>cd $HOME/CFDEM/CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION
git stash
git pull
</PRE>
<P><B>Set Environment Variables:</B>
</P>
<P>Now you need to set some environment variables in ~/.bashrc (if you use c-shell, manipulate ~/.cshrc accordingly). Open ~/.bashrc
</P>
<PRE>gedit ~/.bashrc &
</PRE>
<P>add the lines (you find them also in CFDEMCoupling-$WM_PROJECT_VERSION/src/lagrangian/cfdemParticle/etc/bashrc and cshrc respectively):
</P>
<PRE>#================================================#
#- source cfdem env vars
export CFDEM_VERSION=PUBLIC
export CFDEM_PROJECT_DIR=$HOME/CFDEM/CFDEMcoupling-$CFDEM_VERSION-$WM_PROJECT_VERSION
export CFDEM_SRC_DIR=$CFDEM_PROJECT_DIR/src
export CFDEM_SOLVER_DIR=$CFDEM_PROJECT_DIR/applications/solvers
export CFDEM_DOC_DIR=$CFDEM_PROJECT_DIR/doc
export CFDEM_UT_DIR=$CFDEM_PROJECT_DIR/applications/utilities
export CFDEM_TUT_DIR=$CFDEM_PROJECT_DIR/tutorials
export CFDEM_PROJECT_USER_DIR=$HOME/CFDEM/$LOGNAME-$CFDEM_VERSION-$WM_PROJECT_VERSION
export CFDEM_bashrc=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/bashrc
export CFDEM_LIGGGHTS_SRC_DIR=$HOME/LIGGGHTS/LIGGGHTS-PUBLIC/src
export CFDEM_LIGGGHTS_MAKEFILE_NAME=fedora_fpic
export CFDEM_LPP_DIR=$HOME/LIGGGHTS/mylpp/src
export CFDEM_PIZZA_DIR=$HOME/LIGGGHTS/PIZZA/gran_pizza_17Aug10/src
. $CFDEM_bashrc
#================================================#
</PRE>
<P>If you installed LIGGGHTS(R) or CFDEM(R)coupling in non-standard paths, please have a look at least at CFDEM_PROJECT_DIR and CFDEM_LIGGGHTS_SRC_DIR.
The standard CFDEM_LIGGGHTS_MAKEFILE_NAME is fedora_fpic, which works on most systems. However please checkout LIGGGHTS-PUBLIC/src/MAKE for additional makefiles, wich are available. The most used ones are fedora_fpic and ubuntuVTK_fpic. Beware that the CFDEMcoupling needs a fpic compilation to use LIGGGHTS as a library. Please check the "Advanced Settings" for VTK information.
</P>
<P>Save the ~/.bashrc, open a new terminal and test the settings. The commands:
</P>
<PRE>$CFDEM_PROJECT_DIR
$CFDEM_SRC_DIR
$CFDEM_LIGGGHTS_SRC_DIR
</PRE>
<P>should give "...: is a directory" otherwise something went wrong and the environment variables in ~/.bashrc are not set correctly.
</P>
<P>To specify the paths of pizza, please check the settings in $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/bashrc.
</P>
<P>If $CFDEM_SRC_DIR is set correctly, you can type
</P>
<PRE>cfdemSysTest
</PRE>
<P>to get some information if the paths are set correctly.
</P>
<P><B>Compile LIGGGHTS(R) and CFDEM(R)coupling:</B>
</P>
<P>If above settings were done correctly, you can compile LIGGGHTS(R) by typing:
</P>
<PRE>cfdemCompLIG
</PRE>
<P>and you can then compile CFDEM(R)coupling by typing:
</P>
<PRE>cfdemCompCFDEM
</PRE>
<P>or compile both at once with:
</P>
<PRE>cfdemCompCFDEMall
</PRE>
<P>You can run the tutorial cases by executing .../etc/testTutorial.sh through the alias <I>cfdemTestTUT</I>.
Alternatively you can run each tutorial using the <I>Allrun.sh</I> scripts in the tutorial directories.
</P>
<P>In case questions concerning the installation arise, please feel free to contact our forum at www.cfdem.com.
</P>
<P><B>Run Your Own Cases:</B>
</P>
<P>If you want to run your own cases, please do so in $CFDEM_PROJECT_USER_DIR/run which is automatically being generated. E.g. copy one of the tutorial cases there, adapt it to your needs.
Changes in $CFDEM_TUT_DIR will be lost after every <I>git stash</I>!
</P>
<P><B>Additional Installations:</B>
</P>
<P>Optionally you can install lpp which will help you convert the DEM (dump) data to VTK format. For standard CFD-DEM runs this will not be necessary. To get the DEM postprocessing tool "lpp" you need python-numpy package installed:
</P>
<PRE>sudo apt-get install python-numpy
</PRE>
<P>You can pull the latest version of lpp with:
</P>
<PRE>cd $HOME/LIGGGHTS
</PRE>
<P>with git-protocol:
git clone git://github.com/CFDEMproject/LPP.git
with https:
git clone https://github.com/CFDEMproject/LPP.git
</P>
<P><B>Backwards Compatibility:</B>
</P>
<P>Basically CFDEM(R)coupling supports one OpenFOAM(R) version therefore all settings are prepared for that. Nevertheless we try to maintain backwards compatibility as long as it works with reasonable effort.
</P>
<P>The supported OpenFOAM(R) and LIGGGHTS(R) versions are stated in:
src/lagrangian/cfdemParticle/cfdTools/versionInfo.H
</P>
<P>For using other versions you can manipulate:
src/lagrangian/cfdemParticle/etc/OFversion/OFversion.H
(still not all functionality might work then!)
</P>
<P><B>Advanced Settings:</B>
</P>
<P>Here some advanced settings and hints for non-standard compilations are presented.
As stated in the "Backwards Compatibility"-section, there are compiler flags for different OpenFOAM versions. Checkout src/lagrangian/cfdemParticle/etc/OFversion/OFversion.H for compatibility settings. Just comment the current "#define version2X" in the top-section and uncomment the one you want to compile it with.
</P>
<P>There are advanced compilation settings for library-paths, includes and libraries are within the additionalLibs file in src/lagrangian/cfdemParticle/etc/additionalLibs. There are predefined files for different OpenFOAM versions. To use a different version, add the following lines to your .bashrc (.cshrc) before the standard CFDEM variables:
</P>
<PRE>export CFDEM_ADD_LIBS_DIR=FOLDER_OF_NEW_additionalLibs_FILE/
</PRE>
<PRE>export CFDEM_ADD_LIBS_NAME=additionalLibs30x
</PRE>
<P>This is an example to use a predefined additionalLibs file for OpenFOAM-3.0.x.
</P>
<P>To enable direct VTK-dump (dump custom/vtk) support of LIGGGHTS and CFDEMcoupling, you have to install the VTK libraries. Either 5.8 or 6 are predefined for ubuntu.
</P>
<PRE>sudo apt-get libvtk5.8 libvtk5-dev
</PRE>
<P>Change "export CFDEM_LIGGGHTS_MAKEFILE_NAME=fedora_fpic" in your .bashrc according to your preferred LIGGGHTS makefile.
If you have a non-standard installation location you have to adapt the LIGGGHTS makefile accordingly.
To enable this feature in a coupled run the additionalLibs file has to be modified.
It basically needs to include the same libraries as the LIGGGHTS-Makefile.
E.g. for Ubuntu-14.04 with vtk-5.8:
</P>
<PRE>CFDEM_ADD_LIB_PATHS = -L/usr/include/vtk-5.8
</PRE>
<PRE>CFDEM_ADD_LIBS = -lvtkCommon -lvtkFiltering -lvtkIO
</PRE>
<P><B>Troubleshooting git:</B>
</P>
<UL><LI>Troubles with git clone?
</UL>
<P><B>a)</B> The git protocol will not work if your computer is behind a firewall which blocks the relevant TCP port, you can use alternatively https instead of git (write command in one line):
</P>
<P>git clone https://github.com/CFDEMproject/CFDEMcoupling-PUBLIC.git CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION
</P>
<P><B>b)</B> If you face the error: "error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/...",
</P>
<P>please use: env GIT_SSL_NO_VERIFY=true git clone https://github...
</P>
<P>(see http://stackoverflow.com/questions/3777075/https-github-access)
</P>
<P><B>c)</B> If you face the error: "Agent admitted failure to sign using the key. Permission denied (publickey).", after ssh -T git@github.com
</P>
<P>please type: "ssh-add"
</P>
<P>(see: https://help.github.com/articles/error-agent-admitted-failure-to-sign)
</P>
</HTML>