CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Accessing field values with in a dynamic mesh motion class (https://www.cfd-online.com/Forums/openfoam-programming-development/155460-accessing-field-values-dynamic-mesh-motion-class.html)

kcn July 1, 2015 06:45

Accessing field values with in a dynamic mesh motion class
 
Hello,

Can some one please tell me how to access field values (for example p & U) from with in a dynamic mesh motion class?

I tried,

const volVectorField& U = db().lookupObject<volVectorField>("U");
But it produced the following error.

db was not declared in this scope.

Can some one please tell me the lines of code to use in order to call a field variable to the class.

Thanks,
kcn

hk318i July 14, 2015 10:43

It is not clear which class you mean.
But if db() is declared and there is no reference to objectRegistry, you can use IOdictionary or mesh or time to get reference to objectRegistry if available.

kcn July 21, 2015 00:52

Thanks Hassan. I managed to access them through mesh.


All times are GMT -4. The time now is 08:48.