Various utility functions to work on Fields. More...
Functions | |
template<class Tout , class T1 , class UnaryOp > | |
void | assign (Field< Tout > &result, const Field< T1 > &a, const UnaryOp &op) |
Populate a field as the result of a unary operation on an input. More... | |
template<class Tout , class T1 , class T2 , class BinaryOp > | |
void | assign (Field< Tout > &result, const Field< T1 > &a, const Field< T2 > &b, const BinaryOp &bop) |
Populate a field as the result of a binary operation on two inputs. More... | |
template<class T , class BinaryOp > | |
void | ternary (Field< T > &result, const Field< T > &a, const Field< T > &b, const BinaryOp &bop) |
Emulate a ternary operation, selecting values from a or b depending on the binary predicate. More... | |
template<class T , class BoolListType , class FlipOp > | |
void | ternarySelect (Field< T > &result, const BoolListType &cond, const Field< T > &a, const Field< T > &b, const FlipOp &flip) |
Emulate a ternary operation, selecting values from a or b depending on the conditional. More... | |
template<class T , class FlipOp > | |
void | ternarySelect (Field< T > &result, const bitSet &cond, const Field< T > &a, const Field< T > &b, const FlipOp &flip) |
Emulate a ternary operation, selecting values from a or b depending on the conditional. More... | |
template<class T , class BoolListType > | |
void | ternarySelect (Field< T > &result, const BoolListType &cond, const Field< T > &a, const Field< T > &b) |
Emulated ternary operation, without condition flipping. More... | |
template<class T > | |
void | ternarySelect (Field< T > &result, const bitSet &cond, const Field< T > &a, const Field< T > &b) |
Emulated ternary operation, without condition flipping. More... | |
template<class T1 , class T2 > | |
Tuple2< T1, T2 > | findMinData (const Field< T1 > &vals, const Field< T2 > &data) |
Locate the min value in a field and return it and associated data. More... | |
template<class T1 , class T2 > | |
Tuple2< T1, T2 > | findMaxData (const Field< T1 > &vals, const Field< T2 > &data) |
Locate the max value in a field and return it and associated data. More... | |
template<class Tout , class T1 , class UnaryOp , template< class > class PatchField, class GeoMesh > | |
void | assign (GeometricField< Tout, PatchField, GeoMesh > &result, const GeometricField< T1, PatchField, GeoMesh > &a, const UnaryOp &op) |
Populate a geometric field as the result of a unary operation on an input. More... | |
template<class Tout , class T1 , class T2 , class BinaryOp , template< class > class PatchField, class GeoMesh > | |
void | assign (GeometricField< Tout, PatchField, GeoMesh > &result, const GeometricField< T1, PatchField, GeoMesh > &a, const GeometricField< T2, PatchField, GeoMesh > &b, const BinaryOp &bop) |
Populate a geometric field from the binary operation on two inputs. More... | |
template<class T , class BinaryOp , template< class > class PatchField, class GeoMesh > | |
void | ternary (GeometricField< T, PatchField, GeoMesh > &result, const GeometricField< T, PatchField, GeoMesh > &a, const GeometricField< T, PatchField, GeoMesh > &b, const BinaryOp &bop) |
Emulate a ternary operation, selecting values from a or b depending on the binary predicate. More... | |
template<class T , class BoolType , class FlipOp , template< class > class PatchField, class GeoMesh > | |
void | ternarySelect (GeometricField< T, PatchField, GeoMesh > &result, const GeometricField< BoolType, PatchField, GeoMesh > &cond, const GeometricField< T, PatchField, GeoMesh > &a, const GeometricField< T, PatchField, GeoMesh > &b, const FlipOp &flip) |
Emulate a ternary operation, selecting field values from a or b depending on the conditional. More... | |
template<class Tout , class T1 , class UnaryOp > | |
void | assign (pointPatchField< Tout > &result, const pointPatchField< T1 > &a, const UnaryOp &op) |
template<class Tout , class T1 , class T2 , class BinaryOp > | |
void | assign (pointPatchField< Tout > &result, const pointPatchField< T1 > &a, const pointPatchField< T2 > &b, const BinaryOp &bop) |
template<class T , class BinaryOp > | |
void | ternary (pointPatchField< T > &result, const pointPatchField< T > &a, const pointPatchField< T > &b, const BinaryOp &bop) |
template<class T , class BoolType , class FlipOp > | |
void | ternarySelect (pointPatchField< T > &result, const pointPatchField< BoolType > &cond, const pointPatchField< T > &a, const pointPatchField< T > &b, const FlipOp &flip) |
Populate a field as the result of a unary operation on an input.
It is permissible for inputs/outputs to refer to the same field(s), but partially overlapping regions are ill-defined.
Examples,
Example of using the Random::uniformGeneratorOp unary operator to populate a random field,
Definition at line 28 of file FieldOps.C.
References Foam::abort(), UList< Type >::begin(), UList< Type >::cbegin(), UList< Type >::cend(), Foam::FatalError, FatalErrorInFunction, Foam::nl, UList< Type >::size(), and Foam::transform().
Referenced by assign(), fileName::assign(), keyType::assign(), wordRe::assign(), Field< Foam::vector >::assign(), coordinateSystem::coordinateSystem(), Field< Foam::vector >::Field(), exprDriver::fill_random(), word::operator=(), keyType::operator=(), wordRe::operator=(), fileName::operator=(), valuePointPatchField< vector >::readValueEntry(), fvsPatchField< Type >::readValueEntry(), faePatchField< Type >::readValueEntry(), faPatchField< Type >::readValueEntry(), fvPatchField< vector >::readValueEntry(), scalars::scalars(), wordRe::set(), parseDriver::setInternalFieldResult(), and SHA1Digest::SHA1Digest().
void assign | ( | Field< Tout > & | result, |
const Field< T1 > & | a, | ||
const Field< T2 > & | b, | ||
const BinaryOp & | bop | ||
) |
Populate a field as the result of a binary operation on two inputs.
It is permissible for inputs/outputs to refer to the same field(s), but partially overlapping regions are ill-defined.
Examples,
Definition at line 50 of file FieldOps.C.
References Foam::abort(), Foam::constant::physicoChemical::b, UList< Type >::begin(), UList< Type >::cbegin(), UList< Type >::cend(), Foam::FatalError, FatalErrorInFunction, Foam::nl, UList< Type >::size(), and Foam::transform().
void ternary | ( | Field< T > & | result, |
const Field< T > & | a, | ||
const Field< T > & | b, | ||
const BinaryOp & | bop | ||
) |
Emulate a ternary operation, selecting values from a or b depending on the binary predicate.
Examples,
Definition at line 73 of file FieldOps.C.
References Foam::abort(), Foam::constant::physicoChemical::b, Foam::FatalError, FatalErrorInFunction, forAll, Foam::nl, and UList< T >::size().
Referenced by ternary().
void ternarySelect | ( | Field< T > & | result, |
const BoolListType & | cond, | ||
const Field< T > & | a, | ||
const Field< T > & | b, | ||
const FlipOp & | flip | ||
) |
Emulate a ternary operation, selecting values from a or b depending on the conditional.
The meaning of the conditional is adjusted by the flip operation, which is typically Foam::identityOp() or Foam::flipBoolOp()
Similar parameter requirements as Foam::subset()
Examples,
Definition at line 99 of file FieldOps.C.
References Foam::abort(), Foam::constant::physicoChemical::b, Foam::FatalError, FatalErrorInFunction, forAll, Foam::nl, and UList< T >::size().
Referenced by ternarySelect().
void ternarySelect | ( | Field< T > & | result, |
const bitSet & | cond, | ||
const Field< T > & | a, | ||
const Field< T > & | b, | ||
const FlipOp & | flip | ||
) |
Emulate a ternary operation, selecting values from a or b depending on the conditional.
The meaning of the conditional is adjusted by the flip operation, which is typically Foam::identityOp() or Foam::flipBoolOp()
Definition at line 126 of file FieldOps.C.
References Foam::abort(), Foam::constant::physicoChemical::b, Foam::FatalError, FatalErrorInFunction, forAll, Foam::nl, and UList< T >::size().
void Foam::FieldOps::ternarySelect | ( | Field< T > & | result, |
const BoolListType & | cond, | ||
const Field< T > & | a, | ||
const Field< T > & | b | ||
) |
Emulated ternary operation, without condition flipping.
Definition at line 181 of file FieldOps.H.
References Foam::constant::physicoChemical::b, and ternarySelect().
void Foam::FieldOps::ternarySelect | ( | Field< T > & | result, |
const bitSet & | cond, | ||
const Field< T > & | a, | ||
const Field< T > & | b | ||
) |
Emulated ternary operation, without condition flipping.
Definition at line 197 of file FieldOps.H.
References Foam::constant::physicoChemical::b, and ternarySelect().
Locate the min value in a field and return it and associated data.
This can be used, for example, to return a value/position combination.
Referenced by exprDriver::getPositionOfMinimum().
Locate the max value in a field and return it and associated data.
This can be used, for example, to return a value/position combination.
Referenced by exprDriver::getPositionOfMaximum().
void Foam::FieldOps::assign | ( | GeometricField< Tout, PatchField, GeoMesh > & | result, |
const GeometricField< T1, PatchField, GeoMesh > & | a, | ||
const UnaryOp & | op | ||
) |
Populate a geometric field as the result of a unary operation on an input.
It is permissible for inputs/outputs to refer to the same field(s), but partially overlapping regions are ill-defined.
Definition at line 62 of file GeometricFieldOps.H.
References assign(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), GeometricField< Type, PatchField, GeoMesh >::correctLocalBoundaryConditions(), GeometricField< Type, PatchField, GeoMesh >::primitiveField(), and GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef().
void Foam::FieldOps::assign | ( | GeometricField< Tout, PatchField, GeoMesh > & | result, |
const GeometricField< T1, PatchField, GeoMesh > & | a, | ||
const GeometricField< T2, PatchField, GeoMesh > & | b, | ||
const BinaryOp & | bop | ||
) |
Populate a geometric field from the binary operation on two inputs.
It is permissible for inputs/outputs to refer to the same field(s), but partially overlapping regions are ill-defined.
Definition at line 108 of file GeometricFieldOps.H.
References assign(), Foam::constant::physicoChemical::b, GeometricField< Type, PatchField, GeoMesh >::boundaryField(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), GeometricField< Type, PatchField, GeoMesh >::correctLocalBoundaryConditions(), GeometricField< Type, PatchField, GeoMesh >::primitiveField(), and GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef().
void Foam::FieldOps::ternary | ( | GeometricField< T, PatchField, GeoMesh > & | result, |
const GeometricField< T, PatchField, GeoMesh > & | a, | ||
const GeometricField< T, PatchField, GeoMesh > & | b, | ||
const BinaryOp & | bop | ||
) |
Emulate a ternary operation, selecting values from a or b depending on the binary predicate.
Definition at line 155 of file GeometricFieldOps.H.
References Foam::constant::physicoChemical::b, GeometricField< Type, PatchField, GeoMesh >::boundaryField(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), GeometricField< Type, PatchField, GeoMesh >::correctLocalBoundaryConditions(), GeometricField< Type, PatchField, GeoMesh >::primitiveField(), GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), and ternary().
void Foam::FieldOps::ternarySelect | ( | GeometricField< T, PatchField, GeoMesh > & | result, |
const GeometricField< BoolType, PatchField, GeoMesh > & | cond, | ||
const GeometricField< T, PatchField, GeoMesh > & | a, | ||
const GeometricField< T, PatchField, GeoMesh > & | b, | ||
const FlipOp & | flip | ||
) |
Emulate a ternary operation, selecting field values from a or b depending on the conditional.
Since boolean fields are not normally used, a flip operation is a general requirement.
Definition at line 206 of file GeometricFieldOps.H.
References Foam::constant::physicoChemical::b, GeometricField< Type, PatchField, GeoMesh >::boundaryField(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), GeometricField< Type, PatchField, GeoMesh >::correctLocalBoundaryConditions(), GeometricField< Type, PatchField, GeoMesh >::primitiveField(), GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), and ternarySelect().
|
inline |
Definition at line 353 of file pointPatchFieldFunctions.H.
|
inline |
Definition at line 363 of file pointPatchFieldFunctions.H.
|
inline |
Definition at line 373 of file pointPatchFieldFunctions.H.
|
inline |
Definition at line 383 of file pointPatchFieldFunctions.H.