1 |
|
\texttt{FreeFEM3D} (aka {\ff}) stands for ``\emph{FREE Finite |
2 |
|
Element Method in 3~Dimensions}. |
3 |
|
|
4 |
\section{\Red{Generalities}} |
\section{\Red{Generalities}} |
5 |
|
|
6 |
This software will assist you in solving problems which are modeled by |
This software will assist you in solving problems which are modeled by |
7 |
partial differential equations. As the name indicates it is free, (subject |
partial differential equations. As the name indicates it is free, |
8 |
to the GPL guidelines), it uses FEM (the finite element method) and it is |
(subject to the GPL guidelines), it uses FEM (the finite element |
9 |
for three dimensional problems. |
method) and it is for three dimensional problems. |
10 |
|
|
11 |
You will need to know some mathematics to use {\ff}, because you are required |
You will need to know some mathematics to use {\ff}, because you are |
12 |
to input the partial differential equations which describe your problem. |
required to input the partial differential equations which describe |
13 |
|
your problem. |
14 |
Based on our experience with \texttt{FreeFEM 3.4, FreeFEM+, FreeFEM++} we have |
|
15 |
found that the best way to describe a problem is through a language adapted to |
Based on our experience with \texttt{FreeFEM 3.4, FreeFEM+, FreeFEM++} |
16 |
partial differential equations (PDE). Thus for each problem one needs to |
we have found that the best way to describe a problem is through a |
17 |
write a program and submit it to {\ff} which will compile it and run it, and/or |
language adapted to partial differential equations (PDE). Thus for |
18 |
report bugs. Therefore it is impossible to use {\ff} without reading some part |
each problem one needs to write a program and submit it to {\ff} which |
19 |
of this manual or going through some of the examples. |
will compile it and run it, and/or report bugs. Therefore it is |
20 |
|
impossible to use {\ff} without reading some part of this manual or |
21 |
|
going through some of the examples. |
22 |
|
|
23 |
There are 3 steps to solve a PDE |
There are 3 steps to solve a PDE |
24 |
% |
% |
28 |
\item display graphically the output. |
\item display graphically the output. |
29 |
\end{enumerate} |
\end{enumerate} |
30 |
% |
% |
31 |
The input of the geometry for a 3d problem is a formidable task; the |
The input of the geometry for a tri-dimensional problem is a |
32 |
entire CAD industry is busy with it. Realizing this {\ff} |
formidable task; the entire CAD industry is busy with it. Realizing |
33 |
relies on another program to define the geometry: \pov. |
this {\ff} relies on another program to define the geometry: \pov. |
34 |
|
|
35 |
{\pov} is an image synthesis software which is also free and also runs on a |
{\pov} is an image synthesis software which is also free and also runs on a |
36 |
number of operating systems. You will need to learn to use {\pov} to use {\ff}. |
number of operating systems. You will need to learn to use {\pov} to use {\ff}. |
50 |
|
|
51 |
\begin{itemize} |
\begin{itemize} |
52 |
\item Macintosh with MacOS X 10.1 or later; |
\item Macintosh with MacOS X 10.1 or later; |
53 |
\item PC compatible with Windows 98/2000; |
\item PC compatible with Windows (any version using \texttt{cygwin}); |
54 |
\item and Linux (and others UNIX) |
\item and Linux (and others UNIX) |
55 |
\end{itemize} |
\end{itemize} |
56 |
|
|
57 |
\subsection{\Blue{Contacts}} |
\subsection{\Blue{Contacts}} |
58 |
|
|
59 |
|
\subsubsection{{\ff}'s team} |
60 |
|
|
61 |
|
\begin{itemize} |
62 |
|
\item Project Director: Olivier Pironneau [\URL{Olivier.Pironneau@math.jussieu.fr}], |
63 |
|
\item Main author: St\'ephane Del Pino [\URL{Stephane.DelPino@math.jussieu.fr}] |
64 |
|
\item Mesh improvement: C\'ecile Dobrzynski [\URL{dobrzynski@ann.jussieu.fr}] |
65 |
|
\item Contributor: Pascal Hav\'e [\URL{have@ann.jussieu.fr}] |
66 |
|
\item Tester: Antoine Lehyaric [\URL{lehyaric@ann.jussieu.fr}] |
67 |
|
\end{itemize} |
68 |
|
|
69 |
|
\subsubsection{Project pages} |
70 |
|
|
71 |
|
{\ff} in cyberspace is hosted by \URL{http://www.freefem.org}. More |
72 |
|
precisely one can found its web page at |
73 |
|
\URL{http://www.freefem.org/ff3d/}. |
74 |
|
|
75 |
|
Since {\ff} is a \emph{free} software it is developed transparently: |
76 |
|
every one can access its source code using \texttt{cvs}. We have |
77 |
|
chosen to use Savannah as a project development tool: it provides to |
78 |
|
\emph{free softwares}: |
79 |
\begin{itemize} |
\begin{itemize} |
80 |
\item Project Director: Olivier.Pironneau@math.jussieu.fr, |
\item code source archiving using \texttt{cvs}, |
81 |
\item Software author: Stephane.DelPino@math.jussieu.fr |
\item mailing lists management, |
82 |
|
\item Bug Tracking System (BTS), |
83 |
|
\item and a lot more\ldots |
84 |
\end{itemize} |
\end{itemize} |
85 |
|
{\ff}'s Savannah page is \URL{Savannah-ff3d}. All relevant information |
86 |
|
to use Savannah and {\ff} may be found there. Here is just a reminder. |
87 |
|
|
88 |
|
|
89 |
|
\paragraph{cvs} allows you to keep your source code version up to |
90 |
|
date. It also provides the possibility to retrieve old versions of the |
91 |
|
code just specifying the date. |
92 |
|
|
93 |
|
To checkout the code enter the following commands. |
94 |
|
\begin{verbatim} |
95 |
|
cvs -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/ff3d login |
96 |
|
\end{verbatim} |
97 |
|
Enter an empty password at this point and then type |
98 |
|
\begin{verbatim} |
99 |
|
cvs -z3 -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/ff3d co ff3d |
100 |
|
\end{verbatim} |
101 |
|
And you have the code! |
102 |
|
|
103 |
|
Now, each time you want to synchronize with the latest version, go in |
104 |
|
the {\ff} directory and enter |
105 |
|
\begin{verbatim} |
106 |
|
cvs -z3 update |
107 |
|
\end{verbatim} |
108 |
|
See \URL{\ff's cvs page} for more details. |
109 |
|
|
110 |
|
|
111 |
|
\paragraph{Mailing lists} are also hosted by Savannah. Four mailing |
112 |
|
lists are available: |
113 |
|
\begin{itemize} |
114 |
|
\item \texttt{ff3d-users}: for {\ff}'s usage related questions; |
115 |
|
\item \texttt{ff3d-dev}: for developers discussions. BTS messages are |
116 |
|
copied there; |
117 |
|
\item \texttt{ff3d-cvs}: a read-only list that logs \texttt{cvs} |
118 |
|
messages to inform developers of what changes in the sources, and |
119 |
|
\item \texttt{ff3d-announce}: a read-only low traffic list, used to |
120 |
|
announce {\ff}'s related events... |
121 |
|
\end{itemize} |
122 |
|
One may subscribe to any of those lists. |
123 |
|
|
124 |
|
|
125 |
|
\paragraph{BTS} (the Bug Tracking System) is the best place to report |
126 |
|
bug or wishes. One may obviously consider also the use of the mailing |
127 |
|
lists for that but. Doing so, developers will keep a trace and poster |
128 |
|
will be automatically informed of any change related to his request, |
129 |
|
or see what priority has been assigned to it\ldots |
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
\subsubsection{Numerical Analysis} |
134 |
|
|
135 |
If you wish to know more about the Finite Element Method you may consult |
If you wish to know more about the Finite Element Method you may consult |
136 |
\cite{BLOP}. For the fictitious domain method, you may consult \cite{??}. |
\cite{BLOP}. For the fictitious domain method, you may consult \cite{??}. |
137 |
For {\pov} see \Blue{http://www.povray.org} and the web site for {\dx} is |
For {\pov} see \URL{http://www.povray.org} and the web site for {\dx} is |
138 |
\Blue{http://www.opendx.org}. |
\URL{http://www.opendx.org}. |
139 |
|
|
140 |
\subsection{\Blue{Source codes}} |
\subsection{\Blue{Source codes}} |
141 |
\texttt{http://www.freefem.org} contains the source files, examples and exec |
\URL{http://www.freefem.org} contains the source files, examples and exec |
142 |
files for Macintosh OS X, Windows PC and Linux/Unix machines. |
files for Macintosh OS X, Windows PC and Linux/Unix machines. |
143 |
|
|
144 |
Some makefiles are given too. Recompilation of source files is easy on ANSI |
Some makefiles are given too. Recompilation of source files is easy on ANSI |
373 |
\end{bequation*} |
\end{bequation*} |
374 |
|
|
375 |
\begin{remark} |
\begin{remark} |
376 |
One should note that boundary condition on each variables are given |
One should note that boundary condition on each variable are given |
377 |
while describing the associated PDE. The boundary condition process should |
while describing the associated PDE. The boundary condition process |
378 |
be well understood well (see |
has to be understood precisely (see |
379 |
section~\ref{sec:bound-cond-synt}). Moreover, in the case of |
section~\ref{sec:bound-cond-synt}). Moreover, in the case of |
380 |
\emph{PDE systems} users may find \emph{variational |
\emph{PDE systems} users may find \emph{variational |
381 |
formulae} better suited and less prone to errors. |
formulae} better suited and less prone to errors. |
811 |
languages should not be afraid since it is a |
languages should not be afraid since it is a |
812 |
\emph{hi-level}\footnote{\emph{hi-level} in the sense that |
\emph{hi-level}\footnote{\emph{hi-level} in the sense that |
813 |
it manipulates ``real-life'' objects.} language. |
it manipulates ``real-life'' objects.} language. |
814 |
|
|
815 |
Knowing that we will explain step-by-step this language, but before |
Knowing that we will explain step-by-step this language, let us first |
816 |
let us recall important rules: |
recall important rules: |
817 |
\Red{ |
\Red{ |
818 |
\begin{itemize} |
\begin{itemize} |
819 |
\item All used variable must be declared before being used. |
\item Every variable must be declared before being used. |
820 |
\item One cannot declare a variable twice. |
\item One cannot declare a variable twice. |
821 |
\item Variables are (for the time being) global so beyond its |
\item Each variable is global, so when declared, it \emph{lives} |
822 |
declaration, it \emph{lives} until the end of |
until the end of the program execution, even if declared |
823 |
the execution, even if it is declared \emph{in a block}). |
\emph{in a block}. This behaviour should change in the future. |
824 |
\end{itemize} |
\end{itemize} |
825 |
} |
} |
826 |
|
|
869 |
\hline |
\hline |
870 |
\texttt{abs(a)}&$|a|$\\ |
\texttt{abs(a)}&$|a|$\\ |
871 |
\texttt{exp(a)}&$e^a$\\ |
\texttt{exp(a)}&$e^a$\\ |
872 |
|
\texttt{log(a)}&$\log(a)$\\ |
873 |
\texttt{sin(a)}&$\sin(a)$\\ |
\texttt{sin(a)}&$\sin(a)$\\ |
874 |
\texttt{cos(a)}&$\cos(a)$\\ |
\texttt{cos(a)}&$\cos(a)$\\ |
875 |
\texttt{tan(a)}&$\tan(a)$\\ |
\texttt{tan(a)}&$\tan(a)$\\ |
961 |
\hline |
\hline |
962 |
\texttt{abs(f)}&$|f|$\\ |
\texttt{abs(f)}&$|f|$\\ |
963 |
\texttt{exp(f)}&$e^f$\\ |
\texttt{exp(f)}&$e^f$\\ |
964 |
|
\texttt{log(f)}&$\log(f)$\\ |
965 |
\texttt{sin(f)}&$\sin(f)$\\ |
\texttt{sin(f)}&$\sin(f)$\\ |
966 |
\texttt{cos(f)}&$\cos(f)$\\ |
\texttt{cos(f)}&$\cos(f)$\\ |
967 |
\texttt{tan(f)}&$\tan(f)$\\ |
\texttt{tan(f)}&$\tan(f)$\\ |
978 |
\end{table} |
\end{table} |
979 |
|
|
980 |
|
|
981 |
\paragraph{q1function:} |
\paragraph{femfunction:} |
982 |
This is a special type to define $Q^1$ |
This is a special type related to finite element functions. By new, |
983 |
functions \emph{i.e.} piece-wise \emph{tri-linear} and continuous |
only $Q^1$ functions are allowed: piece-wise \emph{tri-linear} and |
984 |
functions defined on an hexahedral mesh. Since such functions need a |
continuous functions defined on an hexahedral mesh. Since finite |
985 |
a reference to a \emph{mesh}, one has to write |
element functions spaces needs a \emph{mesh} to be defined, one has to |
986 |
|
write |
987 |
\begin{code} |
\begin{code} |
988 |
q1function f(M) = sin(x); |
femfunction f(M) = sin(x); |
989 |
\end{code} |
\end{code} |
990 |
where \texttt{M} is a previously defined mesh |
where \texttt{M} is a previously defined mesh |
991 |
(see~\ref{sec:blueb-instr}). After the instruction, \texttt{f} |
(see~\ref{sec:blueb-instr}). After the instruction, \texttt{f} |
992 |
contains a $Q^1$ approximation of $\sin(x)$, in the sense that it is the local |
contains a finite element approximation of $(x_1,x_2,x_3)\to\sin(x_1)$. \texttt{f} is in |
993 |
trilinear interpolate from |
fact defined by the interpolation at mesh |
994 |
$\mathtt{f}(X)=\sin(X_1)$ if $X$ is a vertex of \texttt{M}. |
vertices: $\mathtt{f}(X)=\sin(X_1)$ if $X$ is a vertex of \texttt{M}. |
995 |
|
|
996 |
|
|
997 |
Even though a \texttt{q1function} is a special kind of \texttt{function}, it |
Even though a \texttt{femfunction} is a special kind of \texttt{function}, it |
998 |
can be used in the \texttt{function} algebra: |
can be used in the \texttt{function} algebra: |
999 |
\begin{code} |
\begin{code} |
1000 |
q1function f(M) = exp(x+y*z); |
femfunction f(M) = exp(x+y*z); |
1001 |
function g = x - f; |
function g = x - f; |
1002 |
\end{code} |
\end{code} |
1003 |
Again, this is a \emph{definition}; |
Again, this is a \emph{definition}; |
1147 |
\begin{remark} |
\begin{remark} |
1148 |
The \texttt{unknown}s computed by the \texttt{solver} can be used later |
The \texttt{unknown}s computed by the \texttt{solver} can be used later |
1149 |
as any |
as any |
1150 |
\texttt{q1function}s (whatever they were before). |
\texttt{femfunction}s (whatever they were before). |
1151 |
\end{remark} |
\end{remark} |
1152 |
|
|
1153 |
|
|
1720 |
the convect operator adapts to the context: |
the convect operator adapts to the context: |
1721 |
\begin{code}[numbers=left] |
\begin{code}[numbers=left] |
1722 |
function f = convect(phi,ux,uy,uz); |
function f = convect(phi,ux,uy,uz); |
1723 |
q1function g(M) = f; |
femfunction g(M) = f; |
1724 |
solve (h) in Omega by M |
solve (h) in Omega by M |
1725 |
{ |
{ |
1726 |
test(v) |
test(v) |
1907 |
\CodeFichierLignes{example2.txt}{9}{15} |
\CodeFichierLignes{example2.txt}{9}{15} |
1908 |
The last line is used to save the data in the file \texttt{"u.dat"}. |
The last line is used to save the data in the file \texttt{"u.dat"}. |
1909 |
|
|
1910 |
|
|
1911 |
|
% Local Variables: |
1912 |
|
% TeX-master: "freefem3dDoc" |
1913 |
|
% End: |