Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect boundary chk in nrsSetup #504

Open
yslan opened this issue Jun 4, 2023 · 0 comments
Open

Incorrect boundary chk in nrsSetup #504

yslan opened this issue Jun 4, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@yslan
Copy link
Contributor

yslan commented Jun 4, 2023

Describe the bug

We should only call bcMap::checkBoundaryAlignment with v-mesh.

nekRS/src/setup/setup.cpp

Lines 253 to 262 in 4f87e0e

std::vector<mesh_t *> meshList;
meshList.push_back(nrs->_mesh);
if (nrs->meshV != nrs->_mesh) {
meshList.push_back(nrs->meshV);
}
for (const auto &msh : meshList) {
bcMap::checkBoundaryAlignment(msh);
bcMap::remapUnalignedBoundaries(msh);
}

To Reproduce
This bug can be observed in the conj_ht example with the following changes where the number of boundary IDs are different between v-mesh and t-mesh.

(usrdat2)
      ! reconstruct boundary tags 
      do iel=1,nelv
      do ifc=1,2*ndim
         if (cbc(ifc,iel,1) .eq. 'v  ') boundaryID(ifc,iel) = 1
         if (cbc(ifc,iel,1) .eq. 'O  ') boundaryID(ifc,iel) = 2
         if (cbc(ifc,iel,1) .eq. 'W  ') boundaryID(ifc,iel) = 1 ! change it to inlet with value 0
      enddo
      enddo

      do iel=1,nelt
      do ifc=1,2*ndim
         if (cbc(ifc,iel,2) .eq. 't  ') boundaryIDt(ifc,iel) = 1
         if (cbc(ifc,iel,2) .eq. 'O  ') boundaryIDt(ifc,iel) = 2
         if (cbc(ifc,iel,2) .eq. 'I  ') boundaryIDt(ifc,iel) = 3
      enddo
      enddo

(par)
[VELOCITY]
boundaryTypeMap = v, O

[TEMPERATURE]
boundaryTypeMap = t, O, I

(error)
generating t-mesh ...
loading mesh from nek ... Nelements: 192, NboundaryIDs: 3, NboundaryFaces: 96 done (2.3564e-05s)
polynomial order N: 7, over-integration order cubN: 10
meshParallelGatherScatterSetup N=7
timing gs: 2.27e-04s
used config: local
generating v-mesh ...
loading mesh from nek ... Nelements: 96, NboundaryIDs: 2, NboundaryFaces: 72 done (2.5134e-05s)
meshParallelGatherScatterSetup N=7
timing gs: 1.14e-04s 
used config: local
Error in id: lookup of bid 3 field velocity failed!

Desktop (please complete the following information):

  • OS: Pop!_OS 22.04 LTS (Ubuntu, kernel 6.2.0-76060200-generic)
  • Version: v23.0.0 (4f87e0e)

Workaround

The code runs if we manually replace the loop between lines 253 to 262 with the single check.
However, further inspection is needed since this case doesn't have SYM with non-aligned BC

      bcMap::checkBoundaryAlignment(mesh);
      bcMap::remapUnalignedBoundaries(mesh);
@stgeke stgeke added the bug Something isn't working label Jun 5, 2023
yslan added a commit to yslan/nekRS that referenced this issue Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants