![]() |
FreeFem++ is a partial differential equation solver.
It has its own language. freefem scripts can solve multiphysics non linear systems in 2D and 3D.
Problems involving PDE (2d, 3d) from several branches of physics such as fluid-structure interactions require interpolations of data on several meshes and their manipulation within one program. FreeFem++ includes a fast 2^d-tree-based interpolation algorithm and a language for the manipulation of data on multiple meshes (as a follow up of bamg (now a part of FreeFem++ ). FreeFem++ is written in C++ and the FreeFem++ language is a C++ idiom. It runs on Macs, Windows, Unix machines. FreeFem++ replaces the older freefem and freefem+. |
@article {MR3043640, AUTHOR = {Hecht, F.}, TITLE = {New development in FreeFem++}, JOURNAL = {J. Numer. Math.}, FJOURNAL = {Journal of Numerical Mathematics}, VOLUME = {20}, YEAR = {2012}, NUMBER = {3-4}, PAGES = {251--265}, ISSN = {1570-2820}, MRCLASS = {65Y15}, MRNUMBER = {3043640}, } |
border aaa(t=0,1){x=t;y=0;}; border bbb(t=0,0.5){x=1;y=t;}; border ccc(t=0,0.5){x=1-t;y=0.5;}; border ddd(t=0.5,1){x=0.5;y=t;}; border eee(t=0.5,1){x=1-t;y=1;}; border fff(t=0,1){x=0;y=1-t;}; mesh Th = buildmesh (aaa(6) + bbb(4) + ccc(4) +ddd(4) + eee(4) + fff(6)); fespace Vh(Th,P1); // to change P1 in P2 to make P2 finite element. Vh u=0,v; func f= 1; func g= 0; int i=0; real error=0.1, coef= 0.1^(1./5.); problem Probem1(u,v,solver=CG,eps=-1.0e-6) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) + int2d(Th) ( v*f ) + on(aaa,bbb,ccc,ddd,eee,fff,u=g) ; for (i=0;i< 10;i++) { real d = clock(); Probem1; // solve the problem plot(u,Th,wait=1); Th=adaptmesh(Th,u,inquire=1,err=error); error = error * coef; } ; |
![]() ![]() Solution on adapted mesh and associated mesh. |
- A very small example of how to solve the Stokes equation 3d on cube
shape :
load "msh3" load "medit" // dynamics load tools for 3d. int nn=8; mesh Th2=square(nn,nn); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], reffacemid=rmid, reffaceup = rup, reffacelow = rdown); medit("c10x10x10",Th); // see the 3d mesh with medit software fespace VVh(Th,[P2,P2,P2,P1]); macro Grad(u) [dx(u),dy(u),dz(u)] // EOM macro div(u1,u2,u3) (dx(u1)+dy(u2)+dz(u3)) //EOM VVh [u1,u2,u3,p]; VVh [v1,v2,v3,q]; solve vStokes([u1,u2,u3,p],[v1,v2,v3,q]) = int3d(Th,qforder=3)( Grad(u1)'*Grad(v1) + Grad(u2)'*Grad(v2) + Grad(u3)'*Grad(v3) - div(u1,u2,u3)*q - div(v1,v2,v3)*p + 1e-10*q*p ) + on(2,u1=1.,u2=0,u3=0) + on(1,u1=0,u2=0,u3=0) ; plot(p,wait=1, nbiso=5); // a 3d plot of iso pressure. in progress... march 2009 // to see the 10 cut plan in 2d for(int i=1;i<10;i++) { real yy=i/10.; // compute yy. // do 3d -> 2d interpolation. ux= u1(x,yy,y); uz= u3(x,yy,y); p2= p(x,yy,y); plot([ux,uz],p2,cmm=" cut y = "+yy,wait= 1); }
Solution on cup plan y=0.5 and mesh 10x10x10 and associated mesh.
- FreeVol: Finite Vol technics in FreeFem++ for hyperbolic PDEs
- 3D implementation: new solver, new mesh tools, new kind of finite element
- Stabilize and test all parallel linear solver interface
- You can get the latest source from
an anonymous git SCM copy with the following unix shell commands :
git clone https://github.com/FreeFem/FreeFem-sources ff++
Self-contained archives for all other systems :
-
This directory contains all the different versions of FreeFem++.
freefem++-4.1.tar.gz ( 3.2 Mb, May 10, 2019 14:53:21.)
freefem++-4.0-beta.tar.gz ( 3.2 Mb, Jan 18, 2019 17:41:08.)
FreeFem++-4.7-1-full-MacOS_10.11.pkg ( 419.7 Mb, Nov 06, 2020 15:18:22.)
FreeFem++-4.5-win64.exe ( 54.5 Mb, Feb 11, 2020 22:11:12.)
FreeFem++-4.4-4-dev-MacOS_10.11.pkg ( 356.5 Mb, Jan 30, 2020 17:29:59.)
FreeFem++-4.2-1-b-348-MacOS_10.11.pkg ( 417.3 Mb, May 31, 2019 12:52:53.)
FreeFem++-4.1.137-win64-CoreI7.exe ( 68.6 Mb, May 10, 2019 13:32:05.)
FreeFem++-4.1-win64-corei7-v2.exe ( 68.6 Mb, Apr 27, 2019 17:09:18.)
FreeFem++-4.1-win64-CoreI7.exe ( 67.9 Mb, Apr 24, 2019 15:14:27.)
FreeFem++-4.1-MacOS_10.11-corei5.pkg ( 358.6 Mb, May 10, 2019 11:08:17.)
FreeFem++-4.0-beta-win64.exe ( 101.2 Mb, Jan 21, 2019 16:51:57.)
FreeFem++-4.0-MacOS_10.11.pkg ( 358.8 Mb, Apr 10, 2019 15:50:53.)
FreeFem++-4.0-MacOS_10.11-beta.pkg ( 387.5 Mb, Apr 09, 2019 14:27:48.)
FreeFem++-3.61-1-MacOS_10.13.pkg ( 445.3 Mb, Jul 12, 2018 14:35:44.)
FreeFem++-3.60-a-win64.exe ( 86.9 Mb, Jun 12, 2018 13:30:04.)
FreeFem++-3.59-MacOS_10.12.pkg ( 507.1 Mb, Mar 16, 2018 14:06:40.)
FreeFem++-3.59-MacOS_10.10.pkg ( 507.1 Mb, Mar 16, 2018 14:06:40.)
- for emacs editor you can download ff++-mode.el : here (thanks to Rafa Rodríguez Galván <rafael.rodriguez@uca.es>).
- for textmate 2 editor on Mac 10.7 or better, download from macromates.com and install it, when get the textmate freefem++ syntax from www.freefem.org/ff++/Textmate2-ff++.zip (version june 2107) unzip Textmate2-ff++.zip and follow the explanation given in file How_To.rtf.
- for notepad++ editor under windows and read and follow the instruction