January 29, 2021, 12:28
|
Creating file dict during a routine
|
#1
|
New Member
Join Date: Sep 2020
Posts: 6
Rep Power: 6
|
Hi All!
I have searched for this problem but none asked before me.
I am trying to build and write a new dictionary inside my OF solver to pass some values to another solver. In simple words, I want to create something like "transportProperties" but it must be written by my solver. I defined the IOdictionary in my code and set a subdict and some keys with their values:
Code:
IOdictionary newProperties(
IOobject("newProperties",
runTime.constant(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE));
dictionary& subdict = newProperties.subDict(subname);
subdict.set("key1",value1);
subdict.set("key2", value2);
newProperties.regIOobject::write();
I am trying to write this newProperties dictionary but even if compile, it crashes because it searches for the dictionary inside the folders (the error is something like "can't find the entry subname"). How can I write a dictionary and solve this problem? Thanks in advance.
|
|
|