Skip to content

2026.07.22 v0.2.0

Latest

Choose a tag to compare

@Shizheng-Wen Shizheng-Wen released this 22 Jul 15:50
c7d0992

TensorMesh 0.2.0 is the mixed-assembly release: multi-field block systems become first-class, three new operator families land (Bloch-Floquet, distributed, open-domain wave), and the documentation — including the Chinese translation — is fully caught up.

Highlights

Mixed multi-field assembly (MixedElementAssembler) — #38

  • Declare fields once (Field(trial="u", test="v", order=2, components=2)), write the coupled weak form as one scalar integrand, get one block SparseMatrix. The unchanged Condenser applies on top.
  • assembler.layout (BlockLayout) owns the block-DOF vocabulary: boundary masks, split/cat, prolong/restrict, coordinate predicates.
  • Generalized order pairs: field order is decoupled from mesh order via topological Lagrange DOF maps — Taylor-Hood P2-P1 runs directly on linear gmsh imports (no re-meshing), P3-P2 pairs and 3D P2-on-P1 tets included, all verified to machine precision.
  • Space-aware load vectors via assemble_vector (+ the field_data channel for Picard / time stepping on generalized fields).
  • The entire fluid example gallery now runs on stabilization-free Taylor-Hood: Stokes convergence study (H1/L2 rates 2.0/2.0), lid-driven cavity 2D/3D, transient cylinder flow, flow past obstacles, three-field Rayleigh-Bénard, Taylor-Green (velocity L2 rate ≈ 3, up from 2 with stabilized P1-P1).

Bloch-Floquet periodic boundary conditions (BlochReducer) — #36

Ties opposite unit-cell faces with the Floquet phase and reduces assembled operators to the master DOFs — the building block of band-structure computations. Ships with three COMSOL-validated 2D phononic-crystal examples (square/triangular lattices: mean band error 0.08% / 0.51%; slab transmission mean |ΔT| 0.007). Contributed by Nicolas Cayuela.

Distributed multi-GPU FEM (tensormesh.distributed)

DistributedMesh partitioning (RCB / spectral / METIS), the @distributed decorator that turns any existing assembler into its distributed counterpart, DSparseMatrix (a torch_sla.DSparseTensor subclass), and Condenser dispatch — end-to-end multi-GPU Poisson under torchrun with NCCL. Contributed by walkerchi.

Open-domain wave operators (PML & ports) — #39

  • FacetBilinearAssembler — boundary bilinear forms scattered to a SparseMatrix (Robin / impedance / radiation).
  • cartesian_pml + AnisotropicLaplaceElementAssembler / ScaledMassElementAssembler — stretched-coordinate PML with complex tensor coefficients.
  • robin_operator / port_source — first-order absorbing / plane-wave-port boundary matrix and load.
  • Four validated examples: port-driven Helmholtz resonator, PML-framed optical microdisk (whispering-gallery mode), rectangular waveguide modes, cantilever vibration modes + FRF. Contributed by Nicolas Cayuela.

Other improvements

  • Drucker-Prager plasticity promoted to public API (DruckerPragerPlasticity, FrictionalMaterial presets) with geomechanics examples — kilickursat; Allen-Cahn convex-concave splitting example — MariusZeinhofer.
  • Complex-valued assembly path (complex dtypes end-to-end through assemble → condense → solve) with a validated Helmholtz example.
  • torch-sla alignment: requires torch-sla ≥ 0.3.0 (six verified solver backends); the [cupy] extra is replaced by [pyamg] (pip install "tensormesh-fem[gpu]" now pulls cuDSS + PyAMG). The old cuDSS SPD-only caveat is gone — general non-symmetric systems solve at machine precision.
  • Fix: MeshGen.remove_sphere no longer hangs on spheres smaller than the mesh size (#40#47).

Documentation

New user-guide chapters (Mixed Assembly, Distributed FEM), new gallery chapters (Phononic Crystals, Open-Domain Wave, Modal Analysis, Taylor-Hood Stokes), a rewritten fluid chapter and solver-backend matrix, refreshed figures throughout — bilingual, with the zh_CN catalogs fully translated: https://docs.tensor-mesh.com

Breaking / migration notes

  • tensormesh-fem[cupy] no longer exists (upstream torch-sla dropped its cupy backend); use the default CPU stack, [cudss], [pyamg], or [gpu].
  • torch-sla < 0.3.0 is no longer supported.

Full changelog: v0.1.1...v0.2.0