CSol
|
#include <pn/csol_pn.h>
Public Member Functions | |
PipeNetwork () | |
PipeNetwork constructor. More... | |
PipeNetwork (const PipeNetwork &) | |
PipeNetwork copy constructor. More... | |
~PipeNetwork () | |
PipeNetwork destructor. More... | |
bool | check (bool) |
PipeNetwork integrity check. More... | |
void | clearData () |
Clears PipeNetwork internal data. More... | |
void | clearNetwork () |
Clears PipeNetwork sites and pipes. More... | |
REAL | get_outlet_flow (int id) |
REAL | get_outlet_head (int id) |
const std::vector< Pipe * > & | getPipes () const |
const std::vector< Site * > & | getSites () const |
void | inc_outlet_head (int id, REAL dhead) |
bool | init (CSol_Solver &, int workGroupSize_=0) |
PipeNetwork initialisation. More... | |
void | parseControl (QXmlStreamReader &, std::vector< Site * > &) |
PipeNetwork xml control node parsing. More... | |
void | parseJunction (QXmlStreamReader &, std::vector< Site * > &) |
PipeNetwork xml junction parsing. More... | |
void | parsePipe (QXmlStreamReader &, std::vector< Pipe * > &) |
PipeNetwork xml pipe parsing. More... | |
void | parseTerminator (QXmlStreamReader &, std::vector< Site * > &) |
PipeNetwork xml terminator parsing. More... | |
bool | read (QString, bool) |
PipeNetwork xml data read. More... | |
bool | reorderCuthillMcKee () |
PipeNetwork reordering operation. More... | |
void | set_outlet_head (int id, REAL head) |
void | setPipes (std::vector< Pipe * > pipes) |
Set the pipe network pipes. More... | |
void | setSites (std::vector< Site * > sites) |
Set the pipe network sites. More... | |
REAL | sign (REAL) |
Mathematical sign function implementation. More... | |
bool | solve () |
PipeNetwork solve step. More... | |
QString | uniqueString (QString, QString) |
Unique string function. More... | |
bool | write (QString) |
PipeNetwork xml data write. More... | |
PipeNetwork | ( | ) |
~PipeNetwork | ( | ) |
PipeNetwork | ( | const PipeNetwork & | r | ) |
bool check | ( | bool | reorder | ) |
Checks nodes and connections are correctly ordered for solving.
reorder | apply Cuthill-McKee re-ordering. |
void clearData | ( | ) |
void clearNetwork | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool init | ( | CSol_Solver & | solver, |
int | workGroupSize_ = 0 |
||
) |
solver | solver handle. |
workGroupSize_ | OpenCL workgroup size to use. |
void parseControl | ( | QXmlStreamReader & | xmlStream, |
std::vector< Site * > & | controls | ||
) |
xmlStream | xml stream handle. |
controls | control node list. |
void parseJunction | ( | QXmlStreamReader & | xmlStream, |
std::vector< Site * > & | junctions | ||
) |
xmlStream | xml stream handle. |
junctions | junction list. |
void parsePipe | ( | QXmlStreamReader & | xmlStream, |
std::vector< Pipe * > & | pipes | ||
) |
xmlStream | xml stream handle. |
pipes | pipe list. |
void parseTerminator | ( | QXmlStreamReader & | xmlStream, |
std::vector< Site * > & | terminators | ||
) |
xmlStream | xml stream handle. |
terminators | terminator list. |
bool read | ( | QString | dataFileName, |
bool | reorder | ||
) |
Read a pipe network from an xml network file.
dataFileName | xml file name. |
reorder | apply Cuthill-McKee re-ordering. |
bool reorderCuthillMcKee | ( | ) |
Reorders nodes to reduce matrix bandwidth using Cuthill-McKee algorithm.
|
inline |
void setPipes | ( | std::vector< Pipe * > | pipes | ) |
void setSites | ( | std::vector< Site * > | sites | ) |
REAL sign | ( | REAL | a | ) |
bool solve | ( | ) |
Solves the pipe network for pressure heads in sites and flow rates in pipes \ using a pressure relaxation method.
QString uniqueString | ( | QString | id0, |
QString | id1 | ||
) |
Returns a unique string r from id0 and id1 with the property that r(id0, id1) == r(id1, id0). This is used to uniquely identify site connection irrespective of the order the sites are given.
bool write | ( | QString | dataFileName | ) |
Writes a pipe network to an xml network file.
dataFileName | xml file name. |