|
[Sponsors] |
December 29, 2018, 19:01 |
'this->' in OpenFOAM
|
#1 |
Member
Tony Zahtila
Join Date: Mar 2016
Posts: 33
Rep Power: 10 |
Hi all,
I am having some trouble understanding the sequence, 'this->' in OpenFOAM. Code:
template<class ParcelType> template<class TrackCloudType> void Foam::KinematicParcel<ParcelType>::setCellValues ( TrackCloudType& cloud, trackingData& td ) { tetIndices tetIs = this->currentTetIndices(); td.rhoc() = td.rhoInterp().interpolate(this->coordinates(), tetIs); if (td.rhoc() < cloud.constProps().rhoMin()) { if (debug) { WarningInFunction << "Limiting observed density in cell " << this->cell() << " to " << cloud.constProps().rhoMin() << nl << endl; } td.rhoc() = cloud.constProps().rhoMin(); } td.Uc() = td.UInterp().interpolate(this->coordinates(), tetIs); td.muc() = td.muInterp().interpolate(this->coordinates(), tetIs); } \textbf{a$\rightarrow$b} \textbf{(this$ \rightarrow b$)}, shorthand notation for (*a).b With $a \rightarrow$ b, b will be a member of the object the pointer a refers to. If, however, a is an object of a class that overloads this operator, then the overloaded operator function gets invoked. Every object in C++ has access to its own address though an important pointer called 'this'. Let's take for example the following sequence: Code:
this->currentTetIndices() I appreciate any help that comes my way. Kind regards. |
|
December 30, 2018, 11:12 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
The right arrow is a regular pointer-to-member. If you scan the inheritance of the class, you will find the corresponding method in the hierarchy.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM Training Beijing 22-26 Aug 2016 | cfd.direct | OpenFOAM Announcements from Other Sources | 0 | May 3, 2016 05:57 |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 14:36 |
[Salome] hdf file example --> Internal faces Salome --> OpenFOAM | student666 | OpenFOAM Meshing & Mesh Conversion | 1 | December 7, 2013 11:09 |
CAD -> gMsh -> enGrid -> OpenFOAM Problem | AlGates | OpenFOAM | 7 | August 6, 2010 13:46 |
[Netgen] Geometry > Netgen > OpenFOAM | ericnutsch | OpenFOAM Meshing & Mesh Conversion | 9 | February 22, 2010 08:39 |