EPANET头文件解读系列8——FUNCS.H

/*
**************************************************************************
                                                                  
FUNCS.H -- Function Prototypes for EPANET Program                      
                                                                  
VERSION:    2.00
DATE:       5/8/00
            9/25/00
            10/25/00
            12/29/00
            3/1/01
            2/14/08    (2.00.12)
AUTHOR:     L. Rossman
            US EPA - NRMRL
                                                                               
**************************************************************************
*/

/*****************************************************************/
/*   Most float arguments have been changed to double - 7/3/07   */
/*****************************************************************/
//main module providing supervisory control;主要模块提供监控
/* ------- EPANET.C --------------------*/
/*
**  NOTE: The exportable functions that can be called
**        via the DLL are prototyped in TOOLKIT.H.         
*/
//EPANET.C中函数原型的声明分别由下列函数以及TOOLKIT.H中所声明,而且TOOLKIT.H中所声明的函数可以通过DLL的方式来进行调用。
void    initpointers(void);               /* Initializes pointers       */
int     allocdata(void);                  /* Allocates memory           */
void    freeTmplist(STmplist *);          /* Frees items in linked list */
void    freeFloatlist(SFloatlist *);      /* Frees list of floats       */
void    freedata(void);                   /* Frees allocated memory     */

...


/* ------- INPUT1.C --------------------*/
//controls processing of input data;输入数据的处理控制。
int     getdata(void);                    /* Gets network data          */
void    setdefaults(void);                /* Sets default values        */
void    initreport(void);                 /* Initializes report options */
void    adjustdata(void);                 /* Adjusts input data         */
int     inittanks(void);                  /* Initializes tank levels    */
void    initunits(void);                  /* Determines reporting units */
void    convertunits(void);               /* Converts data to std. units*/

/* -------- INPUT2.C -------------------*/
//reads data from input file;从输入文件读入数据
int     netsize(void);                    /* Determines network size    */
int     readdata(void);                   /* Reads in network data      */
int     newline(int, char *);             /* Processes new line of data */
int     addnodeID(int, char *);           /* Adds node ID to data base  */

...

/* ---------- INPUT3.C -----------------*/
//parses individual lines of input data;一行行解析输入数据
int     juncdata(void);                   /* Processes junction data    */
int     tankdata(void);                   /* Processes tank data        */
int     pipedata(void);                   /* Processes pipe data        */
int     pumpdata(void);                   /* Processes pump data        */
int     valvedata(void);                  /* Processes valve data       */

...

/* -------------- RULES.C --------------*/
//implements rule-based control of piping system;实现了基于规则的管道控制系统
void    initrules(void);                  /* Initializes rule base      */
void    addrule(char *);                  /* Adds rule to rule base     */
int     allocrules(void);                 /* Allocates memory for rule  */
int     ruledata(void);                   /* Processes rule input data  */
int     checkrules(long);                 /* Checks all rules           */
void    freerules(void);                  /* Frees rule base memory     */ 

/* ------------- REPORT.C --------------*/
//handles reporting of results to text file;将报告结果写入到文本文件
int     writereport(void);                /* Writes formatted report    */
void    writelogo(void);                  /* Writes program logo        */

...

/* --------- HYDRAUL.C -----------------*/
//computes extended period hydraulic behavior;计算延时水力结果
int     openhyd(void);                    /* Opens hydraulics solver    */

/*** Updated 3/1/01 ***/
void    inithyd(int);                     /* Re-sets initial conditions */

int     runhyd(long *);                   /* Solves 1-period hydraulics */
int     nexthyd(long *);                  /* Moves to next time period  */
void    closehyd(void);                   /* Closes hydraulics solver   */

...

/* ----------- SMATRIX.C ---------------*/
//sparse matrix linear equation solver routines;稀疏矩阵线性方程解算器例程,这部分是一些矩阵运算相关的函数
int     createsparse(void);               /* Creates sparse matrix      */
int     allocsparse(void);                /* Allocates matrix memory    */
void    freesparse(void);                 /* Frees matrix memory        */
int     buildlists(int);                  /* Builds adjacency lists     */

...

/* ----------- QUALITY.C ---------------*/
//tracks transport & fate of water quality;跟踪水质,水质解算相关的函数声明
int     openqual(void);                   /* Opens WQ solver system     */
void    initqual(void);                   /* Initializes WQ solver      */
int     runqual(long *);                  /* Gets current WQ results    */

...

/* ------------ OUTPUT.C ---------------*/
//handles transfer of data to and from binary files;处理二进制文件数据的输入与输出
int     savenetdata(void);                /* Saves basic data to file   */
int     savehyd(long *);                  /* Saves hydraulic solution   */
int     savehydstep(long *);              /* Saves hydraulic timestep   */
int     saveenergy(void);                 /* Saves energy usage         */
int     readhyd(long *);                  /* Reads hydraulics from file */
int     readhydstep(long *);              /* Reads time step from file  */
int     saveoutput(void);                 /* Saves results to file      */
int     nodeoutput(int, REAL4 *, double); /* Saves node results to file */
int     linkoutput(int, REAL4 *, double); /* Saves link results to file */
int     savefinaloutput(void);            /* Finishes saving output     */
int     savetimestat(REAL4 *, char);      /* Saves time stats to file   */
int     savenetreacts(double, double,
                      double, double);    /* Saves react. rates to file */
int     saveepilog(void);                 /* Saves output file epilog   */


/* ------------ INPFILE.C --------------*/
//saves modified input data to a text file;将输入数据做格式等修改并保存到文本文件中
int     saveinpfile(char *);              /* Saves network to text file  */

posted @ 2013-09-10 14:12  KingOfFreedom  阅读(406)  评论(0编辑  收藏  举报