-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgrid.h
27 lines (21 loc) · 765 Bytes
/
grid.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef __GRID_H__
#define __GRID_H__
// Describes the cartesian grid used in the problem
typedef struct
{
int N; // Number of segments along each direction
double lb_x;
double ub_x;
double lb_y;
double ub_y;
double h; // Max grid resolution
double* grid_nodes_x; // Partition in x direction
double* grid_nodes_y; // Partition in y direction
} grid;
// Partitions the X/Y axis into partitions pieces
double* uniform_partition(double lb, double ub, int N);
// Builds a cartesian grid with the given grid properties
grid* build_cartesian_grid(double lb_x, double ub_x, double lb_y, double ub_y, int N);
// Cleanup the grid
int cleanup_grid(grid* cartesian_grid);
#endif