objectRegistry::lookupObject<scalar>
(I have tried to add to an existing thread of the same title initiated by Brent Craven a couple years ago but don't seem to have been successful. I'm reposting here to cover my bases. Sorry for duplication, if any).
I have followed the procedure outlined in an earlier post (quoted at bottom) to update the boundary value in the course of a run and seem to have it working. But I get a warning message that is troubling me and I'd like to eliminate it. Here is the warning: --> FOAM Warning : From function Field<Type>::Field(const word& keyword, const dictionary&, const label) in file /....../Field.C at line 262 Reading "myDict" from line 0 to line 0 expected keyword 'uniform' or 'nonuniform', assuming deprecated Field format from Foam version 2.0. Here is my coding: The dictionary is created in createFields.H: Code:
IOdictionary myDict Code:
myDict.set("myValue",aeq[m][n]); Code:
const dictionary& myDict = this->db().objectRegistry::lookupObject<IOdictionary>("myDict"); Quote:
|
May I ask why you are using a dictionary, if you define the variable in the source code anyhow?
|
Hi Bernhard,
My understanding is that this is a good way to bring a variable from the scope of the main solver into the boundary condition (following the discussion in the quoted thread). It is not practical to calculate this value within the boundary condition because a cubic equation needs to be solved at each point in wavenumber space to fill the array (aeq[m][n]) and it doesn't change over the course of the run. Also, I would have to bring a number of additional variables into the bc to do the calculation. |
Thanks to help from Dave Boger and Brent Craven, the solution was found to be replacing
Code:
myDict.set("myValue",aeq[m][n]); Code:
std::stringstream strs; |
All times are GMT -4. The time now is 00:13. |