CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

How to treat autoPtr<psiChemistryModel> ?

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

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

I have a question about a certain line of createFields.H of chemFoam:

http://foam.sourceforge.net/docs/cpp/a03249_source.html
Code:
00026     Info<< nl << "Reading thermophysicalProperties" << endl;
00027     autoPtr<psiChemistryModel> pChemistry(psiChemistryModel::New(mesh));
00028 
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:

Code:
// this part works
pChemistry.set
        (
            i,
            autoPtr<psiChemistryModel>
            (
                psiChemistryModel::New
            (
                fluidRegions[i]
            )
            ).ptr()
        );

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

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

Old   November 28, 2012, 05:53
Default
  #2
Member
 
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 6
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

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
How to treat the jump-periodic boundaries with the fluent!please help me! ChenZhan FLUENT 6 May 8, 2012 21:11
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
how to treat plasma sheath? lucy FLUENT 0 March 10, 2009 05:14


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