|
[Sponsors] |
Foam::CECCellToFaceStencil::CECCellToFaceStencil(. ..) is private |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 3, 2009, 12:22 |
Foam::CECCellToFaceStencil::CECCellToFaceStencil(. ..) is private
|
#1 |
New Member
Join Date: Sep 2009
Posts: 2
Rep Power: 0 |
I'm just trying to compile OpenFOAM-1.6 and I get such error message (many,may times):
lnInclude/CECCellToFaceStencil.H: In constructor âFoam::centredCECCellToFaceStencilObject::centredC ECCellToFaceStencilObject(const Foam::fvMesh&)â: lnInclude/CECCellToFaceStencil.H:57: error: âFoam::CECCellToFaceStencil::CECCellToFaceStencil( const Foam::CECCellToFaceStencil&)â is private lnInclude/centredCECCellToFaceStencilObject.H:69: error: within this context As this is clearly source code bug - could anyone let me know what should be modified? Regards, kovlensky |
|
September 3, 2009, 12:57 |
|
#2 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
This is a compiler 'feature'. Gcc 4.3.3 does not have any problems with it, older versions do.
As a workaround do an explicit cast: replace extendedCentredCellToFaceStencil(CECCellToFaceSten cil(mesh)) with extendedCentredCellToFaceStencil ( static_cast<const cellToFaceStencil&> ( CECCellToFaceStencil(mesh) ) ) |
|
September 3, 2009, 13:45 |
|
#3 |
New Member
Join Date: Sep 2009
Posts: 2
Rep Power: 0 |
Hi Mattijs,
Thank you very much for your answer. As you sure it should solve the problem? To be completely sure: in file src/finiteVolume/lnInclude/CFCCellToFaceStencil.H replace line 70, which is: extendedCentredCellToFaceStencil(CECCellToFaceSten cil(mesh)) with extendedCentredCellToFaceStencil( static_cast<const cellToFaceStencil&>(CECCellToFaceStencil(mesh))) I did that and it crashes exactly like it did before. And you're right, gcc is 4.1. But I'd rather use system one than install another one and maintain it afterwards. And updating the system is out of question unfortunately. Regards, kovlensky Last edited by kovlensky; September 4, 2009 at 05:23. |
|
September 13, 2009, 15:53 |
|
#4 |
Senior Member
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 192
Rep Power: 17 |
Mattijs,
could you confirm that all files in folder OpenFOAM-1.6.x/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/ should be modified using the same syntax ? I've been struggling with this problem for a while and I would really appreciate if you could clarify this patch. Best regards, PO |
|
September 13, 2009, 22:05 |
|
#5 |
Super Moderator
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20 |
Hi,
As far as I see the topic was reported on the gcc-list (see the "Copy constructor access check while initializing a reference" section of the link provided by the reporter for the detailed description of the topic): http://gcc.gnu.org/ml/gcc/2008-03/msg00183.html I would be very interested too if anyone tries a workaround written in the link provided by the poster of the email above (create a member function that returns a const reference to *this). Shall try myself but next week at the earliest... Takuya Last edited by 7islands; September 14, 2009 at 00:29. Reason: clarification |
|
September 14, 2009, 05:18 |
|
#6 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
Hi PO,
yes, you'll have to patch all the other files in a similar way. Did that patch fix your CFCCellToFaceStencil.H problem? (warning, there are a lot of files with similar names) Hi Takuya, interesting - I'll have a look. |
|
September 14, 2009, 08:34 |
|
#7 |
Senior Member
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 192
Rep Power: 17 |
Guys, thanks for your answers and suggestions.
I did not patch all files yet but will do today. Thanks PO |
|
September 14, 2009, 12:31 |
|
#8 | |
New Member
Cheng
Join Date: Apr 2009
Posts: 6
Rep Power: 17 |
Quote:
http://www.cfd-online.com/Forums/ope...oam-1-6-a.html ) I tried to change the following files in src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects: centredCECCellToFaceStencilObject.H, centredCFCCellToFaceStencilObject.H, centredCPCCellToFaceStencilObject.H, centredFECCellToFaceStencilObject.H, and pureUpwindCFCCellToFaceStencilObject.H (I didn't change files upwind*CellToFaceStencilObject.H since I'm not sure what to do), and I still had the same errors. Since I really wanted to get this to work, so I tried something that may seem silly to all of you, especially OF developpers (I must admit that I do NOT know what I was doing, but this might give you some hints what could be the problem). Here is what I did: in file src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H, moved "public:" several lines above to change the copy constructor from private to public, i.e. public: //- Disallow default bitwise copy construct CECCellToFaceStencil(const CECCellToFaceStencil&); //- Disallow default bitwise assignment void operator=(const CECCellToFaceStencil&); Same thing for CFCCellToFaceStencil.H, CPCCellToFaceStencil.H, and FECCellToFaceStencil.H in the same directory. Also same thing for src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.H. After these changes (no changes to files in src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects ), I didn't see the reported errors anymore. (there were some unrelated errors while compiling activeBaffleVelocityFvPatchVectorField.C, directMappedFixedValueFvPatchFields.C, and directMappedVelocityFluxFixedValueFvPatchField.C. However, "wmake libso finteVolume" was successful after I commented the lines related to these three files in src/finiteVolume/Make/files) However, there are still other errors (which I believe was not because of the changes I made) while compiling with gcc-4.1.2. For example, while doing "wmake libso dynamicMesh", I got the following error: slidingInterface/enrichedPatch/enrichedPatchMasterPoints.C: In member function 'void Foam::enrichedPatch::calcMasterPointFaces() const': slidingInterface/enrichedPatch/enrichedPatchMasterPoints.C:78: error: no matching function for call to 'Foam:: DynamicList<int, 0u, 2u, 1u>:: DynamicList(Foam:: DynamicList<int, 0u, 2u, 1u>)' slidingInterface/enrichedPatch/enrichedPatchMasterPoints.C:117: error: no matching function for call to 'Foam:: DynamicList<int, 0u, 2u, 1u>:: DynamicList(Foam:: DynamicList<int, 0u, 2u, 1u>)' While doing "wmake libso autoMesh", I got the following error: autoHexMesh/meshRefinement/meshRefinement.C: In member function 'void Foam::meshRefinement::calcNeighbourData(Foam::labe lList&, Foam:: pointField&) const': autoHexMesh/meshRefinement/meshRefinement.C:87: error: call of overloaded 'HashSet(Foam::labelList)' is ambiguous ~/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude/HashSet.H:98: note: candidates are: Foam::HashSet<Key, Hash>::HashSet(const Foam::HashSet<Key, Hash>&) [with Key = int, Hash = Foam::Hash<int>] ~/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude/HashSet.H:87: note: Foam::HashSet<Key, Hash>::HashSet(const Foam::UList<T>&) [with Key = int, Hash = Foam::Hash<int>] Any help on this will be highly appreciated. Thanks. Cheng Last edited by jsltlx; September 14, 2009 at 12:51. |
||
September 15, 2009, 03:57 |
|
#9 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
This problem is a bug in older releases of gcc, please try with gcc-4.3.3 as supplied with OpenFOAM-1.6.
H |
|
September 15, 2009, 10:50 |
|
#10 | |
New Member
Cheng
Join Date: Apr 2009
Posts: 6
Rep Power: 17 |
Quote:
Thanks for the information. I understand that it's a problem with gcc, not OF itself. It would be nice if we have a workaround for this, since some users like me may not be able to install our own compilers (due to the special architecture of the system etc.). Thanks again to you and other OF developers for this nice tool for CFD. Cheng |
||
September 15, 2009, 11:09 |
|
#11 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
gcc need not be installed in the standard system location; you can install gcc-4.3.3 in OpenFOAM/ThirdParty-1.6 for example and set your environment variables appropriately as we did for the release of OpenFOAM-1.6. This way your use of gcc-4.3.3 for OpenFOAM does not interfere with the rest of the system or other applications you run.
H |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is private data of fvMatrix declare public on purpose | jaswi | OpenFOAM | 0 | July 2, 2009 14:03 |
private tuition for a cfd assignment - payment | ahmed | Main CFD Forum | 4 | August 10, 2005 10:15 |
How can I run a private GENTRA | ben | Phoenics | 3 | January 6, 2004 07:48 |
Site devoted to private experience of application | Dr. A.Ivanov | Phoenics | 6 | November 28, 2002 05:05 |
Private Ground | Mohamed Ouzzane | Phoenics | 4 | June 10, 2002 12:11 |