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

multidimensional Field<>

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 13, 2011, 07:50
Default multidimensional Field<>
  #1
Senior Member
 
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 174
Rep Power: 8
linch is on a distinguished road
Hi Foamers,

is there an elegant way to declare multimedensional fields? Something similar to a multidimensional array e.g. scalar[n4][n3][n2][n1] my4DArray;

This implementation seems to works, but is really inelegant (please don't laugh to loud at this stupid solution):
Code:
Field <scalar>                              dummy1D(n1,scalar(0.0));
Field <Field <scalar> >                     dummy2D(n2,dummy1D);
Field <Field <Field <scalar> > >            dummy3D(n3,dummy2D);
Field <Field <Field <Field <scalar> > > >   my4DField(n4,dummy3D);
Furthermore there are dummies remaining and soiling the code. Do you have an idea, how n-dimensional fields should be defined?

Best regards,
illya
linch is offline   Reply With Quote

Reply

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
multidimensional integration in openfoam Farshad_Noravesh OpenFOAM 2 April 15, 2011 14:15
multidimensional hashtable? Farshad_Noravesh OpenFOAM 0 January 24, 2011 10:05
How to represent the pressure evaluated by multidimensional averaging? renyun0511 OpenFOAM Running, Solving & CFD 0 November 4, 2010 03:44
Dynamic multidimensional array in C++? Chen Zhi Main CFD Forum 13 May 22, 2008 21:18
Genuinely Multidimensional Upwind Scheme Praveen Chandrashekar Main CFD Forum 9 October 25, 2001 06:47


All times are GMT -4. The time now is 00:31.