|
[Sponsors] |
August 3, 2009, 19:06 |
reading in a string
|
#1 |
Member
Scott Ripplinger
Join Date: Mar 2009
Posts: 30
Rep Power: 17 |
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. |
|
August 4, 2009, 06:36 |
|
#2 |
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23 |
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. |
|
August 4, 2009, 12:28 |
|
#3 |
Member
Scott Ripplinger
Join Date: Mar 2009
Posts: 30
Rep Power: 17 |
Yes! I think that is exactly what I am looking for. I'll give it a go and see if it works for me.
|
|
Tags |
i/o, input, read string |
|
|
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 |