Initializing constants
Hello,
I'm looking for a solution of my problem. I have defined constant dimensioned scalars and vectors in the transportProperties dictionary, eg: HTML Code:
Sct Sct [0 2 -1 0 0 0 0] 2.0e-09; HTML Code:
# include "IOdictionary.H" HTML Code:
A::A HTML Code:
#0 Foam::error::printStack(Foam::Ostream&) in "/home/of/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so" Thank you very much. |
A segmentation error usually has to something to do with an array being out of bounds.
In your class, you have defined const dimensionedScalar g_; instead of const dimensionedVector g_; which is different from your constructor. |
Thank you for your answer.
You are right. I have posted it wrongly. Certainly it should mean: HTML Code:
# include "IOdictionary.H" |
How can that compile?
How does class A know about U when it has no arguments in the constructor? and you dont need to do the typecast Sct_ (transportProperties_.lookup("Sct")) is sufficient for dimensionedScalars. |
I found a workaround for my problem:
I read in the parameters from the dictionary transportProperties as global parameters and assign them to the class by the constructor call: HTML Code:
transportProperties_( IOobject( HTML Code:
# include "IOdictionary.H" HTML Code:
A::A(Sct, g) : Sct_( Sct ), g_( g ) {} |
All times are GMT -4. The time now is 06:25. |