CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Can we have access to cells coordinates? (https://www.cfd-online.com/Forums/openfoam-solving/67426-can-we-have-access-cells-coordinates.html)

TurbJet January 23, 2018 14:39

Quote:

Originally Posted by villet (Post 226368)
This may look a bit tricky, but you can get the y-coordinate (scalarField) at cell center like this:

mesh.C().component(vector::Y)

or

mesh.C().component(1)

so use it in the place of "y" in your equation. Basically "mesh.C()" is a vector field of cell center coordinates. I'm sure after this it's easier to look for more examples.

Ville

what if I want to use command mesh.C() in other source files? I tried it but the compiler keeps telling me that I have to declare mesh first. So how am I gonna access mesh in other source file and declare it?


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