functionObjects: uniform, fieldsExpression: Support for dimensioned fields

This commit is contained in:
Will Bainbridge
2023-02-21 12:55:16 +00:00
parent 1321112963
commit e6b517a1e3
5 changed files with 26 additions and 4 deletions

View File

@ -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)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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<GeoField<Type>>(fieldNames_[i]);
FOR_ALL_FIELD_TYPES(findFieldType, VolField);
FOR_ALL_FIELD_TYPES(findFieldType, VolInternalField);
FOR_ALL_FIELD_TYPES(findFieldType, SurfaceField);
#undef findFieldType

View File

@ -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 Type, class GeoMesh>
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<class Type>
using VolInternalField = DimensionedField<Type, volMesh>;
// Protected member data
//- Names of fields to process

View File

@ -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<VolField, Op>()
|| calcGeoFieldOp<VolInternalField, Op>()
|| calcGeoFieldOp<SurfaceField, Op>();
}

View File

@ -82,6 +82,7 @@ bool Foam::functionObjects::uniform::read(const dictionary& dict)
Type##Value_ = dict.lookup<Type>("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<Type>::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