Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    并行,获取某个量达到最大值的这个网格中的其它值

    OpenFOAM
    2
    3
    1411
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 浪
      浪迹天大 last edited by

      并行计算时,利用 gMax 获取了某个 volScalarField 的全局最大值,然后我想找到这个网格的 cell_ID,因为我想输出这个网格的其它的一些 volScalarField 值,我写的代码只能在串行下实现这个功能,请问如何在并行下实现这个想法呢?
      我的串行代码如下:

      scalar theMax = gMax(oneVolScalarField);
      forAll (oneVolScalarField,cellI)
      {
          if ( oneVolScalarField[cellI] >= theMax )  
          {
              Info<<" When oneVolScalarField peaks, anotherVolScalarField ======"<<anotherVolScalarField[cellI]<<endl;  
          } 
      }
      

      OpenFOAM 学习交流:https://openfoam.top

      1 Reply Last reply Reply Quote
      • 李东岳
        李东岳 管理员 last edited by

        你这个串行计算没问题吧?我知道Info只能输出主要核心的那个,试试Pout?

        CFD课程 改成线上了 http://dyfluid.com/class.html
        CFD高性能服务器 http://dyfluid.com/servers.html

        1 Reply Last reply Reply Quote
        • 浪
          浪迹天大 last edited by

          谢谢!经过测试,完美地解决了我的问题!

          OpenFOAM 学习交流:https://openfoam.top

          1 Reply Last reply Reply Quote
          • First post
            Last post

          CFD中文网 | 东岳流体 | 京ICP备15017992号-2