Skip to content

Commit

Permalink
Update juliaClient.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
marlenaweidenauer committed Sep 20, 2023
1 parent dc80bd6 commit f83d5cc
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion julia/juliaClient.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,26 @@ using UMBridge

url = "http://localhost:4242"

val = UMBridge.evaluate(url, "forward" ,[[1,3]], Dict())
# Set up a model by connecting to URL and selecting the "forward" model
model = UMBridge.HTTPModel("forward", url)

# Print model input and output dimension
print(UMBridge.model_input_sizes(model))
print(UMBridge.model_output_sizes(model))

param = [[0, 10]];

# Simple model evaluation without config
val = UMBridge.evaluate(model, param, Dict())
print(val)

# Model evaluation with configuration parameters
config = Dict("vtk_output" => true, "level" => 1);
print(UMBridge.evaluate(model, param, config))

# If model supports Jacobian action,
# apply Jacobian of output zero with respect to input zero to a vector
if UMBridge.supports_apply_jacobian(model)
UMBridge.apply_jacobian(model, 0, 0, param, [1, 4])
end

0 comments on commit f83d5cc

Please sign in to comment.