Fixed: Ensure unique boundary nodes nodes also for ldim=nsd and ldim=4.
Added: Also consider 1D boundaries (edges) in 3D and vertices in 2D.
This commit is contained in:
parent
3712524a0e
commit
83ae2c73fa
@ -871,37 +871,50 @@ void SIMbase::getBoundaryNodes (int pcode, IntVec& glbNodes, Vec3Vec* XYZ) const
|
|||||||
glbNodes.clear();
|
glbNodes.clear();
|
||||||
if (XYZ) XYZ->clear();
|
if (XYZ) XYZ->clear();
|
||||||
|
|
||||||
ASMbase* pch;
|
for (const Property& prop : myProps)
|
||||||
size_t node;
|
if (abs(prop.pindx) == pcode)
|
||||||
for (PropertyVec::const_iterator p = myProps.begin(); p != myProps.end(); ++p)
|
{
|
||||||
if (abs(p->pindx) == pcode && (pch = this->getPatch(p->patch))) {
|
ASMbase* pch = this->getPatch(prop.patch);
|
||||||
if (abs(p->ldim)+1 == pch->getNoParamDim() || p->ldim == 4) {
|
if (!pch) continue; // Silently ignore invalid patch index
|
||||||
|
|
||||||
|
IntVec nodes;
|
||||||
|
if (abs(prop.ldim)+1 == pch->getNoParamDim())
|
||||||
// The boundary is of one dimension lower than the patch
|
// The boundary is of one dimension lower than the patch
|
||||||
IntVec nodes;
|
pch->getBoundaryNodes(abs(prop.lindx%10),nodes);
|
||||||
if (p->ldim == 4) // The boundary nodes are stored explicitly
|
else if (abs(prop.ldim)+2 == pch->getNoParamDim())
|
||||||
nodes = pch->getNodeSet(p->lindx);
|
// The boundary is of two dimensions lower than the patch
|
||||||
else
|
pch->getBoundary1Nodes(prop.lindx,nodes);
|
||||||
pch->getBoundaryNodes(abs(p->lindx%10),nodes);
|
else if (abs(prop.ldim) == pch->getNoParamDim())
|
||||||
for (int n : nodes)
|
|
||||||
if (std::find(glbNodes.begin(),glbNodes.end(),n) == glbNodes.end()) {
|
|
||||||
glbNodes.push_back(n);
|
|
||||||
if (XYZ) {
|
|
||||||
if ((node = pch->getNodeIndex(n,true)))
|
|
||||||
XYZ->push_back(pch->getCoord(node));
|
|
||||||
else
|
|
||||||
XYZ->push_back(Vec3());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (pch->getNoParamDim() == abs(p->ldim)) {
|
|
||||||
// The boundary and the patch are of same dimension
|
// The boundary and the patch are of same dimension
|
||||||
for (node = 1; node <= pch->getNoNodes(); node++)
|
for (size_t node = 1; node <= pch->getNoNodes(); node++)
|
||||||
{
|
|
||||||
glbNodes.push_back(pch->getNodeID(node));
|
glbNodes.push_back(pch->getNodeID(node));
|
||||||
if (XYZ) XYZ->push_back(pch->getCoord(node));
|
else if (prop.ldim == 4)
|
||||||
|
// The boundary nodes are stored explicitly
|
||||||
|
nodes = pch->getNodeSet(prop.lindx);
|
||||||
|
else
|
||||||
|
continue; // Silently ignore other/invalid dimension specification
|
||||||
|
|
||||||
|
// Ensure the global node numbers are unique if more than one patch
|
||||||
|
for (int n : nodes)
|
||||||
|
if (std::find(glbNodes.begin(),glbNodes.end(),n) == glbNodes.end())
|
||||||
|
{
|
||||||
|
glbNodes.push_back(n);
|
||||||
|
if (XYZ)
|
||||||
|
{
|
||||||
|
size_t node = pch->getNodeIndex(n,true);
|
||||||
|
XYZ->push_back(node ? pch->getCoord(node) : Vec3());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SP_DEBUG
|
||||||
|
std::cout <<"Boundary nodes associated with property code "<< pcode <<":";
|
||||||
|
if (glbNodes.empty())
|
||||||
|
std::cout <<" (none)";
|
||||||
|
else for (size_t i = 0; i < glbNodes.size(); i++)
|
||||||
|
std::cout << (i%10 ? " " : "\n") << glbNodes[i];
|
||||||
|
std::cout << std::endl;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user