MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
InitialAssemblyIterator Class Reference

#include <dataman.h>

Collaboration diagram for InitialAssemblyIterator:

Public Member Functions

 InitialAssemblyIterator (const DataManager::ElemDataStructure(*pED)[Elem::LASTELEMTYPE])
 
InitialAssemblyElemGetFirst (void) const
 
InitialAssemblyElemGetNext (void) const
 

Private Attributes

const
DataManager::ElemDataStructure(* 
pElemData )[Elem::LASTELEMTYPE]
 
Elem::Type m_FirstType
 
DataManager::ElemContainerType::const_iterator m_CurrElem
 
Elem::Type m_CurrType
 

Detailed Description

Definition at line 1094 of file dataman.h.

Constructor & Destructor Documentation

InitialAssemblyIterator::InitialAssemblyIterator ( const DataManager::ElemDataStructure(*)  pED[Elem::LASTELEMTYPE])

Definition at line 737 of file elman.cc.

References ASSERT, m_CurrElem, m_CurrType, m_FirstType, and pElemData.

739 : pElemData(pED),
742 {
743  int iCnt = 0;
744 
745  while (!(*pElemData)[iCnt].bToBeUsedInAssembly()
746  || (*pElemData)[iCnt].ElemContainer.empty())
747  {
748  if (++iCnt >= Elem::LASTELEMTYPE) {
749  break;
750  }
751  }
752 
753  // NOTE: this fails if by chance there's no element
754  // that participates in initial assembly
755  ASSERT(iCnt < Elem::LASTELEMTYPE);
756  ASSERT((*pElemData)[iCnt].ElemContainer.begin() != (*pElemData)[iCnt].ElemContainer.end());
757 
759  m_CurrElem = (*pElemData)[m_FirstType].ElemContainer.begin();
760 }
Elem::Type m_FirstType
Definition: dataman.h:1097
const DataManager::ElemDataStructure(* pElemData)[Elem::LASTELEMTYPE]
Definition: dataman.h:1096
DataManager::ElemContainerType::const_iterator m_CurrElem
Definition: dataman.h:1098
Elem::Type m_CurrType
Definition: dataman.h:1099
#define ASSERT(expression)
Definition: colamd.c:977
Type
Definition: elem.h:91

Member Function Documentation

InitialAssemblyElem * InitialAssemblyIterator::GetFirst ( void  ) const

Definition at line 763 of file elman.cc.

References GetNext(), Elem::LASTELEMTYPE, m_CurrElem, m_CurrType, m_FirstType, MBDYN_EXCEPT_ARGS, and NestedElem::pGetElem().

Referenced by DataManager::InitialJointAssembly().

764 {
765  // FIXME: this should not happen: if there are no elements
766  // that need initial assembly, we shouldn't get here in the
767  // first place
770  }
771 
773  m_CurrElem = (*pElemData)[m_FirstType].ElemContainer.begin();
774 
775  /* La variabile temporanea e' necessaria per il debug. */
776  InitialAssemblyElem* p = dynamic_cast<InitialAssemblyElem *>(m_CurrElem->second);
777  if (p == 0) {
778  DrivenElem *pDE = dynamic_cast<DrivenElem *>(m_CurrElem->second);
779  if (pDE != 0) {
780  p = dynamic_cast<InitialAssemblyElem *>(pDE->pGetElem());
781  }
782  if (p == 0) {
783  p = GetNext();
784  }
785  }
786 
787  return p;
788 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Elem::Type m_FirstType
Definition: dataman.h:1097
DataManager::ElemContainerType::const_iterator m_CurrElem
Definition: dataman.h:1098
Elem::Type m_CurrType
Definition: dataman.h:1099
InitialAssemblyElem * GetNext(void) const
Definition: elman.cc:791
virtual Elem * pGetElem(void) const
Definition: nestedelem.cc:60

Here is the call graph for this function:

InitialAssemblyElem * InitialAssemblyIterator::GetNext ( void  ) const

Definition at line 791 of file elman.cc.

References ASSERT, Elem::LASTELEMTYPE, m_CurrElem, m_CurrType, pElemData, NestedElem::pGetElem(), and psElemNames.

Referenced by GetFirst(), and DataManager::InitialJointAssembly().

792 {
793  InitialAssemblyElem* p = 0;
794  do {
795  ++m_CurrElem;
796  if (m_CurrElem == (*pElemData)[m_CurrType].ElemContainer.end()) {
797  int iCnt = int(m_CurrType);
798 
799  do {
800  if (++iCnt >= Elem::LASTELEMTYPE) {
801  return 0;
802  }
803  } while (!(*pElemData)[iCnt].bToBeUsedInAssembly()
804  || (*pElemData)[iCnt].ElemContainer.empty());
805 
806  ASSERT((*pElemData)[iCnt].ElemContainer.begin() != (*pElemData)[iCnt].ElemContainer.end());
807  m_CurrType = Elem::Type(iCnt);
808  m_CurrElem = (*pElemData)[iCnt].ElemContainer.begin();
809  }
810 
811  /* La variabile temporanea e' necessaria per il debug. */
812  p = dynamic_cast<InitialAssemblyElem *>(m_CurrElem->second);
813 
814  if (p == 0) {
815  DrivenElem *pDE = dynamic_cast<DrivenElem *>(m_CurrElem->second);
816  if (pDE != 0) {
817  p = dynamic_cast<InitialAssemblyElem *>(pDE->pGetElem());
818  }
819  }
820 
821 #ifdef DEBUG
822  if (p == 0) {
823  silent_cerr(psElemNames[m_CurrElem->second->GetElemType()]
824  << "(" << m_CurrElem->second->GetLabel() << ")"
825  " is not subjected to initial assembly"
826  << std::endl);
827  }
828 #endif
829  } while (p == 0);
830 
831  return p;
832 }
const DataManager::ElemDataStructure(* pElemData)[Elem::LASTELEMTYPE]
Definition: dataman.h:1096
DataManager::ElemContainerType::const_iterator m_CurrElem
Definition: dataman.h:1098
Elem::Type m_CurrType
Definition: dataman.h:1099
#define ASSERT(expression)
Definition: colamd.c:977
Type
Definition: elem.h:91
const char * psElemNames[]
Definition: enums.cc:39
virtual Elem * pGetElem(void) const
Definition: nestedelem.cc:60

Here is the call graph for this function:

Member Data Documentation

DataManager::ElemContainerType::const_iterator InitialAssemblyIterator::m_CurrElem
mutableprivate

Definition at line 1098 of file dataman.h.

Referenced by GetFirst(), GetNext(), and InitialAssemblyIterator().

Elem::Type InitialAssemblyIterator::m_CurrType
mutableprivate

Definition at line 1099 of file dataman.h.

Referenced by GetFirst(), GetNext(), and InitialAssemblyIterator().

Elem::Type InitialAssemblyIterator::m_FirstType
mutableprivate

Definition at line 1097 of file dataman.h.

Referenced by GetFirst(), and InitialAssemblyIterator().

const DataManager::ElemDataStructure(* InitialAssemblyIterator::pElemData)[Elem::LASTELEMTYPE]
private

Definition at line 1096 of file dataman.h.

Referenced by GetNext(), and InitialAssemblyIterator().


The documentation for this class was generated from the following files: