CFD中文网

    CFD中文网

    • 登录
    • 搜索
    • 最新

    declareRunTimeSelectionTable在基类中可否同时调用两个?

    OpenFOAM
    1
    1
    347
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 吴
      吴优 最后由 编辑

      各位前辈好,我最近准备从其他版本移植一个动网格功能时发现新旧版本之间motionSolver类在调用declareRunTimeSelectionTable函数时存在不同,旧版本中argList使用了Istream,新版本改为了Iodictionary。这导致旧版本的派生类移植到新版本遇到问题,如果直接改新版本的话又会导致其他派生类出现问题。因此可否在基类motionSolver中调用两次declareRunTimeSelectionTable,argList分别使用Istream和Iodictionary?
      事实上我在polyPatch.H中看到了调用两个declareRunTimeSelectionTable的例子:

      TypeName("patch");
      
          //- Debug switch to disallow the use of genericPolyPatch
          static int disallowGenericPolyPatch;
      
      
          // Declare run-time constructor selection tables
      
              declareRunTimeSelectionTable
              (
                  autoPtr,
                  polyPatch,
                  word,
                  (
                      const word& name,
                      const label size,
                      const label start,
                      const label index,
                      const polyBoundaryMesh& bm,
                      const word& patchType
                  ),
                  (name, size, start, index, bm, patchType)
              );
      
              declareRunTimeSelectionTable
              (
                  autoPtr,
                  polyPatch,
                  dictionary,
                  (
                      const word& name,
                      const dictionary& dict,
                      const label index,
                      const polyBoundaryMesh& bm,
                      const word& patchType
                  ),
                  (name, dict, index, bm, patchType)
              );
      

      但是不清楚是否是为了实现上述的功能?

      1 条回复 最后回复 回复 引用
      • First post
        Last post