funsor
funsor copied to clipboard
ODEs, PDEs, quadrature, and finite element analysis
trafficstars
- Could we express ODEs in Funsor and then solve them via (approximate) numerical integration methods?
- Could we express PDEs in Funsor and then solve them via (approximate) finite element methods, possibly wrapping a backend like FEniCS?
@make_funsor
def Curl(
field: Funsor[Reals[3]],
position: Bound,
position2: Fresh[Reals[3]],
) -> Reals[3]:
pass # TODO relies on full autograd implementation
@eager.register(Curl, Tensor, ...):
return 0
def pressure(
velocity: Reals[3],
density: Real,
) -> Real:
pass
# The following are equivalent:
with SimplicialMesh(x=my_mesh):
velocity = ...
assert velocity.inputs["x"] == Reals[3]
@SimplicialMesh.register(Curl, ...)
def meshed_curl_operator(...):
...
velocity = ...
assert velocity.inputs["x"] == Bint[my_mesh.num_vertices]
- Could we pose an ODE as a variational problem and solve with an argmax sum-product computation? In particular, could we have both local variables and global variables wrt a continuous time "plate"?