|
[Sponsors] |
September 20, 2013, 13:56 |
Newbie Question on PtrList usage
|
#1 |
New Member
Tom Chyczewski
Join Date: Mar 2009
Location: Bethpage, New York, USA
Posts: 15
Rep Power: 17 |
I recently received the following information from another post:
If N, you need PtrList<volScalarField> ks(N); PtrList<volScalarField> thetas(N); You will access them as ks[i] and thetas[i]. If NxM, make a PtrList<PtrList<volScalarField> > bigOne(N); forAll (bigOne, i) { bigOne.set(i, new PtrList<volScalarField>(M)); } and then fill the lot. You will access them as bigOne[i][j]; I am able to create the arrays via PtrList as described above but I am not able to access them. If I try ks[1]=1.0; I get a fatal error: hanging pointer, cannot dereference at runtime. If I try ks.set(1,1.0); I get a number of compilation errors. Any suggestions? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Newbie Question IcoFoam - Courant Number explodes | sprobst76 | OpenFOAM Running, Solving & CFD | 12 | March 1, 2018 07:35 |
question about uds | tanven | FLUENT | 2 | July 5, 2015 11:22 |
internal field question - PitzDaily Case | atareen64 | OpenFOAM Running, Solving & CFD | 2 | January 26, 2011 15:26 |
Question about Table applicaiton. | universez | OpenFOAM Running, Solving & CFD | 0 | January 12, 2010 20:31 |
CHANNEL FLOW: a question and a request | Carlos | Main CFD Forum | 4 | August 23, 2002 05:55 |