Skip to content

Support parallel repeated computation in diffgeo, solver, and heat #108

@magnesium2400

Description

@magnesium2400

Feature Description

Functions in diffgeo do not support parallel computation. For example, to calculate the gradient of several functions using tria_compute_gradient requires repeated calls to the function. This requires repeated computation of the normals, which is a large part of this function's cost (similarly for tria_compute_divergence).

Motivation

This pattern is a larger issue in functions like tria_compute_geodesic_f -- here, every call requires a new Solver object to be created.

Alternatives

There are a few options for speeding up the computation:

  1. Allow arrays of size (n_vertices, n_functions) to be input into tria_compute_gradient, and streamline the edge calculations to be able to work with 2D data.
  2. Store the face normals/face areas/unit normals within the TriaMesh objects (eg using @cached_property).
  3. Store objects like splu(stiffness_matrix) or splu(heat_matrix) within Solver objects.

Additional Context

I would be happy to work on this and submit it as a PR in future. But please let me know if you don't want this done (I won't spam your repo) or if there are any design considerations you have. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions