Skip to content
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(不使用皮肤)
  • 不使用皮肤
折叠
CFD中文网

CFD中文网

  1. CFD中文网
  2. OpenFOAM
  3. owner neighbour 网格寻址

owner neighbour 网格寻址

已定时 已固定 已锁定 已移动 OpenFOAM
3 帖子 2 发布者 4.2k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    写于 最后由 李东岳 编辑
    #1
        const labelUList& owner = mesh_.owner();
        const labelUList& neighbour = mesh_.neighbour();
    
        forAll(weis_, kth)
        {
            forAll(sumWeisF[kth], cellI)
            {
    
                Info << "Current cell index is " << cellI << nl;
    
                //- Loop the faces of cellI
                forAll(mesh_.cells()[cellI], faceI)
                {
                    //- Check if it is an internal face
                    if (mesh_.isInternalFace(mesh_.cells()[cellI][faceI]))   
                    {
                        label faceIndex = mesh_.cells()[cellI][faceI];
                        Info << " its faceIndex is " << faceIndex;
                        Info << ", and this face's owner is "
                            << owner[faceIndex] << ", its neighbour is "
                            << neighbour[faceIndex] << nl;
                    }
                }
                
                Info << nl;
            } 
        }
    

    输出如下:

    Current cell index is 851
     its faceIndex is 1684, and this face's owner is 851, its neighbour is 852
     its faceIndex is 1685, and this face's owner is 851, its neighbour is 896
     its faceIndex is 1596, and this face's owner is 806, its neighbour is 851
     its faceIndex is 1682, and this face's owner is 850, its neighbour is 851
    
    Current cell index is 852
     its faceIndex is 1686, and this face's owner is 852, its neighbour is 853
     its faceIndex is 1687, and this face's owner is 852, its neighbour is 897
     its faceIndex is 1598, and this face's owner is 807, its neighbour is 852
     its faceIndex is 1684, and this face's owner is 851, its neighbour is 852
    
    

    希望有用

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    写于 最后由 编辑
    #2

    注意在变量赋值的时候要使用faceIndex而不是faceI,因为p[faceI]只是一直在1 2 3 4 5...中循环,p[faceIndex]是真正的面址

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    写于 最后由 编辑
    #3

    4年过去了,当时发完这个贴就出去玩了。:jingya:

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    1 条回复 最后回复

  • 登录

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]