CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Dictionary (https://www.cfd-online.com/Forums/openfoam-bugs/62311-dictionary.html)

maka February 17, 2009 07:24

Hi! When I use a statement
 
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

henry February 17, 2009 07:44

Try 1.5.x and see if that solv
 
Try 1.5.x and see if that solves your problem.

H

olesen February 17, 2009 07:58

The real problem is that you a
 
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());

maka February 18, 2009 10:26

Thanks for the help. Mark is r
 
Thanks for the help. Mark is right. His solution solves the problem.
Best regards,
Maka.


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