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

declaration of variable number of classes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2017, 03:51
Default declaration of variable number of classes
  #1
Senior Member
 
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 16
Elham is on a distinguished road
Hi,

I am going to modify multiphaseInterFoam and make n classes in a library which n is the number of species. So n is not a constant number and depends on the model. How can I declare it in the library?

Regards,

Elham
Elham is offline   Reply With Quote

Old   December 3, 2017, 12:31
Default Re: declaration of variable number of classes
  #2
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
Assuming your class is "species", can you do something similar as below?

Code:
species *mySpecies
mySpecies = new species[n]
Marpole is offline   Reply With Quote

Old   December 3, 2017, 20:01
Default
  #3
Senior Member
 
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 16
Elham is on a distinguished road
thanks for the suggestion. I will try.

Elham
Elham 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
decomposePar no field transfert Jeanp OpenFOAM Pre-Processing 3 June 18, 2022 12:01
decomposePar -allRegions stru OpenFOAM Pre-Processing 2 August 25, 2015 03:58
SigFpe when running ANY application in parallel Pj. OpenFOAM Running, Solving & CFD 3 April 23, 2015 14:53
[blockMesh] --> foam fatal error: lillo763 OpenFOAM Meshing & Mesh Conversion 0 March 5, 2014 10:27
Stable boundaries marcoymarc CFX 33 March 13, 2013 06:39


All times are GMT -4. The time now is 17:44.