... | ... | @@ -90,9 +90,9 @@ exahype-project SWE |
|
|
/*Configure the domain*/
|
|
|
computational-domain
|
|
|
dimension const = 2
|
|
|
width = 1.0, 1.0
|
|
|
offset = 0.0, 0.0
|
|
|
end-time = 2.0
|
|
|
width = ##width
|
|
|
offset = ##offset
|
|
|
end-time = ##final time
|
|
|
end computational-domain
|
|
|
|
|
|
/*Configure shared memory settings*/
|
... | ... | @@ -105,14 +105,15 @@ exahype-project SWE |
|
|
|
|
|
/*Optimiziation: DO N0T TOUCH*/
|
|
|
global-optimisation
|
|
|
fuse-algorithmic-steps = on
|
|
|
fuse-algorithmic-steps-factor = 0.99
|
|
|
fuse-algorithmic-steps = all
|
|
|
fuse-algorithmic-steps-rerun-factor = 0.99
|
|
|
fuse-algorithmic-steps-diffusion-factor = 0.99
|
|
|
spawn-predictor-as-background-thread = off
|
|
|
spawn-amr-background-threads = off
|
|
|
/* 0.0 und 0.8 sind schon mal zwei Faktoren */
|
|
|
disable-vertex-exchange-in-time-steps = on
|
|
|
time-step-batch-factor = 1.0
|
|
|
disable-metadata-exchange-in-batched-time-steps = on
|
|
|
time-step-batch-factor = 0.0
|
|
|
disable-metadata-exchange-in-batched-time-steps = off
|
|
|
double-compression = 0.0
|
|
|
spawn-double-compression-as-background-thread = off
|
|
|
end global-optimisation
|
... | ... | @@ -120,12 +121,12 @@ exahype-project SWE |
|
|
/*Defines the hyperbolic PDE*/
|
|
|
solver ADER-DG ADERSolver
|
|
|
variables const = h:1,p:2
|
|
|
order const = 3
|
|
|
order const = ##polynomial order of the simulation
|
|
|
/* 27 points: 0.05, 9 points: 0.15 */
|
|
|
maximum-mesh-size = 0.3
|
|
|
maximum-mesh-size = ##mesh size
|
|
|
time-stepping = globalfixed
|
|
|
type const = nonlinear
|
|
|
terms const = flux, ncp
|
|
|
terms const = ##PDE terms, ie fluxes, sources etc
|
|
|
optimisation const = generic
|
|
|
language const = C
|
|
|
|
... | ... | @@ -195,7 +196,7 @@ output-directory const = ./ApplicationExamples/SWE_Test |
|
|
|
|
|
## Adding a plotter
|
|
|
* 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
|
|
|
plot vtk::Cartesian::vertices::ascii VtkWriter
|
... | ... | @@ -276,7 +277,7 @@ void SWE::SWE_ADERDG::eigenvalues(const double* const Q,const int d,double* lamb |
|
|
ReadOnlyVariables vars(Q);
|
|
|
Variables eigs(lambda);
|
|
|
|
|
|
double u = vars.p(d)/vars.h();
|
|
|
double u = vars.p(direction)/vars.h();
|
|
|
double c = std::sqrt(vars.h());
|
|
|
|
|
|
eigs.h() = u - c;
|
... | ... | @@ -306,20 +307,24 @@ In this short example we implement reflecting boundary conditions. For SWE this |
|
|
The state can then be inverted by:
|
|
|
|
|
|
```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) {
|
|
|
// Dimensions = 2
|
|
|
// Number of variables + parameters = 3 + 0
|
|
|
|
|
|
int normalZero = (normalNonZero+1) % 2;
|
|
|
|
|
|
ReadOnlyVariables in(stateIn) ;
|
|
|
ReadOnlyVariables fluxin(fluxIn) ;
|
|
|
Variables out(stateOut);
|
|
|
Variables fluxout(fluxOut);
|
|
|
|
|
|
out.h() = in.h();
|
|
|
out.p(normalZero) = in.p(normalZero);
|
|
|
out.p(normalNonZero)= -in.p(normalNonZero);
|
|
|
//...
|
|
|
out.p(0) = in.p(0);
|
|
|
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):
|
... | ... | |