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/)
-   -   3D tensorField (https://www.cfd-online.com/Forums/openfoam-programming-development/84062-3d-tensorfield.html)

nikwin January 19, 2011 07:21

3D tensorField
 
Hello,

I would need a field where I can store a fieldField<Field, tensor> at every position in the field. Is this possible to do in a smart way in OpenFoam? If not, does anyone know how it can be done in C++ in a rel. simple way?

Regards
/NW

Cyp January 19, 2011 11:52

hi Niklas,

you can use volTensorField :

Code:

volTensorField T
(
    IOobject
    (
        "T",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
    ),
    mesh,
dimensionedTensor("T",dimensionSet(-1,3,1,0,0),tensor::zero)
);

Regards,
Cyp

nikwin January 20, 2011 07:25

Clumsy of me saying I needed a 3D tensorField. What I needed is a matrix to store tensor variables in with 3dimensions. A standard matrix or the FieldField-class gives the oppurtunity to store data in 2dimensions of e.g. the type tensor.

I solved my issue by storing the data in a larger list, which works but makes the indexing more complex.

Anyway, Thank for your reply, Cyp!
/NW


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