We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f1a54e commit c2cda49Copy full SHA for c2cda49
src/auxiliary/nans.jl
@@ -5,8 +5,8 @@ function containsnan(K::T) where {T<:AbstractArray}
5
return false
6
end
7
8
-function nancheck(chunk::AbstractBodyChunk, t, Δt)
9
- if containsnan(chunk.storage.b_int)
+function nancheck(storage::AbstractStorage, t, Δt)
+ if containsnan(storage.b_int)
10
n = (t > 0 && Δt > 0) ? Int(t ÷ Δt) : 0
11
msg = "NaN's found in field `b_int` at simulation time $(t), step $(n)!\n"
12
error(msg)
src/discretization/bond_system.jl
@@ -257,15 +257,22 @@ end
257
258
function calc_force_density!(chunk::AbstractBodyChunk{<:AbstractBondSystem}, t, Δt)
259
(; system, mat, paramsetup, storage) = chunk
260
+ calc_force_density!(storage, system, mat, paramsetup, t, Δt)
261
+ return nothing
262
+end
263
+
264
+function calc_force_density!(storage::AbstractStorage, system::AbstractBondSystem,
265
+ mat::AbstractBondSystemMaterial,
266
+ paramsetup::AbstractParameterSetup, t, Δt)
267
(; dmgmodel) = mat
- storage.b_int .= 0
268
+ storage.b_int .= 0.0
269
storage.n_active_bonds .= 0
- for i in each_point_idx(chunk)
270
+ for i in each_point_idx(system)
271
calc_failure!(storage, system, mat, dmgmodel, paramsetup, i)
272
calc_damage!(storage, system, mat, dmgmodel, paramsetup, i)
273
force_density_point!(storage, system, mat, paramsetup, t, Δt, i)
274
- nancheck(chunk, t, Δt)
275
+ nancheck(storage, t, Δt)
276
return nothing
277
278
0 commit comments