Wrapper for position + weight to be used in e.g. averaging. More...
#include <weightedPosition.H>


Public Member Functions | |
| weightedPosition () | |
| Construct null. | |
| weightedPosition (const scalar s, const point &p) | |
| Construct from components. | |
| void | operator() (const vectorTensorTransform &vt, const bool forward, UList< weightedPosition > &fld) const |
| void | operator() (const vectorTensorTransform &vt, const bool forward, List< List< weightedPosition > > &flds) const |
| void | operator() (const coupledPolyPatch &cpp, Field< weightedPosition > &fld) const |
| template<template< class > class Container> | |
| void | operator() (const coupledPolyPatch &cpp, Container< weightedPosition > &map) const |
| Public Member Functions inherited from Tuple2< scalar, point > | |
| Tuple2 ()=default | |
| Default construct. | |
| const scalar & | first () const noexcept |
| Access the first element. | |
| const point & | second () const noexcept |
| Access the second element. | |
Static Public Member Functions | |
| static void | getPoints (const UList< weightedPosition > &in, List< point > &out) |
| Get points. | |
| static void | setPoints (const UList< point > &in, UList< weightedPosition > &out) |
| Set points. | |
| static void | plusEqOp (weightedPosition &x, const weightedPosition &y) |
| Summation operator. | |
| static void | syncPoints (const polyMesh &mesh, List< weightedPosition > &) |
| Synchronisation for mesh point positions. | |
| static void | syncPoints (const polyMesh &mesh, const labelUList &meshPoints, List< weightedPosition > &) |
| Synchronisation for patch point positions. | |
Additional Inherited Members | |
| Public Types inherited from Tuple2< scalar, point > | |
| typedef scalar | first_type |
| Type of member first, the first template parameter (T1). | |
| typedef point | second_type |
| Type of member second, the second template parameter (T2). | |
Wrapper for position + weight to be used in e.g. averaging.
This avoids the problems when synchronising locations with e.g. parallel cyclics. The separation vector only applies to locations and not e.g. summed locations. Note that there is no corresponding problem for rotational cyclics.
Typical use might be to e.g. average face centres to points on a patch
const labelListList& pointFaces = pp.pointFaces(); const vectorField::subField faceCentres = pp.faceCentres();
Field<weightedPosition> avgBoundary(pointFaces.size());
forAll(pointFaces, pointi) { const labelList& pFaces = pointFaces[pointi]; avgBoundary[pointi].first() = pFaces.size(); avgBoundary[pointi].second() = sum(pointField(faceCentres, pFaces)); } syncTools::syncPointList ( mesh, pp.meshPoints(), avgBoundary, weightedPosition::plusEqOp, // combine op pTraits<weightedPosition>::zero,// null value (not used) pTraits<weightedPosition>::zero // transform class );
Definition at line 95 of file weightedPosition.H.
| weightedPosition | ( | ) |
Construct null.
Definition at line 38 of file weightedPosition.C.
References Tuple2< scalar, point >::Tuple2().
Referenced by plusEqOp().


| weightedPosition | ( | const scalar | s, |
| const point & | p ) |
Construct from components.
Definition at line 44 of file weightedPosition.C.
References p, s(), and Tuple2< scalar, point >::Tuple2().

|
static |
Get points.
Definition at line 52 of file weightedPosition.C.
References Tuple2< scalar, point >::first(), UList< T >::first(), forAll, Foam::mag(), List< T >::resize_nocopy(), and UList< T >::size().
Referenced by snappySnapDriver::avgCellCentres(), operator()(), and operator()().


|
static |
Set points.
Definition at line 71 of file weightedPosition.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, UList< T >::first(), Foam::min(), and UList< T >::size().
Referenced by operator()(), and operator()().


|
static |
Summation operator.
Definition at line 98 of file weightedPosition.C.
References weightedPosition(), x, and y.
Referenced by syncPoints(), and syncPoints().


| void operator() | ( | const vectorTensorTransform & | vt, |
| const bool | forward, | ||
| UList< weightedPosition > & | fld ) const |
Definition at line 109 of file weightedPosition.C.
References fld(), getPoints(), and setPoints().
Referenced by operator()().


| void operator() | ( | const vectorTensorTransform & | vt, |
| const bool | forward, | ||
| List< List< weightedPosition > > & | flds ) const |
Definition at line 132 of file weightedPosition.C.
References fld(), and operator()().

| void operator() | ( | const coupledPolyPatch & | cpp, |
| Field< weightedPosition > & | fld ) const |
Definition at line 146 of file weightedPosition.C.
References fld(), getPoints(), and setPoints().

| void operator() | ( | const coupledPolyPatch & | cpp, |
| Container< weightedPosition > & | map ) const |
Definition at line 27 of file weightedPositionTemplates.C.
References fld(), forAllConstIters, forAllIters, and Foam::mag().

|
static |
Synchronisation for mesh point positions.
Definition at line 161 of file weightedPosition.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld(), mesh, plusEqOp(), and syncTools::syncPointList().
Referenced by snappySnapDriver::avgCellCentres().


|
static |
Synchronisation for patch point positions.
Definition at line 185 of file weightedPosition.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld(), mesh, plusEqOp(), UList< T >::size(), and syncTools::syncPointList().
