mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: postOperation for surfaceFieldValue
- currently only 'none' or 'sqrt', which can be useful in combination with integrate or averaging functions.
This commit is contained in:
@ -286,11 +286,11 @@ Type Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
template<class Type, class WeightType>
|
||||
bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
|
||||
(
|
||||
const word& fieldName,
|
||||
const scalarField& weightField,
|
||||
const Field<WeightType>& weightField,
|
||||
const bool orient
|
||||
)
|
||||
{
|
||||
@ -355,6 +355,22 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
|
||||
|
||||
Type result = processValues(values, Sf, weightField);
|
||||
|
||||
switch (postOperation_)
|
||||
{
|
||||
case postOpNone:
|
||||
break;
|
||||
case postOpSqrt:
|
||||
{
|
||||
// sqrt: component-wise - doesn't change the type
|
||||
for (direction d=0; d < pTraits<Type>::nComponents; ++d)
|
||||
{
|
||||
setComponent(result, d)
|
||||
= sqrt(mag(component(result, d)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
file()<< tab << result;
|
||||
|
||||
Log << " " << operationTypeNames_[operation_]
|
||||
|
||||
Reference in New Issue
Block a user