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

List of Objects

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

LinkBack Thread Tools Display Modes
Old   March 11, 2013, 05:13
Default List of Objects
Jim Knopf
Join Date: Dec 2010
Posts: 60
Rep Power: 8
JimKnopf is on a distinguished road
Hello there,

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

say I have a class foo
class 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
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,
JimKnopf is offline   Reply With Quote

Old   March 13, 2013, 08:35
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 436
Rep Power: 15
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


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
swak4foam building problem GGerber OpenFOAM Installation 54 April 24, 2015 16:02
Error bulding swak4Foam sfigato OpenFOAM Installation 18 August 22, 2013 12:41
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 01:52
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20: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 15:40.