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

How to transpose a list of scalar list?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 14, 2013, 09:12
Default How to transpose a list of scalar list?
  #1
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
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, 15:43
Default
  #2
Member
 
yijin Mao
Join Date: May 2010
Location: Columbia, MO
Posts: 62
Rep Power: 15
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, 16:56
Default
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 16:02
dieselFoam problem!! trying to introduce a new heat transfer model vivek070176 OpenFOAM Programming & Development 10 December 23, 2014 23: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 00: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:35.