Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Writing a Report
The Toolkit has some built-in capabilities to produce formatted output results saved to a file. More specialized reporting needs can always be handled by writing specialized code.
The ENsetreport function is used to define the format of a report while the ENreport function actually writes the report. The latter should be called only after a hydraulic or water quality analysis has been made. An example of creating a report that lists all nodes where the pressure variation over the duration of the simulation exceeds 20 psi is shown below:
/* Compute ranges (max - min) */ ENsettimeparam(EN_STATISTIC, EN_RANGE); /* Solve hydraulics */ ENsolveH(); ENsaveH(); /* Define contents of the report */ ENresetreport(); ENsetreport("FILE myfile.rpt"); ENsetreport("NODES ALL"); ENsetreport("PRESSURE PRECISION 1"); ENsetreport("PRESSURE ABOVE 20"); /* Write the report to file */ ENreport();