Peka2D_v5  v5.0
Classes | Macros | Typedefs | Functions
loadData.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <omp.h>
#include <time.h>
#include "define.h"
#include "structs.h"
#include "mesh.h"
#include "writeInOut.cuh"
Include dependency graph for loadData.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Peka2D_Run_
 
struct  Peka2D_NodeBoundary_
 
struct  Peka2D_OBCWalls_
 
struct  Peka2D_Solute_
 
struct  Peka2D_SoluteGroup_
 
struct  Peka2D_Setup_
 

Macros

#define hy_mesh_
 
#define STR_SIZE   1024
 
#define HYD_N_OBT   20
 
#define HYD_N_OBC_TYPES   12
 
#define HYD_CLOSED   0
 
#define HYD_INFLOW_Q   1
 
#define HYD_INFLOW_HZ   2
 
#define HYD_INFLOW_QHZ   3
 
#define HYD_OUTFLOW_GAUGE   11
 
#define HYD_OUTFLOW_HZ   12
 
#define HYD_OUTFLOW_FREE   13
 
#define HYD_OUTFLOW_FR   14
 
#define HYD_OUTFLOW_NORMAL   15
 

Typedefs

typedef struct Peka2D_Setup_ Peka2D_Setup
 
typedef struct Peka2D_Run_ Peka2D_Run
 
typedef struct Peka2D_NodeBoundary_ Peka2D_NodeBoundary
 
typedef struct Peka2D_OBCWalls_ Peka2D_OBCWalls
 
typedef struct Peka2D_SoluteGroup_ Peka2D_SoluteGroup
 
typedef struct Peka2D_Solute_ Peka2D_Solute
 

Functions

EXPORT_DLL int loadControlParameters (Peka2D_Setup *pksetup, t_parameters *spar, t_mesh *mesh, t_message *msg)
 This function loads control parameters. More...
 
EXPORT_DLL int readControlDataFile (char *filename, Peka2D_Setup *pksetup, t_message *msg)
 This function reads control parameters from file .DAT. More...
 
EXPORT_DLL int setControlParameters (Peka2D_Setup *pksetup, t_parameters *spar, t_mesh *mesh, t_message *msg)
 This function passes the simulation execution paramenters from pksetup to spar. More...
 
EXPORT_DLL int loadMeshData (Peka2D_Setup *pksetup, t_parameters *spar, t_mesh *mesh, t_message *msg)
 This function creates the mesh data structure into variable mesh. More...
 
int IsMeshAllocated (t_mesh *mesh, t_message *e)
 This function checks if the mesh is properly allocated. More...
 
int readMeshFile (char *filename, Peka2D_Setup *pksetup, t_mesh *mesh, t_message *e)
 This function reads the mesh data from file and stores it in variable mesh. More...
 
int setInitialState (Peka2D_Setup *pksetup, t_parameters *spar, t_mesh *mesh, t_message *e)
 This function initializes all the computational variables (water depth, water discharge, etc.) in variable mesh. More...
 
int loadBoundaryConditions (Peka2D_Setup *pksetup, t_parameters *spar, t_mesh *mesh, t_message *e)
 This function loads the general setting of the boundary conditions. More...
 
int readOpenBoundaryNodes (char *filename, int nnodes, Peka2D_NodeBoundary *nbc, t_message *e)
 This function reads the number of open boundary nodes. More...
 
int createOpenBounds (Peka2D_NodeBoundary *nbc, Peka2D_OBCWalls *IOBC, Peka2D_OBCWalls *OOBC, t_parameters *spar, t_mesh *mesh, t_message *e)
 This function creates the inlet/outlet structure of the open boundaries. More...
 
int readOpenBoundaryFile (char *filename, Peka2D_NodeBoundary *nbc, Peka2D_OBCWalls *IOBC, Peka2D_OBCWalls *OOBC, t_parameters *spar, t_mesh *mesh, t_message *e)
 This function reads the data of the inlet and outlet open boundaries (hydrographs) from external files and stores it in mesh. More...
 
EXPORT_DLL int loadSoluteData (Peka2D_Setup *pksetup, t_parameters *spar, t_mesh *mesh, t_message *msg)
 
int readSoluteFile (char *filename, Peka2D_SoluteGroup *soluteGroup, t_message *e)
 
int createSoluteStructures (Peka2D_SoluteGroup *soluteGroup, t_parameters *spar, t_mesh *mesh, t_message *e)
 
int setInitialSoluteState (Peka2D_SoluteGroup *soluteGroup, t_parameters *spar, t_mesh *mesh, t_message *e)
 

Macro Definition Documentation

◆ hy_mesh_

#define hy_mesh_

◆ HYD_CLOSED

#define HYD_CLOSED   0

◆ HYD_INFLOW_HZ

#define HYD_INFLOW_HZ   2

◆ HYD_INFLOW_Q

#define HYD_INFLOW_Q   1

◆ HYD_INFLOW_QHZ

#define HYD_INFLOW_QHZ   3

◆ HYD_N_OBC_TYPES

#define HYD_N_OBC_TYPES   12

◆ HYD_N_OBT

#define HYD_N_OBT   20

◆ HYD_OUTFLOW_FR

#define HYD_OUTFLOW_FR   14

◆ HYD_OUTFLOW_FREE

#define HYD_OUTFLOW_FREE   13

◆ HYD_OUTFLOW_GAUGE

#define HYD_OUTFLOW_GAUGE   11

◆ HYD_OUTFLOW_HZ

#define HYD_OUTFLOW_HZ   12

◆ HYD_OUTFLOW_NORMAL

#define HYD_OUTFLOW_NORMAL   15

◆ STR_SIZE

#define STR_SIZE   1024

Typedef Documentation

◆ Peka2D_NodeBoundary

◆ Peka2D_OBCWalls

◆ Peka2D_Run

typedef struct Peka2D_Run_ Peka2D_Run

◆ Peka2D_Setup

typedef struct Peka2D_Setup_ Peka2D_Setup

◆ Peka2D_Solute

typedef struct Peka2D_Solute_ Peka2D_Solute

◆ Peka2D_SoluteGroup

Function Documentation

◆ createOpenBounds()

int createOpenBounds ( Peka2D_NodeBoundary nbc,
Peka2D_OBCWalls IOBC,
Peka2D_OBCWalls OOBC,
t_parameters spar,
t_mesh mesh,
t_message e 
)

This function creates the inlet/outlet structure of the open boundaries.

Parameters
nbcThis structure variable contains all the information of the boundary nodes.
IOBCThis variable contains the information of the inlet open boundary walls.
OOBCThis variable contains the information of the inlet open boundary walls.

◆ createSoluteStructures()

int createSoluteStructures ( Peka2D_SoluteGroup soluteGroup,
t_parameters spar,
t_mesh mesh,
t_message e 
)

◆ IsMeshAllocated()

int IsMeshAllocated ( t_mesh mesh,
t_message e 
)

This function checks if the mesh is properly allocated.

Parameters
eThis variable notifies if the mesh is not properly allocated.

◆ loadBoundaryConditions()

int loadBoundaryConditions ( Peka2D_Setup pksetup,
t_parameters spar,
t_mesh mesh,
t_message e 
)

This function loads the general setting of the boundary conditions.

◆ loadControlParameters()

EXPORT_DLL int loadControlParameters ( Peka2D_Setup pksetup,
t_parameters spar,
t_mesh mesh,
t_message msg 
)

This function loads control parameters.

◆ loadMeshData()

EXPORT_DLL int loadMeshData ( Peka2D_Setup pksetup,
t_parameters spar,
t_mesh mesh,
t_message msg 
)

This function creates the mesh data structure into variable mesh.

Parameters
meshThis variable is created to contain the structure variables of the computational mesh.

◆ loadSoluteData()

EXPORT_DLL int loadSoluteData ( Peka2D_Setup pksetup,
t_parameters spar,
t_mesh mesh,
t_message msg 
)

◆ readControlDataFile()

EXPORT_DLL int readControlDataFile ( char *  filename,
Peka2D_Setup pksetup,
t_message msg 
)

This function reads control parameters from file .DAT.

Parameters
filenameThis variable passes the name of the data file to read in this the function.
pksetupThis variable gets the information file in this function.

◆ readMeshFile()

int readMeshFile ( char *  filename,
Peka2D_Setup pksetup,
t_mesh mesh,
t_message e 
)

This function reads the mesh data from file and stores it in variable mesh.

Parameters
filenameThis variable passes the name of the data file to read in this the function.
meshThis variable receives the mesh data read from file.

◆ readOpenBoundaryFile()

int readOpenBoundaryFile ( char *  filename,
Peka2D_NodeBoundary nbc,
Peka2D_OBCWalls IOBC,
Peka2D_OBCWalls OOBC,
t_parameters spar,
t_mesh mesh,
t_message e 
)

This function reads the data of the inlet and outlet open boundaries (hydrographs) from external files and stores it in mesh.

Parameters
filenameThis variable passes the name of the file from which the open boundary data is read.

◆ readOpenBoundaryNodes()

int readOpenBoundaryNodes ( char *  filename,
int  nnodes,
Peka2D_NodeBoundary nbc,
t_message e 
)

This function reads the number of open boundary nodes.

Parameters
filenameThis variable passes the name of the file to read the open boundary conditions in this the function.

◆ readSoluteFile()

int readSoluteFile ( char *  filename,
Peka2D_SoluteGroup soluteGroup,
t_message e 
)

◆ setControlParameters()

EXPORT_DLL int setControlParameters ( Peka2D_Setup pksetup,
t_parameters spar,
t_mesh mesh,
t_message msg 
)

This function passes the simulation execution paramenters from pksetup to spar.

Parameters
sparThis variable gets the simulation execution paramenters passed from pksetup in this function.

◆ setInitialSoluteState()

int setInitialSoluteState ( Peka2D_SoluteGroup soluteGroup,
t_parameters spar,
t_mesh mesh,
t_message e 
)

◆ setInitialState()

int setInitialState ( Peka2D_Setup pksetup,
t_parameters spar,
t_mesh mesh,
t_message e 
)

This function initializes all the computational variables (water depth, water discharge, etc.) in variable mesh.

Parameters
meshIn this function, variable mesh receives the initialization of the computational variables.