Skip to content

Commit 061733d

Browse files
committed
switch default option for general_ad to true
1 parent c3324fd commit 061733d

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

src/setup/matlab_model_setup.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ end
294294
function setup_submodels(inputparams::MatlabInputParams;
295295
use_groups::Bool = false,
296296
use_p2d::Bool = true,
297-
general_ad::Bool = false,
297+
general_ad::Bool = true,
298298
kwarg...)
299299

300300
include_cc = include_current_collectors(inputparams)
301301

302302
function setup_component(obj::Dict,
303-
sys,
304-
bcfaces = nothing,
305-
general_ad::Bool = false)
303+
sys,
304+
general_ad::Bool,
305+
bcfaces = nothing)
306306

307307
domain = exported_model_to_domain(obj, bcfaces = bcfaces, general_ad=general_ad)
308308
G = MRSTWrapMesh(obj["G"])
@@ -362,9 +362,9 @@ function setup_submodels(inputparams::MatlabInputParams;
362362

363363
if !include_cc && name == :NeAm
364364
bcfaces = convert_to_int_vector(inputparams_co["externalCouplingTerm"]["couplingfaces"])
365-
model_am = setup_component(inputparams_co, sys_am, bcfaces, general_ad)
365+
model_am = setup_component(inputparams_co, sys_am, general_ad, bcfaces)
366366
else
367-
model_am = setup_component(inputparams_co, sys_am, nothing, general_ad)
367+
model_am = setup_component(inputparams_co, sys_am, general_ad, nothing)
368368
end
369369

370370
return model_am
@@ -386,7 +386,7 @@ function setup_submodels(inputparams::MatlabInputParams;
386386

387387
bcfaces = convert_to_int_vector(inputparams_necc["externalCouplingTerm"]["couplingfaces"])
388388

389-
model_necc = setup_component(inputparams_necc, sys_necc, bcfaces, general_ad)
389+
model_necc = setup_component(inputparams_necc, sys_necc, general_ad, bcfaces)
390390

391391

392392
end
@@ -422,7 +422,7 @@ function setup_submodels(inputparams::MatlabInputParams;
422422

423423
elyte = Electrolyte(params)
424424
model_elyte = setup_component(inputparams["Electrolyte"],
425-
elyte, nothing, general_ad)
425+
elyte, general_ad, nothing)
426426

427427
##############
428428
# Setup PeAm #
@@ -444,7 +444,7 @@ function setup_submodels(inputparams::MatlabInputParams;
444444
sys_pecc = CurrentCollector(pecc_params)
445445

446446

447-
model_pecc = setup_component(inputparams_pecc, sys_pecc, nothing, general_ad)
447+
model_pecc = setup_component(inputparams_pecc, sys_pecc, general_ad, nothing)
448448

449449
end
450450

@@ -723,7 +723,7 @@ function setup_initial_state(inputparams::MatlabInputParams,
723723
end
724724

725725
function exported_model_to_domain(exported; bcfaces = nothing,
726-
general_ad = false)
726+
general_ad = true)
727727

728728
""" Returns domain"""
729729

src/setup/model_setup.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function setup_simulation(inputparams::AbstractInputParams;
7272
extra_timing::Bool = false,
7373
max_step::Union{Integer, Nothing} = nothing,
7474
linear_solver::Symbol = :direct,
75-
general_ad::Bool = false,
75+
general_ad::Bool = true,
7676
use_groups::Bool = false,
7777
model_kwargs::NamedTuple = NamedTuple(),
7878
config_kwargs::NamedTuple = NamedTuple())
@@ -119,7 +119,7 @@ end
119119
function setup_model(inputparams::AbstractInputParams;
120120
use_p2d::Bool = true,
121121
use_groups::Bool = false,
122-
general_ad = false,
122+
general_ad = true,
123123
kwargs...)
124124

125125
# setup the submodels and also return a coupling structure which is used to setup later the cross-terms
@@ -145,7 +145,7 @@ end
145145

146146
function setup_submodels(inputparams::InputParams;
147147
use_groups::Bool = false,
148-
general_ad::Bool = false,
148+
general_ad::Bool = true,
149149
use_p2d = true,
150150
kwargs...)
151151

@@ -273,7 +273,8 @@ function setup_submodels(inputparams::InputParams;
273273
model_am = setup_component(grid,
274274
sys_am;
275275
general_ad = general_ad,
276-
dirichletBoundary = boundary,kwargs...)
276+
dirichletBoundary = boundary,
277+
kwargs...)
277278

278279
return model_am
279280

@@ -498,7 +499,7 @@ end
498499

499500
function setup_component(grid::Jutul.FiniteVolumeMesh,
500501
sys;
501-
general_ad::Bool=false,
502+
general_ad::Bool=true,
502503
dirichletBoundary = nothing,
503504
kwargs...)
504505

0 commit comments

Comments
 (0)