Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Sep 20, 2023
1 parent 5cddadd commit 330d609
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions docs/src/basics/MTKModel_Connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 11 additions & 11 deletions src/systems/pde/pdesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct PDESystem <: ModelingToolkit.AbstractMultivariateSystem
analytic = nothing,
analytic_func = nothing,
gui_metadata = nothing,
eval_module = @__MODULE__,
eval_module = @__MODULE__,
checks::Union{Bool, Int} = true,
name)
if checks == true || (checks & CheckUnits) > 0
Expand All @@ -109,16 +109,16 @@ struct PDESystem <: ModelingToolkit.AbstractMultivariateSystem
throw(ArgumentError("The number of analytic solutions must match the number of dependent variables"))
end

if isnothing(analytic_func)
analytic_func = map(analytic) do eq
args = arguments(eq.lhs)
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(eval_module, ex))
end
end
end
if isnothing(analytic_func)
analytic_func = map(analytic) do eq
args = arguments(eq.lhs)
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(eval_module, ex))
end
end
end

if !isnothing(analytic_func)
analytic_func = analytic_func isa Dict ? analytic_func : analytic_func |> Dict
Expand Down

0 comments on commit 330d609

Please sign in to comment.