CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Bugs

Foam::CECCellToFaceStencil::CECCellToFaceStencil(. ..) is private

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 3, 2009, 11:22
Default Foam::CECCellToFaceStencil::CECCellToFaceStencil(. ..) is private
  #1
New Member
 
Join Date: Sep 2009
Posts: 2
Rep Power: 0
kovlensky is on a distinguished road
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
kovlensky is offline   Reply With Quote

Old   September 3, 2009, 11:57
Default
  #2
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
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)
)
)
mattijs is offline   Reply With Quote

Old   September 3, 2009, 12:45
Default
  #3
New Member
 
Join Date: Sep 2009
Posts: 2
Rep Power: 0
kovlensky is on a distinguished road
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 04:23.
kovlensky is offline   Reply With Quote

Old   September 13, 2009, 14:53
Default
  #4
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 185
Rep Power: 8
podallaire is on a distinguished road
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
podallaire is offline   Reply With Quote

Old   September 13, 2009, 21:05
Default
  #5
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
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 13, 2009 at 23:29. Reason: clarification
7islands is offline   Reply With Quote

Old   September 14, 2009, 04:18
Default
  #6
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
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.
mattijs is offline   Reply With Quote

Old   September 14, 2009, 07:34
Default
  #7
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 185
Rep Power: 8
podallaire is on a distinguished road
Guys, thanks for your answers and suggestions.

I did not patch all files yet but will do today.

Thanks

PO
podallaire is offline   Reply With Quote

Old   September 14, 2009, 11:31
Default
  #8
New Member
 
Cheng
Join Date: Apr 2009
Posts: 6
Rep Power: 8
jsltlx is on a distinguished road
Quote:
Originally Posted by podallaire View Post
Guys, thanks for your answers and suggestions.

I did not patch all files yet but will do today.

Thanks

PO
I'm using gcc-4.1.2 and having the same problem (I also asked this question here
problems with installing OpenFOAM 1.6 )

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 11:51.
jsltlx is offline   Reply With Quote

Old   September 15, 2009, 02:57
Default
  #9
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 13
henry is on a distinguished road
This problem is a bug in older releases of gcc, please try with gcc-4.3.3 as supplied with OpenFOAM-1.6.

H
henry is offline   Reply With Quote

Old   September 15, 2009, 09:50
Default
  #10
New Member
 
Cheng
Join Date: Apr 2009
Posts: 6
Rep Power: 8
jsltlx is on a distinguished road
Quote:
Originally Posted by henry View Post
This problem is a bug in older releases of gcc, please try with gcc-4.3.3 as supplied with OpenFOAM-1.6.

H
Dear Henry,

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
jsltlx is offline   Reply With Quote

Old   September 15, 2009, 10:09
Default
  #11
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 13
henry is on a distinguished road
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
henry is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is private data of fvMatrix declare public on purpose jaswi OpenFOAM 0 July 2, 2009 13:03
private tuition for a cfd assignment - payment ahmed Main CFD Forum 4 August 10, 2005 09: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 11:11


All times are GMT -4. The time now is 04:38.