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

Creating a triple index volScalarField S[i][j][k]

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 4, 2019, 16:42
Default Creating a triple index volScalarField S[i][j][k]
  #1
New Member
 
Join Date: May 2017
Posts: 8
Rep Power: 8
ec91 is on a distinguished road
Hello everyone,


with the following code I can create a double array of volScalarFields with two indexes, eI and eJ:


Code:
    List<PtrList<volScalarField>> S(number_I);
    forAll(S,eI)
    {
        S[eI].resize(number_J); 

        forAll(S[eI],eJ)
        {
            S[eI].set
            (
                eJ,
                new volScalarField
                (
                    IOobject
                    (
                        "S"+Foam::name(eI)+Foam::name(eJ),
                        runTime.timeName(),
                        mesh,
                        IOobject::NO_READ,
                        IOobject::NO_WRITE
                    ),
                    field1 + field2 //some operations (just an example)
                )
            );
        }
    }
Where number_I and number_J are previously defined integers.



Is there a way to create a volScalarField with three indexes, say S[eI][eJ][eK]?


Thank you.
ec91 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
Error message Bruno_Jorge Main CFD Forum 1 February 5, 2019 11:12
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 22:38
[OpenFOAM] Paraview 3.98 - errors when saving geometry file pajot ParaView 1 September 28, 2013 10:45
writing execFlowFunctionObjects immortality OpenFOAM Post-Processing 30 September 15, 2013 06:16
OpenFOAM install on Ubuntu Natty 11.04 bkubicek OpenFOAM 13 May 26, 2011 05:48


All times are GMT -4. The time now is 04:18.