Closed bmxam closed 9 months ago
CellFunction
can be evaluated at a CellPoint
or a FacePoint
because DomainStyle
is defined for those points.
Here in:
PhysicalFunction(x -> ρ(x) * 2)
x
is a SVector
of coordinates for which DomainStyle
is not defined, so evaluation of ρ(x)
is not possible in the inner scope.
We can add a new feature to do so if we assume that x
has the same DomainStyle
as the CellFunction
by default, but it will remove the "safety barriers" in a sense (and it could even be wrong if you compose ReferenceFunction
with PhysicalFunction
)
CellFunction
are AbstractLazy
, you can also simply do:ρ = PhysicalFunction(x -> 1.0)
ρu = 2 * ρ
I agree, the solution is simply what you suggested:
ρ = PhysicalFunction(x -> 1.0)
ρu = 2 * ρ
So no need to change anything.
We cannot use a
PhysicalFunction
in the definition of another one. The following MWE raises an error:Of course to overcome this we can use an intermediate variable