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
ba85a102
Commit
ba85a102
authored
Feb 02, 2021
by
niklas.baumgarten
Browse files
added problem
parent
ada30f3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
mlmc/src/problems/StochasticTransportProblem.cpp
View file @
ba85a102
...
...
@@ -3,10 +3,14 @@
IStochasticTransportProblem
*
CreateStochasticTransportProblem
(
std
::
string
problemName
,
Meshes
&
meshes
)
{
if
(
problemName
==
"CircleWave2D"
)
return
new
CircleWave2D
(
meshes
);
if
(
problemName
==
"StochasticPollution1D"
)
return
new
StochasticPollution1D
(
meshes
);
if
(
problemName
==
"Pollution1D"
)
return
new
Pollution1D
(
meshes
);
if
(
problemName
==
"CircleWave2D"
)
return
new
CircleWave2D
(
meshes
);
if
(
problemName
==
"StochasticPollutionCosHat1D"
)
return
new
StochasticPollutionCosHat1D
(
meshes
);
if
(
problemName
==
"StochasticPollution2D"
)
...
...
mlmc/src/problems/StochasticTransportProblem.hpp
View file @
ba85a102
...
...
@@ -49,6 +49,27 @@ public:
string
Name
()
const
override
{
return
"StochasticPollution1D"
;
}
};
class
Pollution1D
:
public
IStochasticTransportProblem
{
public:
Pollution1D
(
Meshes
&
meshes
)
:
IStochasticTransportProblem
(
meshes
)
{}
Scalar
Solution
(
double
t
,
const
Point
&
x
)
const
override
{
if
(
abs
(
1.0
*
t
-
x
[
0
]
+
0.5
)
>
0.06251
)
return
0.0
;
return
1.0
;
}
VectorField
CellFlux
(
const
cell
&
c
,
const
Point
&
x
)
const
override
{
return
VectorField
(
-
1.0
,
0.0
);
}
Scalar
FaceNormalFlux
(
const
cell
&
c
,
int
face
,
const
VectorField
&
N
,
const
Point
&
x
)
const
override
{
return
1.0
;
}
string
Name
()
const
override
{
return
"Pollution1D"
;
}
};
class
StochasticPollutionCosHat1D
:
public
IStochasticTransportProblem
{
private:
double
amplitude
=
1.00
;
...
...
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