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

Initializing constants

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 21, 2010, 09:59
Default Initializing constants
  #1
New Member
 
Michael Gruber
Join Date: Oct 2009
Location: Graz
Posts: 13
Rep Power: 16
gruber is on a distinguished road
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;
g           g         [ 0  1 -2  0  0  0  0] (0 0 9.81);
The class looks like this:

HTML Code:
# include "IOdictionary.H"
class A
{
  const IOdictionary transportProperties_;
  const dimensionedScalar Sct_;
  const dimensionedScalar g_;
public:
  A;
}
The constructor looks like this:

HTML Code:
A::A
 :
 transportProperties_( IOobject(
     "transportProperties",
     U.time().constant(),
     U.db(),
     IOobject::MUST_READ,
     IOobject::NO_WRITE)),

  Sct_ ( dimensionedScalar( transportProperties_.lookup("Sct") ) ),
  g_    ( dimensionedVector( transportProperties_.lookup("g") ) )
{}
The compiler doesn't report any bugs, but when I try to run a testcase the following error is displayed during the constructor call

HTML Code:
#0  Foam::error::printStack(Foam::Ostream&) in  "/home/of/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1  Foam::sigSegv::sigSegvHandler(int) in  "/home/of/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2  ?? in "/lib64/libc.so.6"
#3  std::string::assign(std::string const&) in  "/home/of/OpenFOAM/ThirdParty/gcc-4.3.1/platforms/linux64/lib64/libstdc++.so.6"
#4  Foam::IOerror::operator()(char const*, char const*, int,  Foam::string const&, int, int) in  "/home/of/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#5  Foam::IOerror::operator()(char const*, char const*, int,  Foam::dictionary const&) in  "/home/of/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#6  Foam::dictionary::lookupEntry(Foam::word const&, bool) const in  "/home/of/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#7  Foam::dictionary::lookup(Foam::word const&, bool) const in  "/home/of/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#8   Foam::IncompressibleCloud::IncompressibleCloud(Foam::volPointInterpolation  const&, Foam::GeometricField<Foam::Vector<double>,  Foam::fvPatchField, Foam::volMesh> const&,  Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField,  Foam::volMesh> const&,  Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField,  Foam::volMesh> const&, Foam::GeometricField<double,  Foam::fvPatchField, Foam::volMesh> const&,  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>  const&, Foam::GeometricField<double, Foam::fvPatchField,  Foam::volMesh> const&) in  "/home/of/OpenFOAM/of-1.5/applications/bin/linux64GccDPOpt/icoRLF"
#9  main in  "/home/of/OpenFOAM/of-1.5/applications/bin/linux64GccDPOpt/icoRLF"
#10  __libc_start_main in "/lib64/libc.so.6"
#11  Foam::regIOobject::readIfModified() in  "/home/of/OpenFOAM/of-1.5/applications/bin/linux64GccDPOpt/icoRLF"
Segmentation fault
Can someone please tell me the error in my program?

Thank you very much.
gruber is offline   Reply With Quote

 


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
Initializing constants gruber Main CFD Forum 0 April 21, 2010 09:57
what constants to choose for std k-e model daniel.struwig FLUENT 0 April 18, 2009 06:51
query regarding role of initializing in a solving Kishore FLUENT 2 July 4, 2007 23:23
Switches and Real Constants for Diesel Combustion Tony Siemens 0 July 30, 2006 20:15
Modelling a turbulent jet and k-epsilon constants Ant Siemens 3 January 24, 2005 15:56


All times are GMT -4. The time now is 07:55.