BG_Flood
0.8
Documentation (Work-in-progress)
|
#include "Testing.h"
Functions | |
template<class T > | |
bool | Testing (Param XParam, Forcing< float > XForcing, Model< T > XModel, Model< T > XModel_g) |
template bool | Testing< float > (Param XParam, Forcing< float > XForcing, Model< float > XModel, Model< float > XModel_g) |
template bool | Testing< double > (Param XParam, Forcing< float > XForcing, Model< double > XModel, Model< double > XModel_g) |
template<class T > | |
bool | GaussianHumptest (T zsnit, int gpu, bool compare) |
template bool | GaussianHumptest< float > (float zsnit, int gpu, bool compare) |
template bool | GaussianHumptest< double > (double zsnit, int gpu, bool compare) |
template<class T > | |
bool | Rivertest (T zsnit, int gpu) |
template bool | Rivertest< float > (float zsnit, int gpu) |
template bool | Rivertest< double > (double zsnit, int gpu) |
template<class T > | |
bool | MassConserveSteepSlope (T zsnit, int gpu) |
template bool | MassConserveSteepSlope< float > (float zsnit, int gpu) |
template bool | MassConserveSteepSlope< double > (double zsnit, int gpu) |
template<class T > | |
bool | reductiontest (Param XParam, Model< T > XModel, Model< T > XModel_g) |
template bool | reductiontest< float > (Param XParam, Model< float > XModel, Model< float > XModel_g) |
template bool | reductiontest< double > (Param XParam, Model< double > XModel, Model< double > XModel_g) |
template<class T > | |
bool | CPUGPUtest (Param XParam, Model< T > XModel, Model< T > XModel_g) |
template<class T > | |
T | ValleyBathy (T x, T y, T slope, T center) |
create V shape Valley basin More... | |
template<class T > | |
T | ThackerBathy (T x, T y, T L, T D) |
create a parabolic bassin More... | |
template<class T > | |
bool | ThackerLakeAtRest (Param XParam, T zsinit) |
template bool | ThackerLakeAtRest< float > (Param XParam, float zsinit) |
template bool | ThackerLakeAtRest< double > (Param XParam, double zsinit) |
template<class T > | |
bool | RiverVolumeAdapt (Param XParam, T maxslope) |
template<class T > | |
bool | RiverVolumeAdapt (Param XParam, T slope, bool bottop, bool flip) |
Simulate a river flowing in a steep valley and heck the Volume conservation. More... | |
template<class T > | |
bool | testboundaries (Param XParam, T maxslope) |
template<class T > | |
bool | RiverOnBoundary (Param XParam, T slope, int Dir, int Bound_type) |
template<class T > | |
bool | LakeAtRest (Param XParam, Model< T > XModel) |
template<class T > | |
void | testButtingerX (Param XParam, int ib, int ix, int iy, Model< T > XModel) |
template<class T > | |
void | testkurganovX (Param XParam, int ib, int ix, int iy, Model< T > XModel) |
template<class T > | |
bool | Raintest (T zsnit, int gpu, float alpha) |
bool | Raintestinput (int gpu) |
template<class T > | |
std::vector< float > | Raintestmap (int gpu, int dimf, T zinit) |
template std::vector< float > | Raintestmap< float > (int gpu, int dimf, float Zsinit) |
template std::vector< float > | Raintestmap< double > (int gpu, int dimf, double Zsinit) |
template<class T > | |
bool | ZoneOutputTest (int nzones, T zsinit) |
template bool | ZoneOutputTest< float > (int nzones, float zsinit) |
template bool | ZoneOutputTest< double > (int nzones, double zsinit) |
template<class T > | |
bool | Rainlossestest (T zsinit, int gpu, float alpha) |
template<class T > | |
int | TestGradientSpeed (Param XParam, Model< T > XModel, Model< T > XModel_g) |
template<class T > | |
bool | TestHaloSpeed (Param XParam, Model< T > XModel, Model< T > XModel_g) |
template<class T > | |
int | TestInstability (Param XParam, Model< T > XModel, Model< T > XModel_g) |
template<class T > | |
int | TestFirsthalfstep (Param XParam, Forcing< float > XForcing, Model< T > XModel, Model< T > XModel_g) |
template<class T > | |
int | Testzbinit (Param XParam, Forcing< float > XForcing, Model< T > XModel, Model< T > XModel_g) |
template<class T > | |
Forcing< float > | MakValleyBathy (Param XParam, T slope, bool bottop, bool flip) |
void | alloc_init2Darray (float **arr, int NX, int NY) |
void | init3Darray (float ***arr, int rows, int cols, int depths) |
template<class T > | |
void | fillrandom (Param XParam, BlockP< T > XBlock, T *z) |
template void | fillrandom< float > (Param XParam, BlockP< float > XBlock, float *z) |
template void | fillrandom< double > (Param XParam, BlockP< double > XBlock, double *z) |
template<class T > | |
void | fillgauss (Param XParam, BlockP< T > XBlock, T amp, T *z) |
template void | fillgauss< float > (Param XParam, BlockP< float > XBlock, float amp, float *z) |
template void | fillgauss< double > (Param XParam, BlockP< double > XBlock, double amp, double *z) |
template<class T > | |
void | TestingOutput (Param XParam, Model< T > XModel) |
template void | TestingOutput< float > (Param XParam, Model< float > XModel) |
template void | TestingOutput< double > (Param XParam, Model< double > XModel) |
template<class T > | |
void | copyID2var (Param XParam, BlockP< T > XBlock, T *z) |
template void | copyID2var< float > (Param XParam, BlockP< float > XBlock, float *z) |
template void | copyID2var< double > (Param XParam, BlockP< double > XBlock, double *z) |
template<class T > | |
void | copyBlockinfo2var (Param XParam, BlockP< T > XBlock, int *blkinfo, T *z) |
template void | copyBlockinfo2var< float > (Param XParam, BlockP< float > XBlock, int *blkinfo, float *z) |
template void | copyBlockinfo2var< double > (Param XParam, BlockP< double > XBlock, int *blkinfo, double *z) |
template<class T > | |
void | CompareCPUvsGPU (Param XParam, Model< T > XModel, Model< T > XModel_g, std::vector< std::string > varlist, bool checkhalo) |
template void | CompareCPUvsGPU< float > (Param XParam, Model< float > XModel, Model< float > XModel_g, std::vector< std::string > varlist, bool checkhalo) |
template void | CompareCPUvsGPU< double > (Param XParam, Model< double > XModel, Model< double > XModel_g, std::vector< std::string > varlist, bool checkhalo) |
template<class T > | |
void | diffdh (Param XParam, BlockP< T > XBlock, T *input, T *output, T *shuffle) |
template<class T > | |
void | diffSource (Param XParam, BlockP< T > XBlock, T *Fqux, T *Su, T *output) |
template<class T > | |
void | diffArray (Param XParam, BlockP< T > XBlock, std::string varname, bool checkhalo, T *cpu, T *gpu, T *dummy, T *out) |
void alloc_init2Darray | ( | float ** | arr, |
int | NX, | ||
int | NY | ||
) |
This function allocates and fills a 2D array with zero values
void CompareCPUvsGPU | ( | Param | XParam, |
Model< T > | XModel, | ||
Model< T > | XModel_g, | ||
std::vector< std::string > | varlist, | ||
bool | checkhalo | ||
) |
This function compares the Valiables in a CPU model and a GPU models This function is quite useful when checking both are identical enough one needs to provide a list (vector<string>) of variable to check
template void CompareCPUvsGPU< double > | ( | Param | XParam, |
Model< double > | XModel, | ||
Model< double > | XModel_g, | ||
std::vector< std::string > | varlist, | ||
bool | checkhalo | ||
) |
template void CompareCPUvsGPU< float > | ( | Param | XParam, |
Model< float > | XModel, | ||
Model< float > | XModel_g, | ||
std::vector< std::string > | varlist, | ||
bool | checkhalo | ||
) |
void copyBlockinfo2var | ( | Param | XParam, |
BlockP< T > | XBlock, | ||
int * | blkinfo, | ||
T * | z | ||
) |
This function copies blick info to an output variable This function is somewhat useful when checking bugs in the mesh refinement or coarsening one needs to provide a pointer(z) allocated on the CPU to store the clockinfo This fonction only works on CPU
template void copyBlockinfo2var< double > | ( | Param | XParam, |
BlockP< double > | XBlock, | ||
int * | blkinfo, | ||
double * | z | ||
) |
template void copyBlockinfo2var< float > | ( | Param | XParam, |
BlockP< float > | XBlock, | ||
int * | blkinfo, | ||
float * | z | ||
) |
This function copies block info to an output variable This function is somewhat useful when checking bugs in the mesh refinement or coarsening one needs to provide a pointer(z) allocated on the CPU to store the clockinfo This fonction only works on CPU
template void copyID2var< double > | ( | Param | XParam, |
BlockP< double > | XBlock, | ||
double * | z | ||
) |
template void copyID2var< float > | ( | Param | XParam, |
BlockP< float > | XBlock, | ||
float * | z | ||
) |
void diffArray | ( | Param | XParam, |
BlockP< T > | XBlock, | ||
std::string | varname, | ||
bool | checkhalo, | ||
T * | cpu, | ||
T * | gpu, | ||
T * | dummy, | ||
T * | out | ||
) |
void diffdh | ( | Param | XParam, |
BlockP< T > | XBlock, | ||
T * | input, | ||
T * | output, | ||
T * | shuffle | ||
) |
This function Calculates The difference in left and right flux terms. This function is quite useful when checking for Lake-at-Rest states This function requires a preallocated output and a shuffle (right side term) CPU pointers to save the result of teh calculation
void diffSource | ( | Param | XParam, |
BlockP< T > | XBlock, | ||
T * | Fqux, | ||
T * | Su, | ||
T * | output | ||
) |
This function Calculate The source term of the equation. This function is quite useful when checking for Lake-at-Rest states This function requires an outputCPU pointers to save the result of teh calculation
This function fill an array with a gaussian bump
borrowed/adapted from Basilisk test (?)
This function fill an array with random values (0 - 1)
template void fillrandom< double > | ( | Param | XParam, |
BlockP< double > | XBlock, | ||
double * | z | ||
) |
template void fillrandom< float > | ( | Param | XParam, |
BlockP< float > | XBlock, | ||
float * | z | ||
) |
bool GaussianHumptest | ( | T | zsnit, |
int | gpu, | ||
bool | compare | ||
) |
This function tests the full hydrodynamics model and compares the results with pre-conmputed (Hard wired) values The function creates it own model setup and mesh independantly to what the user might want to do The setup consist of a centrally located gaussian hump radiating away The test stops at an arbitrary time to compare with 8 values extracted from a identical run in basilisk This function also compares the result of the GPU and CPU code (until they diverge)
template bool GaussianHumptest< double > | ( | double | zsnit, |
int | gpu, | ||
bool | compare | ||
) |
template bool GaussianHumptest< float > | ( | float | zsnit, |
int | gpu, | ||
bool | compare | ||
) |
void init3Darray | ( | float *** | arr, |
int | rows, | ||
int | cols, | ||
int | depths | ||
) |
This function fill a 3D array with zero values
This function simulates the first predictive step and check whether the lake at rest is preserved otherwise it prints out to screen the cells (and neighbour) where the test fails
bool MassConserveSteepSlope | ( | T | zsnit, |
int | gpu | ||
) |
This function tests the mass conservation of the vertical injection (used for rivers) The function creates it own model setup and mesh independantly to what the user might want to do This starts with a initial water level (zsnit=0 is dry) and runs for 0.1s before comparing results with zsnit=0.1 that is approx 20 steps
template bool MassConserveSteepSlope< double > | ( | double | zsnit, |
int | gpu | ||
) |
template bool MassConserveSteepSlope< float > | ( | float | zsnit, |
int | gpu | ||
) |
bool Rainlossestest | ( | T | zsnit, |
int | gpu, | ||
float | alpha | ||
) |
This function tests the Initial Losses and Continuous Losses implementation a plain domain, under constant rain. The function creates its own model setup and mesh independantly to what the user inputs. This starts with a initial water level (zsinit=0.0 is dry) and runs for 1s comparing results every 0.1s (that is approx 20 steps)
bool Raintest | ( | T | zsnit, |
int | gpu, | ||
float | alpha | ||
) |
This function tests the mass conservation of the spacial injection (used to model rain on grid) The function creates its own model setup and mesh independantly to what the user inputs. This starts with a initial water level (zsnit=0.0 is dry) and runs for 0.1s before comparing results with zsnit=0.1 that is approx 20 steps
bool Raintestinput | ( | int | gpu | ) |
This function tests the different inputs for rain forcing. This test is based on the paper Aureli2020, the 3 slopes test with regional rain. The experiment has been presented in Iwagaki1955. The first test compares a time varying rain input using a uniform time serie forcing and a time varying 2D field (with same value). The second test check the 3D rain forcing (comparing it to expected values).
std::vector<float> Raintestmap | ( | int | gpu, |
int | dimf, | ||
T | zinit | ||
) |
\fnstd::vector<float> Raintestmap(int gpu, int dimf, T zinit)
This function return the flux at the bottom of the 3 part slope for different types of rain forcings using the test case based on Iwagaki1955
template std::vector<float> Raintestmap< double > | ( | int | gpu, |
int | dimf, | ||
double | Zsinit | ||
) |
template std::vector<float> Raintestmap< float > | ( | int | gpu, |
int | dimf, | ||
float | Zsinit | ||
) |
Test the algorithm for reducing the global time step on the user grid layout
template bool reductiontest< double > | ( | Param | XParam, |
Model< double > | XModel, | ||
Model< double > | XModel_g | ||
) |
template bool reductiontest< float > | ( | Param | XParam, |
Model< float > | XModel, | ||
Model< float > | XModel_g | ||
) |
bool RiverOnBoundary | ( | Param | XParam, |
T | slope, | ||
int | Dir, | ||
int | Bound_type | ||
) |
bool Rivertest | ( | T | zsnit, |
int | gpu | ||
) |
This function tests the mass conservation of the vertical injection (used for rivers) The function creates it own model setup and mesh independantly to what the user might want to do This starts with a initial water level (zsnit=0 is dry) and runs for 0.1s before comparing results with zsnit=0.1 that is approx 20 steps
template bool Rivertest< double > | ( | double | zsnit, |
int | gpu | ||
) |
template bool Rivertest< float > | ( | float | zsnit, |
int | gpu | ||
) |
bool RiverVolumeAdapt | ( | Param | XParam, |
T | maxslope | ||
) |
bool RiverVolumeAdapt | ( | Param | XParam, |
T | slope, | ||
bool | bottop, | ||
bool | flip | ||
) |
Simulate a river flowing in a steep valley and heck the Volume conservation.
This function creates a dry steep valley topography to a given level and run the model for a while and checks that the Volume matches the theory.
The function can test the water volume for 4 scenario each time:
The function inherits the adaptation set in XParam so needs to be rerun to accnout for the different scenarios:
bool testboundaries | ( | Param | XParam, |
T | maxslope | ||
) |
This function goes through the Buttinger scheme but instead of the normal output just prints all teh usefull values This function is/was used in the lake-at-rest verification
See also: void testkurganovX(Param XParam, int ib, int ix, int iy, Model<T> XModel)
int TestFirsthalfstep | ( | Param | XParam, |
Forcing< float > | XForcing, | ||
Model< T > | XModel, | ||
Model< T > | XModel_g | ||
) |
This function fill an array with random values (0 - 1)
This function test the spped and accuracy of a new gradient function gradient are only calculated for zb but assigned to different gradient variable for storage
bool Testing | ( | Param | XParam, |
Forcing< float > | XForcing, | ||
Model< T > | XModel, | ||
Model< T > | XModel_g | ||
) |
template bool Testing< double > | ( | Param | XParam, |
Forcing< float > | XForcing, | ||
Model< double > | XModel, | ||
Model< double > | XModel_g | ||
) |
template bool Testing< float > | ( | Param | XParam, |
Forcing< float > | XForcing, | ||
Model< float > | XModel, | ||
Model< float > | XModel_g | ||
) |
template void TestingOutput< double > | ( | Param | XParam, |
Model< double > | XModel | ||
) |
template void TestingOutput< float > | ( | Param | XParam, |
Model< float > | XModel | ||
) |
This function goes through the Kurganov scheme but instead of the normal output just prints all teh usefull values This function is/was used in the lake-at-rest verification
int Testzbinit | ( | Param | XParam, |
Forcing< float > | XForcing, | ||
Model< T > | XModel, | ||
Model< T > | XModel_g | ||
) |
T ThackerBathy | ( | T | x, |
T | y, | ||
T | L, | ||
T | D | ||
) |
create a parabolic bassin
This function creates a parabolic bassin. The function returns a single value of the bassin
Borrowed from Buttinger et al. 2019.
Buttinger-Kreuzhuber, A., Horváth, Z., Noelle, S., Blöschl, G., and Waser, J.: A fast second-order shallow water scheme on two-dimensional structured grids over abrupt topography, Advances in water resources, 127, 89–108, 2019.
bool ThackerLakeAtRest | ( | Param | XParam, |
T | zsinit | ||
) |
template bool ThackerLakeAtRest< double > | ( | Param | XParam, |
double | zsinit | ||
) |
template bool ThackerLakeAtRest< float > | ( | Param | XParam, |
float | zsinit | ||
) |
T ValleyBathy | ( | T | x, |
T | y, | ||
T | slope, | ||
T | center | ||
) |
create V shape Valley basin
This function creates a simple V shape Valley basin
bool testzoneOutDef ZoneOutputTest | ( | int | nzones, |
T | zsinit | ||
) |
This function test the zoned output for a basic configuration
This function test the spped and accuracy of a new gradient function gradient are only calculated for zb but assigned to different gradient variable for storage
template bool ZoneOutputTest< double > | ( | int | nzones, |
double | zsinit | ||
) |
template bool ZoneOutputTest< float > | ( | int | nzones, |
float | zsinit | ||
) |