Skip to content

Commit a6a225d

Browse files
committed
Make FP64 coordinates work with the fin
1 parent 13925c9 commit a6a225d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

examples/fsi/fin_2d.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ using TrixiParticles
22
using OrdinaryDiffEqLowStorageRK
33
using OrdinaryDiffEqSymplecticRK
44

5+
function convert_ic(ic, T)
6+
return InitialCondition{ndims(ic)}(ic.coordinates, ic.velocity, ic.mass, ic.density,
7+
ic.pressure, T(ic.particle_spacing))
8+
end
9+
510
# ==========================================================================================
611
# ==== Resolution
712
n_particles_y = 4
@@ -52,6 +57,7 @@ point_in_geometry_algorithm = WindingNumberJacobson(; geometry,
5257
# Returns `InitialCondition`
5358
shape_sampled = ComplexShape(geometry; particle_spacing, density=density,
5459
grid_offset=center, point_in_geometry_algorithm)
60+
shape_sampled = TrixiParticles.@set shape_sampled.coordinates = Float64.(shape_sampled.coordinates)
5561

5662
# Beam and clamped particles
5763
length_clamp = round(Int, 0.15 / particle_spacing) * particle_spacing # m
@@ -113,6 +119,7 @@ if packing
113119

114120
boundary_packing = sample_boundary(foot_sdf; boundary_density=density,
115121
boundary_thickness=4 * particle_spacing)
122+
boundary_packing = TrixiParticles.@set boundary_packing.coordinates = Float64.(boundary_packing.coordinates)
116123
boundary_packing = setdiff(boundary_packing, beam)
117124

118125
background_pressure = 1.0

0 commit comments

Comments
 (0)