Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CryoGrid.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CryoGrid
CryoGrid.jl
Commits
842183de
Commit
842183de
authored
3 years ago
by
Brian Groenke
Browse files
Options
Downloads
Patches
Plain Diff
Add missing import for adstrip
parent
cad2f38c
No related branches found
No related tags found
1 merge request
!36
Fix CFL step limiter callback choking on autodiff types
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/heat_vgfc_seb_samoylov_custom.jl
+2
-1
2 additions, 1 deletion
examples/heat_vgfc_seb_samoylov_custom.jl
src/Callbacks/Callbacks.jl
+1
-1
1 addition, 1 deletion
src/Callbacks/Callbacks.jl
with
3 additions
and
2 deletions
examples/heat_vgfc_seb_samoylov_custom.jl
+
2
−
1
View file @
842183de
...
...
@@ -50,7 +50,8 @@ p.soil.n .= 2.0
p
.
soil
.
Tₘ
.=
273.15
# K
# CryoGrid front-end for ODEProblem
prob
=
CryoGridProblem
(
model
,
tspan
,
p
)
# OPTIONAL: solve for short time period to
# OPTIONAL: solve for short time period to "warm up" (i.e. let Julia compile everything)
solve
(
remake
(
prob
,
tspan
=
(
prob
.
tspan
[
1
],
prob
.
tspan
[
1
]
+
60.0
)),
Euler
(),
dt
=
10.0
);
# solve with forward Euler (w/ CFL) and construct CryoGridOutput from solution
out
=
@time
solve
(
prob
,
Euler
(),
dt
=
2
*
60.0
,
callback
=
CFLStepLimiter
(
model
),
saveat
=
24
*
3600.0
,
progress
=
true
)
|>
CryoGridOutput
;
# Plot it!
...
...
This diff is collapsed.
Click to expand it.
src/Callbacks/Callbacks.jl
+
1
−
1
View file @
842183de
...
...
@@ -4,7 +4,7 @@ import CryoGrid
using
CryoGrid
.
Numerics
using
CryoGrid
.
Setup
:
CryoGridSetup
,
HeatOnlySetup
,
getvar
using
CryoGrid
.
Utils
using
CryoGrid
.
Utils
:
adstrip
using
DiffEqCallbacks
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment