Peka2D_v5  v5.0
Functions
water.cuh File Reference
#include "define.h"
#include "structs.h"
#include "cuTilities.cuh"
Include dependency graph for water.cuh:
This graph shows which files directly or indirectly include this file:

Functions

__global__ void g_compute_cell_mass (int nTasks, t_arrays *arrays, double *mass)
 This function recounts and stores the total mass of all active cells. More...
 
__global__ void g_initialize_delta (int nTasks, t_arrays *arrays)
 This function initializes the variation of conserved variables in the arrays structure to 0.0 and the array solidWallByCell to 0. More...
 
__global__ void g_wall_rotated_calculus (int nTasks, t_arrays *arrays, double *localDt)
 This function initializes the variation of conserved variables in the arrays structure to 0.0 and the array solidWallByCell to 0. More...
 
__global__ void g_get_dtmin (t_arrays *arrays, double *localDt, int *idmin)
 This function finds the minimum time step out of the vector localDt. If the whole domain is dry, it is set to 1.0 seconds. More...
 
__global__ void g_update_contributions (int nTasks, t_arrays *arrays)
 This function computes the right-hand side of the equations to update each physical variable. More...
 
__global__ void g_checkpos_h (int nTasks, t_arrays *arrays, int *check)
 This function checks the positivity of the water depth. If there is a cell where the depth is negative (-tol), it write a notification flag in variable check. More...
 
__global__ void g_reduce_dt (t_arrays *arrays)
 This function multiplies the time step by a factor of 0.8 if the there is a change to get negative water depths (as checked in function c_checkpos_h). More...
 
__global__ void g_set_new_dt (t_arrays *arrays)
 This function sets the new time step according to the dumping and final times. If the precomputed time step is too big, it is reduced to match the desired time. More...
 
__global__ void g_update_cells (int nTasks, t_arrays *arrays)
 This function updates the water depth and water discharges (in wet cells). More...
 
__global__ void g_check_wetdry (int nTasks, t_arrays *arrays)
 This function checks the presence of wet/dry fronts and writes flags to correct them later. More...
 
__global__ void g_update_wetdry_cells (int nTasks, t_arrays *arrays)
 This function corrects the wet/dry fronts found in function c_check_wetdry. More...
 
__global__ void g_compute_mass_error (t_arrays *arrays)
 This function computes the mass error of the current state with respect to the previous one (in %). More...
 
__global__ void g_reconstruct_active_elements (int nTasks, t_arrays *arrays)
 This function computes the mass error of the current state with respect to the previous one (in %). More...
 
__device__ void g_add_active_cells (t_arrays *arrays, int id)
 This function adds the newly wetted cells to the active cells set. More...
 
__device__ void g_add_active_walls (t_arrays *arrays, int id)
 This function adds wall identified by index id to the active walls set. More...
 

Function Documentation

◆ g_add_active_cells()

__device__ void g_add_active_cells ( t_arrays arrays,
int  id 
)

This function adds the newly wetted cells to the active cells set.

Parameters
arraysThis pointer variable passes the arrays structure.
idThis integer variable passes the index of the wetted cell.

◆ g_add_active_walls()

__device__ void g_add_active_walls ( t_arrays arrays,
int  id 
)

This function adds wall identified by index id to the active walls set.

Parameters
arraysThis pointer variable passes the arrays structure.
idThis integer variable passes the index of the wetted cell.

◆ g_check_wetdry()

__global__ void g_check_wetdry ( int  nTasks,
t_arrays arrays 
)

This function checks the presence of wet/dry fronts and writes flags to correct them later.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.

◆ g_checkpos_h()

__global__ void g_checkpos_h ( int  nTasks,
t_arrays arrays,
int *  check 
)

This function checks the positivity of the water depth. If there is a cell where the depth is negative (-tol), it write a notification flag in variable check.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.
checkThis integer acts as a flag to check the positivity of the water depth and is used in calculate.cpp to reduced the time step.

◆ g_compute_cell_mass()

__global__ void g_compute_cell_mass ( int  nTasks,
t_arrays arrays,
double *  mass 
)

This function recounts and stores the total mass of all active cells.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.
massThis pointer variable passes the mass variable to store it.

◆ g_compute_mass_error()

__global__ void g_compute_mass_error ( t_arrays arrays)

This function computes the mass error of the current state with respect to the previous one (in %).

Parameters
arraysThis pointer variable passes the arrays structure.

◆ g_get_dtmin()

__global__ void g_get_dtmin ( t_arrays arrays,
double *  localDt,
int *  idmin 
)

This function finds the minimum time step out of the vector localDt. If the whole domain is dry, it is set to 1.0 seconds.

Parameters
arraysThis pointer variable passes the arrays structure. arrays->dt is modifed.
localDtThis pointer variable contains the local time steps.
idminThis pointer variable indicates the component of the minimum time step.

◆ g_initialize_delta()

__global__ void g_initialize_delta ( int  nTasks,
t_arrays arrays 
)

This function initializes the variation of conserved variables in the arrays structure to 0.0 and the array solidWallByCell to 0.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.

◆ g_reconstruct_active_elements()

__global__ void g_reconstruct_active_elements ( int  nTasks,
t_arrays arrays 
)

This function computes the mass error of the current state with respect to the previous one (in %).

Parameters
arraysThis pointer variable passes the arrays structure.

◆ g_reduce_dt()

__global__ void g_reduce_dt ( t_arrays arrays)

This function multiplies the time step by a factor of 0.8 if the there is a change to get negative water depths (as checked in function c_checkpos_h).

Parameters
arraysThis pointer variable passes the arrays structure.

◆ g_set_new_dt()

__global__ void g_set_new_dt ( t_arrays arrays)

This function sets the new time step according to the dumping and final times. If the precomputed time step is too big, it is reduced to match the desired time.

Parameters
arraysThis pointer variable passes the arrays structure.

◆ g_update_cells()

__global__ void g_update_cells ( int  nTasks,
t_arrays arrays 
)

This function updates the water depth and water discharges (in wet cells).

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.

◆ g_update_contributions()

__global__ void g_update_contributions ( int  nTasks,
t_arrays arrays 
)

This function computes the right-hand side of the equations to update each physical variable.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure. arrays->dt is modifed.

◆ g_update_wetdry_cells()

__global__ void g_update_wetdry_cells ( int  nTasks,
t_arrays arrays 
)

This function corrects the wet/dry fronts found in function c_check_wetdry.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.

◆ g_wall_rotated_calculus()

__global__ void g_wall_rotated_calculus ( int  nTasks,
t_arrays arrays,
double *  localDt 
)

This function initializes the variation of conserved variables in the arrays structure to 0.0 and the array solidWallByCell to 0.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
localDtThis pointer variable gets the values of the local time steps.