Show Menu
Cheatography

FEniCS Cheat Sheet (DRAFT) by

Instructions to install FEniCS, Dolfin-Adjoint, and IpOpt to run topology optimization in the FEniCS enviroment

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Linux fundam­entals commands

sudo -i
apt-get <...>
<co­mma­nd> --help [-H]
Options for the <co­mma­nd> [help]
man <co­mma­nd>
Help for <co­mma­nd>
export LD_LIB­RAR­Y_P­ATH­=/u­sr/­loc­al/­lib­:$L­D_L­IBR­ARY­_PATH
Update the path

Install Anaconda

conda info
Verify if conda is installed (check version number, etc.)
Download anacoda
bash Anacon­da3­-4.4.0­-Li­nux­-x8­6_64.sh
Install the downloaded package
conda update conda
Update conda to the current version
conda update anaconda
Update all packages in the enviro­nment to the versions in the latest release of Anaconda, all of which are tested for compat­ibi­lity. May not contain the newest versions
conda update --all
Update the enviro­nment
conda --version
Verify that conda is installed
conda list
View a list of packages and versions installed in an enviro­nment
conda install <pa­cka­ge-­nam­e>
Install the conda package <pa­cka­ge-­nam­e>
 

Install FEniCS on Ubuntu

Download FEniCS options
sudo add-ap­t-r­epo­sitory ppa:fe­nic­s-p­ack­age­s/f­enics
sudo apt-get update
sudo apt-get install --no-i­nst­all­-re­com­mends fenics
sudo apt-get dist-u­pgrade

Install dolfin­-ad­joint on Ubuntu

Download dolfin­-ad­joint options
sudo apt-ad­d-r­epo­sitory ppa:li­bad­joi­nt/ppa
sudo apt-get update
sudo apt-get install python­-do­lfi­n-a­djoint

Install FEniCS on Anaconda

conda config --add channels conda-­forge
Installing fenics from the conda-­forge channel
conda create -n fenics­project -c conda-­forge fenics
Create an enviro­nment
source activate fenics­project
Activate the enviro­nment
conda install fenics
Install the last stable version of FEniCS
source deactivate fenics­project
To deactivate this enviro­nment

Install dolfin­-ad­joint on Conda

conda install -c conda-­forge dolfin­-ad­joint
 

Install IpOpt

Download Ipopt
tar xvf Ipopt-­3.3.1.tar
Decompress the folder
cd $IPOPT­DIR­/Th­ird­Par­ty/Blas
./get.Blas
cd ../Lapack
./get.L­apack
cd ../ASL
./get.ASL
cd ../Metis
./get.M­etis
cd ../Mumps
./get.M­umps
cd $IPOPTDIR/
mkdir build
cd build
../con­figure
sudo ldconfig
sudo make
sudo make test
sudo make install

Install pyIp­Opt

Get the latest source code
python setup.py build
sudo python setup.py install
python hs071.py
To see if you have PyIpopt ready
PyIpopt is a python module that allows you to use IPOPT in Python Web page