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

A realy easy variable - problem

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By l_r_mcglashan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 4, 2013, 09:41
Default A realy easy variable - problem
  #1
Member
 
Martin
Join Date: Nov 2011
Posts: 35
Rep Power: 15
wernsen is on a distinguished road
Hey guys,

I am going crazy. Here the code:

Code:
forAll(pSampledPlaneList, pI)
{
       pSampledPlaneList[pI]().update();
       fileName fname("plane_" + word(pI) + ".obj");
       pSampledPlaneList[pI]().write(fname);
}
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...
martin
wernsen is offline   Reply With Quote

Old   January 4, 2013, 12:36
Default
  #2
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23
l_r_mcglashan will become famous soon enough
Code:
fileName fname("plane_" + name(pI) + ".obj");
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   January 7, 2013, 11:43
Default
  #3
Member
 
Martin
Join Date: Nov 2011
Posts: 35
Rep Power: 15
wernsen is on a distinguished road
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.
wernsen is offline   Reply With Quote

Old   January 7, 2013, 14:25
Default
  #4
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23
l_r_mcglashan will become famous soon enough
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:

Code:
grep -e "fileName.*(*.obj" -R .
and one of the hits gives:
Code:
fileName cutsFile("hexCellLooper_" + name(cellI) + ".obj");
wyldckat and wernsen like this.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Reply


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
Problem installing on 64bit with ver13 jonititan OpenFOAM Installation 5 May 12, 2006 19:42
Problem installing on 64bit with ver13 jonititan OpenFOAM Installation 0 April 28, 2006 06:45
Easy problem waiting online joywe OpenFOAM Installation 8 May 30, 2005 13:19
Periodic flow boundary condition problem sudha FLUENT 3 April 28, 2004 09:40
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


All times are GMT -4. The time now is 13:53.