diff --git a/Apps/Common/SIMNodalConstraint.C b/Apps/Common/SIMNodalConstraint.C index 3179936f..33078678 100644 --- a/Apps/Common/SIMNodalConstraint.C +++ b/Apps/Common/SIMNodalConstraint.C @@ -306,8 +306,7 @@ public: int getCorner(int vertex, int basis) { static const int indices[4][2] = {{-1,-1}, {1, -1}, {-1, 1}, {1,1}}; - size_t ofs = getStartNode(basis); - return ofs + pch->getCorner(indices[vertex-1][0], indices[vertex-1][1], basis); + return pch->getCorner(indices[vertex-1][0], indices[vertex-1][1], basis); } //! \copydoc NodalConstraintASM2DHelper::constrainEdge diff --git a/Apps/Common/Test/TestSIMNodalConstraint.C b/Apps/Common/Test/TestSIMNodalConstraint.C index 5609ea0b..2ef4d07c 100644 --- a/Apps/Common/Test/TestSIMNodalConstraint.C +++ b/Apps/Common/Test/TestSIMNodalConstraint.C @@ -245,10 +245,10 @@ TEST_P(TestSIMNodalConstraint, Edge2DLRmx) } for (size_t i=1; i <= pch.getNoNodes(2); ++i) { if (std::find(nodes.begin(), nodes.end(), i+ofs) != nodes.end() && - i != ofs+pch.getCorner(1,-1,2) && GetParam() == 1) - check_mpc(pch.findMPC(i+ofs, 1), ofs+pch.getCorner(1,-1,2)); + i+ofs != pch.getCorner(1,-1,2) && GetParam() == 1) + check_mpc(pch.findMPC(i+ofs, 1), pch.getCorner(1,-1,2)); else if (std::find(nodes.begin(), nodes.end(), i+ofs) != nodes.end() && GetParam() == 3) - check_mpc(pch.findMPC(i+ofs, 1), ofs+pch.getCorner(1,1,2)); + check_mpc(pch.findMPC(i+ofs, 1), pch.getCorner(1,1,2)); else if (std::find(nodes.begin(), nodes.end(), i+ofs) != nodes.end()) check_mpc(pch.findMPC(i+ofs, 1), ofs+1); else diff --git a/src/ASM/LR/ASMu2D.C b/src/ASM/LR/ASMu2D.C index cd34c882..1c66a8dd 100644 --- a/src/ASM/LR/ASMu2D.C +++ b/src/ASM/LR/ASMu2D.C @@ -719,13 +719,17 @@ int ASMu2D::getCorner(int I, int J, int basis) const <<" corners returned from LRSplineSurface::getEdgeFunctions()" << std::endl; - return edgeFunctions.front()->getId()+1; + size_t ofs = 1; + for (int i = 1; i < basis; i++) + ofs += this->getNoNodes(i); + + return edgeFunctions.front()->getId()+ofs; } -void ASMu2D::constrainCorner (int I, int J, int dof, int code, char) +void ASMu2D::constrainCorner (int I, int J, int dof, int code, char basis) { - int corner = getCorner(I, J, 1); + int corner = getCorner(I, J, basis); if (corner == 0) return; else