CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Creating field of strings with "mesh-structure" (https://www.cfd-online.com/Forums/openfoam-programming-development/129799-creating-field-strings-mesh-structure.html)

maybee February 13, 2014 05:03

Creating field of strings with "mesh-structure"
 
hi,

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

Code:

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.

ngj February 13, 2014 13:49

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:

Code:

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

forAll (stringField, stringi)
{
    // Populate with correct string
}

Kind regards,

Niels

maybee February 14, 2014 09:49

Hi,

thx for the answer - i will check this later when I have to implement this into my code. :)


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