FreeFEM Documentation on GitHub

stars - forks


Here mathematical expressions and corresponding FreeFEM commands are explained.


  • [\(\delta_{ij}\)] Kronecker delta (\(0\) if \(i\neq j\), 1 if \(i=j\) for integers \(i,j\))
  • [\(\forall\)] for all
  • [\(\exists\)] there exists
  • [i.e.] that is
  • [PDE] partial differential equation (with boundary conditions)
  • [\(\emptyset\)] the empty set
  • [\(\mathbb{N}\)] the set of integers (\(a\in \mathbb{N}\Leftrightarrow\) int a), int means long int inside FreeFEM
  • [\(\mathbb{R}\)] the set of real numbers (\(a\in \mathbb{R}\Leftrightarrow\) real a), double inside FreeFEM
  • [\(\mathbb{C}\)] the set of complex numbers (\(a\in \mathbb{C}\Leftrightarrow\) complex a), complex<double>
  • [\(\mathbb{R}^d\)] \(d\)-dimensional Euclidean space

Sets, Mappings, Matrices, Vectors

Let \(E,\, F,\, G\) be three sets and \(A\) the subset of \(E\).

  • [\(\{x\in E|\; P\}\)] the subset of \(E\) consisting of the elements possessing the property \(P\)
  • [\(E\cup F\)] the set of elements belonging to \(E\) or \(F\)
  • [\(E\cap F\)] the set of elements belonging to \(E\) and \(F\)
  • [\(E\setminus A\)] the set \(\{x\in E|\; x\not\in A\}\)
  • [\(E+F\)] \(E\cup F\) with \(E\cap F=\emptyset\)
  • [\(E\times F\)] the Cartesian product of \(E\) and \(F\)
  • [\(E^n\)] the \(n\)-th power of \(E\) (\(E^2=E\times E\), \(E^n=E\times E^{n-1}\))
  • [\(f:\; E\to F\)] the mapping form \(E\) into \(F\), i.e., \(E\ni x\mapsto f(x)\in F\)
  • [\(I_E\) or \(I\)] the identity mapping in \(E\),i.e., \(I(x)=x\quad \forall x\in E\)
  • [\(f\circ g\)] for \(f:\; F\to G\) and \(g:\; E\to F\), \(E\ni x\mapsto (f\circ g)(x)=f(g(x))\in G\) (see Elementary function)
  • [\(f|_A\)] the restriction of \(f:\; E\to F\) to the subset \(A\) of \(E\)
  • [\(\{a_k\}\)] column vector with components \(a_k\)
  • [\((a_k)\)] row vector with components \(a_k\)
  • [\((a_{k})^T\)] denotes the transpose of a matrix \((a_{k})\), and is \(\{a_{k}\}\)
  • [\(\{a_{ij}\}\)] matrix with components \(a_{ij}\), and \((a_{ij})^T=(a_{ji})\)


For two real numbers \(a,b\)

  • \([a,b]\) is the interval \(\{x\in \mathbb{R}|\; a\le x\le b\}\)
  • \(]a,b]\) is the interval \(\{x\in \mathbb{R}|\; a< x\le b\}\)
  • \([a,b[\) is the interval \(\{x\in \mathbb{R}|\; a\le x< b\}\)
  • \(]a,b[\) is the interval \(\{x\in \mathbb{R}|\; a< x< b\}\)

Differential Calculus

  • [\(\partial f/\partial x\)] the partial derivative of \(f:\mathbb{R}^d\to \mathbb{R}\) with respect to \(x\) (dx(f))
  • [\(\nabla f\)] the gradient of \(f:\Omega\to \mathbb{R}\),i.e., \(\nabla f=(\partial f/\partial x,\, \partial f/\partial y)\)
  • [\(\text{div}(\mathbf{f})\) or \(\nabla.\mathbf{f}\)] the divergence of \(\mathbf{f}:\Omega\to \mathbb{R}^d\), i.e., \(\text{div}(\mathbf{f})=\partial f_1/\partial x+\partial f_2/\partial y\)
  • [\(\Delta f\)] the Laplacian of \(f:\; \Omega\to \mathbb{R}\), i.e., \(\Delta f=\partial^2f/\partial x^2+\partial^2 f/\partial y^2\)


  • [\(\Omega\)] usually denotes a domain on which PDE is defined
  • [\(\Gamma\)] denotes the boundary of \(\Omega\),i.e., \(\Gamma=\partial\Omega\) (keyword border, see Border)
  • [\(\mathcal{T}_h\)] the triangulation of \(\Omega\), i.e., the set of triangles \(T_k\), where \(h\) stands for mesh size (keyword mesh, buildmesh, see Mesh Generation)
  • [\(n_t\)] the number of triangles in \(\mathcal{T}_h\) (get by Th.nt)
  • [\(\Omega_h\)] denotes the approximated domain \(\Omega_h=\cup_{k=1}^{n_t}T_k\) of \(\Omega\). If \(\Omega\) is polygonal domain, then it will be \(\Omega=\Omega_h\)
  • [\(\Gamma_h\)] the boundary of \(\Omega_h\)
  • [\(n_v\)] the number of vertices in \(\mathcal{T}_h\) (get by Th.nv)
  • [\(n_{be}\)] the number of boundary element in \(\mathcal{T}_h\) (get by Th.nbe)
  • [\(|\Omega_h|\)] the measure (area or volume) in \(\mathcal{T}_h\) (get by Th.measure)
  • [\(|\partial \Omega_h|\)] the measure of the border (length or area) in \(\mathcal{T}_h\) (get by Th.bordermeasure)
  • [\(h_{min}\)] the minimum edge size of \(\mathcal{T}_h\) (get by Th.hmin)
  • [\(h_{max}\)] the maximum edge size of \(\mathcal{T}_h\) (get by Th.hmax)
  • [[\(q^iq^j\)]] the segment connecting \(q^i\) and \(q^j\)
  • [\(q^{k_1},q^{k_2},q^{k_3}\)] the vertices of a triangle \(T_k\) with anti-clock direction (get the coordinate of \(q^{k_j}\) by (Th[k-1][j-1].x, Th[k-1][j-1].y))
  • [\(I_{\Omega}\)] the set \(\{i\in \mathbb{N}|\; q^i\not\in \Gamma_h\}\)

Functional Spaces

  • [\(L^2(\Omega)\)] the set \(\displaystyle{\left\{w(x,y)\left|\; \int_{\Omega}|w(x,y)|^2\text{d} x\text{d} y<\infty\right.\right\}}\)
\[\begin{split}\textrm{norm:}\; \| w\|_{0,\Omega}&=\left(\int_{\Omega}|w(x,y)|^2\text{d} x\text{d} y\right)^{1/2}\\ \textrm{scalar product:}\; (v,w)&=\int_{\Omega}vw\end{split}\]
  • [\(H^1(\Omega)\)] the set \(\displaystyle{\left\{w\in L^2(\Omega)\left|\; \int_{\Omega}\left(|\partial w/\partial x|^2+|\partial w/\partial y|^2\right)\text{d} x\text{d} y <\infty\right.\right\}}\)
\[\textrm{norm:}\; \| w\|_{1,\Omega}=\left(\| w\|_{0,\Omega}^2+\|\nabla u\|_{0.\Omega}^2\right)^{1/2}\]
  • [\(H^m(\Omega)\)] the set \(\displaystyle{\left\{w\in L^2(\Omega)\left|\; \int_{\Omega}\frac{\partial^{|\alpha|} w}{\partial x^{\alpha_1}\partial y^{\alpha_2}}\in L^2(\Omega)\quad\forall \alpha=(\alpha_1,\alpha_2)\in \mathbb{N}^2,\, |\alpha|=\alpha_1+\alpha_2\right.\right\}}\)
\[\textrm{scalar product:}\; (v,w)_{1,\Omega}= \sum_{|\alpha|\le m}\int_{\Omega} D^{\alpha}v D^{\alpha}w\]
  • [\(H^1_0(\Omega)\)] the set \(\left\{w\in H^1(\Omega)\left|\; u=0\quad \textrm{on }\Gamma\right.\right\}\)

    [\(L^2(\Omega)^2\)] denotes \(L^2(\Omega)\times L^2(\Omega)\), and also \(H^1(\Omega)^2=H^1(\Omega)\times H^1(\Omega)\)

Finite Element Spaces

  • [\(V_h\)] denotes the finite element space created by fespace Vh(Th, *) in FreeFEM (see Finite Elements for *)
  • [\(\Pi_h f\)] the projection of the function \(f\) into \(V_h\) (func f=x^2*y^3; Vh v = f;) means \(v = Pi_h (f) * [\{v\}]\) for FE-function \(v\) in \(V_h\) means the column vector \((v_1,\cdots,v_M)^T\) if \(v=v_1\phi_1+\cdots+v_M\phi_M\), which is shown by fespace Vh(Th, P2); Vh v; cout << v[] << endl;
Table of content