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

reading in a string

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

Like Tree8Likes
  • 8 Post By l_r_mcglashan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 3, 2009, 19:06
Default reading in a string
  #1
Member
 
Scott Ripplinger
Join Date: Mar 2009
Posts: 30
Rep Power: 15
sripplinger is on a distinguished road
I'm in the middle of writing some code for colloidal particle transport based on the solidParticle class. I would like to be able to read in the name of the model I want to use. For instance, in the particleProperties file I am trying to add a vdwModel variable which is read in as a string ("Gregory" or "SchenkelKitchener"). This would then be used later in the code to specify which force model I want to use.

My question is exactly how do I read in a string? Something along the lines of readScalar is what I'm looking for, but if I need to rethink how I'm doing this, then I'll listen to any suggestions you have.
sripplinger is offline   Reply With Quote

Old   August 4, 2009, 06:36
Default
  #2
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 21
l_r_mcglashan will become famous soon enough
I assume you're familiar with something like this:

scalar variable = readScalar(dictionary.lookup("variableName"));

Well you can have:

word variable = word(dictionary.lookup("variableName"));
__________________
Laurence R. McGlashan :: Website

Last edited by l_r_mcglashan; August 4, 2009 at 07:14.
l_r_mcglashan is offline   Reply With Quote

Old   August 4, 2009, 12:28
Default
  #3
Member
 
Scott Ripplinger
Join Date: Mar 2009
Posts: 30
Rep Power: 15
sripplinger is on a distinguished road
Yes! I think that is exactly what I am looking for. I'll give it a go and see if it works for me.
sripplinger is offline   Reply With Quote

Reply

Tags
i/o, input, read string

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
[Commercial meshers] Fluent3DMeshToFoam simvun OpenFOAM Meshing & Mesh Conversion 50 January 19, 2020 16:33
[Commercial meshers] Problem converting fluent mesh vinz OpenFOAM Meshing & Mesh Conversion 28 October 12, 2015 07:37
[Commercial meshers] Converting a mesh with splitted cells using fluentMeshToFoam jlpelerin OpenFOAM Meshing & Mesh Conversion 4 April 25, 2011 17:56
[Commercial meshers] TGridFluent mesh with internal by prism layer and internal face for diagnostic sponiar OpenFOAM Meshing & Mesh Conversion 2 March 30, 2009 16:02
[Commercial meshers] FluentMesh conversion problem waynezw0618 OpenFOAM Meshing & Mesh Conversion 12 December 1, 2006 00:12


All times are GMT -4. The time now is 09:56.