TheBoussinesqModel
3.2.1
|
#include "turtle.h"
#include "rw_maps.h"
#include "geometry.h"
#include "geometry_utilities.h"
#include "geometry_attribute.h"
#include "geometry_freememory.h"
#include "geometry_io.h"
#include "g_raster2plvector.h"
#include "sorting.h"
#include "linear_span.h"
#include "bigcells2.h"
Go to the source code of this file.
Macros | |
#define | BOUNDARY -10 |
#define | EWRES 1 |
#define | NSRES 2 |
#define | X_BOTTOMLEFTCORNER 4 |
#define | Y_BOTTOMLEFTCORNER 3 |
#define | XY_ORIGIN 0.0 |
#define | A_FLAG 2 |
#define | INTEGER_NULL -99 |
#define | INIT_VALUE2 -990 |
#define | MAX_COL 100 |
#define | REFERENCE_INDEX 1 |
Functions | |
SQUARE_GRID * | get_square_grid (DOUBLEMATRIX *DTM, T_INIT *UV, char *file_resume_lines, char *file_resume_polygons, char *file_resume_connections, long(*index_pixel_from_a_bin)(long r, long c, LONGVECTOR *s_index), int(*check_novalues)(double x, DOUBLEVECTOR *V), long displacement, short print) |
void | write_grid (GRID *grid) |
RASTER_MAP * | new_raster_map (long nh) |
int | add_map_to_raster (long index, char *filename, RASTER_MAP *raster, short a, short print) |
LONGMATRIX_VECTOR * | new_longmatrix_vector (long nh) |
LONGMATRIX_VECTOR * | get_fine_indices (LONGMATRIX *fine, LONGMATRIX *coarse, long i_firstcell, long i_lastcell, long novalue, short print) |
LONGBIN * | get_fine_line_indices (LONGMATRIX *h_fine, LONGMATRIX *h_coarse, LONGMATRIX *v_fine, LONGMATRIX *v_coarse, long n_horizontal, long n_lines, long novalue, short print) |
DOUBLERASTER_MAP * | get_doubleraster_map (long n_coarsemaps, long n_finemaps, char *coarse_mapname, char *fine_mapname, short print) |
DOUBLESQUARE_GRID * | get_doublesquare_grid (DOUBLERASTER_MAP *draster, char *resume_filenames, long(*index_pixel_from_a_bin_coarse)(long r, long c, LONGVECTOR *s_index), long(*index_pixel_from_a_bin_fine)(long r, long c, LONGVECTOR *s_index), long d_coarse, long d_fine, short print) |
int | write_longmatrix_vector (LONGMATRIX_VECTOR *lmv, char *filename) |
int | write_small_lines_indices (LONGBIN *small_lines, char *filename) |
int | write_doublesquare_grid (DOUBLESQUARE_GRID *dsq) |
void | free_longmatrix_vector (LONGMATRIX_VECTOR *lmv) |
void | free_grid (GRID *grid) |
void | free_square_grid (SQUARE_GRID *sq) |
void | free_raster_map (RASTER_MAP *raster) |
void | free_doubleraster_map (DOUBLERASTER_MAP *draster) |
void | free_doublesquare_grid (DOUBLESQUARE_GRID *dsq) |
char * | strcpy2 (char *dest, const char *src) |
char * | copy_string (char *origin) |
#define A_FLAG 2 |
Definition at line 39 of file bigcells2.c.
Referenced by get_dirichletsnode(), get_sources(), and main().
#define BOUNDARY -10 |
Definition at line 33 of file bigcells2.c.
Referenced by get_square_grid().
#define EWRES 1 |
Definition at line 34 of file bigcells2.c.
Referenced by get_square_grid().
#define INIT_VALUE2 -990 |
Definition at line 41 of file bigcells2.c.
#define INTEGER_NULL -99 |
Definition at line 40 of file bigcells2.c.
Referenced by add_map_to_raster(), get_square_grid(), and new_raster_map().
#define MAX_COL 100 |
Definition at line 42 of file bigcells2.c.
Referenced by write_longmatrix_vector().
#define NSRES 2 |
Definition at line 35 of file bigcells2.c.
Referenced by get_square_grid().
#define REFERENCE_INDEX 1 |
Definition at line 43 of file bigcells2.c.
#define X_BOTTOMLEFTCORNER 4 |
Definition at line 36 of file bigcells2.c.
Referenced by get_square_grid().
#define XY_ORIGIN 0.0 |
Definition at line 38 of file bigcells2.c.
#define Y_BOTTOMLEFTCORNER 3 |
Definition at line 37 of file bigcells2.c.
Referenced by get_square_grid().
int add_map_to_raster | ( | long | index, |
char * | filename, | ||
RASTER_MAP * | raster, | ||
short | a, | ||
short | |||
) |
index | (param) - index at which he map is added in the raster map class; |
filename | (char *) - filename of the map in asccii format |
raster | (RASTER_MAP *) - raster map class |
a | - (short) parameter to check boundary and novalue (0: nocheck, 1: check boundary, 2: check boundary and novaule (if raster->reference_index_map is set to NULL, a=0 by default) |
(short) - print parameter |
add a map from asccii format to a raster_map class
Definition at line 161 of file bigcells2.c.
References free_doublematrix(), INTEGER_NULL, RASTER_MAP::layer, DOUBLEMATRIX::nch, new_doublematrix(), RASTER_MAP::nh, DOUBLEMATRIX::nrh, read_map(), RASTER_MAP::reference_index_map, and RASTER_MAP::UV.
Referenced by get_doubleraster_map().
char* copy_string | ( | char * | origin) |
Definition at line 705 of file bigcells2.c.
Referenced by get_doubleraster_map(), get_doublesquare_grid(), get_square_grid(), new_grid_from_grid(), new_output_filenames(), read_doublesquare_grid(), and read_grid().
void free_doubleraster_map | ( | DOUBLERASTER_MAP * | draster) |
Definition at line 651 of file bigcells2.c.
References DOUBLERASTER_MAP::coarse, DOUBLERASTER_MAP::fine, free_raster_map(), DOUBLERASTER_MAP::mapname_coarse, and DOUBLERASTER_MAP::mapname_fine.
Referenced by main().
void free_doublesquare_grid | ( | DOUBLESQUARE_GRID * | dsq) |
Definition at line 666 of file bigcells2.c.
References DOUBLESQUARE_GRID::big, DOUBLESQUARE_GRID::file_resume_c_line, DOUBLESQUARE_GRID::file_resume_c_polygon, DOUBLESQUARE_GRID::fine, free_longbin(), free_longmatrix_vector(), free_square_grid(), DOUBLESQUARE_GRID::small_content_line, and DOUBLESQUARE_GRID::small_content_polygon.
Referenced by main().
void free_grid | ( | GRID * | grid) |
Definition at line 584 of file bigcells2.c.
References GRID::file_resume_connections, GRID::file_resume_lines, GRID::file_resume_polygons, free_linevector(), free_polygon_connection_attribute_array(), free_polygonvector(), GRID::lines, GRID::links, and GRID::polygons.
Referenced by free_DOUBLE_GRID(), and free_square_grid().
void free_longmatrix_vector | ( | LONGMATRIX_VECTOR * | lmv) |
free function
Definition at line 560 of file bigcells2.c.
References LONGMATRIX_VECTOR::element, free_longmatrix(), LONGMATRIX_VECTOR::nh, and LONGMATRIX_VECTOR::nl.
Referenced by free_doublesquare_grid(), and get_fine_line_indices().
void free_raster_map | ( | RASTER_MAP * | raster) |
Definition at line 629 of file bigcells2.c.
References free_doublematrix(), free_doublevector(), RASTER_MAP::layer, RASTER_MAP::nl, T_INIT::U, RASTER_MAP::UV, and T_INIT::V.
Referenced by free_doubleraster_map().
void free_square_grid | ( | SQUARE_GRID * | sq) |
Definition at line 606 of file bigcells2.c.
References free_grid(), free_longmatrix(), SQUARE_GRID::grid, SQUARE_GRID::indices_horizontal_lines, SQUARE_GRID::indices_pixel, SQUARE_GRID::indices_vertex, and SQUARE_GRID::indices_vertical_lines.
Referenced by free_doublesquare_grid().
DOUBLERASTER_MAP* get_doubleraster_map | ( | long | n_coarsemaps, |
long | n_finemaps, | ||
char * | coarse_mapname, | ||
char * | fine_mapname, | ||
short | |||
) |
- | (long) number of coarse-grid maps |
- | (long) number of fine-grid maps |
- | (char *) - name of the file containing the coarse grid map (reference map) |
- | (char *) - name of the file containing the fine grid map (reference map); |
(short) | print; |
Definition at line 372 of file bigcells2.c.
References add_map_to_raster(), DOUBLERASTER_MAP::coarse, copy_string(), draster, DOUBLERASTER_MAP::fine, DOUBLERASTER_MAP::mapname_coarse, DOUBLERASTER_MAP::mapname_fine, new_raster_map(), RASTER_MAP::nl, and t_error().
Referenced by main().
DOUBLESQUARE_GRID* get_doublesquare_grid | ( | DOUBLERASTER_MAP * | draster, |
char * | resume_filenames, | ||
long(*)(long r, long c, LONGVECTOR *s_index) | index_pixel_from_a_bin_coarse, | ||
long(*)(long r, long c, LONGVECTOR *s_index) | index_pixel_from_a_bin_fine, | ||
long | d_coarse, | ||
long | d_fine, | ||
short | |||
) |
- | DOUBLERASTER_MAP *draster |
- | (char *) root neme of textfiles containing the struct information. |
long | (*index_pixel_from_a_bin_coarse)(long r, long c,LONGVECTOR *s_index) - equation of the filling curve for the pixel of a coarse grid |
long | (*index_pixel_from_a_bin_fine)(long r, long c,LONGVECTOR *s_index),long d_coarse,long d_fine,short print) - equation of the filling curve for the pixel of a fine grid |
(long) | d_coarse - displacement for coarse grid |
(long) | d_fine - displacement for fine grid |
(short) |
Definition at line 421 of file bigcells2.c.
References DOUBLESQUARE_GRID::big, RASTER_MAP::check_novalues, DOUBLERASTER_MAP::coarse, copy_string(), dsq, DOUBLESQUARE_GRID::file_resume_c_line, DOUBLESQUARE_GRID::file_resume_c_polygon, DOUBLESQUARE_GRID::fine, DOUBLERASTER_MAP::fine, get_fine_indices(), get_fine_line_indices(), get_square_grid(), SQUARE_GRID::grid, SQUARE_GRID::indices_horizontal_lines, SQUARE_GRID::indices_pixel, SQUARE_GRID::indices_vertical_lines, join_strings(), RASTER_MAP::layer, GRID::lines, LINEVECTOR::nh, POLYGONVECTOR::nh, SQUARE_GRID::nhorizontal_lines, POLYGONVECTOR::nl, SQUARE_GRID::novalue, GRID::polygons, RASTER_MAP::reference_index_map, DOUBLESQUARE_GRID::small_content_line, DOUBLESQUARE_GRID::small_content_polygon, t_error(), and RASTER_MAP::UV.
Referenced by main().
LONGMATRIX_VECTOR* get_fine_indices | ( | LONGMATRIX * | fine, |
LONGMATRIX * | coarse, | ||
long | i_firstcell, | ||
long | i_lastcell, | ||
long | novalue, | ||
short | |||
) |
(LONGMATRIX*) | fine; |
(LONGMATRIX*) | coarse; |
(long) | i_firstcell; |
(long) | I_lastcells; |
(long) | novalue; |
(short) | print; |
Definition at line 229 of file bigcells2.c.
References LONGMATRIX_VECTOR::element, LONGMATRIX::nch, LONGMATRIX::ncl, new_longmatrix(), new_longmatrix_vector(), LONGMATRIX_VECTOR::nh, LONGMATRIX_VECTOR::nl, LONGMATRIX::nrh, LONGMATRIX::nrl, and t_error().
Referenced by get_doublesquare_grid(), and get_fine_line_indices().
LONGBIN* get_fine_line_indices | ( | LONGMATRIX * | h_fine, |
LONGMATRIX * | h_coarse, | ||
LONGMATRIX * | v_fine, | ||
LONGMATRIX * | v_coarse, | ||
long | n_horizontal, | ||
long | n_lines, | ||
long | novalue, | ||
short | |||
) |
vedre qui!!!
Definition at line 306 of file bigcells2.c.
References LONGMATRIX_VECTOR::element, free_longmatrix_vector(), free_longvector(), get_fine_indices(), LONGBIN::index, LONGMATRIX::nch, LONGMATRIX::ncl, new_longbin(), new_longvector(), LONGVECTOR::nh, LONGVECTOR::nl, LONGMATRIX::nrh, and LONGMATRIX::nrl.
Referenced by get_doublesquare_grid().
SQUARE_GRID* get_square_grid | ( | DOUBLEMATRIX * | DTM, |
T_INIT * | UV, | ||
char * | file_resume_lines, | ||
char * | file_resume_polygons, | ||
char * | file_resume_connections, | ||
long(*)(long r, long c, LONGVECTOR *s_index) | index_pixel_from_a_bin, | ||
int(*)(double x, DOUBLEVECTOR *V) | check_novalues, | ||
long | displacement, | ||
short | |||
) |
232: LONGMATRIX *m_indices_from_mask(DOUBLEMATRIX *mask,long row_shift,long col_shift,long novalue,long IBASE,long (*index_pixel_from_a_bin)(long r, long c,LONGVECTOR *s_index),DOUBLEVECTOR *V, int (*check_novalues)(double x, DOUBLEVECTOR *V)){
- | DTM (DOUBLEMATRIX *) - reference map |
- | UV (T_INIT *) - T_INIT information |
- | (char *) - name of file_resume_lines |
- | (char *) - name of file_resume_polygons |
- | (char *) - name of file_resume_connections; |
- | long (*index_pixel_from_a_bin)(long r, long c,LONGVECTOR *s_index) |
- | int (*check_novalues)(double x, DOUBLEVECTOR *V) |
displacement_index | (long), displacement amang which connected polygon are searched |
- | print (short) |
build lines and polygons
chech the simmetry of the connections
Definition at line 44 of file bigcells2.c.
References BOUNDARY, GRID::boundary_indicator, connections_symmetry(), copy_string(), EWRES, GRID::file_resume_connections, GRID::file_resume_lines, GRID::file_resume_polygons, get_connection_array_squares(), get_linevector_from_raster_grid(), get_polygonvector_from_raster(), SQUARE_GRID::grid, index_pixel_from_a_bin(), SQUARE_GRID::indices_horizontal_lines, SQUARE_GRID::indices_pixel, SQUARE_GRID::indices_vertex, SQUARE_GRID::indices_vertical_lines, INTEGER_NULL, GRID::lines, GRID::links, m_indices_from_mask(), LONGMATRIX::ncl, LINEVECTOR::nh, POLYGONVECTOR::nh, SQUARE_GRID::nhorizontal_lines, SQUARE_GRID::novalue, LONGMATRIX::nrl, NSRES, GRID::polygons, t_error(), T_INIT::U, T_INIT::V, X_BOTTOMLEFTCORNER, and Y_BOTTOMLEFTCORNER.
Referenced by get_doublesquare_grid().
LONGMATRIX_VECTOR* new_longmatrix_vector | ( | long | nh) |
nh | (long) - number of elements; |
Definition at line 201 of file bigcells2.c.
References LONGMATRIX_VECTOR::element, LONGMATRIX_VECTOR::nh, LONGMATRIX_VECTOR::nl, NL, NR_END, t_error(), and vector().
Referenced by get_fine_indices(), and read_fine_indices().
RASTER_MAP* new_raster_map | ( | long | nh) |
nh - number of layers;
and allocates a RASTER_MAP class
Definition at line 129 of file bigcells2.c.
References RASTER_MAP::check_novalues, INTEGER_NULL, RASTER_MAP::layer, RASTER_MAP::nh, NL, RASTER_MAP::nl, no_value_function(), NR_END, RASTER_MAP::reference_index_map, t_error(), and RASTER_MAP::UV.
Referenced by get_doubleraster_map().
char* strcpy2 | ( | char * | dest, |
const char * | src | ||
) |
proof utilities
Definition at line 692 of file bigcells2.c.
int write_doublesquare_grid | ( | DOUBLESQUARE_GRID * | dsq) |
Definition at line 545 of file bigcells2.c.
References DOUBLESQUARE_GRID::big, DOUBLESQUARE_GRID::file_resume_c_line, DOUBLESQUARE_GRID::file_resume_c_polygon, DOUBLESQUARE_GRID::fine, SQUARE_GRID::grid, DOUBLESQUARE_GRID::small_content_line, DOUBLESQUARE_GRID::small_content_polygon, write_grid(), write_longmatrix_vector(), and write_small_lines_indices().
Referenced by main().
void write_grid | ( | GRID * | grid) |
Definition at line 107 of file bigcells2.c.
References GRID::file_resume_connections, GRID::file_resume_lines, GRID::file_resume_polygons, GRID::lines, GRID::links, GRID::polygons, write_linevector(), write_polygonconnectionattributearray(), and write_polygonvector().
Referenced by write_doublesquare_grid().
int write_longmatrix_vector | ( | LONGMATRIX_VECTOR * | lmv, |
char * | filename | ||
) |
write functions
(LONGMATRIX_VECTOR | *) lmv |
(char | *) filename |
Definition at line 482 of file bigcells2.c.
References LONGMATRIX_VECTOR::element, MAX_COL, LONGMATRIX::nch, LONGMATRIX_VECTOR::nh, LONGMATRIX_VECTOR::nl, LONGMATRIX::nrh, t_fclose(), t_fopen(), and write_longmatrix_elements().
Referenced by write_doublesquare_grid().
int write_small_lines_indices | ( | LONGBIN * | small_lines, |
char * | filename | ||
) |
(LONBIN | *) small_lines |
(char | *) filename |
write the indices of small lines in a textfile with write_longbin_element function
Definition at line 511 of file bigcells2.c.
References LONGBIN::index, LONGVECTOR::nh, NL, LONGVECTOR::nl, t_fclose(), and t_fopen().
Referenced by write_doublesquare_grid().