### And some more files removed.

parent ddcf1bf8
 DIM: 1 DIM_OF_WORLD: 1 number of vertices: 2 number of elements: 1 vertex coordinates: -1.0 1.0 element vertices: 0 1 element boundaries: 1 1 \ No newline at end of file
 DIM: 2 DIM_OF_WORLD: 2 number of vertices: 5 number of elements: 4 vertex coordinates: -1.0 -1.0 1.0 -1.0 1.0 1.0 -1.0 1.0 0.0 0.0 element vertices: 0 1 4 1 2 4 2 3 4 3 0 4 element boundaries: 0 0 1 0 0 1 0 0 1 0 0 1
 DIM: 3 DIM_OF_WORLD: 3 number of vertices: 8 number of elements: 6 vertex coordinates: -1.0 -1.0 -1.0 1.0 -1.0 -1.0 -1.0 -1.0 1.0 1.0 -1.0 1.0 1.0 1.0 -1.0 1.0 1.0 1.0 -1.0 1.0 -1.0 -1.0 1.0 1.0 element vertices: 0 5 4 1 0 5 3 1 0 5 3 2 0 5 4 6 0 5 7 6 0 5 7 2 element boundaries: 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 element neighbours: -1 -1 1 3 -1 -1 0 2 -1 -1 5 1 -1 -1 4 0 -1 -1 3 5 -1 -1 2 4
 ... ... @@ -5,11 +5,7 @@ \input{heat.tex} \input{vecellipt.tex} \input{couple.tex} %\input{nonlin.tex} \input{neumann.tex} \input{periodic.tex} \input{projections.tex} \input{parametric.tex} %\input{multigrid.tex} %\input{parallelheat.tex} %\input{composite.tex}
 \section{Multigrid} The multigrid method is an effective way to solve large linear systems of equations. Its complexity is proportional to the number of unknowns in the system of equations. This can be achieved by using the hierarchical mesh structure of AMDiS. The multigrid idea is based on the following two principles: \begin{itemize} \item {\it Smoothing principle}: Classical iterative methods often have a strong smoothing effect on the error. \item {\it Coarse grid principle}: A quantity that is smooth on a given grid can be approximated on a coarser grid without any essential loss of information. \end{itemize} To solve $L_h u_h = f_h$ on the fine grid, we start with an arbitrary initial guess of the solution $u_h$. Then we apply the following steps, until a given tolerance criterion for the solution is fulfilled: \begin{enumerate} \item Apply some smoothing steps to $u_h$ on the fine grid (pre-smoothing). \item Compute the fine grid residual $d_h = f_h - L_h u_h$. \item Restrict the residual $d_h$ to the coarse grid ($d_h \rightarrow d_H$). \item Solve the defect equation $L_H v_H = d_H$ on the coarse grid. \item Interpolate $v_H$ to the fine grid ($v_H \rightarrow v_h$). \item Correct the solution: $u_h = u_h + v_h$. \item Apply some smoothing steps to $u_h$ on the fine grid (post-smoothing). \end{enumerate} To solve the defect equation on the coarse level, we can apply the multigrid method recursively. This can be done once ({\it V-cycle}) or twice ({\it W-cycle}). At the coarsest level, the system of equations can be solved by a direct solver or again some smoothing steps are applied to it (in AMDiS, so far, no direct solver is applied at the coarsest level). To use the multigrid solver in AMDiS, only the parameter file has to be modified. So, we omit the other sections here. \begin{table} \center \begin{tabular}{|cc|c|c|c|} \hline & & {\bf 1d} & {\bf 2d} & {\bf 3d} \\ \hline {\bf source code} & \tt src/ & \multicolumn{3}{|c|}{\tt multigrid.cc} \\ \hline {\bf parameter file} & \tt init/ & \tt multigrid.dat.1d & \tt multigrid.dat.2d & \tt multigrid.dat.3d \\ \hline {\bf macro file} & \tt macro/ & \tt macro.stand.1d & \tt macro.stand.2d & \tt macro.stand.3d \\ \hline {\bf output files} & \tt output/ & \multicolumn{3}{|c|}{\tt multigrid.mesh, multigrid.dat} \\ \hline \end{tabular} \caption{Files of the {\tt multigrid} example.} \label{t:multigrid files} \end{table} \subsection{Parameter file} First, we have to avoid, that DOFs at coarse levels are freed, if they are not used at finer levels. \begin{lstlisting}{} multigridMesh->preserve coarse dofs: 1 \end{lstlisting} Now, we choose \verb+mg+ as solver, which is the key for the multigrid solver in AMDiS. \begin{lstlisting}{} multigrid->solver: mg \end{lstlisting} The next three lines are not multigrid specific. They determine the solver tolerance, the maximal number of solver iterations, and the pre-conditioner. \begin{lstlisting}{} multigrid->solver->tolerance: 1.e-12 multigrid->solver->max iteration: 100 multigrid->solver->left precon: diag \end{lstlisting} Now, multigrid specific parameters follow. \begin{lstlisting}{} multigrid->solver->use galerkin operator: 0 multigrid->solver->mg cycle index: 1 % 1: V, 2: W multigrid->solver->smoother: gs multigrid->solver->smoother->omega: 1.0 multigrid->solver->pre smoothing steps: 3 multigrid->solver->post smoothing steps: 3 multigrid->solver->coarse level smoothing steps: 1 multigrid->solver->min level: 0 multigrid->solver->min level gap: 1 multigrid->solver->max mg levels: 100 \end{lstlisting} The entry \verb+use galerkin operator+ determines, how the system on coarse levels is assembled. If the value is set to 1, the system of the finest level is successively restricted to coarser levels by the galerkin operator (which is only defined for linear Lagrange elements). If the value is set to 0, the system of coarser levels is assembled using the usual problem operators on the coarser meshes. The \verb+mg cycle index+ determines the number of recursive multigrid calls within each level. A value of $1$ results in V-cycle iterations, a value of $2$ in W-cycle iterations (in principle, also higher values could be chosen). Currently, as smoother only a relaxed Gauss-Seidel method is implemented (\verb+gs+). The value \verb+smoother->omega+ is the relaxation parameter. The meaning of \verb+pre smoothing steps+, \verb+post smoothing steps+ and \verb+coarse level smoothing+ \verb+steps+ is explained above. \verb+min level+ is the coarsest multigrid level. By default it is 0. \verb+min level gap+ describes the number of mesh levels that at least are skipped between two multigrid levels. \verb+max mg levels+ sets the maximum number of allowed multigrid levels. If necessary, more than \verb+min level gap+ levels are skipped, to fulfill this requirement.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!