Skip to content

Commit

Permalink
update to use element map. other cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
jalving committed Dec 16, 2024
1 parent ea15258 commit 5333d1a
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 147 deletions.
7 changes: 5 additions & 2 deletions examples/optimal_control.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ end
# subproblem optimizer
sub_optimizer = Plasmo.optimizer_with_attributes(Ipopt.Optimizer, "print_level" => 0)

#o ptimize using overlapping schwarz decomposition
# optimize using overlapping schwarz decomposition
optimizer = SchwarzOpt.Algorithm(
graph;
n_partitions=n_parts,
overlap_distance=1,
subproblem_optimizer=sub_optimizer,
max_iterations=100,
mu=10.0,
)

# run the algorithm
SchwarzOpt.run_algorithm!(optimizer)

# check termination status
Expand All @@ -57,6 +59,7 @@ SchwarzOpt.run_algorithm!(optimizer)
@show Plasmo.value(optimizer, state[1][:x])
@show Plasmo.value(optimizer, control[1][:u])

# you can also access the primal and dual feasibility vectors
# you can also access the primal and dual feasibility vectors using
# algorithm methods.
prf = SchwarzOpt.calculate_primal_feasibility(optimizer)
duf = SchwarzOpt.calculate_dual_feasibility(optimizer)
2 changes: 1 addition & 1 deletion src/SchwarzOpt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ include("utils.jl")

include("algorithm.jl")

include("plasmo_interface.jl")
include("interface.jl")

end
Loading

0 comments on commit 5333d1a

Please sign in to comment.