ufl icon indicating copy to clipboard operation
ufl copied to clipboard

ConstantValue and Parameter

Open mscroggs opened this issue 1 year ago • 4 comments

As discussed at SysGenX meeting, we should:

  • Rename ConstantValue to AbstractParameter. This is the base class for parameters (previously constants) without a domain
  • Add Parameter class that inherits from AbstractParameter to represent a parameter with an unknown value
  • Leave Constant as it is: representing a constant over a domain

mscroggs avatar Apr 18 '24 13:04 mscroggs

Is Firedrake (or FEniCSx for that matter) using ConstantValue? As discussed earlier, Constant with an associated domain is motivated by differentiation (i.e. the derivative of a Constant-value maps to the real-element).

jorgensd avatar Apr 18 '24 13:04 jorgensd

Yes, we are using ConstantValue. As soon as you start doing multiple domain calculations, having to associate a domain with a constant is a pain. We concede the differentiation point. For the moment, differentiation WRT to a Parameter won't be possible. In theory in the future it could be made so but that is a much bigger change.

dham avatar Apr 18 '24 14:04 dham

I think AbstractParameter should have a dtype as input, as it could be: Float32,float64,complex64, complex128 etc, which should change the representation of it.

jorgensd avatar Apr 18 '24 20:04 jorgensd