SimFlowCFD / RapidCFD-dev

RapidCFD is an OpenFOAM fork running fully on CUDA platform. Brought to you by
https://sim-flow.com
Other
325 stars 94 forks source link

Compiling custom application #26

Closed KingKraut closed 7 years ago

KingKraut commented 7 years ago

Dear all,

I realise this project is not prevailing anymore, but, I am strongly interested in this. If I manage to solve these issues, this project could be of tremendous help for our research...

I managed to compile RapidCFD and can use the included solvers. But I need to compile a custom application and did not manage to do this yet. Here is the log with the errors I get, when compiling the solver with wmake log_wmake.txt

These are the first few lines of the code. newResistanceFoam.C_firstLines.txt I thinkt the errors come because DataEntry.H (in line 37 from /opt/RapidCFD/RapidCFD-dev/src/OpenFOAM/primitives/functions/DataEntry/DataEntry) and sstream (in line 50) are not included properly. Compiling the identical solver code with OpenFOAM2.3.1 works fine, so I am quite stuck here. To put RapidCFD to good use, I am strongly dependent on this.

Can anybody tell me how to fix this? Thanks a lot!!

daniel-jasinski commented 7 years ago

This an issue related to the earlier CUDA-OpenFOAM function name clash. To resolve this issue using namespace Foam; was removed from fvm.H and all Foam::* classes used in solver files now have to be manually declared in accessFoamNamespace.H.

The problem should be resolved, if you add to accessFoamNamespace.H entries for all the missing classes, e.g.:

using Foam::DataEntry;
using Foam::string;
using Foam::scalarField;
using Foam::sumOp;
KingKraut commented 7 years ago

Thanks a lot for the fast reply here, too!! I just tried what you suggested, and basically get the same error message, however, with an additional line before all the undefined classes errors:

/opt/RapidCFD/RapidCFD-dev/src/OpenFOAM/lnInclude/accessFoamNamespace.H(83): error: namespace "Foam" has no member "DataEntry" Full log: log_wmake_new.txt

KingKraut commented 7 years ago

Actually my latest post was not quite correct. I was a bit too fast, sorry!

Most of the errors were fixed. However, I still have problems with the following formulations in the solver code: autoPtr<DataEntry > nOutletsValue ( DataEntry::New ("nOutlets", controlDictCopy) ); int nOutlets = nOutletsValue().value(0);

All other errors were fixed by your suggestion: log_wmake_new.txt The erros in this logfile all concern expressions of the above kind.

Do you have an idea, how I should add this in accessFoamNamespace.H?

Thank you very much again for help! I highly appreciate that!!

daniel-jasinski commented 7 years ago

No problem :)

To solve the DataEntry problem you need to include DataEntry.H in fvCFD.H.

KingKraut commented 7 years ago

Thank you so much!! The compilation worked. I got a couple of warnings, but I will give it a try now!

daniel-jasinski commented 7 years ago

I am glad it works now.