How to exchange information within coded fvpatchfield between different fields
Dear foamers,
I want to define a field within a volScalarField called psi and access it within another volVectorField named psiVector. I have followed the thread https://www.cfd-online.com/Forums/op...-scalar-3.html. I defined an IOdictionary within createField.H, and tried to modify it within psi field. However, when I tried to access the IOdictionary object within psiVector, the IOdictionary I accessed from the registry was empty. In order to illustrate it more clearly, there are the codes and output. 1. Define an IOobject within createFields.H file. Code:
IOdictionary regedDictionary Code:
left Code:
left Code:
IOdictionary regedDictionary from psi: |
The problem has been solved. Sorry for my foolish error. The error came from the definition of the IOdictionary within createFields.H. The definition should be like this:
Code:
IOdictionary regedDictionary So the value of dictionary could be updated within psiVector. By the way, is it possible to define a new variable or dictionary within psi that can be accessed within psiVector. So the modification of the original solver can be avoided. Do you have any ideals? I have tried the following: psi: Code:
left psiVector: Code:
left I got the following output: Code:
time = 2 Neither the IOdictionary testDict nor the vectorIOField regVectorField could be accessed from psiVectoer. Any suggestions would be appreciated. |
All times are GMT -4. The time now is 01:30. |