CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

U_.mesh() and mesh.

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By jhoepken

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 3, 2013, 23:28
Default U_.mesh() and mesh.
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Hi guys,

Code:
alpha1_
    (
        IOobject
        (
            found("phases") ? word("alpha" + phase1Name_) : alpha1Name,
            U_.time().timeName(),
            U_.db(),
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        U_.mesh()// mesh
    ),
In this piece of code, can I turn it into"mesh"? Whats the dfference between U_.mesh() and mesh?
Thanks in advance.
sharonyue is offline   Reply With Quote

Old   September 4, 2013, 06:43
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Hi Sharonyue,

From the looks of it, this seems like a part of a constructor of a class. So if there is a mesh-object passed as argument with the constructor, then you can change U_.mesh() by mesh. But there probably isn't. Just ask yourself the question, why would you pass both U and mesh as arguments, when U already has a reference to the same mesh object...

Cheers,

Lieven
Lieven is offline   Reply With Quote

Old   September 4, 2013, 09:34
Default
  #3
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
Bernhard is on a distinguished road
Where is your code snippet from? Is it a default OpenFOAM piece?

Anyhow, I would guess you are just passing around pointers here, so constructing this field one way or the other does not really make a difference.
Bernhard is offline   Reply With Quote

Old   September 10, 2013, 03:24
Default
  #4
Senior Member
 
Jens Höpken
Join Date: Apr 2009
Location: Duisburg, Germany
Posts: 159
Rep Power: 17
jhoepken is on a distinguished road
Send a message via Skype™ to jhoepken
As Lieven stated, this is part of the initialization list of a constructor. Apparently the mesh itself is not registered in this class and not passed as a parameter, either. The volVectorField U_ is of generic type GeometricField<...> and stores a reference to the mesh as a private class attribute. It can be accessed by the public mesh() member function of GeometricField<...>.

In this class itself, it is very unlikely that you can substitute U_.mesh() with mesh. Why would you like to do this?
Minghao_Li likes this.
jhoepken is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Star CCM Overset Mesh Error (Rotating Turbine) thezack Siemens 7 October 12, 2016 11:14
[ICEM] surface mesh merging problem everest ANSYS Meshing & Geometry 44 April 14, 2016 06:41
Inner geometry gets lost exporting mesh from ICEM CFD to CFX-Pre powpow CFX 3 December 20, 2012 09:14
[ICEM] Problem making structural mesh on a surface froztbear ANSYS Meshing & Geometry 1 November 10, 2011 08:52
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11


All times are GMT -4. The time now is 22:55.