|
[Sponsors] |
May 5, 2020, 13:34 |
Problem with Templates during compilation
|
#1 |
New Member
Francesco Latella
Join Date: Apr 2020
Location: Bergamo, Italy
Posts: 15
Rep Power: 6 |
Hi guys, I have a problem during the compilation of my solver in OpenFOAM-7.
I'll explain a bit my work. I'm translating a solver that is a modified version of the original InterFoam of OpenFOAM version 2.2.1 where were added some conjugate heat transfer models in order to deal with solid mesh and liquid mesh with heat transfer between these two meshes. This solver (in version 2.2.1) was made by another person and my purpose is just to translate it in order to let it able to run in the last version of OpenFOAM (version 7). I think that I did it well, but when I'm going to compile I have a lot of errors with Templates. What I don't understand is why I have errors if those templates are the same as the templates used in the version 2.2.1. of the solver that I'm translating. They are related to .C files added to the solver for the conjugate heat tranfer model, but are original file of OpenFOAM (if I understood well). So why have I now these problems? I attach a piece of the error message here Code:
In file included from coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.C:31:0: /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/patchToPatchInterpolation.H:41:56: error: wrong number of template arguments (3, should be 2) PrimitivePatch<face, SubList, const pointField&>, ^ In file included from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/primitivePatch.H:35:0, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/polyPatch.H:43, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatch.H:39, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatchField.H:47, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatchFields.H:29, from coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.H:53, from coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.C:27: /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/PrimitivePatch.H:82:7: error: provided for ‘template<class FaceList, class PointField> class Foam::PrimitivePatch’ class PrimitivePatch Code:
/home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/patchToPatchInterpolation.H:41:56: error: wrong number of template arguments (3, should be 2) PrimitivePatch<face, SubList, const pointField&>, Please if you can help me because I'll be very gratefull. |
|
August 11, 2020, 10:51 |
Known bug
|
#2 |
New Member
Felix Hochwallner
Join Date: Nov 2019
Location: Vienna
Posts: 5
Rep Power: 7 |
Hello,
I had a similar problem once and the problem is a known bug due to an incorrect template for PrimitivePatch in patchToPatchInterpolation. Unfortunately https://bugs.openfoam.org/ is offline due to some database error right now, else I could link you to the bug report. If you still haven't figured out a solution, try to use the new Openfoam 8 template for PrimitivePatch. If this does not solve your problem I can provide you with a working example (maybe not the best looking code haha) Best, Felix |
|
August 13, 2020, 06:36 |
|
#3 | |
New Member
Francesco Latella
Join Date: Apr 2020
Location: Bergamo, Italy
Posts: 15
Rep Power: 6 |
Quote:
Hi Felix! You are maybe going to save my life ahaha thank you a lot! I've found a folder called "OpenFoamBugInterpolationTemplates" in https://bugs.openfoam.org/ but now actually I don't know how to use it. There is inside a potentialFoam.C file and a make folder, so maybe first of all I've to compile it, but then? How with this folder can I fix my problem? |
||
August 13, 2020, 07:07 |
|
#4 |
New Member
Francesco Latella
Join Date: Apr 2020
Location: Bergamo, Italy
Posts: 15
Rep Power: 6 |
Ok I found a code on github about the "patchToPatchInterpolation.H" file and I don't have anymore the error abouth this file, but I'm still not able to compie because now I've other errore, here the message
Code:
coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.C: In member function ‘virtual void Foam::regionCoupleTemperatureFvPatchScalarField::write(Foam::Ostream&) const’: coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.C:240:27: error: no matching function for call to ‘writeEntry(const char [6], Foam::Ostream&)’ writeEntry("value", os); ^ coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.C:240:27: note: candidates are: In file included from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/word.H:42:0, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/wordList.H:41, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/patchIdentifier.H:38, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/polyPatch.H:42, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatch.H:39, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatchField.H:47, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatchFields.H:29, from coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.H:53, from coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.C:27: /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/string.H:236:6: note: void Foam::writeEntry(Foam::Ostream&, const char*) void writeEntry(Ostream& os, const char* value); ^ /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/string.H:236:6: note: no known conversion for argument 1 from ‘const char [6]’ to ‘Foam::Ostream&’ /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/string.H:237:6: note: void Foam::writeEntry(Foam::Ostream&, const Foam::string&) void writeEntry(Ostream& os, const string& value); ^ /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/string.H:237:6: note: no known conversion for argument 1 from ‘const char [6]’ to ‘Foam::Ostream&’ In file included from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/wordList.H:41:0, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/patchIdentifier.H:38, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/polyPatch.H:42, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatch.H:39, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatchField.H:47, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatchFields.H:29, from coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.H:53, from coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.C:27: /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/word.H:138:6: note: void Foam::writeEntry(Foam::Ostream&, const Foam::word&) void writeEntry(Ostream& os, const word& value); ^ /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/word.H:138:6: note: no known conversion for argument 1 from ‘const char [6]’ to ‘Foam::Ostream&’ In file included from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/UList.H:46:0, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/List.H:43, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/wordList.H:42, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/patchIdentifier.H:38, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/polyPatch.H:42, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatch.H:39, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatchField.H:47, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatchFields.H:29, from coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.H:53, from coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.C:27: /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/label.H:69:13: note: void Foam::writeEntry(Foam::Ostream&, Foam::label) inline void writeEntry(Ostream& os, const label value) ^ /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/label.H:69:13: note: no known conversion for argument 1 from ‘const char [6]’ to ‘Foam::Ostream&’ In file included from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/floatScalar.H:119:0, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/scalar.H:39, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/zeroI.H:27, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/zero.H:107, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/UList.H:49, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/List.H:43, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/wordList.H:42, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/patchIdentifier.H:38, from /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/polyPatch.H:42, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatch.H:39, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatchField.H:47, from /home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatchFields.H:29, from coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.H:53, from coupledFvPatchFields/regionCoupleTemperature/regionCoupleTemperatureFvPatchScalarField.C:27: /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/Scalar.H:369:6: note: void Foam::writeEntry(Foam::Ostream&, Foam::floatScalar) void writeEntry(Ostream& os, const Scalar value); ^ /home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/Scalar.H:369:6: note: no known conversion for argument 1 from ‘const char [6]’ to ‘Foam::Ostream&’ |
|
August 13, 2020, 07:08 |
patchToPatchInterpolation.H Openfoam 7 Error
|
#5 | |
New Member
Felix Hochwallner
Join Date: Nov 2019
Location: Vienna
Posts: 5
Rep Power: 7 |
Quote:
https://bugs.openfoam.org/view.php?id=3463 The problem is the patchToPatchInterpolation.H file in the Openfoam 7 installation. You just need to change it with the new (Openfoam 8) file. The problem is, that the Openfoam 7 patchToPatchInterpolation.H file uses the old (Openfoam 6) primitivePatch definition, which doesn't work with the new (Openfoam 7/8) one. Therefore you get the error "wrong number of arguments". Here is the faulty patchToPatchInterpolation.H file of Openfoam 7: https://github.com/OpenFOAM/OpenFOAM...nterpolation.H Here is the new working patchToPatchInterpolation.H file of Openfoam 8: https://github.com/OpenFOAM/OpenFOAM...nterpolation.H Notice the difference in the primitivePatch declaration: Openfoam 7: PrimitivePatch<face, SubList, const pointField&> Openfoam 8: PrimitivePatch<SubList<face>, const pointField&> To solve your problem you simply have to replace your current patchToPatchInterpolation.H file in your Openfoam installation folder with the new patchToPatchInterpolation.H file from the Openfoam 8 repository. You could also simply overwrite the code. I hope I could help you with this! |
||
August 13, 2020, 07:35 |
|
#6 | |
New Member
Francesco Latella
Join Date: Apr 2020
Location: Bergamo, Italy
Posts: 15
Rep Power: 6 |
Quote:
Yes I did it, thank you! But as I said above, I've another series of messages that don't let me able to compile. I'm trying to fix them and I don't know if also this could be a bug of OpenFOAM, maybe is just a problem of translation by the version 2.2.1 to the servion 7. I will try. Anyway, thank you by new, very kind and helpfull. |
||
August 13, 2020, 07:41 |
|
#7 | |
New Member
Felix Hochwallner
Join Date: Nov 2019
Location: Vienna
Posts: 5
Rep Power: 7 |
Quote:
Seems like I was a bit too late, but good you could solve the other problem on your own! To the second error. It seems to me that you should change the order of the arguments in writeEntry, so from writeEntry("value", os); to writeEntry(os, "value"); |
||
Tags |
class, compilation error, new solver, template errors, wmake |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compilation problem on Linux System | Nitin Pathak | Fluent UDF and Scheme Programming | 6 | September 29, 2018 21:26 |
[OpenFOAM.com] [v3.0+] Compilation problem in Debian 8.2 | leguichet | OpenFOAM Installation | 1 | May 29, 2016 15:28 |
OpenFoam Extend-3.0 - libscotch 6.0 compilation Problem | rkc.cfd | OpenFOAM Installation | 4 | January 31, 2014 15:21 |
solver compilation problem, /bin/linux64GccDPOpt directory empty | arnaud6 | OpenFOAM Running, Solving & CFD | 0 | July 25, 2013 11:48 |
[swak4Foam] compilation problem | ganeshv | OpenFOAM Community Contributions | 5 | November 11, 2011 17:39 |