Commit a63a7f20 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Forgotten to renew polynomial degree definition in scalar demos in...

Forgotten to renew polynomial degree definition in scalar demos in documentation while removing ProblemScal.
parent 1f0eda53
...@@ -5,7 +5,7 @@ ballMesh->global refinements: 3 ...@@ -5,7 +5,7 @@ ballMesh->global refinements: 3
ball->mesh: ballMesh ball->mesh: ballMesh
ball->dim: 2 ball->dim: 2
ball->polynomial degree: 1 ball->polynomial degree[0]: 1
ball->space->components: 1 ball->space->components: 1
......
...@@ -5,7 +5,7 @@ ballMesh->global refinements: 15 ...@@ -5,7 +5,7 @@ ballMesh->global refinements: 15
ball->mesh: ballMesh ball->mesh: ballMesh
ball->dim: 3 ball->dim: 3
ball->polynomial degree: 1 ball->polynomial degree[0]: 1
ball->space->components: 1 ball->space->components: 1
......
...@@ -4,9 +4,9 @@ bunnyMesh->macro file name: ./macro/bunny_fixed.macro ...@@ -4,9 +4,9 @@ bunnyMesh->macro file name: ./macro/bunny_fixed.macro
bunnyMesh->check: 0 bunnyMesh->check: 0
bunnyMesh->global refinements: 0 bunnyMesh->global refinements: 0
bunny->mesh: bunnyMesh bunny->mesh: bunnyMesh
bunny->dim: 2 bunny->dim: 2
bunny->polynomial degree: 1 bunny->polynomial degree[0]: 1
bunny->solver: cg bunny->solver: cg
bunny->solver->max iteration: 100 bunny->solver->max iteration: 100
......
...@@ -5,7 +5,7 @@ elliptMesh->global refinements: 3 ...@@ -5,7 +5,7 @@ elliptMesh->global refinements: 3
ellipt->mesh: elliptMesh ellipt->mesh: elliptMesh
ellipt->dim: 1 ellipt->dim: 1
ellipt->polynomial degree: 1 ellipt->polynomial degree[0]: 1
ellipt->components: 1 ellipt->components: 1
ellipt->solver: cg ellipt->solver: cg
......
...@@ -5,7 +5,7 @@ elliptMesh->global refinements: 0 ...@@ -5,7 +5,7 @@ elliptMesh->global refinements: 0
ellipt->mesh: elliptMesh ellipt->mesh: elliptMesh
ellipt->dim: 2 ellipt->dim: 2
ellipt->polynomial degree: 1 ellipt->polynomial degree[0]: 1
ellipt->components: 1 ellipt->components: 1
ellipt->solver: cg ellipt->solver: cg
......
...@@ -5,7 +5,7 @@ elliptMesh->global refinements: 0 ...@@ -5,7 +5,7 @@ elliptMesh->global refinements: 0
ellipt->mesh: elliptMesh ellipt->mesh: elliptMesh
ellipt->dim: 3 ellipt->dim: 3
ellipt->polynomial degree: 1 ellipt->polynomial degree[0]: 1
ellipt->components: 1 ellipt->components: 1
ellipt->solver: cg ellipt->solver: cg
......
...@@ -3,7 +3,7 @@ dimension of world: 1 ...@@ -3,7 +3,7 @@ dimension of world: 1
heatMesh->macro file name: ./macro/macro.stand.1d heatMesh->macro file name: ./macro/macro.stand.1d
heatMesh->global refinements: 0 heatMesh->global refinements: 0
heat->space->polynomial degree: 1 heat->space->polynomial degree[0]: 1
heat->space->dim: 1 heat->space->dim: 1
heat->space->mesh: heatMesh heat->space->mesh: heatMesh
......
...@@ -3,7 +3,7 @@ dimension of world: 3 ...@@ -3,7 +3,7 @@ dimension of world: 3
heatMesh->macro file name: ./macro/macro.stand.3d heatMesh->macro file name: ./macro/macro.stand.3d
heatMesh->global refinements: 3 heatMesh->global refinements: 3
heat->space->polynomial degree: 1 heat->space->polynomial degree[0]: 1
heat->space->dim: 3 heat->space->dim: 3
heat->space->mesh: heatMesh heat->space->mesh: heatMesh
......
...@@ -5,7 +5,7 @@ neumannMesh->global refinements: 0 ...@@ -5,7 +5,7 @@ neumannMesh->global refinements: 0
neumann->mesh: neumannMesh neumann->mesh: neumannMesh
neumann->dim: 2 neumann->dim: 2
neumann->polynomial degree: 1 neumann->polynomial degree[0]: 1
neumann->components: 1 neumann->components: 1
neumann->solver: cg neumann->solver: cg
......
...@@ -3,10 +3,10 @@ dimension of world: 3 ...@@ -3,10 +3,10 @@ dimension of world: 3
parametricMesh->macro file name: ./macro/parametric.macro.3d parametricMesh->macro file name: ./macro/parametric.macro.3d
parametricMesh->global refinements: 0 parametricMesh->global refinements: 0
parametric->mesh: parametricMesh parametric->mesh: parametricMesh
parametric->dim: 2 parametric->dim: 2
parametric->polynomial degree: 2 parametric->polynomial degree[0]: 2
parametric->components: 1 parametric->components: 1
parametric->solver: cg parametric->solver: cg
parametric->solver->max iteration: 100 parametric->solver->max iteration: 100
......
...@@ -6,7 +6,7 @@ periodicMesh->global refinements: 0 ...@@ -6,7 +6,7 @@ periodicMesh->global refinements: 0
periodic->mesh: periodicMesh periodic->mesh: periodicMesh
periodic->dim: 1 periodic->dim: 1
periodic->polynomial degree: 1 periodic->polynomial degree[0]: 1
periodic->components: 1 periodic->components: 1
periodic->solver: cg periodic->solver: cg
......
...@@ -6,7 +6,7 @@ periodicMesh->global refinements: 0 ...@@ -6,7 +6,7 @@ periodicMesh->global refinements: 0
periodic->mesh: periodicMesh periodic->mesh: periodicMesh
periodic->dim: 2 periodic->dim: 2
periodic->polynomial degree: 1 periodic->polynomial degree[0]: 1
periodic->components: 1 periodic->components: 1
periodic->solver: cg periodic->solver: cg
......
...@@ -6,7 +6,7 @@ periodicMesh->global refinements: 0 ...@@ -6,7 +6,7 @@ periodicMesh->global refinements: 0
periodic->mesh: periodicMesh periodic->mesh: periodicMesh
periodic->dim: 3 periodic->dim: 3
periodic->polynomial degree: 1 periodic->polynomial degree[0]: 1
periodic->components: 1 periodic->components: 1
periodic->solver: cg periodic->solver: cg
......
...@@ -3,10 +3,10 @@ dimension of world: 3 ...@@ -3,10 +3,10 @@ dimension of world: 3
sphereMesh->macro file name: ./macro/sphere_macro.3d sphereMesh->macro file name: ./macro/sphere_macro.3d
sphereMesh->global refinements: 10 sphereMesh->global refinements: 10
sphere->mesh: sphereMesh sphere->mesh: sphereMesh
sphere->dim: 2 sphere->dim: 2
sphere->polynomial degree: 1 sphere->polynomial degree[0]: 1
sphere->components: 1 sphere->components: 1
sphere->solver: cg sphere->solver: cg
sphere->solver->max iteration: 100 sphere->solver->max iteration: 100
......
...@@ -3,10 +3,10 @@ dimension of world: 3 ...@@ -3,10 +3,10 @@ dimension of world: 3
torusMesh->macro file name: ./macro/torus_macro.3d torusMesh->macro file name: ./macro/torus_macro.3d
torusMesh->global refinements: 8 torusMesh->global refinements: 8
torus->mesh: torusMesh torus->mesh: torusMesh
torus->dim: 2 torus->dim: 2
torus->polynomial degree: 1 torus->polynomial degree[0]: 1
torus->components: 1 torus->components: 1
torus->solver: cg torus->solver: cg
torus->solver->max iteration: 1000 torus->solver->max iteration: 1000
......
...@@ -71,8 +71,8 @@ $F(\{v_i\}_i, \{\nabla w_j\}_j, \vec{x}) \cdot \nabla u$ & \texttt{General\_FOT} ...@@ -71,8 +71,8 @@ $F(\{v_i\}_i, \{\nabla w_j\}_j, \vec{x}) \cdot \nabla u$ & \texttt{General\_FOT}
%========================================================== %==========================================================
\multicolumn{2}{c}{\scriptsize Second-Order-Terms, sign in strong formulation: -}\\ \multicolumn{2}{c}{\scriptsize Second-Order-Terms, sign in strong formulation: -}\\
\hline \hline
$\Delta u$ & \texttt{Laplace\_SOT}() \\ $\Delta u$ & \texttt{Simple\_SOT}() \\
$c \cdot \Delta u$ & \texttt{FactorLaplace\_SOT}($c\in\mathbb{R}$) \\ $c \cdot \Delta u$ & \texttt{Simple\_SOT}($c\in\mathbb{R}$) \\
$\nabla\cdot (f(\vec{x}) \nabla u)$ & \texttt{CoordsAtQP\_SOT}($f:\mathbb{R}^n\rightarrow\mathbb{R}$) \\ $\nabla\cdot (f(\vec{x}) \nabla u)$ & \texttt{CoordsAtQP\_SOT}($f:\mathbb{R}^n\rightarrow\mathbb{R}$) \\
$\nabla\cdot (f(v) \nabla u)$ & \texttt{VecAtQP\_SOT}($v\in${\scriptsize DOFVector}$\langle\mathbb{R}\rangle$, $f:\mathbb{R}\rightarrow\mathbb{R}$) \\ $\nabla\cdot (f(v) \nabla u)$ & \texttt{VecAtQP\_SOT}($v\in${\scriptsize DOFVector}$\langle\mathbb{R}\rangle$, $f:\mathbb{R}\rightarrow\mathbb{R}$) \\
$\nabla\cdot (f(v, \vec{x}) \nabla u)$ & \texttt{VecAndCoordsAtQP\_SOT}($v\in${\scriptsize DOFVector}$\langle\mathbb{R}\rangle$, $f:\mathbb{R}\times\mathbb{R}^n\rightarrow\mathbb{R}$) \\ $\nabla\cdot (f(v, \vec{x}) \nabla u)$ & \texttt{VecAndCoordsAtQP\_SOT}($v\in${\scriptsize DOFVector}$\langle\mathbb{R}\rangle$, $f:\mathbb{R}\times\mathbb{R}^n\rightarrow\mathbb{R}$) \\
...@@ -94,4 +94,4 @@ $\nabla \cdot (A(\nabla v, \vec{x}) \nabla u)$ & \texttt{MatrixGradientAndCoords ...@@ -94,4 +94,4 @@ $\nabla \cdot (A(\nabla v, \vec{x}) \nabla u)$ & \texttt{MatrixGradientAndCoords
$\nabla \cdot (A(\{v_i\}_i, \{\nabla w_j\}_j, \vec{x}) \nabla u)$ & \texttt{General\_SOT}(\small{vector}$\langle${\scriptsize DOFVector}$\langle\mathbb{R}\rangle\rangle$,\small{vector}$\langle${\scriptsize DOFVector}$\langle\mathbb{R}\rangle\rangle$, $ A:\mathbb{R}^n\times$\small{vector}$\langle\mathbb{R}\rangle\times$\small{vector}$\langle\mathbb{R}^n\rangle\rightarrow\mathbb{R}^{n\times n}$, $div:\mathbb{R}^{n\times n}\rightarrow\mathbb{R}^{n}$) \\ $\nabla \cdot (A(\{v_i\}_i, \{\nabla w_j\}_j, \vec{x}) \nabla u)$ & \texttt{General\_SOT}(\small{vector}$\langle${\scriptsize DOFVector}$\langle\mathbb{R}\rangle\rangle$,\small{vector}$\langle${\scriptsize DOFVector}$\langle\mathbb{R}\rangle\rangle$, $ A:\mathbb{R}^n\times$\small{vector}$\langle\mathbb{R}\rangle\times$\small{vector}$\langle\mathbb{R}^n\rangle\rightarrow\mathbb{R}^{n\times n}$, $div:\mathbb{R}^{n\times n}\rightarrow\mathbb{R}^{n}$) \\
\end{longtable} \end{longtable}
\end{document} \end{document}
\ No newline at end of file
...@@ -270,7 +270,7 @@ a finer mesh. ...@@ -270,7 +270,7 @@ a finer mesh.
\begin{lstlisting}{} \begin{lstlisting}{}
ellipt->mesh: elliptMesh ellipt->mesh: elliptMesh
ellipt->dim: 2 ellipt->dim: 2
ellipt->polynomial degree: 1 ellipt->polynomial degree[0]: 1
ellipt->components: 1 ellipt->components: 1
\end{lstlisting} \end{lstlisting}
......
\section{Parametric elements} \section{Parametric elements}
\label{s:parametric} \label{s:parametric}
With parametric elements, problems can be solved on meshes which dimensions are not necessarily equal to the world dimension. Therefore, problems on arbitrary manifolds can be solved. Furthermore, the vertex coordinates of the mesh can be flexible. Hence, moving meshes can be implemented. With parametric elements, problems can be solved on meshes which
dimensions are not necessarily equal to the world dimension.
Therefore, problems on arbitrary manifolds can be solved. Furthermore,
the vertex coordinates of the mesh can be flexible. Hence, moving
meshes can be implemented.
In this section, we solve equation (\ref{eq:ellipt}) with $f=2x_0$ ($x_0$ is the first component of $x$) on a torus. Then we rotate the torus about the $y$-axis and solve the problem again. In this section, we solve equation (\ref{eq:ellipt}) with $f=2x_0$ ($x_0$ is the first component of $x$) on a torus. Then we rotate the torus about the $y$-axis and solve the problem again.
...@@ -43,7 +47,8 @@ We create a torus with center $(0; 0; 0)$ and the rotation axis in $z$-direction ...@@ -43,7 +47,8 @@ We create a torus with center $(0; 0; 0)$ and the rotation axis in $z$-direction
\subsection{Source code} \subsection{Source code}
First, we define the rotation about the $y$-axis, which is used later to rotate the whole torus and the right hand side function. First, we define the rotation about the $y$-axis, which is used later
to rotate the whole torus and the right hand side function.
\begin{lstlisting}{} \begin{lstlisting}{}
class YRotation class YRotation
...@@ -87,7 +92,8 @@ private: ...@@ -87,7 +92,8 @@ private:
}; };
\end{lstlisting} \end{lstlisting}
Every time, the mesh is rotated, the right hand side function will be informed over the method \verb+rotate+. Every time, the mesh is rotated, the right hand side function will be
informed over the method \verb+rotate+.
Now, we implement the projection on the torus. Now, we implement the projection on the torus.
...@@ -132,7 +138,10 @@ protected: ...@@ -132,7 +138,10 @@ protected:
}; };
\end{lstlisting} \end{lstlisting}
In the main program, we create a torus projection as \verb+VOLUME_PROJECTION+ with ID 1. The values of $r_1$ and $r_2$ are chosen, such that the resulting torus is completely surrounded by the macro mesh that is defined later. In the main program, we create a torus projection as
\verb+VOLUME_PROJECTION+ with ID 1. The values of $r_1$ and $r_2$ are
chosen, such that the resulting torus is completely surrounded by the
macro mesh that is defined later.
\begin{lstlisting}{} \begin{lstlisting}{}
int main(int argc, char* argv[]) int main(int argc, char* argv[])
...@@ -158,9 +167,12 @@ int main(int argc, char* argv[]) ...@@ -158,9 +167,12 @@ int main(int argc, char* argv[])
torus.writeFiles(adaptInfo, true); torus.writeFiles(adaptInfo, true);
\end{lstlisting} \end{lstlisting}
The problem definition and the creation of the adaptation loop are done in the usual way (here, replaced by \verb+...+) . After the adaptation loop has returned, we write the result. The problem definition and the creation of the adaptation loop are
done in the usual way (here, replaced by \verb+...+) . After the
adaptation loop has returned, we write the result.
Before we let the torus rotate, some variables are defined. We set the rotation angle to $\frac{\Pi}{3}$. Before we let the torus rotate, some variables are defined. We set the
rotation angle to $\frac{\Pi}{3}$.
\begin{lstlisting}{} \begin{lstlisting}{}
double rotation = M_PI/3.0; double rotation = M_PI/3.0;
...@@ -181,7 +193,11 @@ Before we let the torus rotate, some variables are defined. We set the rotation ...@@ -181,7 +193,11 @@ Before we let the torus rotate, some variables are defined. We set the rotation
parametricCoords[i] = new DOFVector<double>(feSpace, "parametric coords"); parametricCoords[i] = new DOFVector<double>(feSpace, "parametric coords");
\end{lstlisting} \end{lstlisting}
In the next step, we store the rotated vertex coordinates of the mesh in \verb+parametricCoords+,a vector of DOF vectors, where the first vector stores the first component of each vertex coordinate, and so on. In the STL map \verb+visited+, we store which vertices have already been visited, to avoid multiple rotations of the same point. In the next step, we store the rotated vertex coordinates of the mesh
in \verb+parametricCoords+,a vector of DOF vectors, where the first
vector stores the first component of each vertex coordinate, and so
on. In the STL map \verb+visited+, we store which vertices have
already been visited, to avoid multiple rotations of the same point.
\begin{lstlisting}{} \begin{lstlisting}{}
std::map<DegreeOfFreedom, bool> visited; std::map<DegreeOfFreedom, bool> visited;
...@@ -206,14 +222,20 @@ In the next step, we store the rotated vertex coordinates of the mesh in \verb+p ...@@ -206,14 +222,20 @@ In the next step, we store the rotated vertex coordinates of the mesh in \verb+p
} }
\end{lstlisting} \end{lstlisting}
We create an instance of class \verb+ParametricFirstOrder+ which then is handed to the mesh. Now, in all future mesh traverses the vertex coordinates stored in \verb+parametricCoords+ are returned, instead of the original coordinates. We create an instance of class \verb+ParametricFirstOrder+ which then
is handed to the mesh. Now, in all future mesh traverses the vertex
coordinates stored in \verb+parametricCoords+ are returned, instead of
the original coordinates.
\begin{lstlisting}{} \begin{lstlisting}{}
ParametricFirstOrder parametric(&parametricCoords); ParametricFirstOrder parametric(&parametricCoords);
torus.getMesh()->setParametric(&parametric); torus.getMesh()->setParametric(&parametric);
\end{lstlisting} \end{lstlisting}
We rotate the right hand side function, reset \verb+adaptInfo+ and start the adaptation loop again. Now, we compute the solution on the rotated torus, which then is written to the files \verb+rotation1.mesh+ and \verb+rotation1.dat+. We rotate the right hand side function, reset \verb+adaptInfo+ and
start the adaptation loop again. Now, we compute the solution on the
rotated torus, which then is written to the files
\verb+rotation1.mesh+ and \verb+rotation1.dat+.
\begin{lstlisting}{} \begin{lstlisting}{}
f.rotate(rotation); f.rotate(rotation);
...@@ -226,7 +248,9 @@ We rotate the right hand side function, reset \verb+adaptInfo+ and start the ada ...@@ -226,7 +248,9 @@ We rotate the right hand side function, reset \verb+adaptInfo+ and start the ada
delete dc; delete dc;
\end{lstlisting} \end{lstlisting}
We perform another rotation. All we have to do is to modify the coordinates in \verb+parametricCoords+ and to inform $f$ about the rotation. We perform another rotation. All we have to do is to modify the
coordinates in \verb+parametricCoords+ and to inform $f$ about the
rotation.
\begin{lstlisting}{} \begin{lstlisting}{}
visited.clear(); visited.clear();
...@@ -271,7 +295,9 @@ Finally, we free some memory and finish the main program. ...@@ -271,7 +295,9 @@ Finally, we free some memory and finish the main program.
\subsection{Parameter file} \subsection{Parameter file}
In the parameter file, we set the macro file to \verb+./macro/torus_macro.3d+. This two dimensional mesh is 8 times globally refined and successively projected on the torus. In the parameter file, we set the macro file to
\verb+./macro/torus_macro.3d+. This two dimensional mesh is 8 times
globally refined and successively projected on the torus.
\begin{lstlisting}{} \begin{lstlisting}{}
dimension of world: 3 dimension of world: 3
...@@ -279,9 +305,9 @@ dimension of world: 3 ...@@ -279,9 +305,9 @@ dimension of world: 3
torusMesh->macro file name: ./macro/torus_macro.3d torusMesh->macro file name: ./macro/torus_macro.3d
torusMesh->global refinements: 8 torusMesh->global refinements: 8
torus->mesh: torusMesh torus->mesh: torusMesh
torus->dim: 2 torus->dim: 2
torus->polynomial degree: 1 torus->polynomial degree[0]: 1
torus->solver: cg torus->solver: cg
torus->solver->max iteration: 1000 torus->solver->max iteration: 1000
......
...@@ -174,9 +174,9 @@ dimension of world: 3 ...@@ -174,9 +174,9 @@ dimension of world: 3
sphereMesh->macro file name: ./macro/sphere_macro.3d sphereMesh->macro file name: ./macro/sphere_macro.3d
sphereMesh->global refinements: 10 sphereMesh->global refinements: 10
sphere->mesh: sphereMesh sphere->mesh: sphereMesh
sphere->dim: 2 sphere->dim: 2
sphere->polynomial degree: 1 sphere->polynomial degree[0]: 1
sphere->solver: cg sphere->solver: cg
sphere->solver->max iteration: 100 sphere->solver->max iteration: 100
......
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