Commit d5b4506d authored by Simone Deparis's avatar Simone Deparis
Browse files

Merge branch '201302_tutorial_update'

parents b2b92a96 6a8f2c38
......@@ -39,4 +39,6 @@ IF(PDFLATEX_COMPILER)
ADD_SUBDIRECTORY(CodingGuidelines)
ADD_SUBDIRECTORY(manual)
ENDIF()
add_custom_target (manual_links
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/../tex/lifestyle.cls;lifestyle.cls
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/../tex/rcs.sty;rcs.sty
VERBATIM)
add_latex_document (lifev-manual.tex
INPUTS lifev-manual.tex lifev-install.tex lifev-examples.tex cavity.tex navierstokes.tex fsi.tex BCCond.fig BCHandler.fig BasElSha.fig Fem_nodes.fig mixed_pattern.fig theFE.fig BCCond.eps BasElSha.eps NSCode_mesh_types.eps theFE.eps BCHandler.eps Fem_nodes.eps mixed_pattern.eps BCCond.pdf BasElSha.pdf NSCode_mesh_types.pdf theFE.pdf BCHandler.pdf Fem_nodes.pdf mixed_pattern.pdf cavityFigure.pdf_t cavityFigure.pdf ALEmapping.pdf
BIBFILES ../tex/lifev.bib
DEFAULT_PDF
MANGLE_TARGET_NAMES
USE_INDEX)
add_latex_document (lifev-dev.tex
INPUTS lifev-dev.tex lifev-install.tex lifev-examples.tex lifev-dev_conventions.tex lifev-dev_overview.tex lifev-dev_howto.tex BCCond.fig BCHandler.fig BasElSha.fig Fem_nodes.fig mixed_pattern.fig theFE.fig BCCond.eps BasElSha.eps NSCode_mesh_types.eps theFE.eps BCHandler.eps Fem_nodes.eps mixed_pattern.eps BCCond.pdf BasElSha.pdf NSCode_mesh_types.pdf theFE.pdf BCHandler.pdf Fem_nodes.pdf mixed_pattern.pdf cavityFigure.pdf_t cavityFigure.pdf ALEmapping.pdf
BIBFILES ../tex/lifev.bib
DEFAULT_PDF
MANGLE_TARGET_NAMES
USE_INDEX)
add_custom_target (manual)
add_custom_target (dev-guide)
add_dependencies (manual DEPENDS lifev-manual_pdf)
add_dependencies (dev-guide DEPENDS lifev-dev_pdf)
add_dependencies (lifev-manual_pdf DEPENDS manual_links)
add_dependencies (lifev-dev_pdf DEPENDS manual_links)
SET(TEX_FILES
lifev-manual
lifev-dev
)
SET(FILES_lifev-manual
lifev-manual.tex lifev-install.tex lifev-examples.tex cavity.tex navierstokes.tex fsi.tex BCCond.fig BCHandler.fig BasElSha.fig Fem_nodes.fig mixed_pattern.fig theFE.fig BCCond.eps BasElSha.eps NSCode_mesh_types.eps theFE.eps BCHandler.eps Fem_nodes.eps mixed_pattern.eps BCCond.pdf BasElSha.pdf NSCode_mesh_types.pdf theFE.pdf BCHandler.pdf Fem_nodes.pdf mixed_pattern.pdf cavityFigure.pdf_t cavityFigure.pdf ALEmapping.pdf
)
SET(FILES_lifev-dev
lifev-dev.tex lifev-install.tex lifev-examples.tex lifev-dev_conventions.tex lifev-dev_overview.tex lifev-dev_howto.tex BCCond.fig BCHandler.fig BasElSha.fig Fem_nodes.fig mixed_pattern.fig theFE.fig BCCond.eps BasElSha.eps NSCode_mesh_types.eps theFE.eps BCHandler.eps Fem_nodes.eps mixed_pattern.eps BCCond.pdf BasElSha.pdf NSCode_mesh_types.pdf theFE.pdf BCHandler.pdf Fem_nodes.pdf mixed_pattern.pdf cavityFigure.pdf_t cavityFigure.pdf ALEmapping.pdf
)
SET(BIB_FILES
../tex/lifev.bib
)
CONFIGURE_FILE(ltxcompile.cmake
ltxcompile @ONLY)
FOREACH(TEX_FILE ${TEX_FILES})
ADD_CUSTOM_TARGET(pdf_${TEX_FILE} echo
DEPENDS ${TEX_FILE}.pdf
)
ADD_DEPENDENCIES(pdf pdf_${TEX_FILE})
ADD_CUSTOM_COMMAND(
OUTPUT ${TEX_FILE}.pdf
COMMAND /bin/sh ltxcompile
ARGS ${TEX_FILE}.tex
DEPENDS ${FILES_${TEX_FILE}} ${BIB_FILES}
)
INSTALL(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.pdf
DESTINATION share/doc/lifev
COMPONENT doc
OPTIONAL
)
ENDFOREACH()
This diff is collapsed.
\def\filedate{2003/10/29}
\def\fileversion{1}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{lifestyle}[2003/10/29]
\message{`lifestyle v\fileversion, \filedate\space (Christophe Prud'homme <christophe.prudhomme@epfl.ch>)}
\RequirePackage{ifthen}
\newboolean{life@article} \setboolean{life@article}{true}
\newboolean{life@report} \setboolean{life@report}{false}
\newboolean{life@toc} \setboolean{life@toc}{false}
\newboolean{life@stretch} \setboolean{life@stretch}{false}
\DeclareOption{article} {\setboolean{life@article}{true}\setboolean{life@report}{false}}
\DeclareOption{report} {\setboolean{life@report}{true}\setboolean{life@article}{false}}
\DeclareOption{toc} {\setboolean{life@toc}{true}}
\DeclareOption{stretch} {\setboolean{life@stretch}{true}}
\ifthenelse{\boolean{life@article}}
{
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
}{
\ifthenelse{\boolean{life@report}}
{
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
}{
%% default is article
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
}
}
%%
%% Execution of Options
%%
\ProcessOptions
\ifthenelse{\boolean{life@article}}
{
\LoadClass[titlepage]{article}
}{
\ifthenelse{\boolean{life@report}}
{
\LoadClass[titlepage]{report}
}{
%% default is article
\LoadClass[titlepage]{article}
}
}
\RequirePackage{a4wide}
\RequirePackage{fancyhdr}
\RequirePackage{fancybox}
\RequirePackage{xspace}
\RequirePackage{multicol}
\RequirePackage{makeidx}
\RequirePackage{subfigure}
\RequirePackage{verbatim}
\RequirePackage{rcs}
\RequirePackage{colortbl}
\RequirePackage[english]{babel}
\RequirePackage{tabularx}
\RequirePackage[pdftex,colorlinks]{hyperref}
% Graphics rules
%
\RequirePackage[pdftex]{color}
\RequirePackage[pdftex]{graphicx}
\DeclareGraphicsExtensions{.jpg,.png,.pdf}
\DeclareGraphicsRule{*}{mps}{*}{}
% Some maths
%
\RequirePackage{amsmath,amsfonts,amssymb,amscd,amsthm,amsbsy}
\newcommand{\lifedraftdate}{\small Revision: \RCSRevision, \RCSDate, \RCSTime\ UTC Printed: \today}
\newenvironment{rationale}{\renewcommand{\labelitemi}{\textit{Rationale:}}
\begin{itemize}
\item
}{ \end{itemize}}
%%
%% Index
%%
\newcommand{\ix}[1]{#1\index{#1}}
\newcommand{\ixn}[1]{\index{#1}}
\newcommand{\ixv}[1]{{\tt #1}\index{#1}}
\newcommand{\ixs}[2]{#1\index{#1|see{#2}}\index{#2!#1}}
\newcommand{\ixns}[2]{\index{#1|see{#2}}\index{#2!#1}}
\newcommand{\ixvs}[2]{{\tt #1}\index{#1|see{#2}}\index{#2!#1}}
\newcommand{\nindex}[1]{\textit{#1}\index[name]{#1}}
\newcommand{\cppobj}[1]{\index{C++ Objects!#1}}
\newcommand{\lifetitle}[2]{\raggedright{\Huge #1}\\
\rule[2ex]{\linewidth}{1mm}\\
{\hfill\lifedraftdate}\\
\vfill{\Large #2}\\
\rule[2ex]{\linewidth}{.5mm}}
\newcommand{\thelibrary}{\textsl{LIFE V}\xspace}
\newcommand{\lifev}{\textsl{LifeV}\xspace}
%%
%% generate hints
%%
\usepackage{fancybox,framed}
\newcommand{\hinttitle}[1]{\mbox{#1}\xspace}
\definecolor{hintcolor}{rgb}{.95,1,.95}
% \newenvironment{\hint}[1]{
% \begin{framed}
% \colorbox{hintcolor}{\parbox{.65\linewidth}{
% % \begin{tabular}[.65\linewidth]{l}
% % \hinttitle{#1}\\
% % \rule[2ex]{\linewidth}{1mm}\\
% }{\end{framed}}
\makeatletter
\newenvironment{hint}[1]{%
\def\FrameCommand{%
% \setlength{\fboxrule}{\FrameRule}%
% \setlength{\fboxsep}{\FrameSep}%
\shadowbox
}%
\fram@d{\advance\hsize-\width}%
#1 Hint\\
\rule[2ex]{\linewidth}{.5mm}\\
}{%
\endfram@d
}
\makeatother
\makeglossary
\makeindex
\AtBeginDocument{
\maketitle
\ifthenelse{\boolean{life@stretch}}{\baselineskip 0.33in}{}
\ifthenelse{\boolean{life@toc}}{
\setlength{\columnseprule}{0.6pt}
\begin{multicols}{2}
\tableofcontents
\end{multicols}
}
}
\ No newline at end of file
This diff is collapsed.
\documentclass[a4paper, 12pt, report]{lifestyle}
\usepackage{rcs}
\usepackage[top=3.6cm,bottom=3.6cm,right=3.2cm,left=3.5cm]{geometry}
\usepackage{bm}
\RCS $Revision: 1.7 $
\RCS $date: 2010-10-08 13:00:00 $
\RCS $Revision: 1.8 $
\RCS $Date: 2012-08-16 17:00:00$
\RCS $State: Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......@@ -108,6 +110,7 @@
\newcommand{\invNN}{{S'}_\mf^{-1}(\lambda^k) + S'_\ms^{-1}(\lambda^k)}
\title{\lifetitle{LifeV User Manual}
{G. Fourestey, S. Deparis}
}
......@@ -119,14 +122,16 @@
%%\includeonly{lifev-dev_generalities,lifev-dev_howto}
\begin{document}
\maketitle
\phantom{dummy text}
\vfill
This manual is for LifeV (version 1.3.1, October 2010), a library for scientific computing
This manual is for LifeV (version 2.2.1, March 2012), %1.3.1, October 2010),
a library for scientific computing
using finite elements, specially aimed at fluid-structure interaction and blood flow simulation.
Copyright (C) 2001-2010 EPFL, INRIA, Polytechnico Di Milano.
Copyright (C) 2001- 2012 EPFL, INRIA, Polytechnico Di Milano.
\tableofcontents
......@@ -143,15 +148,3 @@ Copyright (C) 2001-2010 EPFL, INRIA, Polytechnico Di Milano.
\printindex
\end{document}
%
%%%%%%%%%%%%% Some Settings for emacs and auc-TeX
% Local Variables:
% TeX-master: t
% TeX-command-default: "PDFLaTeX"
% TeX-parse-self: t
% TeX-auto-save: t
%%% TeX-auto-regexp-list: TeX-auto-full-regexp-list
% eval: (ispell-change-dictionary "american")
% End:
%
......@@ -14,13 +14,13 @@ showlog(){
}
trap "showlog" 1 2 3 4 5 6 7 8 9 10 11
export TEXINPUTS=$srcdir:$top_srcdir/doc/tex//:$TEXINPUTS
export BIBINPUTS=$BIBINPUTS:$srcdir:$top_srcdir/doc/tex//:$BIBINPUTS
export TEXINPUTS=@CMAKE_CURRENT_SOURCE_DIR@:@CMAKE_SOURCE_DIR@/doc/tex//:$TEXINPUTS
export BIBINPUTS=@CMAKE_CURRENT_SOURCE_DIR@:@CMAKE_SOURCE_DIR@/doc/tex//:$BIBINPUTS
echo export TEXINPUTS=$TEXINPUTS | tee $logfile
echo export BIBINPUTS=$BIBINPUTS | tee -a $logfile
prefix=`basename $1 .tex`
prefix=`basename $1 .tex`
#ltxcmdlines="--interaction nonstopmode --file-line-error-style"
ltxcmdlines="--interaction nonstopmode"
......@@ -33,3 +33,4 @@ makeindex $prefix | tee -a $logfile
pdflatex $ltxcmdlines $prefix | tee -a $logfile
pdflatex $ltxcmdlines $prefix | tee -a $logfile
rm -f $prefix.aux $prefix.bbl $prefix.blg $prefix.log $prefix.out
......@@ -8,78 +8,79 @@
% E-MAIL: foureste@iacspc.epfl.ch
%
% ORIG-DATE: 4-Feb-09 at 14:11:50
% LAST-MOD: 5-Feb-09 at 18:11:24 by Gilles Fourestey
% LAST-MOD: 16-Aug-12 at 17:00:00 by Hélène Ruffieux
%
% DESCRIPTION:
% DESCRIP-END.
Now that we have decribed a simple stationary problem, let's have a look at the evolutionary
Now that we have described a simple stationary problem, let's have a look at the evolutionary
case. In this example, we will consider the same domain, but this time we will solve the
Navier-Stokes problem \ixn{Navier-Stokes Problem}. Starting from the Oseen problem (\ref{eqn-oseen})
\begin{equation*}
\left\{
\begin{array}{rl}
\displaystyle \alpha u + \beta \cdot \nabla u - \nu \Delta u+
\nabla p & = f \\
\displaystyle \nabla \cdot u & = 0
\begin{array}{rll}
\displaystyle \alpha \bm{u} + \bm{\beta} \cdot \nabla \bm{u} - \nu \Delta \bm{u}+
\nabla p & = \bm{f}& \mbox{ in } \Omega\\
\displaystyle \nabla \cdot \bm{u} & = 0& \mbox{ in } \Omega
\end{array}
\right.
\end{equation*}
plus boundary conditions.
We want to solve the non-stationary Navier-Stokes problem
\begin{equation*} \label{eqn-navierstokes}
\left\{
\begin{array}{rl}
\displaystyle \frac{\partial u}{\partial t} + u \cdot \nabla u - \nu \Delta u+
\nabla p & = f \\
\displaystyle \nabla \cdot u & = 0
\begin{array}{rll}
\displaystyle \frac{\partial \bm{u}}{\partial t} + \bm{u} \cdot \nabla \bm{u} - \nu \Delta \bm{u}+
\nabla p & = \bm{f} & \mbox{ in } \Omega\\
\displaystyle \nabla \cdot \bm{u} & = 0& \mbox{ in } \Omega
\end{array}
\right.
\end{equation*}
which can be written, using a semi-discretization of the time partial derivative as
\noindent which can be written, using a semi-discretization of the time partial derivative as
\begin{equation*} \label{eqn-nsnl}
\left\{
\begin{array}{rl}
\displaystyle \alpha u^{n+1} + u^{n+1} \cdot \nabla u^{n+1} - \nu \Delta u^{n+1}+
\nabla p^{n+1} & = f^n \\
\displaystyle \nabla \cdot u & = 0 \\
\begin{array}{rll}
\displaystyle \alpha \bm{u}^{n+1} + \bm{u}^{n+1} \cdot \nabla \bm{u}^{n+1} - \nu \Delta \bm{u}^{n+1}+
\nabla p^{n+1} & = \bm{f}^n& \mbox{ in }\Omega \\
\displaystyle \nabla \cdot \bm{u} & = 0 & \mbox{ in } \Omega\,. \\
\end{array}
\right.
\end{equation*}
Where $\alpha$ is a constant which depends on the time discretization order,
$\Delta t$ is the time step, $u^{n+1}$ and $p^{n+1}$
Here $\alpha$ is a constant which depends on the time discretization order,
$\Delta t$ is the time step, $\bm{u}^{n}$ and $p^{n}$
are the velocity and the pressure at the time $t^n = n\Delta t$.
Note that $f^n$ now contains terms resulting from the time discretization.
Using a linearization $\beta^n$ of (\ref{eqn-nsnl}) around $u^{n+1}$,
Note that $\bm{f}^n$ now contains terms resulting from the time discretization.
Using a linearization $\bm{\beta}^n$ of (\ref{eqn-nsnl}) around $\bm{u}^{n+1}$,
we get the full semi-discrete linearized Navier-Stokes
equations
\begin{equation*} \label{eqn-ns}
\left\{
\begin{array}{rl}
\displaystyle \alpha u^{n+1} + \beta^n \cdot \nabla u^{n+1} - \nu \Delta u^{n+1}+
\nabla p^{n+1} & = f^n \\
\displaystyle \nabla \cdot u & = 0 \\
\begin{array}{rll}
\displaystyle \alpha \bm{u}^{n+1} + \bm{\beta}^n \cdot \nabla \bm{u}^{n+1} - \nu \Delta \bm{u}^{n+1}+
\nabla p^{n+1} & = \bm{f}^n& \mbox{ in } \Omega \\
\displaystyle \nabla \cdot \bm{u} & = 0& \mbox{ in } \Omega\,. \\
\end{array}
\right.
\end{equation*}
Solving (\ref{eqn-ns}) using the framework we used for the stationary driven cavity is not difficult.
Instead of setting $\alpha$, $\beta$ and $f^n$ to zero, we give them their proper values. For instance,
Solving (\ref{eqn-ns}) using the framework that we introduced for the stationary driven cavity is not difficult.
Instead of setting $\alpha$, $\bm{\beta}$ and $\bm{f}^n$ to zero, we give them their proper values. For instance,
consider the first order discretization in time
\begin{equation*} \label{eqn-nso1}
\left\{
\begin{array}{rl}
\displaystyle \frac {u^{n+1}}{\Delta t} + u^n \cdot \nabla u^{n+1} - \nu \Delta u^{n+1}+
\nabla p^{n+1} & = \displaystyle \frac{u^n}{\Delta t} \\
\displaystyle \nabla \cdot u & = 0. \\
\begin{array}{rll}
\displaystyle \frac {\bm{u}^{n+1}}{\Delta t} + \bm{u}^n \cdot \nabla \bm{u}^{n+1} - \nu \Delta \bm{u}^{n+1}+
\nabla p^{n+1} & = \displaystyle \frac{\bm{u}^n}{\Delta t} & \mbox{ in } \Omega \\
\displaystyle \nabla \cdot \bm{u} & = 0 & \mbox{ in } \Omega\,. \\
\end{array}
\right.
\end{equation*}
......@@ -88,98 +89,191 @@ Or the second order discretization
\begin{equation*} \label{eqn-nso2}
\left\{
\begin{array}{rl}
\displaystyle \frac {3u^{n+1}}{2\Delta t} + u^n \cdot \nabla u^{n+1} - \nu \Delta u^{n+1}+
\nabla p^{n+1} & = \displaystyle \frac{2u^n}{\Delta t} - \frac{u^{n-1}}{2\Delta t} \\
\displaystyle \nabla \cdot u & = 0. \\
\begin{array}{rll}
\displaystyle \frac {3\bm{u}^{n+1}}{2\Delta t} + \bm{u}^n \cdot \nabla \bm{u}^{n+1} - \nu \Delta \bm{u}^{n+1}+
\nabla p^{n+1} & = \displaystyle \frac{2\bm{u}^n}{\Delta t} - \frac{\bm{u}^{n-1}}{2\Delta t} & \mbox{ in } \Omega \\
\displaystyle \nabla \cdot \bm{u} & = 0& \mbox{ in } \Omega\,. \\
\end{array}
\right.
\end{equation*}
Let's have a look at the code in \verb!testsuite/test_cavity/main.cpp!.
Until the first \verb!fluid.iterate()!, the code is the same as the one used to compute the Stokes problem.
Now, we want to use this Stokes solution to initialize our non-stationary Navier-Stokes problem, and be able
to store a history of previous solutions in order to compute the time derivative.
This can be done by using the following object
\begin{verbatim}
// bdf initialization with the stokes problem solution
BdfTNS<vector_type> bdf(oseenData.getBDF_order());
\end{verbatim}
The backward differentiation formula, class \verb!BdfTNS! \ixn{Backward Differentiation Formula},
stores the previous solution $u^n$, $u^{n-1}$ ...
All we need to do is to construct this class
with the correct time discretization order given in the data file (variable \verb!fluid/discretization/bdf_order!)
so that the stored vector will be resized correctly, and intialize it with our previously computed Stokes problem solution
Let's have a look at the code in $$ \verb+<lifev directory>/lifev/navier_stokes/examples/cavity_ns.cpp+.$$ Apart from the fact that we included another header file that allows to deal with the time discretization :
\begin{verbatim}
bdf.bdf_u().initialize_unk( fluid.solution() );
#include <lifev/core/fem/TimeAdvanceBDFNavierStokes.hpp>
\end{verbatim}
We are now ready to enter the time loop
\begin{verbatim}
Real dt = oseenData.getTimeStep();
Real t0 = oseenData.getInitialTime();
Real tFinal = oseenData.getEndTime ();
\noindent the code is the same as the one used to compute the Stokes problem until the definition of the communication Epetra \verb+fullMap+. %the first \verb!fluid.iterate()!,
int iter = 1;
Now, we want to use this Stokes solution to initialize our non-stationary Navier-Stokes problem, and be able
to store a history of previous solutions in order to compute the time derivative :
for ( Real time = t0 + dt ; time <= tFinal + dt/2.; time += dt, iter++)
\begin{verbatim}
if (verbose) std::cout<< std::endl << "[Initialization of the simulation]"
<< std::endl;
Real dt = oseenData->dataTime()->timeStep();
Real t0 = oseenData->dataTime()->initialTime();
Real tFinal = oseenData->dataTime()->endTime ();
TimeAdvanceBDFNavierStokes<vector_Type> bdf;
bdf.setup(oseenData->dataTime()->orderBDF());
t0 -= dt * bdf.bdfVelocity().order();
(...)
oseenData->dataTime()->setTime(t0);
(...)
// We get the initial solution using a steady Stokes problem
bdf.bdfVelocity().setInitialCondition( *fluid.solution() );
Real time = t0 + dt;
for ( ; time <= oseenData->dataTime()->initialTime() + dt/2.; time += dt)
{
// inside the time loop, it's really like the initialization procedure,
// exept that we now have an advection velocity, rhs and the mass matrix
oseenData.setTime(time);
if (verbose)
{
std::cout << std::endl;
std::cout << "We are now at time " << oseenData.time()
<< " s. " << std::endl;
std::cout << std::endl;
}
chrono.start();
oseenData->dataTime()->setTime(time);
// alpha coefficient for the mass matrix
double alpha = bdf.bdf_u().coeff_der( 0 ) / oseenData.timestep();
fluid.updateSystem(alpha,beta,rhs);
fluid.iterate(bcH);
bdf.bdfVelocity().shiftRight( *fluid.solution() );
}
// extrapolation of the advection term
beta = bdf.bdf_u().extrap();
\end{verbatim}
// rhs part of the time-derivative
rhs = fluid.matrMass()*bdf.bdf_u().time_der( oseenData.timestep() );
\noindent The bdf object is designed to store the previous solutions, $\bm{u}^n$, $\bm{u}^{n-1}$, $\ldots$ We had to construct this class
with the correct time discretization order given in the data file (variable \verb!fluid/discretization/bdf_order!)
so that the stored vector will be resized correctly, and initialize it with our previously computed Stokes problem solution.\\
Moreover, we erase the preconditioner build for the Stokes problem (a new one should be built for Navier-Stokes) :
\begin{verbatim}
fluid.resetPreconditioner();
\end{verbatim}
// update the Oseen system
fluid.updateSystem( alpha, beta, rhs );
We are now ready to enter the time loop to solve the problem. Inside this loop, it is really like the initialization procedure, except that we now have an advection velocity, right handside and the mass matrix.
// and we solve it
fluid.iterate( bcH );
// shifting the previous solutions
bdf.bdf_u().shift_right( fluid.solution() );
\begin{verbatim}
int iter = 1;
// postprocess
*velAndPressure = fluid.solution();
ensight.postProcess( time );
for ( ; time <= tFinal + dt/2.; time += dt, iter++)
{
oseenData->dataTime()->setTime(time);
double alpha = bdf.bdfVelocity().coefficientFirstDerivative( 0 )
/ oseenData->dataTime()->timeStep();
// extrapolates of the advection term
beta = bdf.bdfVelocity().extrapolation();
// rhs part of the time-derivative
bdf.bdfVelocity().updateRHSContribution(oseenData->dataTime()->timeStep() );
rhs = fluid.matrixMass()*bdf.bdfVelocity().rhsContributionFirstDerivative();
(...)
// updates the Oseen system
fluid.updateSystem( alpha, beta, rhs );
// and solves it
fluid.iterate( bcH );
// shifts the previous solutions
bdf.bdfVelocity().shiftRight( *fluid.solution() );
(...)
// exports the solution
*velAndPressure = *fluid.solution();
exporter->postProcess( time );
(...)
}
(...)
exporter->closeFile();
\end{verbatim}
// a barrier for sinchronization
MPI_Barrier(MPI_COMM_WORLD);
%
%
%
%This can be done by using the following object
%\begin{verbatim}
% // bdf initialization with the stokes problem solution
% BdfTNS<vector_type> bdf(oseenData.getBDF_order());
%\end{verbatim}
%
%
%
%The backward differentiation formula, class \verb!BdfTNS! \ixn{Backward Differentiation Formula},
%stores the previous solution $u^n$, $u^{n-1}$ ...
%All we need to do is to construct this class
%with the correct time discretization order given in the data file (variable \verb!fluid/discretization/bdf_order!)
%so that the stored vector will be resized correctly, and intialize it with our previously computed Stokes problem solution
%
%\begin{verbatim}
% bdf.bdf_u().initialize_unk( fluid.solution() );
%\end{verbatim}
%
%We are now ready to enter the time loop
%
%\begin{verbatim}
% Real dt = oseenData.getTimeStep();
% Real t0 = oseenData.getInitialTime();
% Real tFinal = oseenData.getEndTime ();
%
% int iter = 1;
%
% for ( Real time = t0 + dt ; time <= tFinal + dt/2.; time += dt, iter++)
% {
% // inside the time loop, it's really like the initialization procedure,
% // exept that we now have an advection velocity, rhs and the mass matrix
% oseenData.setTime(time);
%