Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    OpenFOAM代码中奇葩的换行

    C斯达克
    5
    5
    2851
    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

      来自rhoCentralFoam:

      U.ref() =
                  rhoU()
                 /rho();
      

      我进行了一个创新,更改为:

      U.ref() =rhoU()/rho();
      

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

      .J. 赵 2 Replies Last reply Reply Quote
      • .J.
        .J. @李东岳 last edited by

        @李东岳 强!

        Blog: http://www.cnblogs.com/Jay-CFD/
        Research Gate: https://www.researchgate.net/profile/Weijie_Yin2

        1 Reply Last reply Reply Quote
        • 赵
          赵一铭 @李东岳 last edited by

          @李东岳 不愧是大师!

          1 Reply Last reply Reply Quote
          • F
            Foamer24 last edited by

            e99a9571-fe97-46e4-8f60-7c0f0b7bd1f1-image.png

            这么写应该是为了版本更替的时候,保证代码可读性,所以写的格式和以前一样了。

            1 Reply Last reply Reply Quote
            • bestucan
              bestucan 版主 副教授 last edited by

              这更像是用代码格式化软件统一生成的。高级编辑器自带的代码格式化一般只改行前缩进,代码格式化软件是全部重新排版。

              一般大型代码库都有非常细致的格式要求,代码格式化软件可以非常细致的定义每一个格式化要求:每行最多字符;算符前后加不加空格、换不换行,前换 后换还是都换……

              然后用被处理过的代码非常满足每一个细致要求,所以某些地方就看着有一点点别扭了。 indent是GNU出的格式化软件。里面有一些常用的风格模板:GNU、K&R、linux。也可以跟“像一篇文章一样长的”参数来定义自己的代码排版风格。

              滚来滚去……~(~o ̄▽ ̄)~o 滚来滚去都不能让大家看出来我不是老师么 O_o

              异步沟通方式(《posting style》from wiki)(下载后打开):
              https://www.jianguoyun.com/p/Dc52X2sQsLv2BRiqnKYD
              提问的智慧(github在gitee的镜像):
              https://gitee.com/bestucan/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md

              1 Reply Last reply Reply Quote
              • First post
                Last post

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