-- abc.adb User problem definitions for a specific PDE to be solved -- this includes the user choice of degree and discretization -- -- The problem must be well posed and the solution must be -- continuous and continuously differentiable -- -- The general PDE to be solved is: -- a1(x,y)*uxx(x,y) + b1(x,y)*uxy(x,y) + c1(x,y)*uyy(x,y) + -- d1(x,y)*ux(x,y) + e1(x,y)*uy(x,y) + f1(x,y)*u(x,y) = c(x,y) -- with Real_Arrays; -- type Real comes from here use Real_Arrays; with Ada.Numerics.Long_Elementary_Functions; use Ada.Numerics.Long_Elementary_Functions; package body abc is -- the user must provide all functions, even if only return 0.0; -- the functions are implemented in the file abc.abd -- A specific set of test functions is covered in abc.txt function a1(x:Real; y:Real) return Real is begin return exp(x/2.0)*exp(y)/2.0; end a1; function b1(x:Real; y:Real) return Real is begin return 0.7/(x*x*y*y+0.5); end b1; function c1(x:Real; y:Real) return Real is begin return (4.0 - exp(x) - exp(y/2.0))*2.0; end c1; function d1(x:Real; y:Real) return Real is begin return x*x+y; end d1; function e1(x:Real; y:Real) return Real is begin return x*y*y; end e1; function f1(x:Real; y:Real) return Real is begin return 3.0*x + 2.0*y; end f1; function u (x:Real; y:Real) return Real is begin -- must compute boundary, if solution, then set ifcheck := 1 return x*x*x + 2.0*y*y*y + 3.0*x*x*y + 4.0*x*y*y + 5.0*x*y + 6.0*x + 7.0*y + 8.0; end u; function c (x:Real; y:Real) return Real is -- this becomes defined by a1...f1 begin return 0.5*exp(x/2.0)*exp(y)*(6.0*x+6.0*y) + 0.7*(6.0*x + 8.0*y + 5.0)/(x*x*y*y+0.5) + (8.0 - 2.0*exp(x) - 2.0*exp(y/2.0))*(12.0*y + 8.0*x) + (x*x+y)*(3.0*x*x + 6.0*x*y + 4.0*y*y + 5.0*y + 6.0) + x*y*y*(6.0*y*y + 3.0*x*x + 8.0*x*y + 5.0*x +7.0) + (3.0*x + 2.0*Y)*(x*x*x + 2.0*y*y*y + 3.0*x*x*y + 4.0*x*y*y + 5.0*x*y + 6.0*x + 7.0*y + 8.0); end c; end abc;