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

input .txt file (vector list) to OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 14, 2014, 04:17
Default input .txt file (vector list) to OpenFOAM
  #1
New Member
 
MWu
Join Date: Nov 2013
Posts: 10
Rep Power: 12
gnoyeh525 is on a distinguished road
Hi, every, I am a new Openfoam user

If I want to read vector-list(.txt file) into openfoam, and identify each vector, How can I manage to do this, please?

ie, positions vector list
(4.0446766158e+00 3.5020000000e+00 4.0000000000e+00)
(3.9430552591e+00 3.5060000000e+00 4.0521660473e+00)
(4.0086987498e+00 3.5100000000e+00 3.9008822329e+00)
... ... ...

And I want to get
positions[0] = (4.0446766158e+00 3.5020000000e+00 4.0000000000e+00)
positions[1] = (3.9430552591e+00 3.5060000000e+00 4.0521660473e+00)
positions[2] = (4.0086987498e+00 3.5100000000e+00 3.9008822329e+00)
... ... ... ...

Is there any one know how to read this data from .txt file and identify each vector?
Thanks
gnoyeh525 is offline   Reply With Quote

Old   February 14, 2014, 04:55
Default
  #2
New Member
 
Luca
Join Date: Feb 2014
Posts: 19
Rep Power: 12
lfrigeri3 is on a distinguished road
You have to give us more information. What do u need to do with that file? Is it for build your mesh?

However, I think you should do a little script in c++ , write it with gedit and save it "script" , then make it an executable with "chmod +x script" and execute it "./script" .

BUT: I don't know if this way will works, I'm a little (but creative) newbie
lfrigeri3 is offline   Reply With Quote

Old   February 14, 2014, 05:00
Default
  #3
New Member
 
MWu
Join Date: Nov 2013
Posts: 10
Rep Power: 12
gnoyeh525 is on a distinguished road
Quote:
Originally Posted by lfrigeri3 View Post
You have to give us more information. What do u need to do with that file? Is it for build your mesh?

However, I think you should do a little script in c++ , write it with gedit and save it "script" , then make it an executable with "chmod +x script" and execute it "./script" .

BUT: I don't know if this way will works, I'm a little (but creative) newbie

Hi,

Thanks for reply. I don't use it for building mesh, I use there positions for interpolate velocities. (interpolate velocities to each markers positions)

Thanks again
gnoyeh525 is offline   Reply With Quote

Old   February 14, 2014, 09:51
Default
  #4
New Member
 
MWu
Join Date: Nov 2013
Posts: 10
Rep Power: 12
gnoyeh525 is on a distinguished road
any one can tell me?
gnoyeh525 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
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 03:23
[swak4Foam] swak4Foam-groovyBC build problem zxj160 OpenFOAM Community Contributions 18 July 30, 2013 13:14
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 11:46


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