OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
transect.c File Reference

Irregular channel transect geometry and hydraulic tables. More...

#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "headers.h"
Include dependency graph for transect.c:

Macros

#define _CRT_SECURE_NO_DEPRECATE
 
#define MAXSTATION   1500
 

Functions

int transect_create (int n)
 Creates an array of cross-section transects.
 
void transect_delete (void)
 Deletes memory allocated for all transects.
 
int transect_readParams (int *count, char *tok[], int ntoks)
 Parse an NC, X1 or GR transect input record.
 
void transect_validate (int j)
 Validates transect data and creates its geometry tables.
 
void transect_createStreetTransect (TStreet *street)
 Construct hydraulic geometry tables from a one- or two-sided street section.
 

Detailed Description

Irregular channel transect geometry and hydraulic tables.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com (OpenSWMM maintenance and extensions)
License
Apache-2.0 for OpenSWMM contributions; original EPA SWMM provenance is retained.

Macro Definition Documentation

◆ _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE

◆ MAXSTATION

#define MAXSTATION   1500

Function Documentation

◆ transect_create()

int transect_create ( int n)

Creates an array of cross-section transects.

Parameters
[in]nNumber of transect objects to create.
Returns
An error code.

◆ transect_createStreetTransect()

void transect_createStreetTransect ( TStreet * street)

Construct hydraulic geometry tables from a one- or two-sided street section.

Parameters
[in,out]streetNon-null borrowed street with validated internal-feet geometry, dimensionless slopes and Manning coefficients. Its transect tables and transect roughness are overwritten.
Postcondition
Reuses shared Station/Elev/Nstations and roughness/bank positions, then calls createTables() over the computed elevation range.
Note
No allocation or geometry status is returned; caller retains the street.
Here is the caller graph for this function:

◆ transect_delete()

void transect_delete ( void )

Deletes memory allocated for all transects.

◆ transect_readParams()

int transect_readParams ( int * count,
char * tok[],
int ntoks )

Parse an NC, X1 or GR transect input record.

Parameters
[in,out]countNon-null next-transect index; X1 increments it before assigning new parameters. NC validates the previous transect.
[in]tokBorrowed ntoks token strings; tok[0] must exist and select a supported record keyword. NC provides Manning values, X1 metadata and scaling, GR elevation/station pairs in authored length units.
[in]ntoksAvailable token count, at least one; record-specific minimums and pair completeness are checked.
Returns
Zero on success or an input/geometry error code. Global transect state or count may already have changed before an error return.
Note
The active transect and station arrays are module-level state; record order must follow the normal HEC-2-style input sequence.
Here is the call graph for this function:

◆ transect_validate()

void transect_validate ( int j)

Validates transect data and creates its geometry tables.

Parameters
[in]jTransect index.
Here is the call graph for this function:
Here is the caller graph for this function: