Troubles when create a new volScalarField in my own library
Dear all,
I'm struggling to create a new volScalarField variable in my own function before compiling my own source code, the exactly same thing like pressure, density, viscosity, etc. But failed again and again, any suggestion please?:confused: |
fail? your question is too vague, atleast post your error line
|
error: no matching function for call to ‘Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField()’
|
would you mind!, add your pieces of code here too ;)
|
Quote:
|
Quote:
#include "fvCFD.H" #include "IOstream.H" #include "messageStream.H" namespace Foam { namespace Test { class Try { public: volScalarField value1,value2; static volScalarField newField( ); }; } } The implement file (XXX.C) is: #include "XXX.H" namespace Foam { namespace Test { volScalarField value1; volScalarField Try::newField( ); volScalarField value2; value2=value1; return (value2); } } To generate a new library, I have tried with some 'int' type functions and variables in this way, they can be compiled and work well to be called in a main program. But when the variable type is 'volScalarField', did I miss something? Like other header files to include? |
As far as I can see, you are trying to call a volScalarField constructor without any arguments. There is no such constructor, see: http://foam.sourceforge.net/docs/cpp/a00776.html , to construct a volScalarField, you need at least a mesh somewhere.
|
All times are GMT -4. The time now is 00:01. |