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

compilation error with setSize

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 30, 2013, 11:56
Default compilation error with setSize
  #1
Member
 
Pascal
Join Date: Jun 2009
Location: Montreal
Posts: 65
Rep Power: 8
Pascal_doran is on a distinguished road
Hi everyone,

I try to introduce a new list (named vorticityMode0_x ) in my solver, but I can't compile the code. The list has to handle parallel calculation. Here's what I wrote :


Code:
List<scalar> vorticityMode0_x(Pstream::nProcs());

vorticityMode0_x[Pstream::myProcNo()].setSize(nLim); // Problem seems from this line

vorticityMode0_x[Pstream::myProcNo()][nxyI] = inX[0]/nz;

Pstream::gatherList(vorticityMode0_x);
Here's the error message :
Code:
Making dependency list for source file vortexCar_FFT.C
SOURCE=vortexCar_FFT.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/home/ag74290/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/ag74290/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude -I/home/ag74290/OpenFOAM/OpenFOAM-2.1.0/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/vortexCar_FFT.o
In file included from vortexCar_FFT.C:37:0:
caracterisation.H: In function ‘int caracterisationMain(Foam::vector&, Foam::vector&, Foam::vector&, Foam::vector&, Foam::volVectorField&, int, int, int, int, int, double, double, double, Foam::instantList, int, int)’:
caracterisation.H:75:43: error: request for member ‘setSize’ in ‘vorticityMode0_x.Foam::List<double>::<anonymous>.Foam::UList<T>::operator[] [with T = double, Foam::label = int](Foam::UPstream::myProcNo())’, which is of non-class type ‘double’
caracterisation.H:77:43: error: request for member ‘setSize’ in ‘vorticityMode0_y.Foam::List<double>::<anonymous>.Foam::UList<T>::operator[] [with T = double, Foam::label = int](Foam::UPstream::myProcNo())’, which is of non-class type ‘double’
caracterisation.H:79:43: error: request for member ‘setSize’ in ‘vorticityMode0_z.Foam::List<double>::<anonymous>.Foam::UList<T>::operator[] [with T = double, Foam::label = int](Foam::UPstream::myProcNo())’, which is of non-class type ‘double’
caracterisation.H:118:51: error: invalid types ‘double[int]’ for array subscript
caracterisation.H:118:108: error: invalid types ‘double[int]’ for array subscript
caracterisation.H:118:165: error: invalid types ‘double[int]’ for array subscript
caracterisation.H:123:52: error: invalid types ‘double[int]’ for array subscript
caracterisation.H:123:110: error: invalid types ‘double[int]’ for array subscript
caracterisation.H:123:165: error: invalid types ‘double[int]’ for array subscript
caracterisation.H:123:220: error: invalid types ‘double[int]’ for array subscript
/home/ag74290/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/home/ag74290/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable]
/home/ag74290/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/readPISOControls.H:12:16: warning: unused variable ‘momentumPredictor’ [-Wunused-variable]
/home/ag74290/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable]
/home/ag74290/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
make: *** [Make/linux64GccDPOpt/vortexCar_FFT.o] Error 1
Thank you very much for your help,
Pascal
Pascal_doran is offline   Reply With Quote

Old   January 30, 2013, 17:48
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Pascal,

I might be wrong, but I think what you want is this:
Code:
List< List<scalar> > vorticityMode0_x(Pstream::nProcs());
At least that's the idea you're giving with the remaining code!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   February 5, 2013, 19:58
Default
  #3
Member
 
Pascal
Join Date: Jun 2009
Location: Montreal
Posts: 65
Rep Power: 8
Pascal_doran is on a distinguished road
oups... Thank you Bruno!

I was wondering if you knew what is the simple way to merge all the lists from every CPUs into a single list readable by the master CPU?

I though gatherList() was doing it but it seems that it only make all the lists visible from the master CPU.

Thank you
Pascal
Pascal_doran 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
Compilation error for OpenFOAM-ext on Ubantu 10.04 32 bit Sargam05 OpenFOAM Installation 13 March 22, 2014 06:21
swak4Foam compilation for OF-2.0.0 camoesas OpenFOAM Installation 19 December 10, 2012 14:24
Compilation Error (V 1.7.1; Icc 12.1.0, OpenMPI 1.4.3) floydfan OpenFOAM Installation 7 December 20, 2011 06:56
Compilation error with uparm.f Raghu CD-adapco 2 May 30, 2007 02:09
Compilation Error.... Arnab CD-adapco 4 September 12, 2004 15:54


All times are GMT -4. The time now is 06:51.