Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    internalField() 和 Ref()

    OpenFOAM
    3
    3
    1951
    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 李东岳

      OpenFOAM-4.x以前?反正是老的:

      const scalarField& psi = U.internalField(); 
      scalarField& psi = U.internalField(); 
      

      OpenFOAM-5.x, 4.x:

      const scalarField& psi = U.primitiveField(); 
      scalarField& psi = U.primitiveFieldRef(); 
      

      https://www.openfoam.com/documentation/developer-upgrade-guide.php

      线上CFD课程 7月1日报名截止 http://dyfluid.com/class.html
      CFD高性能服务器 http://dyfluid.com/servers.html

      1 Reply Last reply Reply Quote
      • Y
        youmengtian last edited by

        对,最近也是发现这个改动。不太明白出于什么目的,之前函数重载用着挺舒服的。不知道为什么要改成这样

        天命之谓性;率性之谓道;修道之谓教。
        道也者,不可须臾离也;可离,非道也。是故君子戒慎乎其所不睹,恐惧乎其所不闻。
        莫见乎隐,莫显乎微。故君子慎其独也

        1 Reply Last reply Reply Quote
        • W
          wwzhao 教授 last edited by 李东岳

          这个改动主要是为了区别 const 和 non-const 访问。

          1 Reply Last reply Reply Quote
          • First post
            Last post

          CFD中文网 | 东岳流体 | 京ICP备15017992号-2
          论坛登录问题反馈可联系 li.dy@dyfluid.com