Mimetic Operators Library Enhanced 4.0
Loading...
Searching...
No Matches
RobinBC Class Reference

#include <robinbc.h>

Inheritance diagram for RobinBC:

Public Member Functions

 RobinBC (u16 k, u32 m, Real dx, Real a, Real b)
 
 RobinBC (u16 k, u32 m, Real dx, u32 n, Real dy, Real a, Real b)
 
 RobinBC (u16 k, u32 m, Real dx, u32 n, Real dy, u32 o, Real dz, Real a, Real b)
 

Detailed Description

Definition at line 6 of file robinbc.h.

Constructor & Destructor Documentation

◆ RobinBC() [1/3]

RobinBC::RobinBC ( u16 k,
u32 m,
Real dx,
Real a,
Real b )

Definition at line 4 of file robinbc.cpp.

5{
6 sp_mat A(m+2, m+2);
7 sp_mat BG(m+2, m+2);
8
9 A.at(0, 0) = a;
10 A.at(m+1, m+1) = a;
11
12 Gradient grad(k, m, dx);
13
14 BG.row(0) = -b*grad.row(0);
15 BG.row(m+1) = b*grad.row(m);
16
17 *this = A + BG;
18}

◆ RobinBC() [2/3]

RobinBC::RobinBC ( u16 k,
u32 m,
Real dx,
u32 n,
Real dy,
Real a,
Real b )

Definition at line 21 of file robinbc.cpp.

22{
23 RobinBC Bm(k, m, dx, a, b);
24 RobinBC Bn(k, n, dy, a, b);
25
26 sp_mat Im = speye(m+2, m+2);
27 sp_mat In = speye(n+2, n+2);
28
29 In.at(0, 0) = 0;
30 In.at(n+1, n+1) = 0;
31
32 sp_mat BC1 = Utils::spkron(In, Bm);
33 sp_mat BC2 = Utils::spkron(Bn, Im);
34
35 *this = BC1 + BC2;
36}
static sp_mat spkron(const sp_mat &A, const sp_mat &B)
Definition utils.cpp:53

◆ RobinBC() [3/3]

RobinBC::RobinBC ( u16 k,
u32 m,
Real dx,
u32 n,
Real dy,
u32 o,
Real dz,
Real a,
Real b )

Definition at line 39 of file robinbc.cpp.

40{
41 RobinBC Bm(k, m, dx, a, b);
42 RobinBC Bn(k, n, dy, a, b);
43 RobinBC Bo(k, o, dz, a, b);
44
45 sp_mat Im = speye(m+2, m+2);
46 sp_mat In = speye(n+2, n+2);
47 sp_mat Io = speye(o+2, o+2);
48
49 Io.at(0, 0) = 0;
50 Io.at(o+1, o+1) = 0;
51
52 sp_mat In2 = In;
53 In2.at(0, 0) = 0;
54 In2.at(n+1, n+1) = 0;
55
56 sp_mat BC1 = Utils::spkron(Utils::spkron(Io, In2), Bm);
57 sp_mat BC2 = Utils::spkron(Utils::spkron(Io, Bn), Im);
58 sp_mat BC3 = Utils::spkron(Utils::spkron(Bo, In), Im);
59
60 *this = BC1 + BC2 + BC3;
61}

The documentation for this class was generated from the following files: