CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

How to treat autoPtr<psiChemistryModel> ?

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

LinkBack Thread Tools Display Modes
Old   November 26, 2012, 23:18
Default How to treat autoPtr<psiChemistryModel> ?
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 9
Hanzo is on a distinguished road
Hello together,

I have a question about a certain line of createFields.H of chemFoam:
00026     Info<< nl << "Reading thermophysicalProperties" << endl;
00027     autoPtr<psiChemistryModel> pChemistry(psiChemistryModel::New(mesh));
00029     psiChemistryModel& chemistry = pChemistry();
00030     scalar dtChem = refCast<const psiChemistryModel>(chemistry).deltaTChem()[0];
What exactly is pChemistry? I see that psiChemistryModel is an abstract class and instances cannot be created using the standard constructor, right?
However, in line 29, what is pChemistry(); doing ?

Actually, what I want to do is: create a list of autoPtr<psiChemistryModel> and then perform line 29 for each entry of that list.
Here is my code which does not work:

// this part works

// but this step does not work
psiChemistryModel& chemistry = (pChemistry[i])();
This results in the error:

fluid/createFluidFields.H:108: error: no match for call to (Foam::psiChemistryModel) ()
Hanzo is offline   Reply With Quote

Old   November 28, 2012, 05:53
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 9
Hanzo is on a distinguished road
Okay, found it. Just had to look at the implementation of
PtrList, List and psiChemistryModel
Hanzo is offline   Reply With Quote


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
how to treat plasma sheath? lucy FLUENT 1 December 6, 2016 16:34
How to treat the jump-periodic boundaries with the fluent!please help me! ChenZhan FLUENT 12 March 20, 2016 13:59
Is reactingParcelFilmFoam able to treat cases of two gas-liquid interfaces mitsuru OpenFOAM Running, Solving & CFD 0 January 20, 2012 06:20
Fluent:How to treat catalyst in surface reaction? gahquq FLUENT 0 June 1, 2010 22:16
how to treat RF heating in ANSYS Fluent Jiuan FLUENT 0 May 5, 2010 05:14

All times are GMT -4. The time now is 14:43.