Commit 7f2fd286 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

some documentations added

parent 1e7a784a
...@@ -54,7 +54,7 @@ if (($handle = fopen($file, "r")) !== FALSE) { ...@@ -54,7 +54,7 @@ if (($handle = fopen($file, "r")) !== FALSE) {
fclose($handle); fclose($handle);
} }
} }
$latex .= "\\bibliographystyle{plain}\n\\bibliography{parameters}";
$latex .= '\end{document}'; $latex .= '\end{document}';
if (($handle = fopen('parameters.tex', "w")) !== FALSE) { if (($handle = fopen('parameters.tex', "w")) !== FALSE) {
......
\documentclass[10pt,a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{xcolor} % Extended colors
\usepackage{color}
% colors
\definecolor{light-gray}{gray}{0.95}
\definecolor{dark-gray}{gray}{0.3}
\definecolor{light-red}{HTML}{FFE9E9}
\definecolor{light-yellow}{HTML}{FFFAE9}
\definecolor{light-blue}{HTML}{EFF5FF} %E9F1FF
\newsavebox{\mybox}
\newenvironment{codebox}
{\newcommand\colboxcolor{light-blue}%
\vspace{-0.5cm}\begin{lrbox}{\mybox}%
\begin{minipage}{\textwidth}
\ttfamily }
{\end{minipage}\end{lrbox}%
\begin{center}
\colorbox{\colboxcolor}{\usebox{\mybox}}
\end{center}}
\newcommand{\kommentar}[1]{\textit{\textcolor{dark-gray}{\% #1}}}
\title{The Initfile Manual}
\author{Simon Praetorius}
\date{\today}
\begin{document}
\maketitle
AMDiS is equipped with a parser for parameter files to control simulations, e.g. set material parameters, define the timestep length, set meshes for each problem and configure the number of global refinements. These parameter files (or init-files) are simple text files in a special syntax, that is described here.
The .xml-file \texttt{amdis.xml} in the \texttt{tools/misc} sub-directory of AMDiS is a syntax-file for the Kate editor, that should be copied to the user directory \\\texttt{$\sim$/.kde/share/apps/katepart/syntax} in order to activate the highlighting scheme.
\section{General notation}
Init-files\marginpar{\texttt{\%\ldots}} have the suffix \texttt{.dat.Xd}, where \texttt{X} is in $\{1,2,3\}$. The general definition of a parameter is done by
\begin{codebox}
parameter\_name: parameter\_value\quad\kommentar{a comment}
\end{codebox}
where the '\texttt{:}' sign is the delimiter between parameter name and its value and the '\texttt{\%}' sign indicates a starting comment and is not allowed as part of a parameter-name or value.
You\marginpar{\texttt{\#include}} can include other init-files by
\begin{codebox}
\#include $<$filename$>$\quad\kommentar{or}\\
\#include "filename"
\end{codebox}
where \texttt{filename} must be relative to the path of the calling program. All parameters in the included init-file overwrites the parameters with the same name defined before the include statement.
One\marginpar{\texttt{\$\{\ldots\}}} can use parameters, defined previously, as variables:
\begin{codebox}
parameter1: value1\\
parameter2: \$parameter1\\
parameter3: \$\{parameter1\}\\
parameter4\_\$\{parameter1\}: value2\quad\kommentar{variable in parameter-name}\\
\kommentar{$\Rightarrow$ parameter4\_value1 = value2}
\end{codebox}
where you have to use brackets '\{' and '\}', if the variable name contains signs other than \{a-z, A-Z, 0-9, \_\}. Variable replacement is simple string replacement, no cast or evaluation of the variable is performed before it is inserted!
If you set a parameter twice, the last value is the one that is return on evaluation:
\begin{codebox}
parameter1: value1\\
parameter1: value2\quad\kommentar{$\Rightarrow$ parameter1 = value2}
\end{codebox}
\section{Value format}
The values of the parameters can be numbers, strings, vectors or arithmetic expression, or some combination of that:
\begin{codebox}
parameter1: 1.0\quad\kommentar{double}\\
parameter2: 1\quad\kommentar{int}\\
parameter3: Hello World!\quad\kommentar{string}\\
parameter4: [1,2,3]\quad\kommentar{vector$<$int$>$}\\
parameter5: [1,2,3; 4,5,6; 7,8,9]\quad\kommentar{vector$<$vector$<$int$> >$}\\
parameter6: 1/2\quad\kommentar{arithmetic expression $\Rightarrow$ 0.5}\\
parameter7: 2*\$\{parameter6\}+sin(0.5)\quad\kommentar{complex arithmetic expr.}
parameter8: m\_pi+m\_e\quad\kommentar{some constants($\pi + e$)}\\
\kommentar{now all together:}\\
parameter9: [2*m\_pi, sin((\$\{parameter7\})*m\_e)/2]
\end{codebox}
Sometimes\marginpar{\texttt{\$(\ldots)}} it is necessary to evaluate an expression before it is used as variable in an other parameter, e.g. if you want to insert a numeric value into a string, e.g. a filename, it is better to use "0.5" than "1/2", since the last one is interpreted as sub-directory delimiter. To insert the value of "1/2" into a string it has to be evaluated before. This can be done, by:
\begin{codebox}
parameter1: 1/2 + 1/2\\
parameter2: Hello \$\{parameter1\} World!\\\kommentar{$\Rightarrow$ parameter2="Hallo 1/2 + 1/2 World!"}\\
parameter3: Hello \$(\$\{parameter1\}) World!\\\kommentar{$\Rightarrow$ parameter3="Hallo 1 World!"}\\
parameter4: Hello \$(1/2 + 1/2) World!\\\kommentar{$\Rightarrow$ parameter4="Hallo 1 World!"}
\end{codebox}
\end{document}
\ No newline at end of file
...@@ -197,6 +197,79 @@ Reinitialization class HL\_SignedDistTraverse(\texttt{(name)},\ldots) with \text ...@@ -197,6 +197,79 @@ Reinitialization class HL\_SignedDistTraverse(\texttt{(name)},\ldots) with \text
\end{longtable} \end{longtable}
} }
\section*{Marker}
Global Marker Parameters
{
\small
\renewcommand{\basis}{{(marker)->}}
\begin{longtable}[l]{|>{\ttfamily}lp{.15\textwidth}>{\ttfamily}lp{.4\textwidth}|}
\hline
\textrm{\textbf{keyword}} & \textrm{\textbf{data type}} & \textrm{\textbf{default}} & \textrm{\textbf{description}} \\
\hline\hline
\hline\basis strategy & \textbf{int \{0-4\}} & [0] & 0..no marker, 1..GRMarker, 2..MSMarker, 3..ESMarker, 4..GERSMarker\\ \hline
\basis p & \textbf{int} & [2] & power in estimator norm\\ \hline
\basis info & \textbf{int} & [10] & Info level\\ \hline
\basis max refinement level & \textbf{int} & [-1] & Maximal level of all elements\\ \hline
\basis min refinement level & \textbf{int} & [-1] & Minimal level of all elements\\ \hline
\end{longtable}
}
Parameters for the \textbf{ESMarker} (Equidistribution strategy \cite{es_marker})
{
\small
\renewcommand{\basis}{{(marker)->}}
\begin{longtable}[l]{|>{\ttfamily}lp{.15\textwidth}>{\ttfamily}lp{.4\textwidth}|}
\hline
\textrm{\textbf{keyword}} & \textrm{\textbf{data type}} & \textrm{\textbf{default}} & \textrm{\textbf{description}} \\
\hline\hline
\hline\basis ESTheta & \textbf{double} & [0.9] & Marking parameter $\theta$\\ \hline
\basis ESThetaC & \textbf{double} & [0.2] & Marking parameter $\theta_C$\\ \hline
\end{longtable}
}
Parameters for the \textbf{GERSMarker} (Guaranteed error reduction strategy \cite{gers_marker})
{
\small
\renewcommand{\basis}{{(marker)->}}
\begin{longtable}[l]{|>{\ttfamily}lp{.15\textwidth}>{\ttfamily}lp{.4\textwidth}|}
\hline
\textrm{\textbf{keyword}} & \textrm{\textbf{data type}} & \textrm{\textbf{default}} & \textrm{\textbf{description}} \\
\hline\hline
\hline\basis GERSThetaStar & \textbf{double} & [0.6] & Marking parameter $\theta^\ast$\\ \hline
\basis GERSNu & \textbf{double} & [0.1] & Marking parameter $\nu$\\ \hline
\basis GERSThetaC & \textbf{double} & [0.1] & Marking parameter $\theta_C$\\ \hline
\end{longtable}
}
Parameters for the \textbf{GRMarker} (Global refinement strategy)
{
\small
\renewcommand{\basis}{{(marker)->}}
\begin{longtable}[l]{|>{\ttfamily}lp{.15\textwidth}>{\ttfamily}lp{.4\textwidth}|}
\hline
\textrm{\textbf{keyword}} & \textrm{\textbf{data type}} & \textrm{\textbf{default}} & \textrm{\textbf{description}} \\
\hline\hline
\hline\end{longtable}
}
Parameters for the \textbf{MSMarker} (Maximum strategy)
{
\small
\renewcommand{\basis}{{(marker)->}}
\begin{longtable}[l]{|>{\ttfamily}lp{.15\textwidth}>{\ttfamily}lp{.4\textwidth}|}
\hline
\textrm{\textbf{keyword}} & \textrm{\textbf{data type}} & \textrm{\textbf{default}} & \textrm{\textbf{description}} \\
\hline\hline
\hline\basis MSGamma & \textbf{double} & [0.5] & Marking parameter $\gamma$\\ \hline
\basis MSGammaC & \textbf{double} & [0.1] & Marking parameter $\gamma_C$\\ \hline
\end{longtable}
}
\section*{Mesh} \section*{Mesh}
Mesh(\texttt{(name)},$\cdot$) Mesh(\texttt{(name)},$\cdot$)
{ {
...@@ -313,4 +386,5 @@ RosenbrockAdaptInstationary ...@@ -313,4 +386,5 @@ RosenbrockAdaptInstationary
\end{longtable} \end{longtable}
} }
\end{document} \bibliographystyle{plain}
\ No newline at end of file \bibliography{parameters}\end{document}
\ No newline at end of file
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