|
[Sponsors] |
Troubles when create a new volScalarField in my own library |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 19, 2013, 05:44 |
Troubles when create a new volScalarField in my own library
|
#1 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 13 |
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? |
|
June 19, 2013, 05:50 |
|
#2 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 |
fail? your question is too vague, atleast post your error line
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
June 19, 2013, 06:18 |
|
#3 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 13 |
error: no matching function for call to ‘Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField()’
|
|
June 19, 2013, 09:10 |
|
#4 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 |
would you mind!, add your pieces of code here too
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
June 19, 2013, 11:48 |
|
#5 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21 |
||
June 19, 2013, 13:26 |
|
#6 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 13 |
A very simple test, the header file (XXX.H) is:
#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? |
|
June 20, 2013, 03:42 |
|
#7 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21 |
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.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
using fieldAverage library to average postprocessing | eelcovv | OpenFOAM Programming & Development | 32 | May 17, 2022 10:55 |
[ICEM] How can I create prism mesh for a 3D domain surrounded by a torus? | lzgwhy | ANSYS Meshing & Geometry | 5 | May 18, 2017 18:10 |
How to call FORTRAN files as UDF? | Ehsan-F | Fluent UDF and Scheme Programming | 6 | September 11, 2012 12:03 |
Actuator disk model | audrich | FLUENT | 0 | September 21, 2009 08:06 |
Where's the singularity/mesh flaw? | audrich | FLUENT | 3 | August 4, 2009 02:07 |