diff --git a/docs/src/basics/MTKModel_Connector.md b/docs/src/basics/MTKModel_Connector.md index c20c1c959e..53e1f72e5d 100644 --- a/docs/src/basics/MTKModel_Connector.md +++ b/docs/src/basics/MTKModel_Connector.md @@ -97,6 +97,7 @@ However, as `p2` isn't listed in the model definition, its default can't be modi ```julia julia> @named model_c1 = ModelC(; model_a.k1 = 1); + ``` And as `k2` isn't listed in the sub-component definition of `ModelC`, its default value can't be modified by users. diff --git a/src/systems/pde/pdesystem.jl b/src/systems/pde/pdesystem.jl index 048dbf304e..7e54538d7d 100644 --- a/src/systems/pde/pdesystem.jl +++ b/src/systems/pde/pdesystem.jl @@ -94,6 +94,7 @@ struct PDESystem <: ModelingToolkit.AbstractMultivariateSystem analytic = nothing, analytic_func = nothing, gui_metadata = nothing, + eval_module = @__MODULE__, checks::Union{Bool, Int} = true, name) if checks == true || (checks & CheckUnits) > 0 @@ -114,7 +115,7 @@ struct PDESystem <: ModelingToolkit.AbstractMultivariateSystem p = ps isa SciMLBase.NullParameters ? [] : map(a -> a.first, ps) args = vcat(DestructuredArgs(p), args) ex = Func(args, [], eq.rhs) |> toexpr - eq.lhs => drop_expr(@RuntimeGeneratedFunction(ex)) + eq.lhs => drop_expr(@RuntimeGeneratedFunction(eval_module, ex)) end end end