BG_Flood  0.8
Documentation (Work-in-progress)
Testing.h File Reference
#include "General.h"
#include "Param.h"
#include "Write_txtlog.h"
#include "ReadInput.h"
#include "ReadForcing.h"
#include "Util_CPU.h"
#include "Arrays.h"
#include "Forcing.h"
#include "Mesh.h"
#include "Setup_GPU.h"
#include "Mainloop.h"
#include "FlowCPU.h"
#include "FlowGPU.h"
#include "Adaptation.h"
Include dependency graph for Testing.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T >
bool Testing (Param XParam, Forcing< float > XForcing, Model< T > XModel, Model< T > XModel_g)
 
template<class T >
bool GaussianHumptest (T zsnit, int gpu, bool compare)
 
template<class T >
void TestingOutput (Param XParam, Model< T > XModel)
 
template<class T >
void copyID2var (Param XParam, BlockP< T > XBlock, T *z)
 
template<class T >
void copyBlockinfo2var (Param XParam, BlockP< T > XBlock, int *blkinfo, T *z)
 
template<class T >
void CompareCPUvsGPU (Param XParam, Model< T > XModel, Model< T > XModel_g, std::vector< std::string > varlist, bool checkhalo)
 
template<class T >
std::vector< float > Raintestmap (int gpu, int dimf, T zinit)
 
bool Raintestinput (int gpu)
 
template<class T >
bool Rivertest (T zsnit, int gpu)
 
template<class T >
bool MassConserveSteepSlope (T zsnit, int gpu)
 
template<class T >
bool Raintest (T zsnit, int gpu, float alpha)
 
template<class T >
bool testboundaries (Param XParam, T maxslope)
 
template<class T >
bool ZoneOutputTest (int nzones, T zsinit)
 
template<class T >
bool Rainlossestest (T zsnit, int gpu, float alpha)
 

Function Documentation

◆ CompareCPUvsGPU()

template<class T >
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

◆ copyBlockinfo2var()

template<class T >
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

◆ copyID2var()

template<class T >
void copyID2var ( Param  XParam,
BlockP< T >  XBlock,
T *  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

◆ GaussianHumptest()

template<class T >
bool GaussianHumptest ( 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)

◆ MassConserveSteepSlope()

template<class T >
bool MassConserveSteepSlope ( 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

◆ Rainlossestest()

template<class T >
bool Rainlossestest ( zsinit,
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)

◆ Raintest()

template<class T >
bool Raintest ( 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

◆ Raintestinput()

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).

◆ Raintestmap()

template<class T >
std::vector<float> Raintestmap ( int  gpu,
int  dimf,
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

◆ Rivertest()

template<class T >
bool Rivertest ( 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

◆ testboundaries()

template<class T >
bool testboundaries ( Param  XParam,
maxslope 
)

◆ Testing()

template<class T >
bool Testing ( Param  XParam,
Forcing< float >  XForcing,
Model< T >  XModel,
Model< T >  XModel_g 
)

◆ TestingOutput()

template<class T >
void TestingOutput ( Param  XParam,
Model< T >  XModel 
)

OUTDATED?

◆ ZoneOutputTest()

template<class T >
bool ZoneOutputTest ( int  nzones,
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