Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mpp
MLUQ
Commits
d487b22f
Commit
d487b22f
authored
Dec 04, 2022
by
niklas.baumgarten
Browse files
update problem
parent
118080e0
Pipeline
#251962
failed with stages
in 33 minutes and 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mluq/src/problems/StochasticTransportProblems.cpp
View file @
d487b22f
...
...
@@ -239,11 +239,11 @@ public:
};
class
StochasticPollutionCosHat2D
:
public
IStochasticTransportProblem
{
protected:
HybridFaceNormalFluxGenerator
scalarGenerator
;
HybridCellFluxGenerator
vectorFieldGenerator
;
protected:
double
amplitude
=
1.0
;
double
cc
=
6.0
;
...
...
@@ -283,20 +283,36 @@ public:
};
class
StochasticPollutionTrippleCosHat2D
:
public
StochasticPollutionCosHat2D
{
UniformDistributionRVector
rVectorGenerator
;
public:
explicit
StochasticPollutionTrippleCosHat2D
()
:
IProblem
(
"UnitSquare"
),
StochasticPollutionCosHat2D
()
{
IProblem
(
"UnitSquare"
),
StochasticPollutionCosHat2D
(),
rVectorGenerator
(
UniformDistributionRVector
(
3
,
0.25
,
0.75
))
{
CFL
=
1.0
;
}
void
InitGenerator
(
int
init
)
override
{
scalarGenerator
.
InitGenerator
(
meshes
,
init
);
rVectorGenerator
.
InitGenerator
(
meshes
,
init
);
vectorFieldGenerator
.
InitGenerator
(
meshes
,
init
);
}
void
drawSample
(
const
SampleID
&
id
)
override
{
scalarGenerator
.
DrawSample
(
id
);
rVectorGenerator
.
DrawSample
(
id
);
vectorFieldGenerator
.
DrawSample
(
id
);
}
double
Solution
(
double
t
,
const
Point
&
x
)
const
override
{
std
::
vector
<
Point
>
midPoints
{
Point
(
0.25
,
0.8
),
Point
(
0.5
,
0.8
),
Point
(
0.75
,
0.8
)};
RVector
x0
=
this
->
rVectorGenerator
.
EvalSample
();
std
::
vector
<
Point
>
midPoints
{
Point
(
x0
[
0
],
0.8
),
Point
(
x0
[
1
],
0.8
),
Point
(
x0
[
2
],
0.8
)};
double
return_val
=
0.0
;
for
(
auto
&
point
:
midPoints
)
{
double
r
=
dist
(
point
,
x
);
if
(
r
<
1
/
cc
)
return
amplitude
*
pow
(
cos
(
cc
*
Pi
*
r
)
+
1.0
,
2.0
);
return
_val
=
max
(
amplitude
*
pow
(
cos
(
cc
*
Pi
*
r
)
+
1.0
,
2.0
)
,
return_val
)
;
}
return
0.0
;
return
return_val
;
}
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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