Commit c16bff69 authored by Mark van Turnhout's avatar Mark van Turnhout
Browse files

update documentation and typesetting 9spacing) of listings

parent 1de2fbbd
...@@ -34,10 +34,7 @@ ...@@ -34,10 +34,7 @@
% listings and code % listings and code
\usepackage{listings} \usepackage{listings}
\input{listingset.tex} \input{listingset.tex}
\lstset{
inputencoding=utf8,
extendedchars=false
}
\usepackage{framed} \usepackage{framed}
\usepackage{enumitem} \usepackage{enumitem}
% indexing % indexing
...@@ -120,6 +117,8 @@ ...@@ -120,6 +117,8 @@
\bibliographystyle{myplainhp} \bibliographystyle{myplainhp}
\bibliography{jabref} \bibliography{jabref}
\clearpage
\addcontentsline{toc}{chapter}{\protect\numberline{\color{white}}Index}
\printindex \printindex
% %
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
\begin{savequote} \begin{savequote}
In the computer model, all the microfilaments were given certain quantitative properties with names that mean something to physicists: a `viscous damping coefficient' and an `elastic spring constant'. Never mind exactly what these mean: they are the kind of things physicists like to measure in a spring. \qauthor{Richard Dawkins \cite{Dawkins2009}} In the computer model, all the microfilaments were given certain quantitative properties with names that mean something to physicists: a `viscous damping coefficient' and an `elastic spring constant'. Never mind exactly what these mean: they are the kind of things physicists like to measure in a spring. \qauthor{Richard Dawkins \cite{Dawkins2009}}
\end{savequote} \end{savequote}
\chapter{Building the FEM}\label{buildfem} \chapter{\bas{buildFEM}}\label{buildfem}
In this chapter we discuss the core of BasilLab: \bas{buildFEM} and its ouput \texttt{basil<basilid>\_job.py\index{basil<basilid>\_job.py@\texttt{basil<basilid>\_job.py}}}. In this chapter we discuss the core of BasilLab: \bas{buildFEM} and its ouput \texttt{basil<basilid>\_job.py\index{basil<basilid>\_job.py@\texttt{basil<basilid>\_job.py}}}.
...@@ -27,6 +27,7 @@ The function \bas{buildFEM} accepts a number of parameters that are provided in ...@@ -27,6 +27,7 @@ The function \bas{buildFEM} accepts a number of parameters that are provided in
\texttt{maxNumInc} & \textbf{1e6} & integer & maximum number of iterations in the indentation step for Abaqus\\ \hline\noalign{\smallskip} \texttt{maxNumInc} & \textbf{1e6} & integer & maximum number of iterations in the indentation step for Abaqus\\ \hline\noalign{\smallskip}
\texttt{initialInc} & \textbf{1} & float & time used for the first attempt in the first increment in the indentation step for Abaqus\\ \hline\noalign{\smallskip} \texttt{initialInc} & \textbf{1} & float & time used for the first attempt in the first increment in the indentation step for Abaqus\\ \hline\noalign{\smallskip}
\texttt{minInc} & \textbf{1e-6} & float & minimum increment time; Abaqus will abort when the required increment time in the indentation step becomes smaller than this value\\ \hline\noalign{\smallskip} \texttt{minInc} & \textbf{1e-6} & float & minimum increment time; Abaqus will abort when the required increment time in the indentation step becomes smaller than this value\\ \hline\noalign{\smallskip}
\texttt{maxInc} & \textbf{5} & float & maximum increment time; Abaqus will not make time increments larger than this value\\ \hline\noalign{\smallskip}
\texttt{cast} & 0 & integer & do not model the alginate cast around the leg\\ \texttt{cast} & 0 & integer & do not model the alginate cast around the leg\\
& \textbf{1} & & \textbf{model the alginate cast around the leg}\\ \hline\noalign{\smallskip} & \textbf{1} & & \textbf{model the alginate cast around the leg}\\ \hline\noalign{\smallskip}
\texttt{submit} & \textbf{0} & integer & \textbf{do not run the simulation when the FEM has been build} \\ \texttt{submit} & \textbf{0} & integer & \textbf{do not run the simulation when the FEM has been build} \\
...@@ -41,7 +42,7 @@ The function \bas{buildFEM} accepts a number of parameters that are provided in ...@@ -41,7 +42,7 @@ The function \bas{buildFEM} accepts a number of parameters that are provided in
& \textbf{1} & & \textbf{write the Abaqus input file} \\ \hline\noalign{\smallskip} & \textbf{1} & & \textbf{write the Abaqus input file} \\ \hline\noalign{\smallskip}
\texttt{cae} & \textbf{0} & integer & \textbf{do not write the Abaqus cae file} \\ \texttt{cae} & \textbf{0} & integer & \textbf{do not write the Abaqus cae file} \\
& 1 & & write the Abaqus cae file \\ \hline\noalign{\smallskip} & 1 & & write the Abaqus cae file \\ \hline\noalign{\smallskip}
\texttt{Ogden} & \textbf{[0.0156, 21.4, 60]} & row & \textbf{Ogden material parameters for the soft tissue} (see section \ref{ogden}) \\ \hline\noalign{\smallskip} \texttt{Ogden} & \textbf{[0.0156, 21.4, 60]} & floats & \textbf{Ogden material parameters for the soft tissue} (see \cite{Bosboom2003} and section \ref{ogden}) \\ \hline\noalign{\smallskip}
\texttt{exec} & 0 & integer & do not submit the model python script to Abaqus\\ \texttt{exec} & 0 & integer & do not submit the model python script to Abaqus\\
& \textbf{1} & & \textbf{submit the model python script to Abaqus} \\ \hline\noalign{\smallskip} & \textbf{1} & & \textbf{submit the model python script to Abaqus} \\ \hline\noalign{\smallskip}
\texttt{odbT} & \textbf{5} & integer & period that Abaqus uses to write simulation results to the \texttt{odb}-file in the indentation step\\ \hline\noalign{\smallskip} \texttt{odbT} & \textbf{5} & integer & period that Abaqus uses to write simulation results to the \texttt{odb}-file in the indentation step\\ \hline\noalign{\smallskip}
...@@ -84,6 +85,62 @@ Thus, the default material parameters in \bas{buildFEM} use a Poisson's ratio of ...@@ -84,6 +85,62 @@ Thus, the default material parameters in \bas{buildFEM} use a Poisson's ratio of
\noindent The material parameter option \texttt{Ogden} for \bas{buildFEM} accepts a three element input, or a four element input. The three element input should have the format [$\mu_0$, $\alpha$, $D$]. With the four element input, you can supply the Poisson's ratio explicitly in the fourth value, i.e.\ the format becomes [$\mu_0$, $\alpha$, 0, $\nu$]. In this case, \bas{buildFEM} will call \bas{nu2D} with $\mu_0$ and $\nu$, and the third value in the input will be overwritten with the calculated parameter $D$. Thus, the options $\text{\texttt{Ogden}} = \begin{bmatrix}0.0156, & 21.4, & 60\end{bmatrix}$ and $\text{\texttt{Ogden}}= \begin{bmatrix}0.0156, & 21.4, & 0, & 0.2976\end{bmatrix}$ are equivalent. \noindent The material parameter option \texttt{Ogden} for \bas{buildFEM} accepts a three element input, or a four element input. The three element input should have the format [$\mu_0$, $\alpha$, $D$]. With the four element input, you can supply the Poisson's ratio explicitly in the fourth value, i.e.\ the format becomes [$\mu_0$, $\alpha$, 0, $\nu$]. In this case, \bas{buildFEM} will call \bas{nu2D} with $\mu_0$ and $\nu$, and the third value in the input will be overwritten with the calculated parameter $D$. Thus, the options $\text{\texttt{Ogden}} = \begin{bmatrix}0.0156, & 21.4, & 60\end{bmatrix}$ and $\text{\texttt{Ogden}}= \begin{bmatrix}0.0156, & 21.4, & 0, & 0.2976\end{bmatrix}$ are equivalent.
\section{The \texttt{odbT} parameter} \subsection{The \texttt{odbT} parameter}
By default, Abaqus writes simulation results to the \texttt{odb}-file for every (successful) increment. To reduce the size of the \texttt{odb}-file, we can ask Abaqus to write the results only every \texttt{odbT} seconds of the simulation time. With the default settings, this gives you the results at $100/5 = 20$ equidistant time points in the indentation step.
For large models, in terms of elements and nodes, you may wish to increase \texttt{odbT}. With quadratic elements and a \texttt{seed} of 1, writing only the results of 4 time points in the indentation step, the \texttt{odbT}-file may already reach 500\,MB. With a seed of 0.6, quadratic elements and 4 time points, the \texttt{odbT}-file may reach 1\,GB.
\subsection{\texttt{basil<basilid>\_modelparam.m\index{basil<basilid>\_modelparam.m@\texttt{basil<basilid>\_modelparam.m}}} and \bas{rebuildFEM}}
\begin{lstlisting}[language=octave, float, caption={Example of \texttt{basil<basilid>\_modelparam.m\index{basil<basilid>\_modelparam.m@\texttt{basil<basilid>\_modelparam.m}}}.}, label=modelparam]
param.buildon = '16-Dec-2015 10:42:00';
param.basilhome = '/home/mark/tue/WillekeBasil';
param.seed = 6.000000e-01;
param.elOrder = 2;
param.ri = 1.500000e+00;
param.numCpus = 4;
param.numDomains = 4;
param.timePeriod = 100.000000;
param.maxNumInc = 1000000;
param.initialInc = 1;
param.minInc = 1.000000e-06;
param.maxInc = 5;
param.cast = 1;
param.submit = 0;
param.plot = 0;
param.fixbone = 0;
param.discon = 0;
param.inp = 1;
param.cae = 1;
param.exec = 1;
param.ogden = [0.003600 5.000000 0 0.450000];
param.odbT = 25;
param.indOff = 0.000000;
\end{lstlisting}
Next to the Abaqus python script \texttt{basil<basilid>\_job.py\index{basil<basilid>\_job.py@\texttt{basil<basilid>\_job.py}}} that builds the model, \bas{buildFEM} also writes a file \texttt{basil<basilid>\_modelparam.m\index{basil<basilid>\_modelparam.m@\texttt{basil<basilid>\_modelparam.m}}} in the current working directory. This file contains all the optional parameters that \bas{buildFEM} used to write the Abaqus python script. The default values are substituted for parameters that were not explicitly defined in the input parameter structure. In addition, the first line of \texttt{basil<basilid>\_modelparam.m\index{basil<basilid>\_modelparam.m@\texttt{basil<basilid>\_modelparam.m}}} contains the the date and time that \bas{buildFEM} was called to write \texttt{basil<basilid>\_job.py\index{basil<basilid>\_job.py@\texttt{basil<basilid>\_job.py}}} (\texttt{buildon}, see listing \ref{modelparam} for an example).
With this file, you can always and easily check the parameters that were used to build a particular model. As long as you keep this file, you can always ask \bas{buildFEM} to build the model again from scratch and be sure that you use the same options as you used before. Likewise, you can be sure to use the same options for (certain) different models. E.g.\ to build the model for \texttt{<basilid> = 140611} with the same parameters that were used to build a model for \texttt{<basilid> = 140613}, run:
\begin{lstlisting}[numbers=none]
>> run basil140613_modelparam.m, bas_buildFEM(140611,param)
\end{lstlisting}
\noindent BasilLab also provides the function \bas{rebuildFEM}. This function reads \texttt{basil<basilid>\_model\-param.m\index{basil<basilid>\_modelparam.m@\texttt{basil<basilid>\_modelparam.m}}} for a given \texttt{<basilid>} and then calls \bas{buildFEM} for \texttt{<basilid>} with the parameters that were read from \texttt{basil<basilid>\_modelparam.m\index{basil<basilid>\_modelparam.m@\texttt{basil<basilid>\_modelparam.m}}}. So, the following two commands are equivalent:
\begin{lstlisting}
>> run basil140611_modelparam.m, bas_buildFEM(140611,param)
>> bas_rebuildFEM(140611)
\end{lstlisting}
Furthermore, \bas{rebuildFEM} also accepts the parameter structure as (optional) input. When \bas{rebuildFEM} is called with the parameter structure as an argument, it will first read the original parameters from \texttt{basil<basilid>\-\_modelparam.m\index{basil<basilid>\_modelparam.m@\texttt{basil<basilid>\_modelparam.m}}} and next substitute parameters that were supplied as an argument to \bas{rebuildFEM} with these (new) values. So again, the following two commands are equivalent:
\begin{lstlisting}
>> run basil140611_modelparam.m, param.seed = 1; bas_buildFEM(140611,param)
>> param.seed = 1; bas_rebuildFEM(140611,param)
\end{lstlisting}
This function \bas{rebuildFEM} can be very useful when you wish to change a single or few parameters in all your models, while keeping the (other) original parameters for each individual \texttt{<basilid>} the same as before. E.g.\ when, you call
\begin{lstlisting}[numbers=none]
>> param.seed = 0.5; bas_rebuildFEM([140611:140613], param)
\end{lstlisting}
all parameters for \texttt{<basilid> = 140611}, \texttt{<basilid> = 140612} and \texttt{<basilid> = 140613} will be the same as before, except for the mesh seed size.\\
By default, Abaqus writes simulation results to the \texttt{odb}-file for every (successful) increment. To reduce the size of the \texttt{odb}-file \noindent Note that each call to \bas{buildFEM} (and therefore to \bas{rebuildFEM}) will change the first line of \texttt{basil<basilid>\-\_modelparam.m\index{basil<basilid>\_modelparam.m@\texttt{basil<basilid>\_modelparam.m}}}. The \texttt{buildon}-information will have a new date and time.
\ No newline at end of file \ No newline at end of file
...@@ -12,7 +12,6 @@ showtabs = false, % show tabs within strings adding particular underscores ...@@ -12,7 +12,6 @@ showtabs = false, % show tabs within strings adding particular underscores
frameround = fttt, % rounded frame corners frameround = fttt, % rounded frame corners
frame = trBL, % adds a frame around the code frame = trBL, % adds a frame around the code
tabsize = 2, % sets default tabsize to 2 spaces tabsize = 2, % sets default tabsize to 2 spaces
captionpos = b, % sets the caption-position to bottom
breaklines = true, % sets automatic line breaking breaklines = true, % sets automatic line breaking
breakatwhitespace = false, % sets if automatic breaks should only happen at whitespace breakatwhitespace = false, % sets if automatic breaks should only happen at whitespace
title = \lstname, % show the filename of files included with \lstinputlisting; title = \lstname, % show the filename of files included with \lstinputlisting;
...@@ -22,6 +21,9 @@ escapeinside = {\%*}{*)}, % if you want to add a comment within your code ...@@ -22,6 +21,9 @@ escapeinside = {\%*}{*)}, % if you want to add a comment within your code
%morekeywords = {*,...}, % if you want to add more keywords to the set %morekeywords = {*,...}, % if you want to add more keywords to the set
commentstyle = \color{green}, commentstyle = \color{green},
stringstyle = \color{red}, stringstyle = \color{red},
keywordstyle = \color{blue} keywordstyle = \color{blue},
inputencoding = utf8,
extendedchars = false,
aboveskip = -1em
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment