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

How to define the list of vector when a vector has n components

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 26, 2012, 00:58
Default How to define the list of vector when a vector has n components
  #1
Senior Member
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 170
Rep Power: 7
fumiya is on a distinguished road
Hi,

I can define the list of vector by the following
when a vector has "three" components:

label Np = mesh.points().size();
List<vector> N(Np, vector::zero);

What should I do if I want to define the list of
vector when a vector has "n" components(n: positive integer)?

Best regards,
Fumiya
fumiya is offline   Reply With Quote

Old   October 26, 2012, 04:10
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
Good morning Fumiya

You could do the following

Code:
List<scalarField> var( size_0 );

forAll( var, vari )
{
    scalarField & v( var[vari] );
    v.setSize( size_1, 0.0);

    // Fill the scalarField with its content
}
You could also do the same with vectorField, tensorField, pointField, labelList, etc.

Kind regards,

Niels
ngj 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
Robin B.C. Yu FLUENT 3 May 27, 2012 04:19
ACCESS VIOLATION MHDWill FLUENT 1 September 23, 2007 02:51
REAL GAS UDF brian FLUENT 6 September 11, 2006 08:23
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24
UDF FOR UNSTEADY TIME STEP mayur FLUENT 3 August 9, 2006 10:19


All times are GMT -4. The time now is 16:45.