graphlow.core.MeshTopology.map_face_to_point#

MeshTopology.map_face_to_point(x_face: T, mode: Literal['sum', 'mean', 'conservative'], method: Literal['segment', 'sparse'] = 'segment') T#

Map face field to point.

Parameters:
x_faceT

Tensor of shape (n_faces, ...).

mode“sum” | “mean” | “conservative”

Mapping mode.

"sum"

Sum of face values that are connected to the point.

"mean"

Row-normalized PF operator.

The point value is computed as the arithmetic average of the values of the faces connected to the point:

\[x_{\text{point}} = \frac{1}{\operatorname{deg}(p)} \sum_{f \ni p} x_{\text{face}}\]

where \(\operatorname{deg}(p)\) is the number of faces connected to point \(p\).

This corresponds to a local averaging over the face stencil around each point. Each neighboring face contributes equally, regardless of the number of points in that face. In general, this method does not guarantee global conservation of the total quantity.

"conservative"

Column-normalized PF operator.

The point value is obtained by distributing each face value equally among the points connected to that face:

\[x_{\text{point}} = \sum_{f \ni p} \left(\frac{1}{\operatorname{deg}(f)}\right) x_{\text{face}}\]

where \(\operatorname{deg}(f)\) is the number of points in face \(f\).

Each face contributes its value conservatively to its vertices, and the total sum over points equals the total sum over faces, making this formulation suitable for conservative transfers.

method“segment” | “sparse”

Mapping method. Default is “segment”.

"segment"

Computes the reduction without explicitly constructing the PF matrix. It is typically more memory efficient, especially on GPU. In most practical settings, this method is recommended.

"sparse"

Computes the reduction by multiplying the PF matrix with the face values. It depends strongly on backend implementation quality but it can be beneficial when the PF matrix is used repeatedly.

Returns:
T

Tensor of shape (n_points, ...).