TheBoussinesqModel
3.2.1
|
#include <sys/stat.h>
#include "turtle.h"
#include "t_utilities.h"
#include "get_filenames.h"
#include "rw_maps.h"
#include "linear_span.h"
#include "geometry.h"
#include "geometry_utilities.h"
#include "read_command_line.h"
#include "additional_read_functions.h"
#include "geometry_io.h"
#include "geometry_attribute.h"
#include "geometry_freememory.h"
#include "g_raster2plvector.h"
#include "bigcells2.h"
#include "geometry2.h"
#include "keywords_file_b.h"
#include "b_solver.h"
#include "b_volumes.h"
#include "b_utilities.h"
#include "b_readgrid.h"
Go to the source code of this file.
Macros | |
#define | NULL_ELEVATION -9999 |
#define | INTEGER_NULL -99 |
#define | POLYGON_SUFFIX "_polygons.txt" |
#define | LINE_SUFFIX "_lines.txt" |
#define | CONNECTION_SUFFIX "_connections.txt" |
#define | no_PRINT 0 |
Functions | |
LINEVECTOR * | read_linevector (char *filename, short print) |
POLYGON * | read_polygon (FILE *fd, short print) |
POLYGONVECTOR * | read_polygonvector (char *filename, short print) |
polygon_connection_attributes * | read_connections (FILE *fd, short print) |
polygon_connection_attribute_array * | read_connection_attribute_array (char *filename, short print) |
GRID * | read_grid (char *keyname, short print) |
SQUARE_GRID * | read_square_grid (char *keyname, DOUBLEMATRIX *DTM, long(*index_pixel_from_a_bin)(long r, long c, LONGVECTOR *s_index), DOUBLEVECTOR *V, int(*check_novalues)(double x, DOUBLEVECTOR *V), short print) |
LONGMATRIX_VECTOR * | read_fine_indices (char *filename, short print) |
LONGBIN * | read_line_indices (char *filename, short print) |
DOUBLESQUARE_GRID * | read_doublesquare_grid (DOUBLERASTER_MAP *draster, char *keyname, 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), short print) |
This file is part of Boussinesq.
Boussinesq is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Boussinesq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Boussinesq. If not, see http://www.gnu.org/licenses/.
Definition in file b_readgrid.c.
#define CONNECTION_SUFFIX "_connections.txt" |
Definition at line 53 of file b_readgrid.c.
Referenced by read_grid().
#define INTEGER_NULL -99 |
Definition at line 50 of file b_readgrid.c.
Referenced by read_square_grid().
#define LINE_SUFFIX "_lines.txt" |
Definition at line 52 of file b_readgrid.c.
Referenced by read_grid().
#define no_PRINT 0 |
Definition at line 54 of file b_readgrid.c.
Referenced by read_connection_attribute_array(), read_connections(), read_fine_indices(), read_linevector(), and read_polygonvector().
#define NULL_ELEVATION -9999 |
Definition at line 49 of file b_readgrid.c.
Referenced by read_linevector(), and read_polygon().
#define POLYGON_SUFFIX "_polygons.txt" |
Definition at line 51 of file b_readgrid.c.
Referenced by read_grid().
polygon_connection_attribute_array* read_connection_attribute_array | ( | char * | filename, |
short | |||
) |
(char*) | - name of filename |
(short) | - |
It creates and reads a polygonvector from the following options:
Definition at line 227 of file b_readgrid.c.
References polygon_connection_attribute_array::element, new_connection_attributes(), polygon_connection_attribute_array::nh, polygon_connection_attribute_array::nl, no_PRINT, read_connections(), read_index(), t_fclose(), and t_fopen().
Referenced by read_grid().
polygon_connection_attributes* read_connections | ( | FILE * | fd, |
short | |||
) |
fd | - (FILE *) file pointer |
- (short) |
Definition at line 185 of file b_readgrid.c.
References polygon_connection_attributes::connections, polygon_connection_attributes::d_connections, free_doublevector(), new_doublevector(), new_longvector(), DOUBLEVECTOR::nh, LONGVECTOR::nl, no_PRINT, and read_doublearray().
Referenced by read_connection_attribute_array().
DOUBLESQUARE_GRID* read_doublesquare_grid | ( | DOUBLERASTER_MAP * | draster, |
char * | keyname, | ||
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, | ||
short | |||
) |
Definition at line 452 of file b_readgrid.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, SQUARE_GRID::grid, LONGBIN::index, join_strings(), RASTER_MAP::layer, GRID::lines, LONGMATRIX_VECTOR::nh, LINEVECTOR::nh, POLYGONVECTOR::nh, LONGVECTOR::nh, GRID::polygons, read_fine_indices(), read_line_indices(), read_square_grid(), RASTER_MAP::reference_index_map, DOUBLESQUARE_GRID::small_content_line, DOUBLESQUARE_GRID::small_content_polygon, stop_execution(), t_error(), RASTER_MAP::UV, and T_INIT::V.
LONGMATRIX_VECTOR* read_fine_indices | ( | char * | filename, |
short | |||
) |
(char*) | - name of filename |
(short) | - |
Definition at line 364 of file b_readgrid.c.
References LONGMATRIX_VECTOR::element, new_longmatrix_vector(), LONGMATRIX_VECTOR::nh, LONGMATRIX_VECTOR::nl, no_PRINT, LONGMATRIX::nrh, read_index(), read_longmatrix(), t_error(), t_fclose(), and t_fopen().
Referenced by read_doublesquare_grid().
GRID* read_grid | ( | char * | keyname, |
short | |||
) |
Definition at line 260 of file b_readgrid.c.
References GRID::boundary_indicator, CONNECTION_SUFFIX, polygon_connection_attributes::connections, copy_string(), POLYGON::edge_indices, POLYGONVECTOR::element, polygon_connection_attribute_array::element, GRID::file_resume_connections, GRID::file_resume_lines, GRID::file_resume_polygons, join_strings(), LINE_SUFFIX, GRID::lines, GRID::links, LINEVECTOR::nh, POLYGONVECTOR::nh, polygon_connection_attribute_array::nh, LONGVECTOR::nh, polygon_connection_attribute_array::nl, LONGVECTOR::nl, POLYGON_SUFFIX, GRID::polygons, read_connection_attribute_array(), read_linevector(), read_polygonvector(), and t_error().
Referenced by read_square_grid().
LONGBIN* read_line_indices | ( | char * | filename, |
short | |||
) |
Definition at line 397 of file b_readgrid.c.
References free_longvector(), LONGBIN::index, new_longbin(), new_longvector(), LONGVECTOR::nh, LONGVECTOR::nl, read_index(), read_longarray(), t_fclose(), and t_fopen().
Referenced by read_doublesquare_grid().
LINEVECTOR* read_linevector | ( | char * | filename, |
short | |||
) |
filename | (char *) - name of the file where to read line_information |
(short) |
It creates and reads a linevector from the following options: index{1} FILE CONTAINIG NECESSARY INFORMATION FOR LINES x y line_index lenght2d x_P1 y_P1 x_P2 y_P2
1: double matrix lines information {55550,8}
x coordinate of the middle point
y coordinate of the midddele point
iline_index of the line
lenght of the line
P1 x coordinate
P1 y coordinate
P2 x coordinate
P2 y coordinate
Definition at line 56 of file b_readgrid.c.
References LINEVECTOR::element, free_doublematrix(), free_point(), DOUBLEMATRIX::nch, new_line_from_points(), new_linevector(), new_point(), LINEVECTOR::nh, LINEVECTOR::nl, no_PRINT, DOUBLEMATRIX::nrh, NULL_ELEVATION, read_doublematrix(), read_index(), and t_fopen().
Referenced by read_grid().
POLYGON* read_polygon | ( | FILE * | fd, |
short | |||
) |
Emanuele Cordano
(FILE | *) - file pointer |
(short) |
Definition at line 113 of file b_readgrid.c.
References POLYGON::area2D, POLYGON::centroid, POLYGON::edge_indices, free_doublevector(), POLYGON::index, new_longvector(), new_point(), DOUBLEVECTOR::nh, LONGVECTOR::nl, NULL_ELEVATION, read_doublearray(), and t_error().
Referenced by read_polygonvector().
POLYGONVECTOR* read_polygonvector | ( | char * | filename, |
short | |||
) |
(char*) | - name of filename |
(short) | - |
It creates and reads a polygonvector from the following options:
Definition at line 154 of file b_readgrid.c.
References POLYGONVECTOR::element, POLYGON::index, new_polygonvector(), POLYGONVECTOR::nh, POLYGONVECTOR::nl, no_PRINT, read_index(), read_polygon(), t_fclose(), and t_fopen().
Referenced by read_grid().
SQUARE_GRID* read_square_grid | ( | char * | keyname, |
DOUBLEMATRIX * | DTM, | ||
long(*)(long r, long c, LONGVECTOR *s_index) | index_pixel_from_a_bin, | ||
DOUBLEVECTOR * | V, | ||
int(*)(double x, DOUBLEVECTOR *V) | check_novalues, | ||
short | |||
) |
keyname | (char *) - keyname of the SQUARE_GRID |
DTM | (DOUBLEMATRIX *) - Digital Terrain Model |
long | (*index_pixel_from_a_bin)(long r, long c,LONGVECTOR *s_index) - function for the space filling curve |
V | - (DOUBLEVECTOR *) - vector containig novalue information |
int | (*check_novalues)(double x, DOUBLEVECTOR *V) - function identintifyng novalue information |
(short) |
first element of sqp->inices_pixel is assumed as a no-value
Definition at line 311 of file b_readgrid.c.
References 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, m_indices_from_mask(), LONGMATRIX::ncl, SQUARE_GRID::nhorizontal_lines, SQUARE_GRID::novalue, LONGMATRIX::nrl, read_grid(), and t_error().
Referenced by read_doublesquare_grid().