mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: 'mag' postOperation for surfaceFieldValue (#1622)
- support postOperation for volFieldValue as well
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -407,9 +407,19 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
|
||||
{
|
||||
break;
|
||||
}
|
||||
case postOpMag:
|
||||
{
|
||||
// mag: component-wise - does not change the type
|
||||
for (direction d=0; d < pTraits<Type>::nComponents; ++d)
|
||||
{
|
||||
setComponent(result, d)
|
||||
= mag(component(result, d));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case postOpSqrt:
|
||||
{
|
||||
// sqrt: component-wise - doesn't change the type
|
||||
// sqrt: component-wise - does not change the type
|
||||
for (direction d=0; d < pTraits<Type>::nComponents; ++d)
|
||||
{
|
||||
setComponent(result, d)
|
||||
@ -442,6 +452,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
|
||||
Log << " " << prefix << regionName_ << suffix
|
||||
<< " of " << fieldName << " = ";
|
||||
|
||||
|
||||
// Operation tagged that it always returns scalar?
|
||||
const bool alwaysScalar(operation_ & typeScalar);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user