-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
* visualize signed distances * fix infinite normals * clean up TriangleMesh * clean up TriangleMesh * modify shapes * change ELTYPE in IO * add files and remove `scale_factor` * add shape and `complexShape` tests * remove complex tank example * add docs for `complexShapes` * add docs for the algorithms * add test data * add tests for sampled shapes * data path relative to module * use `Threads.@threads` instead of `threaded` * fix @threaded * fix tests * fix wrong directory * use `@threaded` again * change winding number factor for julia 1.9 * fix tests * modify examples * revise * add docs for `ParticlePackingSystem` * add signed distance docs * add closure for sdf * modify example 3d * add setter for tvf * add trixi2vtk(sdf) * sample boundary in `ComplexShape` * add stl files * add `ComplexShape` structure * fix callback used check * implement suggestions * rename kwargs * add comments * apply formatter * implement suggestion * fix tests * remove abstract type `Shapes` * fix tests * make type stable * implement suggestions * add `unique_soted` * add comment * implement suggestions * RADME and NEWS entry * adapt docs * `for` instead of `while` * rename `shape` to `geometry` * rename again * implement suggestions * fix typo * implement suggestions * adapt example files * sum-init with `zero(eltype))` * implement suggestions * construct hierarchy in constructor * use ASCII characters * minor changes * add 2d hierarchical winding * minor changes * change function name * fix * implement suggestions * fix typo * apply formatter * fix typo * add `deleteat!` * circle example eps() -> 0 * start docs * simplify * implement suggestions * fix docs * fix tests * fix tests * minor changes * typo * fix * fix again * fx * fix tests * fix again * implement suggestions * modify NEWS.md * modify again * remove face nhs * adapt examples * minor changes * clean up * add tgv validation example * add ldc validation * modify validation * increase `maxiters` * remove double velocity initialization * add random displacement * implement suggestions * update `NEWS.md` * remove check for viscosity * fix tests * add short tilde description in docs * remove discarded example from tests * implement suggestions * apply formatter * add boundary compress factor * fix signed distance field * fix io * implement suggestions * add comment * fix test * fix typo * apply formatter * fix unit tests * apply formatter * revise docs * add autodocs * fix tests * implement suggestions * remove dependency * implement suggestions nhs * add `*` * formatting docs * improve `triangle_plane_intersection` * minor changes * implement sdf suggestions * fix kwarg bug * fix sign bit bug * add comment * revise docs * improve API * adapt example files * terminate with steady state callback * fix tests * implement suggestions * add unit test for `SignedDistanceField` * add system tests * apply formatter * remove geometry from system * add `delete_positions_in_empty_cells` * revise face nhs * fix face nhs * add cell intersection tests * fix typos * fix tests * add kwargs for trixi2vtk * resolve dependency error * implement suggestions * implement suggestions * add `neighbors` field in nhs * fix * add example * remove cell intersection check * adapt nhs tests * fix tests * fix doc tests * add comment for update * add whole packing dir to docs * implement suggestions * add comments * fix tests * add comments * fix rounding error for v1.9 * Revert "fix rounding error for v1.9" This reverts commit f026ddc. * implement suggestions * Increase Version * Update NEWS.md * Typo * Typo * Update NEWS.md Co-authored-by: Erik Faulhaber <[email protected]> * modify news --------- Co-authored-by: LasNikas <[email protected]> Co-authored-by: Sven Berger <[email protected]> Co-authored-by: Erik Faulhaber <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "TrixiParticles" | ||
uuid = "66699cd8-9c01-4e9d-a059-b96c86d16b3a" | ||
authors = ["erik.faulhaber <[email protected]>"] | ||
version = "0.2.5-dev" | ||
version = "0.2.5" | ||
|
||
[deps] | ||
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
using TrixiParticles | ||
using OrdinaryDiffEq | ||
|
||
filename = "circle" | ||
file = pkgdir(TrixiParticles, "examples", "preprocessing", "data", filename * ".asc") | ||
|
||
# ========================================================================================== | ||
# ==== Packing parameters | ||
save_intervals = false | ||
tlsph = true | ||
|
||
# ========================================================================================== | ||
# ==== Resolution | ||
particle_spacing = 0.03 | ||
|
||
# The following depends on the sampling of the particles. In this case `boundary_thickness` | ||
# means literally the thickness of the boundary packed with boundary particles and *not* | ||
# how many rows of boundary particles will be sampled. | ||
boundary_thickness = 8particle_spacing | ||
|
||
# ========================================================================================== | ||
# ==== Load complex geometry | ||
density = 1000.0 | ||
|
||
geometry = load_geometry(file) | ||
|
||
signed_distance_field = SignedDistanceField(geometry, particle_spacing; | ||
use_for_boundary_packing=true, | ||
max_signed_distance=boundary_thickness) | ||
|
||
point_in_geometry_algorithm = WindingNumberJacobson(; geometry, | ||
winding_number_factor=0.4, | ||
hierarchical_winding=true) | ||
# Returns `InitialCondition` | ||
shape_sampled = ComplexShape(geometry; particle_spacing, density, | ||
point_in_geometry_algorithm) | ||
|
||
# Returns `InitialCondition` | ||
boundary_sampled = sample_boundary(signed_distance_field; boundary_density=density, | ||
boundary_thickness, tlsph) | ||
|
||
trixi2vtk(shape_sampled) | ||
trixi2vtk(boundary_sampled, filename="boundary") | ||
|
||
# ========================================================================================== | ||
# ==== Packing | ||
|
||
# Large `background_pressure` can cause high accelerations. That is, the adaptive | ||
# time-stepsize will be adjusted properly. We found that the following order of | ||
# `background_pressure` result in appropriate stepsizes. | ||
background_pressure = 1e6 * particle_spacing^ndims(geometry) | ||
|
||
packing_system = ParticlePackingSystem(shape_sampled; | ||
signed_distance_field, tlsph=tlsph, | ||
background_pressure) | ||
|
||
boundary_system = ParticlePackingSystem(boundary_sampled; | ||
is_boundary=true, signed_distance_field, | ||
tlsph=tlsph, boundary_compress_factor=0.8, | ||
background_pressure) | ||
|
||
# ========================================================================================== | ||
# ==== Simulation | ||
semi = Semidiscretization(packing_system, boundary_system) | ||
|
||
# Use a high `tspan` to guarantee that the simulation runs at least for `maxiters` | ||
tspan = (0, 10.0) | ||
ode = semidiscretize(semi, tspan) | ||
|
||
# Use this callback to stop the simulation when it is sufficiently close to a steady state | ||
steady_state = SteadyStateReachedCallback(; interval=1, interval_size=10, | ||
abstol=1.0e-5, reltol=1.0e-3) | ||
|
||
info_callback = InfoCallback(interval=50) | ||
|
||
saving_callback = save_intervals ? | ||
SolutionSavingCallback(interval=10, prefix="", ekin=kinetic_energy) : | ||
nothing | ||
|
||
callbacks = CallbackSet(UpdateCallback(), saving_callback, info_callback, steady_state) | ||
|
||
sol = solve(ode, RDPK3SpFSAL35(); | ||
save_everystep=false, maxiters=1000, callback=callbacks, dtmax=1e-2) | ||
|
||
packed_ic = InitialCondition(sol, packing_system, semi) | ||
packed_boundary_ic = InitialCondition(sol, boundary_system, semi) | ||
|
||
trixi2vtk(packed_ic, filename="initial_condition_packed") | ||
trixi2vtk(packed_boundary_ic, filename="initial_condition_boundary_packed") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using TrixiParticles | ||
using OrdinaryDiffEq | ||
|
||
filename = "sphere" | ||
file = pkgdir(TrixiParticles, "examples", "preprocessing", "data", filename * ".stl") | ||
|
||
# ========================================================================================== | ||
# ==== Packing parameters | ||
tlsph = true | ||
save_intervals = false | ||
|
||
# ========================================================================================== | ||
# ==== Resolution | ||
particle_spacing = 0.1 | ||
|
||
# The following depends on the sampling of the particles. In this case `boundary_thickness` | ||
# means literally the thickness of the boundary packed with boundary particles and *not* | ||
# how many rows of boundary particles will be sampled. | ||
boundary_thickness = 8particle_spacing | ||
|
||
trixi_include(joinpath(examples_dir(), "preprocessing", "packing_2d.jl"), | ||
density=1000.0, particle_spacing=particle_spacing, file=file, | ||
boundary_thickness=boundary_thickness, tlsph=tlsph, | ||
save_intervals=save_intervals) |
1 comment
on commit c36ac19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/123222
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
@JuliaRegistrator register
Release notes:
## Breaking changes
- blah
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
git tag -a v0.2.5 -m "<description of version>" c36ac19270a1f5a3553c2945f6301db8e642df81
git push origin v0.2.5
@JuliaRegistrator register