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

Foam::word problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 5, 2009, 23:21
Default Foam::word problem
  #1
New Member
 
Eric.wang
Join Date: Jun 2009
Location: beijing china
Posts: 11
Rep Power: 16
wang.zhy is on a distinguished road
word a = "abc" ;
word b = a +"b"; //no problem
word c = b +"'" ; //do have a problem"word::stripInvalid() called for word abcc....",but this had no
//problem in OF1.5
wang.zhy is offline   Reply With Quote

Old   August 6, 2009, 02:40
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,684
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by wang.zhy View Post
word a = "abc" ;
word b = a +"b"; //no problem
word c = b +"'" ; //do have a problem"word::stripInvalid() called for word abcc....",but this had no
//problem in OF1.5

The documentation is not so clear about it, but a "word" should not contain whitespace, quotes (single or double), '/' path separators, ';' end statement or ' {', '}' brace brackets.

This has been the same for many versions of OpenFOAM, so you are lucky to have not have problems before. What might be different is your setting of the debug variable for 'word'. If it is zero, the words will not be checked on construction. With 1, they'll be checked and you'll get a warning. With 2 they'll be treated as a fatal error.

Thus for your above example (assuming you really want to use a quote inside the word), you really should be using a plain string not a word.
olesen is offline   Reply With Quote

Old   August 6, 2009, 03:01
Default
  #3
New Member
 
Eric.wang
Join Date: Jun 2009
Location: beijing china
Posts: 11
Rep Power: 16
wang.zhy is on a distinguished road
thank you ,olesen !
your suggestion is good for me !
wang.zhy 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
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Incoherent problem table in hollow-fiber spinning Gianni FLUENT 0 April 5, 2008 10:33
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


All times are GMT -4. The time now is 17:47.