Added: Utilities ASMbase::getElementNodes and SIMbase::getElmNodes

This commit is contained in:
Knut Morten Okstad 2018-07-26 11:40:33 +02:00
parent b8695d24d4
commit 1910f350f3
4 changed files with 30 additions and 0 deletions

View File

@ -272,6 +272,15 @@ int ASMbase::getElmID (size_t iel) const
return abs(MLGE[iel-1]);
}
const IntVec& ASMbase::getElementNodes (int iel) const
{
if (iel > 0 && (size_t)iel <= MNPC.size())
return MNPC[iel-1];
static IntVec empty;
return empty;
}
unsigned char ASMbase::getNodalDOFs (size_t inod) const
{

View File

@ -254,6 +254,9 @@ public:
const IntVec& getMyNodeNums() const { return myMLGN; }
//! \brief Returns the actual global element numbers of this patch.
const IntVec& getMyElementNums() const { return myMLGE; }
//! \brief Returns the nodal point correspondance array for an element.
//! \param[in] iel 1-based element index local to current patch
const IntVec& getElementNodes(int iel) const;
//! \brief Returns number of bases of this patch.
virtual size_t getNoBasis() const { return 1; }
//! \brief Returns the total number of nodes in this patch.

View File

@ -609,6 +609,22 @@ size_t SIMbase::getNoElms (bool includeXelms) const
}
bool SIMbase::getElmNodes (IntVec& mnpc, int iel) const
{
if (mySam)
return mySam->getElmNodes(mnpc,iel);
else if (myModel.size() != 1)
{
std::cerr <<" *** SIMbase::getElmNodes: The nodal point correspondance is"
<<" unknown at this point in a multi-patch model."<< std::endl;
return false;
}
mnpc = myModel.front()->getElementNodes(iel);
return !mnpc.empty();
}
size_t SIMbase::getNoSolutions () const
{
return myProblem ? myProblem->getNoSolutions() : 0;

View File

@ -181,6 +181,8 @@ public:
int getGlobalNode(int node) const;
//! \brief Returns the process-local node number from a global node number.
int getLocalNode(int node) const;
//! \brief Finds the Matrix of Nodal Point Correspondance for element \a iel.
bool getElmNodes(std::vector<int>& mnpc, int iel) const;
//! \brief Finds the list of global nodes associated with a boundary.
//! \param[in] pcode Property code identifying the boundary