fixed: implement ASMu2Dmx::getCoord

need to use the correct spline object for the requested node
This commit is contained in:
Arne Morten Kvarving 2016-11-15 16:48:14 +01:00 committed by Kjetil Andre Johannessen
parent 877601c072
commit b2365bbeab
2 changed files with 22 additions and 0 deletions

View File

@ -668,3 +668,22 @@ bool ASMu2Dmx::refine (const LR::RefineData& prm,
return true; return true;
} }
Vec3 ASMu2Dmx::getCoord (size_t inod) const
{
size_t b = 0;
size_t nbb = 0;
while (nbb + nb[b] < inod && b < nb.size())
nbb += nb[b++];
++b;
const LR::Basisfunction* basis = this->getBasis(b)->getBasisfunction(inod-nbb-1);
if (!basis) {
std::cerr << "Asked to get coordinate for node " << inod
<< ", but only have " << this->getBasis(b)->nBasisFunctions()
<< " nodes in basis " << b << std::endl;
return Vec3();
}
return Vec3(&(*basis->cp()),nsd);
}

View File

@ -72,6 +72,9 @@ public:
//! \brief Returns the classification of a node. //! \brief Returns the classification of a node.
//! \param[in] inod 1-based node index local to current patch //! \param[in] inod 1-based node index local to current patch
virtual char getNodeType(size_t inod) const; virtual char getNodeType(size_t inod) const;
//! \brief Returns the global coordinates for the given node.
//! \param[in] inod 1-based node index local to current patch
virtual Vec3 getCoord(size_t inod) const;
//! \brief Initializes the patch level MADOF array for mixed problems. //! \brief Initializes the patch level MADOF array for mixed problems.
virtual void initMADOF(const int* sysMadof); virtual void initMADOF(const int* sysMadof);