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

How to treat autoPtr<psiChemistryModel> ?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 26, 2012, 22:18
Default How to treat autoPtr<psiChemistryModel> ?
  #1
Member
 
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 15
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, 04:53
Default
  #2
Member
 
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 15
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


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
how to treat plasma sheath? lucy FLUENT 1 December 6, 2016 15:34
How to treat the jump-periodic boundaries with the fluent!please help me! ChenZhan FLUENT 12 March 20, 2016 12:59
Is reactingParcelFilmFoam able to treat cases of two gas-liquid interfaces mitsuru OpenFOAM Running, Solving & CFD 0 January 20, 2012 05: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 04:08.