Skip to content

Commit 9fa9e0b

Browse files
authored
super minor fixes for Sphinx rendering issues (#1585)
1 parent 8a02bce commit 9fa9e0b

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

physicsnemo/mesh/mesh.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,8 @@ def cell_centroids(self) -> torch.Tensor:
620620
"""Compute the centroids (geometric centers) of all cells.
621621
622622
The centroid of a cell is computed as the arithmetic mean of its vertex positions.
623-
For an n-simplex with vertices (v0, v1, ..., vn), the centroid is:
624-
centroid = (v0 + v1 + ... + vn) / (n + 1)
623+
For an n-simplex with vertices (v0, v1, ..., vn), the centroid is
624+
``centroid = (v0 + v1 + ... + vn) / (n + 1)``.
625625
626626
The result is cached in ``_cache["cell", "centroids"]`` for efficiency.
627627
@@ -1541,24 +1541,28 @@ def get_facet_mesh(
15411541
----------
15421542
manifold_codimension : int, optional
15431543
Codimension of extracted mesh relative to parent.
1544+
15441545
- 1: Extract (n-1)-facets (default, immediate boundaries of all cells)
15451546
- 2: Extract (n-2)-facets (e.g., edges from tets, vertices from triangles)
15461547
- k: Extract (n-k)-facets
15471548
data_source : {"points", "cells"}, optional
15481549
Source of data inheritance:
1550+
15491551
- "cells": Facets inherit from parent cells they bound. When multiple
15501552
cells share a facet, data is aggregated according to data_aggregation.
15511553
- "points": Facets inherit from their boundary vertices. Data from
15521554
multiple boundary points is averaged.
15531555
data_aggregation : {"mean", "area_weighted", "inverse_distance"}, optional
15541556
Strategy for aggregating data from multiple sources
15551557
(only applies when data_source="cells"):
1558+
15561559
- "mean": Simple arithmetic mean
15571560
- "area_weighted": Weighted by parent cell areas
15581561
- "inverse_distance": Weighted by inverse distance from facet centroid
15591562
to parent cell centroids
15601563
target_counts : list[int] | {"boundary", "shared", "interior", "all"}, optional
15611564
Which facets to keep based on how many parent cells share them:
1565+
15621566
- "all": Keep all unique facets (default)
15631567
- "boundary": Keep only boundary facets (appearing in exactly 1 cell)
15641568
- "shared": Keep only shared facets (appearing in 2+ cells)
@@ -1969,6 +1973,7 @@ def get_cell_to_cells_adjacency(self, adjacency_codimension: int = 1):
19691973
----------
19701974
adjacency_codimension : int, optional
19711975
Codimension of shared facets defining adjacency.
1976+
19721977
- 1 (default): Cells must share a codimension-1 facet (e.g., triangles
19731978
sharing an edge, tetrahedra sharing a triangular face)
19741979
- 2: Cells must share a codimension-2 facet (e.g., tetrahedra sharing
@@ -2201,6 +2206,7 @@ def draw(
22012206
----------
22022207
backend : {"auto", "matplotlib", "pyvista"}
22032208
Visualization backend to use:
2209+
22042210
- "auto": Automatically select based on n_spatial_dims
22052211
(matplotlib for 0D/1D/2D, PyVista for 3D)
22062212
- "matplotlib": Force matplotlib backend (supports 3D via mplot3d)
@@ -2211,12 +2217,14 @@ def draw(
22112217
customization before display.
22122218
point_scalars : torch.Tensor or str or tuple[str, ...], optional
22132219
Scalar data to color points. Mutually exclusive with cell_scalars. Can be:
2220+
22142221
- None: Points use neutral color (black)
22152222
- torch.Tensor: Direct scalar values, shape (n_points,) or
22162223
(n_points, ...) where trailing dimensions are L2-normed
22172224
- str or tuple[str, ...]: Key to lookup in mesh.point_data
22182225
cell_scalars : torch.Tensor or str or tuple[str, ...], optional
22192226
Scalar data to color cells. Mutually exclusive with point_scalars. Can be:
2227+
22202228
- None: Cells use neutral color (lightblue if no scalars,
22212229
lightgray if point_scalars active)
22222230
- torch.Tensor: Direct scalar values, shape (n_cells,) or
@@ -2787,12 +2795,14 @@ def subdivide(
27872795
levels : int, optional
27882796
Number of subdivision iterations to perform. Each level
27892797
increases mesh resolution exponentially:
2798+
27902799
- 0: No subdivision (returns original mesh)
27912800
- 1: Each cell splits into 2^n children
27922801
- 2: Each cell splits into 4^n children
27932802
- k: Each cell splits into (2^k)^n children
27942803
filter : {"linear", "butterfly", "loop"}, optional
27952804
Subdivision scheme to use:
2805+
27962806
- "linear": Simple midpoint subdivision (interpolating).
27972807
New vertices at exact edge midpoints. Works for any dimension.
27982808
Preserves original vertices.

physicsnemo/mesh/transformations/geometric.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ def transform(
454454
-----
455455
Cache Handling:
456456
- areas: For square invertible matrices:
457-
- Full-dimensional meshes: scaled by |det|
458-
- Codimension-1 manifolds: per-element scaling using |det| × ||M^{-T} n||
457+
- Full-dimensional meshes: scaled by ``|det|``
458+
- Codimension-1 manifolds: per-element scaling using ``|det| * ||M^{-T} n||``
459459
- Higher codimension: invalidated
460460
- centroids: Always transformed
461461
- normals: For square invertible matrices, transformed by inverse-transpose

physicsnemo/mesh/visualization/draw_mesh.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def draw_mesh(
5959
Mesh object to visualize.
6060
backend : {"auto", "matplotlib", "pyvista"}
6161
Visualization backend to use:
62+
6263
- "auto": Automatically select based on n_spatial_dims
6364
(matplotlib for 0D/1D/2D, PyVista for 3D)
6465
- "matplotlib": Force matplotlib backend (supports 3D via mplot3d)
@@ -70,13 +71,15 @@ def draw_mesh(
7071
point_scalars : torch.Tensor or str or tuple[str, ...] or None, optional
7172
Scalar data to color points. Mutually exclusive with
7273
cell_scalars. Can be:
74+
7375
- None: Points use neutral color (black)
7476
- torch.Tensor: Direct scalar values, shape (n_points,) or
7577
(n_points, ...) where trailing dimensions are L2-normed
7678
- str or tuple[str, ...]: Key to lookup in mesh.point_data
7779
cell_scalars : torch.Tensor or str or tuple[str, ...] or None, optional
7880
Scalar data to color cells. Mutually exclusive with
7981
point_scalars. Can be:
82+
8083
- None: Cells use neutral color (lightblue if no scalars,
8184
lightgray if point_scalars active)
8285
- torch.Tensor: Direct scalar values, shape (n_cells,) or

0 commit comments

Comments
 (0)