diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index 2a39ff4ec..40ad8ccdc 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -48,11 +48,13 @@ namespace Foam template<> - const char* NamedEnum::names[] = + const char* NamedEnum::names[] = { "none", "sum", + "weightedSum", "sumMag", + "weightedSumMag", "sumDirection", "sumDirectionBalance", "average", @@ -78,7 +80,7 @@ namespace Foam const Foam::NamedEnum Foam::fieldValues::faceSource::sourceTypeNames_; -const Foam::NamedEnum +const Foam::NamedEnum Foam::fieldValues::faceSource::operationTypeNames_; diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H index 7a94ffc7a..4f01c529a 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H @@ -185,7 +185,9 @@ public: { opNone, opSum, + opWeightedSum, opSumMag, + opWeightedSumMag, opSumDirection, opSumDirectionBalance, opAverage, @@ -201,7 +203,7 @@ public: }; //- Operation type names - static const NamedEnum operationTypeNames_; + static const NamedEnum operationTypeNames_; private: diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C index d86e02f02..7847da28a 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C @@ -143,11 +143,21 @@ Type Foam::fieldValues::faceSource::processSameTypeValues result = sum(values); break; } + case opWeightedSum: + { + result = sum(weightField*values); + break; + } case opSumMag: { result = sum(cmptMag(values)); break; } + case opWeightedSumMag: + { + result = sum(weightField*cmptMag(values)); + break; + } case opSumDirection: { FatalErrorIn