multiphaseEulerFoam: Method forAllIter(...) within solve()
hi,
within method solve() of multiphaseEulerFoam is found: Code:
void Foam::multiphaseSystem::solve() Code:
forAllIter (...) is defined as Where can I find the class (or struct?) "Container::iterator" , because I need to know what the operator () is doing when called on "iter" ? greetings maybee |
I don't know if this answers your Question, but here is some code of the file $FOAM_SRC/OpenFOAM/containers/PtrListI.H
I assume that phases_ is a pointer list or is based on a pointer list. So my guess is that phases_ is a dynamic data structure and iter() returns the actual element of this list. So iter().correct() calls the correct() method of the phase class. Code:
template<class T> |
hi,
first of all thx for the help, but I am not really sure if the operators you have listed are the right ones, because when I look in class multiphaseSystem (multiphaseSystem.H) I find for phases_ : Code:
PtrDictionary<phaseModel> phases_; //in multiphaseSystem.H However, when looking at the methods you' ve posted I think they could be the right ones since iterator iter is some kind of pointer and phases_ is a pointer dictionary -> the double dereferenziation therefore seems logical. How could you find these operators and how can I be sure that these are the right ones, since even when I look in class PtrList<T> I can't find them? greetings maybee |
The answer to your question is inhertitance and polymorphism. Both are concepts in computer science and C++ implements them.
phases_ is of the type PtrDictionary<T> The T means any data type that is compatible with all the operations performed on T. If the class PtrDictionary does not define an operator (), then this class must have inherited this operator, otherwise the compiler would throw an error when compiling OpenFOAM. Take a look from which class PtrDictionary is derived and then check this class. Note: C++ allows multiple inhertitance, i.e. class X can be derived from the classes A and B. Somewhere up the family tree you will find a definition for the operator or function you are interested in. |
Quote:
http://foam.sourceforge.net/docs/cpp...ce.html#l00055 Also here I canīt find the operator (). See: http://foam.sourceforge.net/docs/cpp...ce.html#l00055 and http://foam.sourceforge.net/docs/cpp/a06384_source.html |
All times are GMT -4. The time now is 21:19. |