CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   mesh_(U.mesh()), (http://www.cfd-online.com/Forums/openfoam/90619-mesh_-u-mesh.html)

Tarak July 15, 2011 15:58

mesh_(U.mesh()),
 
Hii,

Can someone please let me know what the expressions runTime_(U.time()) and mesh_(U.mesh()) do in the following lines?

regIOobject
(
IOobject
(
turbulenceModelName,
U.time().constant(),
U.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
)
),
runTime_(U.time()),
mesh_(U.mesh()),

U_(U),
phi_(phi),
transportModel_(transport)


Thanks,
Tarak

marupio July 16, 2011 16:08

Not much context, but it looks like this is a constructor initialization list. The object under construction has a reference to the mesh and runTime. You'll find data members in its header file:
Code:

fvMesh& mesh_;
Time& runTime_;

Possibly with "const" in front. This means the object stores the location of runTime and the mesh for easy access. These are not copies - they are references (kind of like pointers). All references must be initialized during construction. That is the purpose of those lines... giving the references their addresses.


All times are GMT -4. The time now is 02:24.