added: SAM::getUniqueEqns
this returns the unique equations for a given element. in particular it resolves MPC couplings
This commit is contained in:
parent
6d42ff4e22
commit
bebf8c1313
@ -720,6 +720,32 @@ bool SAM::getElmEqns (IntVec& meen, int iel, int nedof) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SAM::getUniqueEqns (IntSet& meen, int iel) const
|
||||||
|
{
|
||||||
|
meen.clear();
|
||||||
|
|
||||||
|
IntVec meenTmp;
|
||||||
|
if (!this->getElmEqns(meenTmp, iel))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (int jeq : meenTmp)
|
||||||
|
{
|
||||||
|
if (jeq < 0)
|
||||||
|
{
|
||||||
|
int jpmceq1 = mpmceq[-jeq-1];
|
||||||
|
int jpmceq2 = mpmceq[-jeq]-1;
|
||||||
|
for (int jp = jpmceq1; jp < jpmceq2; ++jp)
|
||||||
|
if (mmceq[jp] > 0)
|
||||||
|
meen.insert(meqn[mmceq[jp]-1]);
|
||||||
|
}
|
||||||
|
else if (jeq != 0)
|
||||||
|
meen.insert(jeq);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t SAM::getNoElmEqns (int iel) const
|
size_t SAM::getNoElmEqns (int iel) const
|
||||||
{
|
{
|
||||||
size_t result = 0;
|
size_t result = 0;
|
||||||
|
@ -196,6 +196,8 @@ public:
|
|||||||
//! \brief Returns the number equations for an element.
|
//! \brief Returns the number equations for an element.
|
||||||
//! \param[in] iel Identifier for the element to get number of equations for
|
//! \param[in] iel Identifier for the element to get number of equations for
|
||||||
size_t getNoElmEqns(int iel) const;
|
size_t getNoElmEqns(int iel) const;
|
||||||
|
//! \brief Finds the matrix of unique equation numbers for an element.
|
||||||
|
bool getUniqueEqns(IntSet& meen, int iel) const;
|
||||||
|
|
||||||
//! \brief Finds the matrix of equation numbers for a node.
|
//! \brief Finds the matrix of equation numbers for a node.
|
||||||
//! \param[out] mnen Matrix of node equation numbers
|
//! \param[out] mnen Matrix of node equation numbers
|
||||||
|
Loading…
Reference in New Issue
Block a user