-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasis_serene.m
84 lines (74 loc) · 2.11 KB
/
basis_serene.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
function v = basis_serene ( xq, yq, xw, ys, xe, yn, xx, yy )
%*****************************************************************************80
%
%% BASIS_SERENE evaluates the serendipity basis functions.
%
% Discussion:
%
% This procedure assumes that a serendipity element has been defined,
% whose sides are parallel to coordinate axes.
%
% The local element numbering is
%
% YN 3--2--1
% | | |
% | 4 8
% | | |
% YS 5--6--7
% |
% +--XW---XE--
%
% We note that each basis function can be written as the product of
% three linear terms, which never result in an x^2y^2 term.
%
% Licensing:
%
% This code is distributed under the GNU LGPL license.
%
% Modified:
%
% 29 June 2014
%
% Author:
%
% John Burkardt
%
% Parameters:
%
% Input, real XQ, YQ, the evaluation point.
%
% Input, real XW, YS, the coordinates of the lower left corner.
%
% Input, real XE, YN, the coordinates of the upper right corner.
%
% Input, real XX(8), YY(8), the coordinates of the 8 nodes.
%
% Output, real V(8), the value of the basis functions at (XQ,YQ).
%
v = zeros(8,1);
v(1) = not1 ( xq, xw, xx(1) ) ...
* not1 ( yq, ys, yy(1) ) ...
* not2 ( xq, yq, xx(8), yy(8), xx(2), yy(2), xx(1), yy(1) );
v(2) = not1 ( xq, xw, xx(2) ) ...
* not1 ( xq, xe, xx(2) ) ...
* not1 ( yq, ys, yy(2) );
v(3) = not1 ( xq, xe, xx(3) ) ...
* not1 ( yq, ys, yy(3) ) ...
* not2 ( xq, yq, xx(2), yy(2), xx(4), yy(4), xx(3), yy(3) );
v(4) = not1 ( xq, xe, xx(4) ) ...
* not1 ( yq, yn, yy(4) ) ...
* not1 ( yq, ys, yy(4) );
v(5) = not1 ( xq, xe, xx(5) ) ...
* not1 ( yq, yn, yy(5) ) ...
* not2 ( xq, yq, xx(4), yy(4), xx(6), yy(6), xx(5), yy(5) );
v(6) = not1 ( xq, xe, xx(6) ) ...
* not1 ( xq, xw, xx(6) ) ...
* not1 ( yq, yn, yy(6) );
v(7) = not1 ( xq, xw, xx(7) ) ...
* not1 ( yq, yn, yy(7) ) ...
* not2 ( xq, yq, xx(6), yy(6), xx(8), yy(8), xx(7), yy(7) );
v(8) = not1 ( yq, ys, yy(8) ) ...
* not1 ( yq, yn, yy(8) ) ...
* not1 ( xq, xw, xx(8) );
return
end