From 6476c3380e3ad9867dda7b327bd8055a47bb9886 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 20 Oct 2016 11:22:36 +0200 Subject: [PATCH] fixed: corners was not properly constrained in ASMu2D for non-projected boundary conditions, the wrong code was used in the prescribe call. this reuses the code from ASMs2D to handle this. this somehow got lost --- src/ASM/LR/ASMu2D.C | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/ASM/LR/ASMu2D.C b/src/ASM/LR/ASMu2D.C index 207d8d70..71418157 100644 --- a/src/ASM/LR/ASMu2D.C +++ b/src/ASM/LR/ASMu2D.C @@ -625,24 +625,27 @@ void ASMu2D::constrainEdge (int dir, bool open, int dof, int code, char basis) } std::vector nodes = this->getEdgeNodes(edge,basis); - // Skip the first and last function if we are requesting an open boundary. - // I here assume the edgeFunctions are ordered such that the physical - // end points are represented by the first and last edgeFunction. - if (!open) - this->prescribe(nodes.front(),dof,code); - + int bcode = code; if (code > 0) { std::vector funcs; dirich.push_back(DirichletEdge(this->getBasis(basis)->edgeCurve(edge,funcs), dof,code)); - } + } else if (code < 0) + bcode = -code; + + // Skip the first and last function if we are requesting an open boundary. + // I here assume the edgeFunctions are ordered such that the physical + // end points are represented by the first and last edgeFunction. + if (!open) + this->prescribe(nodes.front(),dof,bcode); + for (size_t i = 1; i < nodes.size()-1; i++) if (this->prescribe(nodes[i],dof,-code) == 0 && code > 0) dirich.back().nodes.push_back(std::make_pair(i,nodes[i])); if (!open) - this->prescribe(nodes.back(),dof,code); + this->prescribe(nodes.back(),dof,bcode); if (code > 0) if (dirich.back().nodes.empty())