About the Iter class

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
burnningcat
Posts: 50
Joined: Mon Jun 18, 2007 1:10 am
Location: ROMA

About the Iter class

Post by burnningcat »

Dear FMK,

There are some iter class in OpenSees . For example, the FE_EleIter is an iter for returning the FE_Elements of an object of class AnalysisModel.

FE_Element *elePtr;
FE_EleIter &theEles2 = theAnalysisModel->getFEs();


while((elePtr = theEles2()) != 0) {
if (theSOE->addB(elePtr->getResidual(this),elePtr->getID()) <0) {
opserr << "WARNING IncrementalIntegrator::formElementResidual -";
opserr << " failed in addB for ID " << elePtr->getID();
res = -2;
}
}

I need to check how many FE_Element in the AnalysisModel totally, is there a way to print theFE_EleIter list? It is an abstract object , and it doesn’t have the Print() function. So would you please teach me, except to use the “while…”, how to get the list of this FE_EleIter in the Analysis? Thank you very much!
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

there is no way to print the list .. we never needed the # of elements in the list .. suggest you iterate through and use a counter for now.
Post Reply