-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathProjector_toNedelec.m
60 lines (49 loc) · 1.73 KB
/
Projector_toNedelec.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
classdef Projector_toNedelec < Projector
properties (Access = private)
order
end
methods (Access = public)
function obj = Projector_toNedelec(cParams)
obj.init(cParams);
obj.order = cParams.projectorType;
end
function xFun = project(obj, x)
LHS = obj.computeLHS(x);
RHS = obj.computeRHS(x);
xProj = LHS\RHS;
s.mesh = obj.mesh;
s.fValues = reshape(xProj,[1,numel(xProj)])'; % no
s.order = obj.order;
xFun = NedelecFunction(s);
end
end
methods (Access = private)
function LHS = computeLHS(obj,fun)
s.mesh = obj.mesh;
s.test = NedelecFunction.create(obj.mesh, 1, obj.order);
s.trial = NedelecFunction.create(obj.mesh, 1, obj.order);
% s.quadratureOrder = 'QUADRATIC'; % no
s.type = 'MassMatrixVect';
lhs = LHSintegrator.create(s);
LHS = lhs.compute();
end
function RHS = computeRHS(obj,fun)
ord = obj.createRHSQuadrature(fun);
switch class(fun)
case {'UnfittedFunction','UnfittedBoundaryFunction'}
s.mesh = fun.unfittedMesh;
s.type = 'Unfitted';
otherwise
s.mesh = obj.mesh;
s.type = 'ShapeFunctionN';
end
s.quadType = ord;
int = RHSintegrator.create(s);
test = NedelecFunction.create(obj.mesh,1,obj.order);
RHS = int.compute(fun,test);
end
function ord = createRHSQuadrature(obj, fun)
ord = 2;
end
end
end