Exemple #1
0
void MDAL::DriverFlo2D::parseOUTDatasets( const std::string &datFileName, const std::vector<double> &elevations )
{
  // Create Depth and Velocity datasets Time varying datasets
  parseTIMDEPFile( datFileName, elevations );

  // Maximum Depth and Water Level
  parseDEPTHFile( datFileName, elevations );

  // Maximum Velocity
  parseVELFPVELOCFile( datFileName );
}
Mesh* Crayfish::loadFlo2D( const QString& datFileName, LoadStatus* status )
{
    if (status) status->clear();
    Mesh* mesh = 0;

    try
    {
        // Parse all nodes
        Mesh::Nodes nodes;
        parseCADPTSFile(datFileName, nodes);

        // Parse all elements
        Mesh::Elements elements;
        QVector<float> elevations = parseFPLAINFile(datFileName, elements);

        // Create mesh
        mesh = new Mesh(nodes, elements);

        // create output for bed elevation
        addStaticDataset(elevations, "Bed Elevation", DataSet::Bed, datFileName, mesh);

        // Create Depth and Velocity datasets Time varying datasets
        parseTIMDEPFile(datFileName, mesh, elevations);

        // Maximum Depth and Water Level
        parseDEPTHFile(datFileName, mesh, elevations);

        // Maximum Velocity
        parseVELFPVELOCFile(datFileName, mesh);

    }

    catch (LoadStatus::Error error)
    {
        if (status) status->mLastError = (error);
        if (mesh) delete mesh;
        mesh = 0;
    }

    return mesh;
}