CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Class Time constructor (https://www.cfd-online.com/Forums/openfoam-programming-development/126684-class-time-constructor.html)

maybee November 23, 2013 09:59

Class Time constructor
 
Hi,

I have some question about a few lines of the Class Time constructor.

1.
Code:

397* libs_(),  //dlLibraryTable libs_; //- Any loaded dynamic libraries. Make sure
                                                  //to construct before reading controlDict.       
398*            //operator () : T& operator() (const Key& key) inline 
                  //Find and return a hashedEntry, create it null if not present.
                  //template<class T, class Key, class Hash>
                  //inline T& Foam::HashTable<T, Key, Hash>::operator()(const Key& key)
                  //{
                  //iterator iter = this->find(key);
                  //if (iter == this->end())
                  //  {
                  //this->insert(key, T());
                  //return *find(key);
                  //  }
                  //else
                  // {
                  //return *iter;
                  // }
                  //}

First of all, have I found the right overloaded operator () ? If yes, what does the happen here?

2.
Code:

417* writeControl_(wcTimeStep),
with
Code:

//enum writeControls
      //wcTimeStep
      //wcRunTime
      //wcAdjustableRunTime*
      //wcClockTime*
      //wcCpuTime

What do the the single options in the enum mean?

3.
Code:

418* writeInterval_(GREAT),  //scalar writeInterval_;, GREAT ?
What is the variable GREAT and where to find it?

4.
Code:

420* secondaryWriteInterval_(labelMax/10.0),    //scalar secondaryWriteInterval_;
What is the variable labelMax and where to find it?

wyldckat November 24, 2013 16:49

Greetings maybee,

Given the range of questions you've been asking, I suggest that you read and study the following:
And you can use Google to help you search for things, for example:
Code:

site:foam.sourceforge.net/docs/cpp/ labelMax
And on Github you can also search for things in OpenFOAM's source code: https://github.com/OpenFOAM/OpenFOAM-2.2.x/ - the search bar is on the top of the page.

Good luck! Best regards,
Bruno

maybee November 25, 2013 06:38

Hi,

first of all thanks for the links. Surely I'll read the programmers guide at some point and the forum and github link could come in handy, too.

Furthermore I know a lot about the basics of c++ programming, google really does not help me with my questions and I just can't find the descriptions I am searching for (see QUestion 2,3,4).

wyldckat November 25, 2013 16:05

Hi maybee,
Quote:

Originally Posted by maybee (Post 463382)
Furthermore I know a lot about the basics of c++ programming, google really does not help me with my questions and I just can't find the descriptions I am searching for (see QUestion 2,3,4).


Mmm... well, Google can help find things in some other situations, but I guess that Github would be better for finding code definitions in OpenFOAM's code.

Best regards,
Bruno


All times are GMT -4. The time now is 04:16.