CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   A realy easy variable - problem (

wernsen January 4, 2013 09:41

A realy easy variable - problem
Hey guys,

I am going crazy. Here the code:


forAll(pSampledPlaneList, pI)
      fileName fname("plane_" + word(pI) + ".obj");

I am a having planeList and I want to write them down. It works but there is a problem with the file name. The output looks like this: plane_?.obj

I think there is a problem with the variable type but I cannot solve it.

Thanks for any hint...

l_r_mcglashan January 4, 2013 12:36


fileName fname("plane_" + name(pI) + ".obj");

wernsen January 7, 2013 11:43

thanks alot it works. But can you tell me how can I find out this the next time by my own? Just a few hints would be nice.

l_r_mcglashan January 7, 2013 14:25

Not sure, I just know it, but I often use grep to try and find out if there's already something similar to what I want to do around. You could have done the following search:


grep -e "fileName.*(*.obj" -R .
and one of the hits gives:

fileName cutsFile("hexCellLooper_" + name(cellI) + ".obj");

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