|
[Sponsors] |
How would you dynamically allocate higher order arrays in OF? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 2, 2015, 09:50 |
How would you dynamically allocate higher order arrays in OF?
|
#1 |
Member
Rudolf Hellmuth
Join Date: Sep 2012
Location: Dundee, Scotland
Posts: 40
Rep Power: 13 |
Hallo,
I need to allocate higher order arrays in OF, like 3D, 4D large matrices. I couldn't find any native OF class that do that. For 1D arrays I am using PtrList. In the case of 3rd order array, is it possible to use?: Code:
PtrList<PtrList<PtrList<scalar>>>> array; array.setSize[sizeX]; forAll(array, i) { array[i].setSize[sizeY]; forAll(array[i], j) { array[i][j].setSize[sizeZ]; } } Or should I ratter allocate in a standard way? Code:
scalar*** array; array = new scalar**[sizeX]; for(int i = 0; i < sizeX; ++i) { array[i] = new scalar*[sizeY]; for(int j = 0; j < sizeY; ++j) { array[i][j] = new scalar[sizeZ]; } } How would you rather do that? Best regards, Rudolf |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
higher order discretisation scheme | Simon Smokes | Main CFD Forum | 2 | August 23, 2014 07:19 |
Higher order discretization on staggered grid | Chandra Shekhar | Main CFD Forum | 9 | January 27, 2005 16:31 |
Higher Order FV Schemes for unstructured meshes | Apurva Shukla | Main CFD Forum | 4 | December 15, 2000 09:17 |
Gradient Estimation for Higher Order Schemes | jianxia | Main CFD Forum | 0 | June 6, 2000 19:40 |
Higher order FVM | Sergey Smirnov | Main CFD Forum | 10 | April 15, 2000 01:49 |