|
[Sponsors] |
Foam::FixedList accepts only static data members? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 4, 2012, 11:11 |
Foam::FixedList accepts only static data members?
|
#1 |
Member
Hagen Müller
Join Date: Nov 2010
Posts: 34
Rep Power: 15 |
Dear Foamers,
I need to define a new vector type with a fixed length. For that purpose I used: typedef FixedList<scalar, n_> newType_; This appears to work with n being defined as a "static const int" only. In my case, however, n is an integer, which is initialized in another class and passed on. Trying to compile produces the following error: error: invalid use of non-static data member ‘Foam::specie::n_ Any help on this issue is greatly appreciated! Hagen |
|
April 5, 2012, 02:51 |
|
#2 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,694
Rep Power: 40 |
Quote:
|
||
April 5, 2012, 03:08 |
|
#3 |
Member
Hagen Müller
Join Date: Nov 2010
Posts: 34
Rep Power: 15 |
I would like to define the new type to store species properties, e.g. the critical temperature, in a multi-component solver. Thus the size of the vector depends on the number of species involved. In order to have a flexible code, suitable for changing number of species, I want to read the vector size from the "thermophysicalProperties" dictionary.
Do I get it right that this is not possible with the FixedList class since the size of it is fixed during compilation? Any suggestions how to define a vector type with flexible size? Thank you! |
|
April 5, 2012, 03:29 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,694
Rep Power: 40 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
error: uninitialized local variable 't' used | MASOUD | Fluent UDF and Scheme Programming | 5 | October 17, 2016 04:24 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 10:52 |
defining a term for a domain using DEFINE_ADJUST | MASOUD | Fluent UDF and Scheme Programming | 1 | September 24, 2010 05:08 |
enum | MASOUD | Fluent UDF and Scheme Programming | 0 | June 5, 2010 00:49 |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 17:27 |