reference to a velocity component
Hello to all,
I would like to know if it is possible to get a reference to a component of the velocity. Code:
volVectorField U Code:
scalarField& Ux = U.component(0) // This does not appear to work |
If you take U.component(vector::X), you are extracting a tmp field, cannot bind this to a reference!
Code:
tmp<scalarField> tcompx = U.component(vector::X); You need to think about how the data is stored. The vector field (U) is a array of structs x/y/z. But you wish to have something like a struct of arrays, which is not there. If you want to be memory efficient, you can loop over the velocity field and return the x() component of the individual velocity entry. This will be memory efficient. Not sure if it fits nicely into your code though. |
All times are GMT -4. The time now is 07:38. |