function-derivative-legendre.at
来自「这是FreeFem2D的姊妹软件」· AT 代码 · 共 68 行
AT
68 行
# This file is part of ff3d - http://www.freefem.org/ff3d# Copyright (C) 2005 Stephane Del Pino# 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: function-derivative-legendre.at,v 1.1 2007/05/01 17:24:43 yakoubix Exp $ AT_SETUP([Function derivative (Legendre)])AT_KEYWORDS (legendre)AT_DATA([test.ff],[[vertex a = (0,0,0);vertex b = (1,2,3);vertex n = (3,5,4);mesh M = spectral(n,a,b);sfunction u(M);function uexact = x^3*y^5*z^4+2+y-z;u = uexact;function dx_uexact = 3*x^2*y^5*z^4;function dy_uexact = x^3*5*y^4*z^4+1;function dz_uexact = x^3*y^5*4*z^3-1;// TEMPORAIREmesh Q = structured((10,10,15),a,b);double dx_l2error = sqrt(int[Q]((dx(u)-dx_uexact)^2));if (dx_l2error < 1E-6) cout << "ok dx\n";else cout << "oops dx: l2 error is " << dx_l2error << "\n";double dy_l2error = sqrt(int[Q]((dy(u)-dy_uexact)^2));if (dy_l2error < 1E-6) cout << "ok dy\n";else cout << "oops dy: l2 error is " << dy_l2error << "\n";double dz_l2error = sqrt(int[Q]((dz(u)-dz_uexact)^2));if (dz_l2error < 1E-6) cout << "ok dz\n";else cout << "oops dz: l2 error is " << dz_l2error << "\n";]])AT_CHECK([$abs_top_builddir/ff3d -V 0 -nw test.ff],0,[[ok dxok dyok dz]])AT_CLEANUP
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?