Make a function available to a volSymmTensorField
Hello to all,
I'm new to programming in OpenFoam and would like to know the following: I defined a custom function in OpenFoam that takes as input two tensors and returns a symmetric tensor. Code:
inline SymmTensor<scalar> test(const Tensor<scalar>& a, const Tensor<scalar>& b) I would like to be able to initialize a volSymmTensorField with this function, taking as input two volTensorFields .e.g, Code:
volTensorField a Is this possible? What steps do I need to take to make this work? Best Regards! Is |
Sure it is possible, but is a bit of work. Starting from the bottom and working our way up.
- define function operating on two tensors - define function for plain lists/fields - see FieldFunctions.H - define function for a field of fields - see FieldFieldFunctions.H - define function for dimensioned (internal) fields - see DimensionedFieldFunctions.H - finally define function for volume fields, handling internal and boundary (FieldFields) - see GeometricFieldFunctions.H A bit of work, but certainly a really good way to learn. |
All times are GMT -4. The time now is 02:54. |