Skip to content

Commit

Permalink
Merge branch 'main' into fsi-check-configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
LasNikas authored Feb 6, 2024
2 parents 553ac1f + 321a607 commit 1aa4042
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/general/initial_condition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ struct InitialCondition{ELTYPE}

if velocity isa AbstractMatrix
velocities = velocity
if size(coordinates) != size(velocities)
throw(ArgumentError("`coordinates` and `velocities` must be of the same size"))
end
else
# Assuming `velocity` is a scalar or a function
velocity_fun = wrap_function(velocity, Val(NDIMS))
Expand All @@ -111,7 +108,10 @@ struct InitialCondition{ELTYPE}
"for $NDIMS-dimensional `coordinates`"))
end
velocities_svector = velocity_fun.(coordinates_svector)
velocities = reinterpret(reshape, ELTYPE, velocities_svector)
velocities = stack(velocities_svector)
end
if size(coordinates) != size(velocities)
throw(ArgumentError("`coordinates` and `velocities` must be of the same size"))
end

if density isa AbstractVector
Expand Down

0 comments on commit 1aa4042

Please sign in to comment.