|
[Sponsors] |
January 8, 2014, 07:40 |
Method flux(...) of FOAM::fvc namespace
|
#1 |
Senior Member
Join Date: Jan 2012
Posts: 166
Rep Power: 14 |
When looking at the code of the following flux method
Code:
template<class Type> 43 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > 44 flux 45 ( 46 const surfaceScalarField& phi, 47 const GeometricField<Type, fvPatchField, volMesh>& vf, 48 const word& name 49 ) 50 { 51 return fv::convectionScheme<Type>::New 52 ( 53 vf.mesh(), 54 phi, 55 vf.mesh().divScheme(name) 56 )().flux(phi, vf); 57 } Can someone tell me where to find the operator (), because in "fv::convectionScheme<Type>" I can't find them? greetings maybee |
|
January 8, 2014, 08:02 |
|
#2 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21 |
Please correct me if I'm wrong.
The operator(), is not of the class fv::convectionScheme, but from the class of the return type of fvc::convectionScheme::New. I.e, of the class tmp<Type>, i.e.: http://foam.sourceforge.net/docs/cpp...ce.html#l00184 The reason it is there, is for some smart handling of pointers. For more info on the tmp class, you can read here http://openfoamwiki.net/index.php/OpenFOAM_guide/tmp I think the operator() (which is called dereference operator), as far as I know makes sure the object becomes a "real" object, and not just a pointer to the object. I hope this helps and I hope anyone can correct me if I made a conceptual mistake here |
|
January 8, 2014, 15:21 |
|
#3 | |
Senior Member
Join Date: Jan 2012
Posts: 166
Rep Power: 14 |
Hi,
1. So the "<Type>" within "fv::convectionScheme<Type>" in this case is "tmp" and therefore the operator () of class tmp is called? 2. Lets say 1. is true. When calling operator on Code:
fv::convectionScheme<Type>::New ( vf.mesh(), phi, vf.mesh().divScheme(name) ) 3. Afterwards on the geometricField is called Code:
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > flux ( const surfaceScalarField&, const GeometricField< Type, fvPatchField, volMesh > & pure virtual ) const Quote:
|
||
January 9, 2014, 03:20 |
|
#4 | |||
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21 |
Quote:
See: src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C (line 57 for example). Code:
tmp<convectionScheme<Type> > convectionScheme<Type>::New Quote:
Quote:
|
||||
January 9, 2014, 05:02 |
|
#5 | |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
Quote:
[Edit] Bernhard wins this one, the comments in the code actually do refer to the operator as dereference: http://foam.sourceforge.net/docs/cpp...ad06354be9ca09
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
||
January 9, 2014, 12:01 |
|
#6 | |
Senior Member
Join Date: Jan 2012
Posts: 166
Rep Power: 14 |
Quote:
http://foam.sourceforge.net/docs/cpp...ce.html#l00045 Afterwards just click at the second flux method within the flux method of the link, you will be forwarded to the flux method above. Got the rest now. Thx for the help. Obviously I slept a little bit when looking at the code . Last edited by maybee; January 9, 2014 at 13:26. |
||
January 10, 2014, 03:08 |
|
#7 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21 |
||
January 10, 2014, 05:38 |
|
#8 | |
Senior Member
Join Date: Jan 2012
Posts: 166
Rep Power: 14 |
Quote:
I just wanted to show the way I had found the method to make sure it is the right one, but here we go: http://foam.sourceforge.net/docs/cpp...071d0d5b6d6208 |
||
January 10, 2014, 06:44 |
|
#9 | |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21 |
Quote:
|
||
January 10, 2014, 06:54 |
|
#10 |
Senior Member
Join Date: Jan 2012
Posts: 166
Rep Power: 14 |
Hi,
the quesiton is solved. I just misinterpreted "fv::convectionScheme<Type>::New" and did not realize that the method is of type tmp, Therefore I was wondering what operator () is used. greetings maybee |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
chtMultiRegionFoam heat flux | sailor79 | OpenFOAM Running, Solving & CFD | 0 | September 27, 2013 09:08 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 07:28 |
Info on method of lines approach | charlie ryan | Main CFD Forum | 2 | August 9, 2007 12:06 |
UDS flux and boundaries | Kasper Skriver | FLUENT | 0 | April 18, 2006 09:36 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 21:09 |