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

Dictionary

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 17, 2009, 08:24
Default Hi! When I use a statement
  #1
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 8
maka is on a distinguished road
Hi!

When I use a statement like:
const LESmodel& sgsModel = mesh_.lookupObject<lesmodel>(dict_.name());

where dict_ referes to a dictionary that is passed as input (turbulentProperties).

then I run,

solver .. 001

I get the error:

word::stripInvalid() called for string ..001constantturbulenceProperties

It seems that name() member function of dictionary removes the "/" and that is causing a problem. How can I recover only "turbulenceProperties" of the name?

This V1.3. Thanks.

Best regards,
Maka
maka is offline   Reply With Quote

Old   February 17, 2009, 08:44
Default Try 1.5.x and see if that solv
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 12
henry is on a distinguished road
Try 1.5.x and see if that solves your problem.

H
henry is offline   Reply With Quote

Old   February 17, 2009, 08:58
Default The real problem is that you a
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 17
olesen will become famous soon enough
The real problem is that you are using the dictionary name() method, which returns a full-qualified fileName and not a word.

Try using the fileName::name() method to retrieve the last part of a path.
ie, try this:
const LESmodel& sgsModel = mesh_.lookupObject<lesmodel>(dict_.name().name());
olesen is offline   Reply With Quote

Old   February 18, 2009, 11:26
Default Thanks for the help. Mark is r
  #4
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 8
maka is on a distinguished road
Thanks for the help. Mark is right. His solution solves the problem.
Best regards,
Maka.
maka is offline   Reply With Quote

Reply

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
RadialModel is undefined in dictionary mahaputra OpenFOAM Running, Solving & CFD 1 February 9, 2009 01:16
FunkySetFields dictionary gschaider OpenFOAM Running, Solving & CFD 14 December 3, 2008 22:13
RotateMesh Dictionary File titio OpenFOAM Mesh Utilities 2 March 12, 2008 12:15
Dictionary of fluid mechanics Lam Main CFD Forum 1 April 26, 2007 11:18
Reading a numbered selfmade dictionary fra76 OpenFOAM Running, Solving & CFD 0 April 19, 2006 11:05


All times are GMT -4. The time now is 00:30.