Commit 36c428c0 authored by Praetorius, Simon's avatar Praetorius, Simon

updated some slides and added cheat sheets

parent 93f0b2e0
......@@ -10,8 +10,8 @@
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
</style>
<!--<link rel="stylesheet" type="text/css" href="style_display.css" />-->
<link rel="stylesheet" type="text/css" href="style_print.css" />
<link rel="stylesheet" type="text/css" href="style_display.css" />
<!--<link rel="stylesheet" type="text/css" href="style_print.css" />-->
</head>
<body>
<textarea id="source">
......@@ -32,15 +32,15 @@ Simon Praetorius *simon.praetorius@tu-dresden.de*
# About this Course
> Goals: Introductory course
- You know how to use the software AMDiS
- You can solve a scalar equation, or a system of elliptic equations
- You know how to use the compile and link against the AMDiS library
- You can solve a linear scalar equation, or a system of elliptic equations
- You can handle instationary problems, nonlinearities and complex boundary conditions
- You can run your simulation in parallel
--
> References:
- Some theoretical background and basic design ideas of AMDiS software: [ALBERTA-FEM](http://goo.gl/Sn9CIE) especially the ALBERT 1.0 [documentation](http://goo.gl/ZMI2kA).
- Some theoretical background and basic design ideas of AMDiS software: [ALBERTA-FEM](http://goo.gl/Sn9CIE).
- The [AMDiS-Wiki](https://goo.gl/Jy3u1u)
- Some (old) PDF Documentation on [Fusionforge](https://goo.gl/5ngfYd)
......@@ -135,6 +135,20 @@ Andreas Naumann, Simon Praetorius, Siqi Ling, Sebastian Reuther, ...
- Interface to **linear solvers**: (P)MTL4, PETSc, Hypre
- **FETI-DP** / Schur-complement solvers in parallel
---
# Install AMDiS
- Debian package
- EasyBuild software
- Docker image
- Manual installation
### Requirements
- Recent C++ compiler (e.g. g++ >= 6.0, clang >= 4.0, intel icc >= 2018)
- CMake (>= 3.1)
- Boost (>= 1.48)
- optional: Git, SuiteSparse, PETSc, ParMetis, Hypre, BDDC,...
</textarea>
<script src="lib/remark.js" type="text/javascript"></script>
......
<!DOCTYPE html>
<html>
<head>
<title>AMDiS - Adaptive Multi-Dimensional Simulations</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Raleway);
@import url(https://fonts.googleapis.com/css?family=Ubuntu);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
</style>
<link rel="stylesheet" type="text/css" href="style_display.css" />
<!--<link rel="stylesheet" type="text/css" href="style_print.css" />-->
</head>
<body>
<textarea id="source">
class: center, middle
# AMDiS - Adaptive Multi-Dimensional Simulations
## Introduction to the FEM-Framework
Simon Praetorius *simon.praetorius@tu-dresden.de*
*Institut für Wissenschaftliches Rechnen*
*Technische Universität Dresden*
---
## AMDiS: **A**daptive **M**ulti-**Di**mensional **S**imulations
AMDiS developed around 2005. Basis: C-library *ALBERTA*. Now: an object-oriented `C++`-Framework. Basic concepts:
- **High abstraction level**: (Physical) Problems can be formulated with little knowledge about numerical details
- **Generality**: Solve a broad class of PDE problems. Linear and nonlinear problems, stationary and instationary.
Multiple dimensions and coupling of different dimensions
- **Extensibility**: Interface to extend AMDiS in several aspects, e.g. own error estimators, linear solvers,
preconditioners, time-stepping schemes
- **Efficiency**: Several tools for highly efficient simulations, e.g. adaptive meshes, parallelization, multi-mesh,
fast linear solver libraries
---
# About this Course
> Goals: Introductory course
- You know how to compile and link against the AMDiS library
- You can solve a linear scalar PDE and a system of elliptic equations
- You can handle instationary problems, nonlinearities and complex boundary conditions
- You can run your simulation in parallel (*optional*)
--
> References:
- Some theoretical background and basic design ideas of AMDiS software: [ALBERTA-FEM](http://goo.gl/Sn9CIE).
- The [AMDiS-Wiki](https://goo.gl/Jy3u1u)
- Some (old) PDF Documentation on [Fusionforge](https://goo.gl/5ngfYd)
> Workshop material can be found on [GitHub](https://goo.gl/pjtg4a)
---
## Get the slides and material
All slides and source code, as well as exercise material can be found in a git repository:
```
# Get the repository
git clone https://gitlab.mn.tu-dresden.de/spraetor/amdis_workshop_16.git ...
... amdis_workshop
# Download the material
cd amdis_workshop
git submodule update --init --recursive
```
In the subdirectory `cheat_sheets/` you can find quick reference cards on some tools used in this workshop.
See also https://devhints.io
---
# Agenda
### Wednesday Nov 28
- Scalar linear second order PDEs
- Discrete functions on unstructured grids
### Friday Nov 30
- Adaptivity and systems of equations
- Time-dependent and nonlinear problems
### Wednesday Dec 5
- Boundary conditions and Composite FEM
- Parallelization
---
# Introduction
## Short history
- 2002: Beginning of development (based on C-library ALBERT(A))
- 2005: First release
- 2007: PhD Thesis of Simon Vey: "*Adaptive Finite Elements for Systems of PDEs*"
- 2007: Development in the IWR at TU-Dresden
- 2008: First parallel version
- 2011: Release of stable version 0.9
- 2013: PhD Thesis of Thomas Witkowski: "*Software concepts and algorithms for an efficient and scalable parallel finite element method*"
- 2014: Generic expression terms introduced
- 2019 (?): AMDiS 2.0 (based on dune library)
Developers:
```
Axel Voigt, Simon Vey, Christina Stöcker, Thomas Wittkowski,
Andreas Naumann, Simon Praetorius, Siqi Ling, Sebastian Reuther, ...
```
---
## Some features
- Solve (sequence of) Systems of **stationary linear PDEs** of **2nd order**
- **Time integrators**: e.g. Rosenbrock method
- **Nonlinear solvers**: e.g. Newton method
- **Adaptivity** in space and time
- Lagrange **basis functions** (deg. 1--4), and center-bubble function
- **Mixed finite-elements**, e.g. `\(P^2/P^1\)`, Mini-Element
- **Multi-Mesh** method (i.e. different components with different mesh)
- Sequential and **parallel** (tested with up to 16K cores, and `\(10^9\)` DOFs)
- **Multi-Grid**: geometric (in AMDiS), algebraic (external library)
- Interface to **linear solvers**: (P)MTL4, PETSc, Hypre
- **FETI-DP** / Schur-complement solvers in parallel
---
# Get AMDiS
### Source code
AMDiS is an open source library availabe on Gitlab
https://gitlab.mn.tu-dresden.de/iwr/amdis
### Package
Some precompiled packages for Debian Linux available
https://gitlab.mn.tu-dresden.de/iwr/packages
### Docker image
Environment to work with compiled and installed library
https://hub.docker.com/r/mathiwr/amdis-1.1.dev
---
## System requirements
- Recent C++ compiler (e.g. g++ >= 6.0, clang >= 4.0, intel icc >= 2018)
- CMake (>= 3.1)
- Boost (>= 1.48)
- optional: Git, SuiteSparse, PETSc, ParMetis, Hypre, BDDC,...
Everything necessary is collected and composed in a docker image.
## Setup AMDiS in PC lab
- Use docker image: `mathiwr/amdis-1.1.dev:debian9`
- Mount local directory: `~/Desktop`
- Work in terminal: `bash`
```
docker pull mathiwr/amdis-1.1.dev
docker run -it -v ~/Desktop:/Desktop mathiwr/amdis-1.1.dev:debian9 bash
```
</textarea>
<script src="lib/remark.js" type="text/javascript"></script>
<script type="text/javascript" src="MathJax/MathJax.js?config=TeX-AMS_HTML"></script>
<script type="text/javascript">
var slideshow = remark.create({
ratio: "4:3",
highlightLanguage: "cpp"
});
// Setup MathJax
MathJax.Hub.Config({
tex2jax: {
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre']
}
});
MathJax.Hub.Queue(function() {
$(MathJax.Hub.getAllJax()).map(function(index, elem) {
return(elem.SourceElement());
}).parent().addClass('has-jax');
});
MathJax.Hub.Configured();
</script>
</body>
</html>
......@@ -10,8 +10,8 @@
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
</style>
<!--<link rel="stylesheet" type="text/css" href="style_display.css" />-->
<link rel="stylesheet" type="text/css" href="style_print.css" />
<link rel="stylesheet" type="text/css" href="style_display.css" />
<!--<link rel="stylesheet" type="text/css" href="style_print.css" />-->
</head>
<body>
<textarea id="source">
......@@ -19,17 +19,9 @@
class: center, middle
# Session 1
## Scalar linear second order PDEs
---
# Agenda
### Monday
## Wednesday Nov 28
- **Scalar linear second order PDEs**
- Handling data on unstructured grids
- Adaptivity and systems of equations
- Introduction to Student Projects
- Discrete functions on unstructured grids
---
......@@ -69,23 +61,25 @@ with `\(\langle a,b \rangle_\Omega:=\int_\Omega a\cdot b\,\text{d}x\)` and `\(V^
- `\(V^{(0)}=V^{(1)} = H^1(\Omega)\)`, or
- `\(V^{(1)}=V_G:=\{u\in H^1(\Omega)\,:\,u|_{\partial\Omega}=G\}, V^{(0)} = V_0\)`.
plus some boundary terms from the boundary conditions.
---
# Basic ingredients
What data/information do you need to formulate your problem?
1. Description of your **domain** `\(\Omega\)` + a **triangulation** `\(\mathcal{T}_h\)` of the domain --> `Mesh`
2. Function-space `\(V\)`, or its **basis-functions** respectively.
- `P1` := Lagrange elements with polynomial degree `\(p=1\)`:
2. (Discrete) Function-space `\(V_h\)`, or its **basis-functions** respectively.
- `P1` := Lagrange elements with polynomial degree `\(p=1\)`, e.g.
\\[
V = \\{ v\in H^1(\Omega)\,:\, v|\_T\in\mathbb{P}\_p(T),\,\forall T\in\mathcal{T}\_h(\Omega)\\}
V_h = \\{ v\in H^1(\Omega)\,:\, v|\_T\in\mathbb{P}\_p(T),\,\forall T\in\mathcal{T}\_h(\Omega)\\}
\\]
- `P1+bubble` := `P1` + center bubble-function
`\(V^{(0)}\)` is called `RowFeSpace` and `\(V^{(1)}\)` is called `ColumnFeSpace`.
`\(V_h^{(0)}\)` is called `RowFeSpace` and `\(V_h^{(1)}\)` is called `ColumnFeSpace`.
--
3. **Solution** vector `\(u\)`, based on a numbering of all DOFs --> `DOFVector`
3. **Solution** vector `\((u_i)\equiv u\in V_h^{(1)}\)`, called `DOFVector`
\\[
u(x) = \sum\_i u\_i\phi\_i(x),\quad\text{with}\;\\{\phi_i\\}\text{ a basis of }V^{(1)}
\\]
......@@ -111,11 +105,11 @@ What data/information do you need to formulate your problem?
# General procedure
<img src="images/procedure.png" width="100%" alt="Solution procedure" />
<img src="images/procedure_en.png" width="100%" alt="Solution procedure" />
---
# Basic structure of an AMDiS program
# First AMDiS program
### Header file
```
......@@ -169,7 +163,7 @@ prob.initialize(INIT_ALL);
```
with `initialize(flag)`
- reads a mesh from file
- initial flobal refinement
- initial global refinement of the mesh
- creates corresponsing finite-element spaces
- creates, estimators, markers, solvers, ...
......@@ -193,10 +187,10 @@ Operator opF(prob.getFeSpace());
addZOT(opF, 1.0); // <f, theta>, f=1
```
with `addSOT(op, coeff)`
- adds a second order term to the operator `op`, with coefficient function `coeff`
- adds a 2nd order term to the operator `op`, with coefficient function `coeff`
with `addZOT(op, coeff)`
- adds a zero order term to the operator `op`, with coefficient function `coeff`
- adds a 0th order term to the operator `op`, with coefficient function `coeff`
---
......@@ -220,7 +214,7 @@ addZOT(opF, 1.0); // <f, theta>, f=1
prob.addMatrixOperator(opL, 0, 0);
prob.addVectorOperator(opF, 0);
```
with the number `0` corresponding to the block-matrix component. We have only one block and thus, this is always 0. More about block systems later.
with the number `0` corresponds to the 0th unknown in the 0th equation. We have only one block and thus, this is always 0. More about block systems later.
---
......@@ -253,9 +247,6 @@ a predefined functor, that returns `0` always.
---
# Example 1
Find `\(u\in V_0\)`, s.t. `\(\langle\nabla u,\nabla\theta\rangle_\Omega = \langle f,\theta\rangle_\Omega,\;\forall\theta\in V_0.\)`
### Define boundary conditions
```
ProblemStat prob("poisson"); // Problem definition
......@@ -276,8 +267,8 @@ prob.addDirichletBC(nr, 0, 0, new Constant(0.0)); // Define boundary condition
```
AdaptInfo adaptInfo("adapt"); // Store Informations about solution process
prob.assemble(&adaptInfo); // Assemble and solve system
prob.solve(&adaptInfo);
prob.assemble(&adaptInfo); // Assemble and
prob.solve(&adaptInfo); // solve the linear system
prob.writeFiles(&adaptInfo, true); // Write solution to file
```
......@@ -320,7 +311,7 @@ int main(int argc, char** argv)
# Compile and run the AMDiS program
### CMake configuration
File `CMakeLists.txt`
File `DIR/CMakeLists.txt`
```cmake
project("workshop")
find_package(AMDIS REQUIRED)
......@@ -328,19 +319,87 @@ add_executable("poisson" src/poisson.cc)
target_link_libraries("poisson" AMDiS)
```
- CMake requires variable `AMDIS_DIR` to point to directory, that contains the file `AMDiSConfig.cmake`
- CMake requires variable `AMDIS_DIR` to point to directory, that contains the file `AMDiSConfig.cmake`. This
is set automatically in Docker container.
- See [Link](http://goo.gl/kVe0Z2) for documentation of cmake commands
### Compile
```
cd DIR
mkdir build && cd build
cmake [-DAMDIS_DIR=...] DIR
make [poisson]
```
where `DIR=..` contains the `CMakeLists.txt` file.
---
### CMake output
```
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- [...]
-- Performing Test COMPILER_SUPPORTS_CXX14_FLAG - Success
-- Performing Test CXX14_COMPILES_WITH_CXX14_FLAG - Success
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- system
-- [...]
-- UMFPACK version: 5.7.1 (Oct 10, 2014)
-- Found the following SuiteSparse libraries:
-- /usr/lib/x86_64-linux-gnu/libumfpack.so
-- [...]
-- Configuring done
-- Generating done
-- Build files have been written to: DIR/build
```
### Compile output
```
Scanning dependencies of target poisson
[ 50%] Building CXX object CMakeFiles/poisson.dir/src/poisson.cc.o
[100%] Linking CXX executable poisson
[100%] Built target poisson
```
---
### Run an AMDiS program
```
./poisson INIT-FILE
cd DIR
./build/poisson INIT-FILE
```
```
MacroReader::checkMesh():
Checking mesh ...
checking done; no error detected
ProblemStat::buildAfterCoarsen():
2113 DOFs for FeSpace[0] (P1)
fillin of assembled matrix: 13897
buildAfterCoarsen needed 0.01085 seconds
LinearSolverInterface::solveSystem():
LinearSolverInterface::solveSystem()
Problem::solve():
solution of discrete system needed 0.00278 seconds
FileWriter<T>::writeFiles():
ParaView file written to ./output/poisson.2d.vtu
ProblemStat::writeFiles():
writeFiles needed 0.01950 seconds
```
---
# The parameter file
# Visualization
Plot Solution (.vtu file), using [ParaView](www.paraviw.org)
<img src="images/paraview.png" width="100%" alt="Poisson equation in paraview" />
---
# The parameter file (INIT-FILE)
A parameter file (init-file) controls various parameters of the solution
A parameter file controls various parameters of the solution
process, defines the FiniteElemSpace and sets the mesh and is mandatory.
Init-files have the suffix `.dat.Xd`, where `X` is in \{1, 2, 3\}.
......@@ -434,15 +493,6 @@ vertex coordinates:
</td>
</tr></table>
---
# Visualization
Plot Solution (.vtu file), using [ParaView](www.paraviw.org)
<img src="images/paraview.png" width="100%" alt="Poisson equation in paraview" />
---
class: center, middle
......@@ -495,7 +545,16 @@ with the program `ParaView`.
---
# Some hints
1. Used functions/classes:
1. When you get the error message
```
Cannot open file ./output/exercise1.2d.vtu for writing!
```
the directory `output` is missing. Just create it and run again:
```
mkdir output
```
2. Used functions/classes:
```
addSOT(Operator, EXPRESSION);
addZOT(Operator, EXPRESSION);
......@@ -503,17 +562,19 @@ addZOT(Operator, EXPRESSION);
// argument-type WorldVector<double>:
AbstractFunction<double, WorldVector<double>>;
```
2. Parameters to modify:
3. Parameters to modify:
```matlab
mesh->global refinements: INTEGER
poisson->feSpace[0]: [P1|P2|P3|P4|P1+bubble]
poisson->solver: [cg|gmres|direct|...]
```
3. Sources for help:
- [AMDiS-Wiki](https://goo.gl/Jy3u1u)
- [Init-file manual](https://goo.gl/Dhm9Bx)
- [Expressions manual](https://goo.gl/JK8EUI)
- [List of init-file parameters](https://goo.gl/LWJzq9)
---
## Sources for help:
- [AMDiS-Wiki](https://goo.gl/Jy3u1u)
- [Init-file manual](https://goo.gl/Dhm9Bx)
- [Expressions manual](https://goo.gl/JK8EUI)
- [List of init-file parameters](https://goo.gl/LWJzq9)
</textarea>
<script src="lib/remark.js" type="text/javascript"></script>
......
......@@ -10,45 +10,34 @@
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
</style>
<!--<link rel="stylesheet" type="text/css" href="style_display.css" />-->
<link rel="stylesheet" type="text/css" href="style_print.css" />
<link rel="stylesheet" type="text/css" href="style_display.css" />
<!--<link rel="stylesheet" type="text/css" href="style_print.css" />-->
</head>
<body>
<textarea id="source">
class: center, middle
# Session 2
## Handling data on unstructured grids
---
# Agenda
### Monday
## Wednesday Nov 28
- Scalar linear second order PDEs
- **Handling data on unstructured grids**
- Adaptivity and systems of equations
- Introduction to Student Projects
- **Discrete functions on unstructured grids**
---
# Motivation
### Extract maxima of solution
<img src="images/ball500.png" width="45%" /><img src="images/pfc_sphere.png" width="45%" />
<img src="images/ball500.png" width="25%" /> <img src="images/pfc_sphere.png" width="25%" />
### Calculate integrals
<img src="images/energy.png" width="45%" />
<img src="images/energy.png" width="35%" />
---
# Working with the discrete solution
Finite-Element function `\(u_h\)` expressed as linear combination of basis-functions `\(\phi_i\)`:
# Working with discrete functions
Finite-Element function `\(u_h\)`, a linear combination of basis-functions `\(\phi_i\)`:
\\[
u\_h(x) = \sum\_i u\_i \phi\_i(x),
u\_h(x) = \sum\_i u\_i \phi\_i(x) = \sum\_j u\_{i\_T(j)} \hat{\phi}_j(\lambda\_T(x)),
\\]
with `\(u_i:=\)` Degrees of Freedom, stored in `DOFVector<value_type> U`:
- Evaluate at DOF index: `U[idx]`
- Evaluate at DOF index: `u_i = U[i]`
- Iterate over all DOFs:
```
DOFIterator<value_type> it(&U [, USED_DOFS]);
......@@ -56,7 +45,7 @@ for (it.reset(); !it.end(); ++it)
*it = value; // idx = it.getDOFIndex()
```
- Evaluate DOFVector at coordinate `\(x\)`:
- Evaluate DOFVector at global coordinate `\(x\)`:
```
WorldVector<double> x;
x[0] = 0.2; x[1] = 0.3;
......@@ -64,18 +53,47 @@ value_type value = U(x);
```
---
## Discrete function on element T
Evaluate DOFVector in local coordinates `\(\lambda\)` of element `T=elInfo->getElement()`
\\[
u\_h(x\_T(\lambda)) = \sum\_j \hat{u}\_j \hat{\phi}_j(\lambda),
\\]
with `\(\hat{u}_j = u_{i_T(j)}\)`
1. Get local DOFs `u_j` on the element
2. Evaluate the linear combination of basis functions
```
const FiniteElemeSpace* feSpace = U.getFeSpace();
const BasisFunction* basFcts = feSpace->getBasisFcts();
ElementVector uh(basFcts->getNumber());
U.getLocalVector(elInfo->getElement(), uh); // local DOFs u_j
basFcts->evalUh(lambda, uh); // linear combination
```
---
# Interpolate a local function to a DOFVector
A local function is something that can be evaluated at local coordinates in a *bound* element.
By traversing the mesh the local function can be used to locally interpolate to the DOFs of an
element.
# Fill a DOFVector}
```
U << EXPRESSION;
```
where `EXPRESSION` can contain e.g.
- The coordinates: `X()`, `X(i)`
- Scalar values: `1.0`, `constant(1.0)`
- Matrix and vector expressions: `two_norm(...)`, `vec * vec`
- Other DOFVectors: `valueOf(V)`, `gradientOf(V)`
- Matrix and vector expressions: `two_norm(...)`, `vec * vec`
([Expressions manual](https://goo.gl/JK8EUI))
([Expressions manual](https://gitlab.mn.tu-dresden.de/iwr/amdis/wikis/expressions))
---
### Example:
Let `\(C\)` and `\(U\)` be of type `DOFVector<double>`:
......
## List of Expressions
### Terminal/elemental epressions
In the following table, a `DV` represents a pointer or reference to a `DOFVector<T>` of some value type `T`:
| Expression | Semantics |
| --------------- | ----------------------------- |
| `valueOf(DV)` | Evaluation of a DOFVector in local coordinates |
| `gradientOf(DV)`| Evaluation of the gradient of a DOFVector in local coodinates |
| `derivativeOf(DV, i)` | Evaluation of the partial derivative of a DOFVector w.r.t. component i |
| `hessianOf(DV)` | Evaluation of the hessian of a DOFVector, i.e. `H_ij = d_i(d_j(DV))` |
| `laplacianOf(DV)` | Evaluation of the Lacplacian of a DOFVector, i.e. `L = sum_i(d_i(d_i(DV)))` |
| `componentOf(DV, i)` | The i-th Component of a (vector valued) DOFVector |
| `X(), X(i)` | The global coordinate `x(lambda)` of the local coordinate `lambda`, or its i-th component. |
| `N(b), N(b,i)` | The outer boundary normal vector, w.r.t. the boundary face wiht nr `b`, or its i-th component. |
| `M(), M(i)` | The surface normal vector (element normal) for surface grids, or its i-th component. |
| `constant(c), c` | A constant numeric value |
| `constant<C>()` | A constant numeric value evaluable at compile time. Useful for symbolic differentiation, see below. |
| `ref_(c)` | A reference wrapper of a dynamic numeric value. |
The expression `valueOf(DV)` can also be applied to vector or matrices of DOFVectors.:
| Expression | Semantics |
| ---------- | --------- |
| `valueOf(DV)` | Evaluation of a DOFVector in local coordinates |
| `valueOf(vector<DV<T>>)` | Results in a `vector<T>` with values from the DOFVectors evaluated in the local coordinates. |
| `valueOf(matrix<DV<T>>)` | Results in a `matrix<T>` with values from the DOFVectors evaluated in the local coordinates |
| `valueOf<Name>(X)` | An expression with a name, i.e. a unique type `Name`. Usefull for symbolic differentiation. |
### Operations on expressions
In the following table operations are listed that can be applied to elemental expressions or combination of those. In the list `T` and `Tn` represent an expression (term) and `F` represents a funktor-objekt (see below).
| Expression | Semantics |
| ---------- | --------- |
| `+, -, *, /` | Arithmetic operations |
| `pow<p>(T)` | The p-th power of an expression. |
| `sqrt(T)` | The square-root of an expression |
| `exp(T)` | The exponential function applied to the evaluated expression |
| `log(T)` | The natural logarithm applied to an evaluated expression. |
| `cos(T), sin(T), tan(T)` | Der Cosinus, Sinus, bzw. Tangens der Auswertung des Terms T. |
| `acos(T), asin(T), atan(T)` | Der Arkus-Cosinus, Arkus-Sinus, bzw. Arkus Tangens der Auswertung des Terms T. |
| `atan2(T1, T2)` | Der Arkus-Tangens 2 = atan(T1 / T2). |
| `cosh(T), sinh(T), tanh(T)` | Der Cosinus-Hyperbolicus, Sinus-Hyperbolicus, bzw. Tangens-Hyperbolicus der Auswertung des Terms T. |
| `acosh(T), asinh(T), atanh(T)` | Der Arkus Cosinus-Hyperbolicus, Arkus Sinus-Hyperbolicus, Arkus Tangens-Hyperbolicus der Auswertung des Terms T. |
| `max(T1, T2), min(T1, T2)` | Das Maximum/Minimum der Auswertungen von T1, bzw. T2. |
| `abs_(T), signum(T)` | Der Absolutbetrag von T, bzw. das Vorzeichen (`T < 0 => signum(T) := -1, T>0 => signum(T) := 1, T==0 => signum(T) := 0`) |
| `clamp(T, lo, hi)` |
| `ceil(T), floor(T)` | die kleines ganze Zahl größer, bzw. die größte ganze Zahl kleiner als Wert von T |
| `function_(F, T1, T2, T3, ...)` | Die Anwendung eines Funktors F auf die Auswertung der Terme T1,T2,... | If `T` compares less than `lo`, returns `lo`; otherwise if `hi` compares less than `T`, returns `hi`; otherwise returns `T`
Ein Funktor ist dabei eine Klasse mit folgender Struktur:
```c++
struct Functor : public FunctorBase
{
typedef (...) value_type;
int getDegree(int d1, int d2, ...) const { return (...); }
value_type operator()(const T1::value_type&, const T2::value_type&, ...) const { return (...); }
};
```
Die Argumente, die an die Funktion `getDegree` übergeben werden sind die Polynomgrade der Terme:
```c++
getDegree(T1.getDegree(), T2.getDegree(), ...)
```
### Vektor-/Matrix-Ausdrücke
Für vektor- bzw. matrixwertige Term, wie z.B. `gradientOf(DV)` gibt es eine Reihe von Ausdrücken / Operationen, die im Folgenden aufgelistet sind. Dabei bezeichnet `V` eine vektorwerte Expression und `M` eine matrixwertige Expressions.
| Expression | Semantics |
| ---------- | --------- |
| `+, -` | Elementare arithmetische Ausdrücke (Elementweise) |
| `unary_dot(V)` | Skalarprodukt eines vektorwertigen Terms mit sich selbst: `result = V^H * V`. |
| `dot(V1, V2)` | Skalarprodukt zweier vektorwertigen Terme: `result = V1^H * V2`. |
| `one_norm(V)` | Die 1-Norm eines Vektors `result = sum_i(abs(V_i))`. |
| `one_norm(M)` | Die 1-Norm einer Matrix `result = max_j(sum_i(abs(M_ij)))`. |
| `two_norm(V)` | Die 2-Norm eines Vektors `result = sqrt(V^H * V)`. |
| `p_norm<p>(V)` | Die p-Norm eines Vektors `result = [sum_i(abs(v_i)^p)]^(1/p)`. |
| `cross(V1, V2)` | Kreuzprodukt zweier vektorwertigen Terme: `result = V1 x V2`. |
| `diagonal(V)` | Diagonalmatrix aus einträgen eines vektorwertigen Terms: `matrix = diagonal(V)`. |
| `outer(V1, V2)` | Äußeres Produkt (dyadisches Produkt / Tensorprodukt) zweier vektorwertigen Terme: `matrix = V1 * V2^T`. |
| `trans(M)` | Das Transponierte eines matrixwertigen Terms: `result = M^T`. |
| `at(V, i)` | Zugriff auf eine Komponente eines Vektors: `result = V_i`. |
| `at(M, i, j)` | Zugriff auf eine Komponente einer Matrix: `result = M_ij`. |
Subproject commit 609b809c4b908adc9c7aea3d92f80f75f78e04e1
Subproject commit af1c8568b5158284b56e49d052c6df6a33a8487c
......@@ -9,11 +9,14 @@ a { color: #ffef69; }
background: #2e2e2e;
color: #fff;
}
.remark-slide-content h2 {
.remark-slide-content h1 {
font-size: 35px;
}
.remark-slide-content h2 {
font-size: 28px;
}
.remark-slide-content h3 {
font-size: 25px;
font-size: 20px;
}
.remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
.katex-html { display: none; }
......
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