Changes
Page history
Update Intro
authored
Apr 09, 2020
by
ge68wax
Hide whitespace changes
Inline
Side-by-side
Intro.md
View page @
f80a23a6
...
@@ -90,9 +90,9 @@ exahype-project SWE
...
@@ -90,9 +90,9 @@ exahype-project SWE
/
*Configure the domain*
/
/
*Configure the domain*
/
computational-domain
computational-domain
dimension const = 2
dimension const = 2
width =
1.0, 1.0
width =
##width
offset =
0.0, 0.0
offset =
##offset
end-time =
2.0
end-time =
##final time
end computational-domain
end computational-domain
/
*Configure shared memory settings*
/
/
*Configure shared memory settings*
/
...
@@ -105,27 +105,28 @@ exahype-project SWE
...
@@ -105,27 +105,28 @@ exahype-project SWE
/
*Optimiziation: DO N0T TOUCH*
/
/
*Optimiziation: DO N0T TOUCH*
/
global-optimisation
global-optimisation
fuse-algorithmic-steps = on
fuse-algorithmic-steps = all
fuse-algorithmic-steps-factor = 0.99
fuse-algorithmic-steps-rerun-factor = 0.99
spawn-predictor-as-background-thread = off
fuse-algorithmic-steps-diffusion-factor = 0.99
spawn-amr-background-threads = off
spawn-predictor-as-background-thread = off
/
* 0.0 und 0.8 sind schon mal zwei Faktoren *
/
spawn-amr-background-threads = off
disable-vertex-exchange-in-time-steps = on
/
* 0.0 und 0.8 sind schon mal zwei Faktoren *
/
time-step-batch-factor = 1.0
disable-vertex-exchange-in-time-steps = on
disable-metadata-exchange-in-batched-time-steps = on
time-step-batch-factor = 0.0
double-compression = 0.0
disable-metadata-exchange-in-batched-time-steps = off
spawn-double-compression-as-background-thread = off
double-compression = 0.0
end global-optimisation
spawn-double-compression-as-background-thread = off
end global-optimisation
/
*Defines the hyperbolic PDE*
/
/
*Defines the hyperbolic PDE*
/
solver ADER-DG ADERSolver
solver ADER-DG ADERSolver
variables const = h:1,p:2
variables const = h:1,p:2
order const =
3
order const =
##polynomial order of the simulation
/
* 27 points: 0.05, 9 points: 0.15 *
/
/
* 27 points: 0.05, 9 points: 0.15 *
/
maximum-mesh-size =
0.3
maximum-mesh-size =
##mesh size
time-stepping = globalfixed
time-stepping = globalfixed
type const = nonlinear
type const = nonlinear
terms const =
flux, ncp
terms const =
##PDE terms, ie fluxes, sources etc
optimisation const = generic
optimisation const = generic
language const = C
language const = C
...
@@ -195,7 +196,7 @@ output-directory const = ./ApplicationExamples/SWE_Test
...
@@ -195,7 +196,7 @@ output-directory const = ./ApplicationExamples/SWE_Test
## Adding a plotter
## Adding a plotter
* In this example we add a simple vtk output plotter which is sufficient for our needs.
* In this example we add a simple vtk output plotter which is sufficient for our needs.
*
Place these
lines after `language const` and before `end solver`:
*
Uncomment the plotter
lines after `language const` and before `end solver`
and fill in the missing information
:
```
javascript
```
javascript
plot vtk::Cartesian::vertices::ascii VtkWriter
plot vtk::Cartesian::vertices::ascii VtkWriter
...
@@ -276,7 +277,7 @@ void SWE::SWE_ADERDG::eigenvalues(const double* const Q,const int d,double* lamb
...
@@ -276,7 +277,7 @@ void SWE::SWE_ADERDG::eigenvalues(const double* const Q,const int d,double* lamb
ReadOnlyVariables vars(Q);
ReadOnlyVariables vars(Q);
Variables eigs(lambda);
Variables eigs(lambda);
double u = vars.p(d)/vars.h();
double u = vars.p(d
irection
)/vars.h();
double c = std::sqrt(vars.h());
double c = std::sqrt(vars.h());
eigs.h() = u - c;
eigs.h() = u - c;
...
@@ -306,20 +307,24 @@ In this short example we implement reflecting boundary conditions. For SWE this
...
@@ -306,20 +307,24 @@ In this short example we implement reflecting boundary conditions. For SWE this
The state can then be inverted by:
The state can then be inverted by:
```
c++
```
c++
void SWE::SWE_ADERDG::boundaryValues(const double
*
const x,const double t,const double dt,const int faceIndex,const int
normalNonZero
,
void SWE::SWE_ADERDG::boundaryValues(const double
*
const x,const double t,const double dt,const int faceIndex,const int
direction
,
const double
* const fluxIn,const double*
const stateIn, double
*fluxOut,double*
stateOut) {
const double
* const fluxIn,const double*
const stateIn, double
*fluxOut,double*
stateOut) {
// Dimensions = 2
// Dimensions = 2
// Number of variables + parameters = 3 + 0
// Number of variables + parameters = 3 + 0
int normalZero = (normalNonZero+1) % 2;
ReadOnlyVariables in(stateIn) ;
ReadOnlyVariables in(stateIn) ;
ReadOnlyVariables fluxin(fluxIn) ;
Variables out(stateOut);
Variables out(stateOut);
Variables fluxout(fluxOut);
out.h() = in.h();
out.h() = in.h();
out.p(normalZero) = in.p(normalZero);
out.p(0) = in.p(0);
out.p(normalNonZero)= -in.p(normalNonZero);
out.p(1) = in.p(1);
//...
out.p(direction)= -in.p(direction);
fluxout.h() = fluxin.h();
fluxout.p(0) = fluxin.p(0);
fluxout.p(1) = fluxin.p(1);
}
```
```
To get the new flux we apply the inverted velocity vector to the flux term (in this example for normalNonZero=0):
To get the new flux we apply the inverted velocity vector to the flux term (in this example for normalNonZero=0):
...
...
...
...