Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mpp
MLUQ
Commits
019c962a
Commit
019c962a
authored
Nov 12, 2020
by
niklas.baumgarten
Browse files
added set Solution for HybridEllipticAssemble
parent
8732d315
Changes
3
Hide whitespace changes
Inline
Side-by-side
mlmc/src/assemble/HybridEllipticAssemble.cpp
View file @
019c962a
...
...
@@ -156,6 +156,29 @@ FluxPair HybridEllipticAssemble::OutflowLeftRight(const Vector &p) const {
return
{
PPM
->
Sum
(
outflowLeft
),
PPM
->
Sum
(
outflowRight
)};
}
void
HybridEllipticAssemble
::
SetSolution
(
const
Vector
&
u
,
Vector
&
p
)
const
{
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
int
N
=
c
.
Faces
();
SmallMatrix
A
(
N
);
SmallVector
B
(
N
);
SmallVector
R
(
N
);
LocalProblem
(
c
,
u
,
A
,
B
,
R
);
InverseSmallMatrix
IA
(
A
);
SmallVector
IAB
(
IA
,
B
);
Scalar
BIAB
=
B
*
IAB
;
SmallVector
RU
(
R
);
SmallVector
UU
(
R
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
for
(
int
i
=
0
;
i
<
c
.
Faces
();
++
i
)
UU
[
i
]
=
u
(
elem
[
i
],
0
);
for
(
int
i
=
0
;
i
<
c
.
Faces
();
++
i
)
RU
[
i
]
*=
UU
[
i
];
SmallVector
IARU
(
IA
,
RU
);
Scalar
BIARU
=
B
*
IARU
;
p
(
c
(),
0
)
=
BIARU
/
BIAB
;
}
}
void
HybridEllipticAssemble
::
SetFlux
(
const
Vector
&
u
,
Vector
&
flux
)
{
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
int
N
=
c
.
Faces
();
...
...
mlmc/src/assemble/HybridEllipticAssemble.hpp
View file @
019c962a
...
...
@@ -55,6 +55,8 @@ public:
virtual
void
SetExactSolution
(
Vector
&
uEx
)
const
override
;
void
SetSolution
(
const
Vector
&
u
,
Vector
&
p
)
const
override
;
virtual
void
SetFlux
(
const
Vector
&
u
,
Vector
&
flux
)
override
;
void
AssembleTransfer
(
TransferMatrix
&
TM
)
const
override
;
...
...
mlmc/src/assemble/IStochasticEllipticAssemble.hpp
View file @
019c962a
...
...
@@ -72,6 +72,8 @@ public:
virtual
void
SetExactSolution
(
Vector
&
u_ex
)
const
=
0
;
virtual
void
SetSolution
(
const
Vector
&
u
,
Vector
&
p
)
const
{};
virtual
void
SetFlux
(
const
Vector
&
u
,
Vector
&
flux
)
=
0
;
void
AssembleTransfer
(
TransferMatrix
&
TM
)
const
override
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment