TheBoussinesqModel  3.2.1
 All Data Structures Files Functions Variables Typedefs Macros Pages
geometry_attribute.c File Reference
#include "turtle.h"
#include "geometry.h"
#include "t_datamanipulation.h"
#include "geometry_utilities.h"
#include "geometry_attribute.h"

Go to the source code of this file.

Macros

#define NO_INTERSECTION   -99
 
#define NULL_VALUE   -99
 

Functions

polygon_connection_attributesget_connection (POLYGON *polygon, POLYGONVECTOR *polygons, long boundary, long displacement, short print)
 
polygon_connection_attribute_arraynew_connection_attributes (long nh)
 
polygon_connection_attribute_arrayget_connection_array (POLYGONVECTOR *polygons, long boundary, long displacement, short print)
 
int write_polygonconnectionattributearray (char *filename, polygon_connection_attribute_array *pca)
 
int fprint_polygonconnectionattributearray (char *filename, polygon_connection_attribute_array *pca)
 
int connections_symmetry (polygon_connection_attribute_array *pca, long boundary)
 
polygon_connection_attributesget_connection_squares (POLYGON *polygon, POLYGONVECTOR *polygons, long boundary, long novalue, long r, long c, LONGMATRIX *mask, short print)
 
polygon_connection_attribute_arrayget_connection_array_squares (POLYGONVECTOR *polygons, long boundary, long novalue, LONGMATRIX *pixels, short print)
 

Macro Definition Documentation

#define NO_INTERSECTION   -99

Definition at line 34 of file geometry_attribute.c.

Referenced by get_connection(), and get_connection_squares().

Function Documentation

int connections_symmetry ( polygon_connection_attribute_array pca,
long  boundary 
)
Parameters
pca- (polygon_connection_attrivute_array *) the attributte array of which the symmetry is verified;
boundary- (long) - boundary indicator
Author
Emanuele Cordano
Date
March 2008

symmetry is assumed

Definition at line 278 of file geometry_attribute.c.

References polygon_connection_attributes::connections, polygon_connection_attribute_array::element, polygon_connection_attribute_array::nl, and LONGVECTOR::nl.

Referenced by get_square_grid().

int fprint_polygonconnectionattributearray ( char *  filename,
polygon_connection_attribute_array pca 
)
Author
Emanuele Cordano November 2008
Parameters
name- (char *)name of file where to write the linevector properties
pca- (polygon_connection_attribute_array *) the polygon_connection_attribute_array to be printed
Returns
0 if the polygon_connection_attribute_array is written correctly, -1 otherwise

PRINT HEADER

end print header

Definition at line 220 of file geometry_attribute.c.

References polygon_connection_attributes::connections, polygon_connection_attributes::d_connections, polygon_connection_attribute_array::element, LONGVECTOR::nh, NL, polygon_connection_attribute_array::nl, LONGVECTOR::nl, DOUBLEVECTOR::nl, and NULL_VALUE.

polygon_connection_attributes* get_connection ( POLYGON polygon,
POLYGONVECTOR polygons,
long  boundary,
long  displacement,
short  print 
)
BGEOMETRY BUILDS THE MESH FROM A RASTER FOR THE BOUSSINESQ MODEL

BGEOMETRY Version 0.9375 KMackenzie

file geometry_attribute.h

Copyright, 2009 Emanuele Cordano and Riccardo Rigon

This file is part of BGEOMETRY. BGEOMETRY 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.

BGEOMETRY 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 this program. If not, see http://www.gnu.org/licenses/.

function header

Parameters
polygon- (POLYGON *) polygon to which link are referred
polygons- (POLYGONS *) vector of polygons
boundary- (long) long value which indetifies the boundary
displacement- (long) displacement in the POLYNGONVECTOR polygons around the index value of polygon where to find the connections
print- (short)
Author
Emanuele Cordano
Date
November 2008
Returns
a poygon_connection_atributes struct for a given polygon (polygon) within a polygon array (polygons)

extremes of the search interval

Definition at line 37 of file geometry_attribute.c.

References polygon_connection_attributes::connections, polygon_connection_attributes::d_connections, POLYGON::edge_indices, POLYGONVECTOR::element, POLYGON::index, initialize_doublevector(), initialize_longvector(), new_doublevector(), new_longvector(), POLYGONVECTOR::nh, LONGVECTOR::nh, POLYGONVECTOR::nl, NO_INTERSECTION, NULL_VALUE, and shared_edges().

Referenced by get_connection_array().

polygon_connection_attribute_array* get_connection_array ( POLYGONVECTOR polygons,
long  boundary,
long  displacement,
short  print 
)
Parameters
polygons- (POLYGONS *) vector of polygons
boundary- (long) long value which indetifies the boundary
displacement- (long) displacement in the POLYNGONVECTOR polygons around the index value of polygon where to find the connections
print- (short)
Author
Emanuele Cordano
Date
November 2008
Returns
build a a poygon_connection_atribute_array struct for a given array of polygons

Definition at line 122 of file geometry_attribute.c.

References polygon_connection_attributes::connections, POLYGONVECTOR::element, polygon_connection_attribute_array::element, get_connection(), new_connection_attributes(), POLYGONVECTOR::nh, polygon_connection_attribute_array::nh, LONGVECTOR::nh, and polygon_connection_attribute_array::nl.

polygon_connection_attribute_array* get_connection_array_squares ( POLYGONVECTOR polygons,
long  boundary,
long  novalue,
LONGMATRIX pixels,
short  print 
)
Parameters
polygons- (POLYGONS *) vector of polygons
boundary- (long) long value which indetifies the boundary
novalue- null value
pixels- (LONGTMATRIX *) - matrix of the indices of the pixels
print- (short)
Author
Emanuele Cordano
Date
July 2009
Returns
build a a poygon_connection_atribute_array struct for a given array of polygons

Definition at line 383 of file geometry_attribute.c.

References polygon_connection_attributes::connections, POLYGONVECTOR::element, polygon_connection_attribute_array::element, get_connection_squares(), LONGMATRIX::ncl, new_connection_attributes(), POLYGONVECTOR::nh, polygon_connection_attribute_array::nh, LONGVECTOR::nh, polygon_connection_attribute_array::nl, and LONGMATRIX::nrl.

Referenced by get_square_grid().

polygon_connection_attributes* get_connection_squares ( POLYGON polygon,
POLYGONVECTOR polygons,
long  boundary,
long  novalue,
long  r,
long  c,
LONGMATRIX mask,
short  print 
)
Parameters
polygon- (POLYGON *) polygon to which link are referred
polygons- (POLYGONS *) vector of polygons
boundary- (long) long value which indetifies the boundary
novalue- (long) null value used in the pixel index matrix
r- (long) row
c- (long) column
(LONGMATRIX*) pixel index matrix
print- (long) displacement in the POLYNGONVECTOR polygons around the index value of polygon where to find the connections
Author
Emanuele Cordano
Date
July 2009
Returns
a poygon_connection_atributes struct for a given polygon (polygon) within a polygon array (polygons)

extremes of the search interval

Definition at line 315 of file geometry_attribute.c.

References polygon_connection_attributes::connections, polygon_connection_attributes::d_connections, POLYGON::edge_indices, POLYGONVECTOR::element, POLYGON::index, initialize_doublevector(), initialize_longvector(), LONGMATRIX::nch, LONGMATRIX::ncl, new_doublevector(), new_longvector(), LONGVECTOR::nh, NO_INTERSECTION, LONGMATRIX::nrh, LONGMATRIX::nrl, NULL_VALUE, and shared_edges().

Referenced by get_connection_array_squares().

int write_polygonconnectionattributearray ( char *  filename,
polygon_connection_attribute_array pca 
)
Author
Emanuele Cordano November 2008
Parameters
name- (char *)name of file where to write the linevector properties
pca- (polygon_connection_attribute_array *) the polygon_connection_attribute_array to be printed

This functions writes a polygonconnectionattributearray in an ascii files with fluidturle formalism

Returns
0 if the polygon_connection_attribute_array is written correctly, -1 otherwise

PRINT HEADER

end print header

Definition at line 158 of file geometry_attribute.c.

References polygon_connection_attributes::connections, polygon_connection_attributes::d_connections, polygon_connection_attribute_array::element, polygon_connection_attribute_array::nh, LONGVECTOR::nh, NL, polygon_connection_attribute_array::nl, LONGVECTOR::nl, DOUBLEVECTOR::nl, and NULL_VALUE.

Referenced by write_grid().