diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.C index 1d40659574..102501e1ba 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,6 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +UNARY_FUNCTION(tensor, tensor, T, transform) UNARY_FUNCTION(scalar, tensor, tr, transform) UNARY_FUNCTION(sphericalTensor, tensor, sph, transform) UNARY_FUNCTION(symmTensor, tensor, symm, transform) @@ -58,6 +59,9 @@ UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, sign) UNARY_OPERATOR(vector, tensor, *, hdual, transform) UNARY_OPERATOR(tensor, vector, *, hdual, transform) +BINARY_OPERATOR(vector, vector, tensor, /, '|', divide) +BINARY_TYPE_OPERATOR(vector, vector, tensor, /, '|', divide) + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/functionObjects/field/fieldsExpression/fieldsExpression.C b/src/functionObjects/field/fieldsExpression/fieldsExpression.C index 1898022e21..a0697e02a9 100644 --- a/src/functionObjects/field/fieldsExpression/fieldsExpression.C +++ b/src/functionObjects/field/fieldsExpression/fieldsExpression.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -143,6 +143,7 @@ bool Foam::functionObjects::fieldsExpression::execute() found \ || mesh_.foundObject>(fieldNames_[i]); FOR_ALL_FIELD_TYPES(findFieldType, VolField); + FOR_ALL_FIELD_TYPES(findFieldType, VolInternalField); FOR_ALL_FIELD_TYPES(findFieldType, SurfaceField); #undef findFieldType diff --git a/src/functionObjects/field/fieldsExpression/fieldsExpression.H b/src/functionObjects/field/fieldsExpression/fieldsExpression.H index 54d55d5da2..ab6e390023 100644 --- a/src/functionObjects/field/fieldsExpression/fieldsExpression.H +++ b/src/functionObjects/field/fieldsExpression/fieldsExpression.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,6 +44,10 @@ SourceFiles namespace Foam { + +template +class DimensionedField; + namespace functionObjects { @@ -57,6 +61,15 @@ class fieldsExpression { protected: + // Protected typedefs + + //- Internal field typedef that doesn't go via the + // GeometricField::Internal typedef, and therefore allows template + // argument deduction of the Type + template + using VolInternalField = DimensionedField; + + // Protected member data //- Names of fields to process diff --git a/src/functionObjects/field/fieldsExpression/fieldsExpressionTemplates.C b/src/functionObjects/field/fieldsExpression/fieldsExpressionTemplates.C index 705f8aab6e..604edf6ea1 100644 --- a/src/functionObjects/field/fieldsExpression/fieldsExpressionTemplates.C +++ b/src/functionObjects/field/fieldsExpression/fieldsExpressionTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -158,6 +158,7 @@ bool Foam::functionObjects::fieldsExpression::calcOp() { return calcGeoFieldOp() + || calcGeoFieldOp() || calcGeoFieldOp(); } diff --git a/src/functionObjects/field/uniform/uniform.C b/src/functionObjects/field/uniform/uniform.C index eeb765c72d..c4ab0aaa98 100644 --- a/src/functionObjects/field/uniform/uniform.C +++ b/src/functionObjects/field/uniform/uniform.C @@ -82,6 +82,7 @@ bool Foam::functionObjects::uniform::read(const dictionary& dict) Type##Value_ = dict.lookup("value"); \ } FOR_ALL_FIELD_TYPES(readValueType, VolField); + FOR_ALL_FIELD_TYPES(readValueType, VolInternalField); FOR_ALL_FIELD_TYPES(readValueType, SurfaceField); #undef readValueType @@ -94,6 +95,7 @@ bool Foam::functionObjects::uniform::read(const dictionary& dict) #define getFieldType(Type, GeoField) \ fieldTypes.append(GeoField::typeName); FOR_ALL_FIELD_TYPES(getFieldType, VolField); + FOR_ALL_FIELD_TYPES(getFieldType, VolInternalField); FOR_ALL_FIELD_TYPES(getFieldType, SurfaceField); #undef getFieldType @@ -124,6 +126,7 @@ bool Foam::functionObjects::uniform::execute() ); \ } FOR_ALL_FIELD_TYPES(calcType, VolField); + FOR_ALL_FIELD_TYPES(calcType, VolInternalField); FOR_ALL_FIELD_TYPES(calcType, SurfaceField); #undef calcType