CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

Creating field of strings with "mesh-structure"

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

LinkBack Thread Tools Display Modes
Old   February 13, 2014, 06:03
Default Creating field of strings with "mesh-structure"
Senior Member
Join Date: Jan 2012
Posts: 159
Rep Power: 7
maybee is on a distinguished road

I need to create a field that consists of a function (string) for each cell of the current geometry like of type

GeometricField<string, fvPatchField, volMesh>

The field should have the structure of the current mesh. Is this possible and how would I do it?
I've read about the classes "geometricField" and "dimensionedField", but I am not sure if it s possible and how to do it.

Last edited by maybee; February 13, 2014 at 07:46.
maybee is offline   Reply With Quote

Old   February 13, 2014, 14:49
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,754
Rep Power: 29
ngj will become famous soon enoughngj will become famous soon enough
Hi Maybee,

It sounds a bit weird, because I am pretty sure that the boundary field is not defined for strings. Do something along the following lines:

List<string> stringField(mesh.C().internalField().size());

forAll (stringField, stringi)
    // Populate with correct string
Kind regards,

Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   February 14, 2014, 10:49
Senior Member
Join Date: Jan 2012
Posts: 159
Rep Power: 7
maybee is on a distinguished road

thx for the answer - i will check this later when I have to implement this into my code.
maybee is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 17:51
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 15:37
Creating a mesh of the flow field in GAMBIT Vidya Raja FLUENT 0 October 3, 2005 09:53

All times are GMT -4. The time now is 08:36.