-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSolveBEM_GMRES.m
24 lines (22 loc) · 1.07 KB
/
SolveBEM_GMRES.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
function x = SolveBEM_GMRES(coord, connect, inletelem, outletelem, ...
elemDofNum, ...
NeumannDofs, NeumannNode, DirichletElem, ...
FieldPts, NormalV, Weights, BasisFn, ...
Telem, ...
grx, grw, gtx, gtw, mu, numGaussPoints, ...
numNodes, numDofPerNode, numDofPerElem, ...
ToleranceGMRES)
[A, b, Minv] = ...
PrecomputeBEM_Vessel(coord, connect, inletelem, outletelem, ...
elemDofNum, ...
NeumannDofs, NeumannNode, DirichletElem, ...
FieldPts, NormalV, Weights, BasisFn, ...
Telem, ...
grx, grw, gtx, gtw, mu, numGaussPoints, ...
numNodes, numDofPerNode, numDofPerElem);
x = gmres(A,b,[],ToleranceGMRES,size(A,1),@PreCondition);
%%
function y = PreCondition(r)
y = Minv*r;
end
end