diff --git a/src/SIM/SIMgeneric.C b/src/SIM/SIMgeneric.C index 3f9c0d7c..f363b669 100644 --- a/src/SIM/SIMgeneric.C +++ b/src/SIM/SIMgeneric.C @@ -56,11 +56,12 @@ Vector SIMgeneric::getSolution (const Vector& psol, const double* par, int SIMgeneric::evalPoint (const double* xi, Vec3& X, double* param, - int patch) const + int patch, bool global) const { ASMbase* pch = this->getPatch(patch,true); if (!pch) return -1; double dummy[3]; - return pch->evalPoint(xi, param ? param : dummy, X); + int inod = pch->evalPoint(xi, param ? param : dummy, X); + return inod > 0 && global ? pch->getNodeID(inod) : inod; } diff --git a/src/SIM/SIMgeneric.h b/src/SIM/SIMgeneric.h index 7e14f428..47f2588e 100644 --- a/src/SIM/SIMgeneric.h +++ b/src/SIM/SIMgeneric.h @@ -51,9 +51,9 @@ public: //! \param[out] X The Cartesian coordinates of the point //! \param[out] param The parameters of the point in the knot-span domain //! \param[in] patch 1-based patch index containing the evaluation point - //! \return Local node number within the patch that matches the point - int evalPoint(const double* xi, Vec3& X, - double* param = nullptr, int patch = 1) const; + //! \return Patch-local or global node number of node that matches the point + int evalPoint(const double* xi, Vec3& X, double* param = nullptr, + int patch = 1, bool global = false) const; }; #endif diff --git a/src/SIM/SIMoutput.C b/src/SIM/SIMoutput.C index 47be05ee..a967182f 100644 --- a/src/SIM/SIMoutput.C +++ b/src/SIM/SIMoutput.C @@ -207,14 +207,14 @@ void SIMoutput::preprocessResPtGroup (std::string& ptFile, ResPointVec& points) { for (ResPointVec::iterator p = points.begin(); p != points.end();) { - int pid = this->getLocalPatchIndex(p->patch); - if (pid < 1 || myModel[pid-1]->empty()) + ASMbase* pch = this->getPatch(p->patch,true); + if (!pch || pch->empty()) p = points.erase(p); - else if ((p->inod = myModel[pid-1]->evalPoint(p->u,p->u,p->X)) < 0) + else if ((p->inod = pch->evalPoint(p->u,p->u,p->X)) < 0) p = points.erase(p); else { - p->npar = myModel[pid-1]->getNoParamDim(); + p->npar = pch->getNoParamDim(); int ipt = 1 + (int)(p-points.begin()); if (ipt == 1) IFEM::cout <<'\n'; IFEM::cout <<"Result point #"<< ipt <<": patch #"<< p->patch; @@ -229,7 +229,7 @@ void SIMoutput::preprocessResPtGroup (std::string& ptFile, ResPointVec& points) if (p->npar > 1) IFEM::cout <<')'; if (p->inod > 0) IFEM::cout <<", node #"<< p->inod; if (p->inod > 0 && myModel.size() > 1) - IFEM::cout <<", global #"<< myModel[pid-1]->getNodeID(p->inod); + IFEM::cout <<", global #"<< pch->getNodeID(p->inod); IFEM::cout <<", X = "<< p->X << std::endl; p++; }