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

List of volScalarField

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 14, 2013, 06:39
Default List of volScalarField
  #1
New Member
 
Seiji Adachi
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 5
Rep Power: 8
seiji_adachi is on a distinguished road
Hello,

I'd like to create a list of volScalarField. I have made testListField.C but
the compilation results in an error at the line highlighted in red.
What's wrong with this?

Code:
#include "fvCFD.H"

int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"

  int N = 10; // size of the list
  List<volScalarField> X(N);

  Info<< "End\n" << endl;
  
  return(0);
}
Quote:
SOURCE=testListField.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/finiteVolume/lnInclude -I/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/meshTools/lnInclude -IlnInclude -I. -I/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude -I/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/testListField.o
In file included from /home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/List.H:259:0,
from /home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/labelList.H:48,
from /home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/UPstream.H:43,
from /home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/Pstream.H:42,
from /home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/parRun.H:35,
from /home/sea/OpenFOAM/OpenFOAM-2.2.0/src/finiteVolume/lnInclude/fvCFD.H:4,
from testListField.C:33:
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/List.C: In constructor ‘Foam::List<T>::List(Foam::label) [with T = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::label = int]’:
testListField.C:42:27: instantiated from here
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/List.C:56:9: error: no matching function for call to ‘Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField()’

/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/List.C:56:9: note: candidates are:
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:605:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::GeometricField<Type, PatchField, GeoMesh>&, const wordList&, const wordList&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh, Foam::wordList = Foam::List<Foam::word>]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:605:1: note: candidate expects 4 arguments, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:570:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::GeometricField<Type, PatchField, GeoMesh>&, const Foam::word&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:570:1: note: candidate expects 3 arguments, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:540:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::word&, const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:540:1: note: candidate expects 2 arguments, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:507:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::word&, const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:507:1: note: candidate expects 2 arguments, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:475:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:475:1: note: candidate expects 2 arguments, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:444:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:444:1: note: candidate expects 1 argument, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:412:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:412:1: note: candidate expects 1 argument, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:371:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dictionary&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh, Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:371:1: note: candidate expects 3 arguments, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:331:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh, Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:331:1: note: candidate expects 2 arguments, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:304:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensionSet&, const Foam::Field<TypeR>&, const Foam::PtrList<PatchField<Type> >&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh, Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:304:1: note: candidate expects 5 arguments, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:274:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensioned<Form>&, const wordList&, const wordList&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh, Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh, Foam::wordList = Foam::List<Foam::word>]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:274:1: note: candidate expects 5 arguments, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:245:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensioned<Form>&, const Foam::word&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh, Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:245:1: note: candidate expects 4 arguments, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:217:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensionSet&, const wordList&, const wordList&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh, Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh, Foam::wordList = Foam::List<Foam::word>]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:217:1: note: candidate expects 5 arguments, 0 provided
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:187:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensionSet&, const Foam::word&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh, Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh]
/home/sea/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/GeometricField.C:187:1: note: candidate expects 4 arguments, 0 provided
make: *** [Make/linux64GccDPOpt/testListField.o] Error 1
seiji_adachi is offline   Reply With Quote

Old   May 14, 2013, 17:45
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Seiji,

I think this has been asked a few times in the past... here's one thread on this topic: Multiple volScalarFields using List<volScalarField>

In essence, the problem is that you're trying to use the list as the traditional/simpler kind of lists in C++. But OpenFOAM uses a far more complex operator overload mechanisms, which leads you're attempt to fail.
As I wrote above, you can find more examples on the forum, if you search for:
Code:
List<volScalarField>
Best regards,
Bruno
wyldckat is online now   Reply With Quote

Old   May 16, 2013, 06:03
Default
  #3
New Member
 
Seiji Adachi
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 5
Rep Power: 8
seiji_adachi is on a distinguished road
Hello Bruno,

By referring to the thread you showed, this problem has been
solved. Thanks a lot!

Seiji
seiji_adachi 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
swak4foam building problem GGerber OpenFOAM Installation 54 April 24, 2015 16:02
Error bulding swak4Foam sfigato OpenFOAM Installation 18 August 22, 2013 12:41
build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Installation 14 April 23, 2013 13:59
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 01:52
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 10:18.