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

read vector for a user defined application with controlDict files

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 3, 2015, 07:29
Default read vector for a user defined application with controlDict files
  #1
New Member
 
LU
Join Date: Oct 2015
Posts: 11
Rep Power: 10
louvel is on a distinguished road
I'm trying to read in a vector, eg. the point of the rotating center, from a dictionary and to initialize it as constant of a application, eg. A.I have susscceful to define a scaler

scalar omega=0;
omega=readScalar(myDict.lookup("omega");

And now i want to do the same thing for a vector, but when i use readVector instead of readScaler, the error is that: the readVector is not declared, so i do not know how to declare it ?

And I know there is also a dimensionedVecotr , so I try
const vector r (0,0,0)
dimensionedVector(myDict.looup("r");

in the case ,i can compile it but in the result ,the real value of r in myDIct is not read, it just use the (0,0,0) .so could you tell me the reasons or give me some suggestion.

Thank you so much

Best regards

Lu
louvel is offline   Reply With Quote

Old   December 6, 2015, 11:08
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
Did you try something like:
Code:
dimensionedVector r(myDict.looup("r"));
or
Code:
const vector r(myDict.looup("r"));
jherb is offline   Reply With Quote

Old   April 4, 2018, 06:18
Default
  #3
New Member
 
sencer yucesan
Join Date: Mar 2018
Location: Vienna
Posts: 2
Rep Power: 0
sencer is on a distinguished road
Quote:
Originally Posted by louvel View Post
I'm trying to read in a vector, eg. the point of the rotating center, from a dictionary and to initialize it as constant of a application, eg. A.I have susscceful to define a scaler

scalar omega=0;
omega=readScalar(myDict.lookup("omega");

And now i want to do the same thing for a vector, but when i use readVector instead of readScaler, the error is that: the readVector is not declared, so i do not know how to declare it ?

And I know there is also a dimensionedVecotr , so I try
const vector r (0,0,0)
dimensionedVector(myDict.looup("r");

in the case ,i can compile it but in the result ,the real value of r in myDIct is not read, it just use the (0,0,0) .so could you tell me the reasons or give me some suggestion.

Thank you so much

Best regards

Lu
louvel,

Did you managed to read the files from the controlDict ? I also created my own application, however, still struggling to read the vectors ..
sencer is offline   Reply With Quote

Old   April 4, 2018, 08:42
Default
  #4
Member
 
Jibran
Join Date: Oct 2012
Location: UK
Posts: 61
Blog Entries: 1
Rep Power: 14
Jibran is on a distinguished road
Quote:
Originally Posted by sencer View Post
louvel,

Did you managed to read the files from the controlDict ? I also created my own application, however, still struggling to read the vectors ..
Something like this should work:
Code:
vector r (dict.lookup("r"));
__________________
Jibran Haider
https://jibranhaider.com/
Jibran 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
Additional Variables Defined By User FORTRAN CEL Wheeler CFX 2 August 6, 2013 21:33
User Defined Scalars - Returning Values Carlos V. FLUENT 0 April 19, 2006 18:18
Usage of user defined functions Gowrish FLUENT 1 October 26, 2005 07:44
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 20:51
User defined memory Hp FLUENT 0 September 24, 2004 00:10


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