diff --git a/src/ASM/ASMbase.C b/src/ASM/ASMbase.C index d9769cfe..cd5a367c 100644 --- a/src/ASM/ASMbase.C +++ b/src/ASM/ASMbase.C @@ -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 { diff --git a/src/ASM/ASMbase.h b/src/ASM/ASMbase.h index 345b83a9..36060df1 100644 --- a/src/ASM/ASMbase.h +++ b/src/ASM/ASMbase.h @@ -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. diff --git a/src/SIM/SIMbase.C b/src/SIM/SIMbase.C index 5897a358..fceeb35b 100644 --- a/src/SIM/SIMbase.C +++ b/src/SIM/SIMbase.C @@ -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; diff --git a/src/SIM/SIMbase.h b/src/SIM/SIMbase.h index 7c004381..01d5fad4 100644 --- a/src/SIM/SIMbase.h +++ b/src/SIM/SIMbase.h @@ -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& mnpc, int iel) const; //! \brief Finds the list of global nodes associated with a boundary. //! \param[in] pcode Property code identifying the boundary