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
This commit is contained in:
Arne Morten Kvarving 2016-10-20 11:22:36 +02:00
parent b7294f3a9a
commit 6476c3380e

View File

@ -625,24 +625,27 @@ void ASMu2D::constrainEdge (int dir, bool open, int dof, int code, char basis)
} }
std::vector<int> nodes = this->getEdgeNodes(edge,basis); std::vector<int> nodes = this->getEdgeNodes(edge,basis);
// Skip the first and last function if we are requesting an open boundary. int bcode = code;
// 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);
if (code > 0) { if (code > 0) {
std::vector<LR::Basisfunction*> funcs; std::vector<LR::Basisfunction*> funcs;
dirich.push_back(DirichletEdge(this->getBasis(basis)->edgeCurve(edge,funcs), dirich.push_back(DirichletEdge(this->getBasis(basis)->edgeCurve(edge,funcs),
dof,code)); 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++) for (size_t i = 1; i < nodes.size()-1; i++)
if (this->prescribe(nodes[i],dof,-code) == 0 && code > 0) if (this->prescribe(nodes[i],dof,-code) == 0 && code > 0)
dirich.back().nodes.push_back(std::make_pair(i,nodes[i])); dirich.back().nodes.push_back(std::make_pair(i,nodes[i]));
if (!open) if (!open)
this->prescribe(nodes.back(),dof,code); this->prescribe(nodes.back(),dof,bcode);
if (code > 0) if (code > 0)
if (dirich.back().nodes.empty()) if (dirich.back().nodes.empty())