CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

Initializing constants

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 21, 2010, 09:57
Default Initializing constants
  #1
New Member
 
Michael Gruber
Join Date: Oct 2009
Location: Graz
Posts: 13
Rep Power: 8
gruber is on a distinguished road
Hello,

I'm looking for a solution of my OpenFOAM 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.

Last edited by gruber; April 21, 2010 at 10:20.
gruber 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
VOF error when initializing Simone CD-adapco 11 February 11, 2009 12:26
query regarding role of initializing in a solving Kishore FLUENT 2 July 4, 2007 23:23
Switches and Real Constants for Diesel Combustion Tony CD-adapco 0 July 30, 2006 20:15
want to know the information about constants limingtiger CD-adapco 3 July 22, 2005 09:25
Modelling a turbulent jet and k-epsilon constants Ant CD-adapco 3 January 24, 2005 16:56


All times are GMT -4. The time now is 03:35.