pyccel / sympde

Symbolic calculus for partial differential equations (and variational forms)
http://sympde.readthedocs.io/
MIT License
20 stars 4 forks source link

Allow turning off linearity checks in bilinear and linear forms #153

Closed e-moral-sanchez closed 7 months ago

e-moral-sanchez commented 7 months ago

Add the boolean flag check_linearity to the constructors of BilinearForm and LinearForm. The default value is True. If set to False, the linearity checks are turned off completely. This is different than the existing flag ignore_linearity_errors, which controls whether we get a warning or an error when the linearity check fails.

The new flag might be useful when the expression in the bilinear or linear form is complicated, because then the linearity check calls the SymPy Expr method .expand(deep=True), which is recursive and can take a very long time.