当前位置: 首页>>代码示例>>C++>>正文


C++ System::SearchActiveSeaModel方法代码示例

本文整理汇总了C++中System::SearchActiveSeaModel方法的典型用法代码示例。如果您正苦于以下问题:C++ System::SearchActiveSeaModel方法的具体用法?C++ System::SearchActiveSeaModel怎么用?C++ System::SearchActiveSeaModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System的用法示例。


在下文中一共展示了System::SearchActiveSeaModel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ReadFiles

//######################################## ReadFiles Function #########################################################
void ReadFiles(string runPath)
{
    //Reads in all the input files

    FileReader fileIn;                  //Create file reading objects
    dictBodies dictBod;                 //Create dictionary object for bodies.in
    dictForces dictForce;               //Create dictionary object for forces.in
    dictControl dictCont;               //Create dictionary object for control.in
    dictSeaEnv dictSea;                 //Create dictionary object for seaenv.in
    dictData dictDat(&fileIn);           //Create dictionary object for data.in
    dictOutputs dictOut;                //Create dictionary object for outputs.in

    try {
        //Create pointer to System object for each of the filereader objects
        fileIn.setSystem( &sysofreq);
        dictBod.setSystem( &sysofreq);
        dictForce.setSystem( &sysofreq);
        dictCont.setSystem( &sysofreq);
        dictSea.setSystem( &sysofreq);
        dictDat.setSystem( &sysofreq);
        dictOut.setSystem( &sysofreq);

        //Set path for file reading
        fileIn.setPath(runPath);

        //Read input files
        //Sequence of file reading is important.
        //Read control file.
        fileIn.setDictionary(dictCont);
        fileIn.readControl();       //Must be first.
        //Read sea environment file.
        fileIn.setDictionary(dictSea);
        fileIn.readSeaEnv();
        //Read user forces
        fileIn.setDictionary(dictForce);
        fileIn.readForces();        //Must come before reading Bodies
        //Read Bodies
        fileIn.setDictionary(dictBod);
        fileIn.readBodies();        //Must come after reading forces.
        //Read hydrodynamic data
        fileIn.setDictionary(dictDat);
        fileIn.readData();
        //Read in output controls
        fileIn.setDictionary(dictOut);
        fileIn.readOutputs();

        //At the end, force system to check one last time for the active sea model.
        sysofreq.SearchActiveSeaModel();

        //Write output to screen.
        sysofreq.logStd.Write("Hydrodynamic Input Files",3);
        sysofreq.logStd.Write("-----------------------------",3);

        //So far, input files only specified the location of the hydrodynamic data.  Now need to actually  read it.
        HydroReader hydroIn;            //Create hydroreader.
        hydroIn.setSystem( &sysofreq);

        if (fileIn.listDataFiles().size() > 0)
        {
            for (unsigned int i = 0; i < fileIn.listDataFiles().size(); i++)
            {
                //Iterate through each of the items on the list of hydro files and read them.
                hydroIn.setPath(fileIn.listDataFiles(i));           //Set the path to the hydro system.
                hydroIn.readHydroSys();
            }
        }
    }
    catch(const std::exception &err)
    {
        sysofreq.logStd.Notify();
        sysofreq.logErr.Write(ID + std::string(err.what()));
    }
}
开发者ID:DatawaveMarineScience,项目名称:OpenSEA,代码行数:74,代码来源:ofreq.cpp


注:本文中的System::SearchActiveSeaModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。