CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User 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 Search this Thread Display Modes
Old   October 26, 2012, 01:58
Default How to define the list of vector when a vector has n components
  #1
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
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, 05:10
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Robin B.C. Yu FLUENT 3 May 27, 2012 05:19
ACCESS VIOLATION MHDWill FLUENT 1 September 23, 2007 03:51
REAL GAS UDF brian FLUENT 6 September 11, 2006 09:23
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 13:24
UDF FOR UNSTEADY TIME STEP mayur FLUENT 3 August 9, 2006 11:19


All times are GMT -4. The time now is 11:03.