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

List of Objects

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 11, 2013, 04:13
Default List of Objects
  #1
Member
 
Jim Knopf
Join Date: Dec 2010
Posts: 60
Rep Power: 15
JimKnopf is on a distinguished road
Hello there,

i'm wondering about some "types" in Foam.

say I have a class foo
Code:
class foo
{
 foo();
void doSomeThing();
scalar returnSomeThin();

scalar value;
}
In a boundary condition i like to have one of these objects for every cell, how do I do this?

First Idea:
in my BC i define a list an do a loop over the list
Code:
static foam::List<foo> fooList
But what is the constructor for such a list? How do I set the size of the list?

In terms of basic c++ I would use a std::vector<foo> fooList, but this does not feel right for FOAM.

Anyone got an idea?

Best Regards,
Jim
JimKnopf is offline   Reply With Quote

Old   March 13, 2013, 07:35
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21
marupio is on a distinguished road
A PtrList would be suitable. Also, it can't be static because you need to know the mesh size.
__________________
~~~
Follow me on twitter @DavidGaden
marupio 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
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 16:02
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 18 August 22, 2013 12:41
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 00:52
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


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