Added: protected virtual method to renumber global node numbers in the model.

Applications that have private data depending on global node numbers
(e.g., nodal point load tables) need to overload this method.
This commit is contained in:
Knut Morten Okstad 2017-04-23 01:30:11 +02:00
parent 2f3f44ec63
commit 891798e639
2 changed files with 17 additions and 3 deletions

View File

@ -246,9 +246,9 @@ bool SIMbase::preprocess (const IntVec& ignored, bool fixDup)
if (renum > 0)
IFEM::cout <<"\nRenumbered "<< renum <<" nodes."<< std::endl;
for (mit = myModel.begin(); mit != myModel.end(); ++mit)
(*mit)->renumberNodes(*g2l);
ASMs2DC1::renumberNodes(*g2l);
// Apply the old-to-new node number mapping to all node tables in the model
if (!this->renumberNodes(*g2l))
return false;
// Perform specialized preprocessing before the assembly initialization.
// This typically involves the system-level Lagrange multipliers, etc.
@ -368,6 +368,17 @@ bool SIMbase::preprocess (const IntVec& ignored, bool fixDup)
}
bool SIMbase::renumberNodes (const std::map<int,int>& nodeMap)
{
bool ok = true;
for (PatchVec::const_iterator it = myModel.begin(); it != myModel.end(); ++it)
ok &= (*it)->renumberNodes(nodeMap);
ASMs2DC1::renumberNodes(nodeMap);
return ok;
}
void SIMbase::generateThreadGroups (const Property& p, bool silence)
{
ASMbase* pch = this->getPatch(p.patch);

View File

@ -480,6 +480,9 @@ protected:
virtual bool preprocessB() { return true; }
//! \brief Preprocesses the result sampling points.
virtual void preprocessResultPoints() = 0;
//! \brief Renumbers all global node numbers if the model.
//! \param[in] nodeMap Mapping from old to new node number
virtual bool renumberNodes(const std::map<int,int>& nodeMap);
//! \brief Extracts all local solution vector(s) for a specified patch.
//! \param[in] problem Integrand to receive the patch-level solution vectors