Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "FiniteElementContainers"
uuid = "d08262e4-672f-4e7f-a976-f2cea5767631"
version = "0.15.1"
version = "0.15.2"
authors = ["Craig M. Hamel <cmhamel32@gmail.com> and contributors"]

[deps]
Expand Down
8 changes: 4 additions & 4 deletions src/Parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ struct Parameters{
times::TimeStepper{RT}
physics::Phys
properties::PropertyField{RT, RV, IV}
state_old::StateVariableField{RT, RV}
state_new::StateVariableField{RT, RV}
state_old::StateVariableField{RT, RV, IV}
state_new::StateVariableField{RT, RV, IV}
coords::H1Field{RT, RV, D}
field::Field
field_old::Field
Expand Down Expand Up @@ -260,8 +260,8 @@ struct TypeStableParameters{
times::TimeStepper{RT}
physics::Phys
properties::PropertyField{RT, RV, IV}
state_old::StateVariableField{RT, RV}
state_new::StateVariableField{RT, RV}
state_old::StateVariableField{RT, RV, IV}
state_new::StateVariableField{RT, RV, IV}
coords::H1Field{RT, RV, D}
field::Field
field_old::Field
Expand Down
26 changes: 6 additions & 20 deletions src/assemblers/BlockMatrixAssemblers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,18 @@ function assemble_vector!(
U = map(x -> x.field, p)
U_old = map(x -> x.field_old, p)

# this allocates a bit
for sol_id in 1:length(fspace)
_update_for_assembly!(p[sol_id], assembler.dof[sol_id], Uu[BlockArrays.Block(sol_id)])
_update_for_assembly!(p[sol_id], assembler.dof[sol_id], view(Uu, BlockArrays.Block(sol_id)))
end

return_type = AssembledVector()
conns = map(x -> x.elem_conns.data, fspace)
coffsets = map(x -> x.elem_conns.offsets, fspace)
physics = p[1].physics
props = p[1].properties
state_old = p[1].state_old
state_new = p[1].state_new
for b in 1:num_blocks(fspace[1])
block_physics = values(physics)[b]
ref_fe = map(x -> block_reference_element(x, b), fspace)
Expand All @@ -175,39 +178,22 @@ function assemble_vector!(
val_el = map((r, u) -> _element_scratch(return_type, r, u), ref_fe, U)
for q in 1:num_q_pts
interps = map(r -> _cell_interpolants(r, q), ref_fe)
state_old_q = state_variables(p[1].state_old, q, e, b)
state_new_q = state_variables(p[1].state_new, q, e, b)
state_old_q = state_variables(state_old, q, e, b)
state_new_q = state_variables(state_new, q, e, b)
val_q = func(block_physics, interps, x_el, t, Δt, u_el, u_el_old, state_old_q, state_new_q, props_el)
val_el = map((f, vq, ve) -> _accumulate_q_value(return_type, f, vq, ve, q, e), U, val_q, val_el)
# @show val_el
end
# out = map((f, v, c) -> _assemble_element!(f, v, c, e), U, val_el, conn)
for sol_id in 1:length(U)
# @show "Hur"
_assemble_element!(assembler.residual_storage[sol_id], val_el[sol_id], conn[sol_id], e)
end
end
# @show assembler.residual_storage
end
end

# function assemble_vector_neumann_bc!(assembler, Uu, p)
# @warn "Sources not supported in block solvers yet."
# return nothing
# end

# function assemble_vector_source!(assembler, Uu, p)
# @warn "Sources not supported in block solvers yet."
# return nothing
# end

function residual(asm::BlockSparseMatrixAssembler)
# @show asm.residual_storage
for (b, (d, s)) in enumerate(zip(asm.dof, asm.residual_storage))
# @show s
extract_field_unknowns!(view(asm.residual_unknowns, BlockArrays.Block(b)), d, s)
end
# @show asm.residual_unknowns
return asm.residual_unknowns
end

Expand Down
Loading