// -*- c++ -*- // This file is part of ff3d - http://www.freefem.org/ff3d // Copyright (C) 2003 Laboratoire J.-L. Lions UPMC Paris // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2, or (at your option) // any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // $Id: stokes.ff,v 1.1 2003/09/26 07:55:59 ArceneL Exp $ // A real-world test case from Stephane Del Pino's PhD Thesis, // paragraph 4.2.1: Stokes' equations. vector n = (20,20,20); vertex A = (0,0,0); vertex B = (1,1,1); scene S = pov("stokes.pov"); mesh M = structured(n,A,B); domain Omega = domain(S,outside(<1,0,0>)); function teta0 = 0; double eps = 1e-2; solve(u1,u2,u3,p) in Omega by M method(type=penalty),krylov(precond=none,type=cg), cg(epsilon=1e-2),memory(matrix=none){ pde(u1) -div(grad(u1)) + dx(p) = 0; u1 = 0 on M xmin; u1 = 0 on M xmax; u1 = 0 on M ymin; u1 = 1 on M ymax; u1 = 0 on M zmin; u1 = 0 on M zmax; u1 = 0 on <1,0,0>; pde(u2) -div(grad(u2)) + dy(p) = 0; u2 = 0 on M; u2 = 0 on <1,0,0>; pde(u3) -div(grad(u3)) + dz(p) = 0; u3 = 0 on M; u3 = 0 on <1,0,0>; pde(p) -div(eps*grad(p)) + eps*p + dx(u1) + dy(u2) + dz(u3) = 0; }; save(opendx,"u.dx",u1,M); save(opendx,"v.dx",u2,M); save(opendx,"w.dx",u3,M); save(opendx,"p.dx",p,M);