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

How to transpose a list of scalar list?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 14, 2013, 10:12
Default How to transpose a list of scalar list?
  #1
Member
 
Hossein
Join Date: Apr 2010
Posts: 62
Rep Power: 8
atoof is on a distinguished road
Send a message via Yahoo to atoof
Dear Foamers,

I am developing a new code for a reacting flow and using OF2.1.x.
I should read a list of list (which contains scalars) and then transpose it. I did the first step but I can not do the other. The part of the code contains these step is in the following:
Code:
   List<List<scalar> > Y_(dict.lookup("Tin"));
.
.
.
    wordList speciesNames
    ( 
       dict.lookup("species")
    );
   RectangularMatrix<doubleScalar> Ys(ns, Y_.size());
   forAll(speciesNames, s)
    {
        List<List<scalar> > Ys[s][Y_.size()];
        forAll(Y_,i)
        {
            Ys(s,i) = Y_[i][s];
        }
    }
where dict is dictionary includes list of species and "Tin" has format of:

Tin
(
( 1 2 3 ... )
( 4 5 6 ... )
. . .
)
)

After compiling, I encounter the following errors:
error: ‘RectangularMatrix’ was not declared in this scope
error: expected primary-expression before ‘>’ token
error: ‘Ys’ was not declared in this scope

Mohammad
atoof is offline   Reply With Quote

Old   January 14, 2013, 16:43
Default
  #2
Member
 
yijin Mao
Join Date: May 2010
Location: Columbia, MO
Posts: 48
Rep Power: 8
alundilong is on a distinguished road
Quote:
Originally Posted by atoof View Post
Dear Foamers,

I am developing a new code for a reacting flow and using OF2.1.x.
I should read a list of list (which contains scalars) and then transpose it. I did the first step but I can not do the other. The part of the code contains these step is in the following:
Code:
   List<List<scalar> > Y_(dict.lookup("Tin"));
.
.
.
    wordList speciesNames
    ( 
       dict.lookup("species")
    );
   RectangularMatrix<doubleScalar> Ys(ns, Y_.size());
   forAll(speciesNames, s)
    {
        List<List<scalar> > Ys[s][Y_.size()];
        forAll(Y_,i)
        {
            Ys(s,i) = Y_[i][s];
        }
    }
where dict is dictionary includes list of species and "Tin" has format of:

Tin
(
( 1 2 3 ... )
( 4 5 6 ... )
. . .
)
)

After compiling, I encounter the following errors:
error: ‘RectangularMatrix’ was not declared in this scope
error: expected primary-expression before ‘>’ token
error: ‘Ys’ was not declared in this scope

Mohammad
did you include header file defined RectangularMatrix Class?
alundilong is offline   Reply With Quote

Old   January 14, 2013, 17:56
Default
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 727
Rep Power: 20
mturcios777 will become famous soon enough
Edward's answer is correct. To further clarify, the compiler doesn't know how to build template objects RectangularMatrix of the type doubleScalar without information that is contained in the header file for that template class.
mturcios777 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
dieselFoam problem!! trying to introduce a new heat transfer model vivek070176 OpenFOAM Programming & Development 10 December 24, 2014 00:48
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
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 07:57.