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

Dimensioned%2360Type new class delaration

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 18, 2007, 13:47
Default Hi everybody, I am working
  #1
New Member
 
diego n.
Join Date: Mar 2009
Posts: 17
Rep Power: 17
diegon is on a distinguished road
Hi everybody,

I am working to the definition of a new class for RTE solvers, but I have problems with dimensioned<type>, if I declare a dimensionedScalar as a RTE member, while compling I am obtaining the following message:

RTEModel/RTEModel.C:76: error: no matching function for call to 'Foam::dimension ed<double>::dimensioned()'....

In order to build my new class I have taken a look to forum, doxygen and turbulunceModel.H and .C.

In .H I have called the declareRunTimeSelectionTable constructor in this way:

declareRunTimeSelectionTable
(
autoPtr,
RTEModel,
dictionary,
(
const volScalarField& T,
const volScalarField& Kabs
),
(T, Kabs)
);

And the autoptr to New:

static autoPtr<rtemodel> New
(
const volScalarField& T,
const volScalarField& Kabs

);

I also used:
defineTypeNameAndDebug(RTEModel, 0);
defineRunTimeSelectionTable(RTEModel, dictionary);

I have built the RTE::RTE function in this way:

RTEModel::RTEModel
(
const word& type,
const volScalarField& T,
const volScalarField& Kabs

)
:
IOdictionary
(
IOobject
(
"RTEModelSettings",
T.time().constant(),
T.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),

runTime_(T.time()),
mesh_(T.mesh()),

T_(T),
Kabs_(Kabs),


RTE_(lookup("RTE")),
RTEModelSets_(subDict(type + "Sets"))

And following the same structure of turbulence model I reported in newRTEModel.C:

autoPtr<rtemodel> RTEModel::New
(
const volScalarField& T,
const volScalarField& Kabs

)
{
word RTEModelTypeName;

// Enclose the creation of the RTEsetsDict to ensure it is
// deleted before the RTEModel is created otherwise the dictionary
// is entered in the database twice
{
IOdictionary RTEModelSettingsDict
(
IOobject
(
"RTEModelSettings",
T.time().constant(),
T.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);

RTEModelSettingsDict.lookup("RTEModel")
>> RTEModelTypeName;
}

Info<< "Selecting RTE model " << RTEModelTypeName << endl;

dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(RTEModelTypeName);

if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"RTEModel::New(const volScalarField& T, "
"const volScalarField& Kabs, const volScalarField& Emissivity"
")"
) << "Unknown RTEModel type " << RTEModelTypeName
<< endl << endl
<< "Valid RTEModel types are :" << endl
<<>toc()
<< exit(FatalError);
}

return autoPtr<rtemodel>
(
cstrIter() (T, Kabs)
);
}


I am sure to have followed the turbulunceModel declaration, but I also have to say that I have never used the RunTimeSelection utilities.

Thanks in advance.


Diego
diegon is offline   Reply With Quote

Old   February 18, 2007, 14:03
Default I have to correct part of my p
  #2
New Member
 
diego n.
Join Date: Mar 2009
Posts: 17
Rep Power: 17
diegon is on a distinguished road
I have to correct part of my previous post.

The error I am obtaining is:

error: no matching function for call to 'Foam::dimensioned<double>::dimensioned()'note: candidates are: Foam::dimensioned<type>::dimensioned(Foam::Istream &) [with Type = double]...and the others suitable.

I am not obtaining an error with dimensioned<type> if I istantiate it in this way (letting my scalar be sigma): "sigma("sigma",dimensionSet(1,0,-3,-4,0),5.67040e-8).

While I am obtaining error if is use:
lookup("RTE") >> RTE_;
RTEModelSets_ = subDict(type() + "Sets");

if (found("sigma"))
{
lookup("sigma") >> sigma;
}
diegon is offline   Reply With Quote

Old   October 12, 2007, 03:59
Default undefined reference to new the
  #3
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 64
Rep Power: 18
richpaj is on a distinguished road
undefined reference to new thermophysical class constructors

Hello,

I hope I chose a relevant thread regarding the creation of new classes.

Under OpenFOAM-1.3 on SUSE 10.1 using gcc 4.1.0 and where ld -v gives
2.16.91.0.5 20051219

I wonder if anyone has any ideas about the following:

I've encountered the following issue when trying to link
"libmyThermophysicalModels.so" (based on modifications to "basicThermo",
"hCombustionThermo" and "hMixtureThermo") with the main/top-level code:

Linux: undefined reference to constructor (in this case the constructor of
"myhMixtureThermo")

"collect2; ld returned 1 exit status"




Interestingly (or otherwise....) under OpenFOAM-1.3 on OSX (ver 10.4.10) using gcc
4.0.1 the various "dylib" libraries compile and link, however, at run-time I
get:

"dyld: lazy symbol binding failed: Symbol not found: ...."

This occurs when the following is attempted in "mynewhCombustionThermo.C"

return autoPtr<myhcombustionthermo> ( cstrIter()( myArgumentList ) );


I've preserved the overall structures of "basicThermo", "hCombustionThermo" and
"hMixtureThermo" and have merely added functions and altered constructor
argument lists. (Though I did comment out the 'ifdefNoReposiory ...'
conditional at the foot of myhMixtureThermo). The "thermotype" is correctly
read from the "thermophysicalProperties" dictionary and forms the correct "head"
(to use Mathematica terminology) of the function. The snag being that the resulting
constructor is not recognized.....

I've scoured the relevant openFOAM docs, message boards, and wiki site but the nearest
I've come to an answer was the suggestion made at

http://openfoamwiki.net/index.php/Ho...e_OpenFOAM_Mac

namely that the above trouble could be related to linker issues. For the Mac, other sites have recommended using
gcc 3.X (set by gcc_select ) to get around the lazy symbol problem for that platform. Tried the latter but resetting the
default compiler is currently proving troublesome.

However, I reckon my problem is self-inflicted by some erroneous coding.......

I'd be very grateful for any suggestions,

Many prospective thanks,

Richard Kenny.
richpaj is offline   Reply With Quote

Old   October 12, 2007, 14:51
Default Having just read http://ww
  #4
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 64
Rep Power: 18
richpaj is on a distinguished road
Having just read

http://www.sunsite.ualberta.ca/Documentation/Gnu/gcc-3.0.2/html_node/gcc_120.htm l#SEC120

I can now see that the linkage problems above relate to handling the various instantiations of the templates
contained within the thermophysical library. Perhaps it was hasty after all to comment
out the "NoRepository" conditional at the bottom of the myhMixtureThermo.H file.
richpaj is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tmp class maka OpenFOAM Bugs 2 August 20, 2008 15:53
How to access solver fields from fvPatchField%2360Type derived class that defines BC kar OpenFOAM Running, Solving & CFD 0 February 29, 2008 13:41
How to add a new class locally ville OpenFOAM 4 December 11, 2006 14:20
Expanding a class fabianpk OpenFOAM 0 October 3, 2005 05:26
CFD class notes Lee Main CFD Forum 0 January 30, 2004 13:39


All times are GMT -4. The time now is 11:47.