i207M / PINNacle

Codebase for PINNacle: A Comprehensive Benchmark of Physics-Informed Neural Networks for Solving PDEs.
https://arxiv.org/abs/2306.08827
MIT License
211 stars 37 forks source link

How to define a new PDE #10

Open shensummer opened 1 month ago

shensummer commented 1 month ago

hello,I am want to define a new PDE in your code, How can I reach my goal? Thanks for your time.

i207M commented 1 month ago

You can refer to some examples in src/pde/poisson.py.

https://github.com/i207M/PINNacle/blob/60fc2d977067ed563a5fdf1d04a1679eba0ac59c/src/pde/poisson.py#L8

  1. Inherit from baseclass.BasePDE.
  2. Define self.output_dim, self.bbox, self.geom. bbox is a list of numbers, and geom is an instance of deepxde.geometry.
  3. Define a pde function which will be used as the pde loss. Also do self.set_pdeloss(num=<the number of pdes>).
  4. Define boundary conditions. We support multiple types of bcs. See https://github.com/i207M/PINNacle/blob/60fc2d977067ed563a5fdf1d04a1679eba0ac59c/src/pde/baseclass.py#L104
  5. Finally, set reference solution. This can be done by either self.load_ref_data(...) or self.ref_sol=<reference function>.

Feel free to ask if anything is not clear.