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:
- 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.
- Store the face normals/face areas/unit normals within the TriaMesh objects (eg using
@cached_property).
- 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.
Feature Description
Functions in
diffgeodo not support parallel computation. For example, to calculate the gradient of several functions usingtria_compute_gradientrequires repeated calls to the function. This requires repeated computation of the normals, which is a large part of this function's cost (similarly fortria_compute_divergence).Motivation
This pattern is a larger issue in functions like
tria_compute_geodesic_f-- here, every call requires a newSolverobject to be created.Alternatives
There are a few options for speeding up the computation:
(n_vertices, n_functions)to be input intotria_compute_gradient, and streamline the edge calculations to be able to work with 2D data.@cached_property).splu(stiffness_matrix)orsplu(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.