Debian Codegraph @

debian/external_deps/fetk/mclite/dfu_wv.m

raw
1 function [thetam] = dfu_wv(evalKey, parm, L, xm,ym,type, u,ux,uy, ...
2 ps,psx,psy, pr,prx,pry);
3 %DFU_WV evaluate bilinear linearization form of a PDE
4 %
5 % Usage: [thetam] = dfu_wv(evalKey, parm, L, xm,ym,type, u,ux,uy, ...
6 % ps,psx,psy, pr,prx,pry);
7 %
8 % Evaluate the bilinear form by providing the value of the quantity
9 % under the integral sign, at a particular quadrature point.
10 %
11 % Because we do this for all of the elements at one time to make things
12 % reasonably fast, we pass some arrays around.
13 %
14 % Input:
15 %
16 % evalKey ==> area or surface integral
17 % L ==> number of elements to do all at once
18 % xm(1:L,1) ==> x-coordindinates of quadrature points, one per element
19 % ym(1:L,1) ==> y-coordindinates of quadrature points, one per element
20 % type(1:L,1) ==> point type (interior/diri/neum), one per element
21 %
22 % u(1:L,1) ==> u, evaluated on master element
23 % ux(1:L,1) ==> partial w.r.t. x of u, one per element
24 % uy(1:L,1) ==> partial w.r.t. x of u, one per element
25 %
26 % ps ==> phi(s), evaluated on master element
27 % psx(1:L,1) ==> partial w.r.t. x of phi(s), one per element
28 % psy(1:L,1) ==> partial w.r.t. x of phi(s), one per element
29 %
30 % pr ==> phi(r), evaluated on master element
31 % prx(1:L,1) ==> partial w.r.t. x of phi(r), one per element
32 % pry(1:L,1) ==> partial w.r.t. x of phi(r), one per element
33 %
34 % Output:
35 %
36 % thetam ==> the integrand for the area or surface integral,
37 % not including the jacobian of transformation
38 %
39 % Author: Michael Holst
40 % rcsid="$Id: dfu_wv.m,v 1.2 2008/03/12 06:23:07 fetk Exp $"
41
42 lambda = parm(1);
43
44 %%% area integral
45 if (evalKey == 0)
46
47 %%% coefficients
48 atilde = ones(L,1); % the first order coefficient function
49
50 %%% linearized operator evaluated at the FEM function "u"
51 thetam(1:L,1) = ...
52 atilde(1:L,1) .* (psx(1:L,1).*prx(1:L,1)+psy(1:L,1).*pry(1:L,1)) ...
53 + lambda * exp(u(1:L,1)) * ps * pr;
54
55 %%% edge integral (for natural boundary condition)
56 elseif (evalKey == 1)
57 thetam(1:L,1) = zeros(L,1);
58
59 %%% error
60 else
61 assertw( 0, 'dfu_wv 1' );
62 end
63