graphlow.core.MeshTopology.map_point_to_face#

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

Map point field to face.

Parameters:
x_pointT

Tensor of shape (n_points, ...).

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

Mapping mode.

"sum"

Sum of point values in each face.

"mean"

Row-normalized FP operator.

The face value is computed as the simple average of the values at the points connected to the face:

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

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

This corresponds to a local arithmetic averaging over the face stencil. It treats each point in the face equally, regardless of how many faces that point belongs to. In general, this method does not guarantee global conservation of the total quantity.

"conservative"

Column-normalized FP operator.

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

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

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

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

method“segment” | “sparse”

Mapping method. Default is “segment”.

"segment"

Computes the reduction without explicitly constructing the FP 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 FP matrix with the point values. It depends strongly on backend implementation quality but it can be beneficial when the FP matrix is used repeatedly.

Returns:
T

Tensor of shape (n_faces, ...).