|
[Sponsors] |
May 27, 2010, 04:59 |
list new element
|
#1 |
New Member
Peter Wiemeyer
Join Date: Sep 2009
Location: Germany, Munich
Posts: 22
Rep Power: 16 |
Hello,
the question is probably quite easy, but still some basics are missing and I'm not able to find it in the forum ... I want to make a list or something similiar where I can store elements and I have dynamics memory allocation. As a result of a search in the mesh I get a couple of cell numbers: Sometimes only perhaps 5 another time 500000. So I need to make a list, where I'm able to store just the cell numbers in. One by one, the order doesn't matter at the end. (At the beginning of the storing process it's not clear how much cells will be in at the end) If the forAll command is working would be great but of course no must have. Hope its clear so far what I would like to have. Is there anybody who is able to help me? Thx @ all & best Regards, Peter |
|
May 27, 2010, 05:29 |
|
#2 |
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17 |
Hi Peter,
I think you can use DynamicList<label> declared in DynamicList.H. You can use the member append to insert your cell numbers at the end of this list. The forAll command is working. Regards, Stefan |
|
May 27, 2010, 06:45 |
it works
|
#3 |
New Member
Peter Wiemeyer
Join Date: Sep 2009
Location: Germany, Munich
Posts: 22
Rep Power: 16 |
Thx for your help.
It worked great. Just for the next one who is looking for something similar: Initialize: DynamicList<int> bla; Append value: bla.append(5); Clear all entries: bla.clear(); (That are the commands that I needed.) Best Regards, Peter |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mesh file for flow over a circular cylinder | Ardalan | Main CFD Forum | 7 | December 15, 2020 13:06 |
RP_Set_List_of_Integer | linch | FLUENT | 0 | December 2, 2009 10:41 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 19:08 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 01:24 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 17:51 |