functionObjects: uniform, fieldsExpression: Support for dimensioned fields
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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>();
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user