Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Oscillating Beam #349

Merged
merged 246 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
246 commits
Select commit Hold shift + click to select a range
e541ce8
add interpolation
svchb Nov 29, 2023
d09e779
basic working
svchb Nov 30, 2023
fd3c98b
support periodic
svchb Nov 30, 2023
118585b
allow to define different smoothing_length
svchb Nov 30, 2023
a4e306d
more precisely identify system regions
svchb Nov 30, 2023
d0d4e85
to improve accuracy calc shepard
svchb Dec 1, 2023
7f11ce6
add support for multiple points
svchb Dec 1, 2023
2d7334c
add line interpolation
svchb Dec 1, 2023
0a5a580
add doc
svchb Dec 1, 2023
2c10d6c
format
svchb Dec 1, 2023
69e8ddf
add test
svchb Dec 1, 2023
567e1fb
Merge branch 'main' into add_interpolation
svchb Dec 1, 2023
27065cc
small change to doc
svchb Dec 1, 2023
238671e
revert accidental change
svchb Dec 1, 2023
1512816
fix
svchb Dec 1, 2023
959e36e
another fix
svchb Dec 1, 2023
a0c9694
format
svchb Dec 1, 2023
b0a22e4
format
svchb Dec 1, 2023
9f3b68b
also interpolate pressure and velocity
svchb Dec 1, 2023
c83061e
lower tolerance
svchb Dec 1, 2023
f9b8bef
add example plot
svchb Dec 1, 2023
54ffa68
missing dependency
svchb Dec 1, 2023
9d2b15e
format
svchb Dec 1, 2023
51567d6
add func
svchb Dec 1, 2023
a7786fd
add doc
svchb Dec 1, 2023
4278910
add test
svchb Dec 1, 2023
fcfb065
add another test
svchb Dec 1, 2023
9106912
comment out example
svchb Dec 1, 2023
363bfcb
remove pyplot again
svchb Dec 1, 2023
5a89022
fix
svchb Dec 1, 2023
589f7b3
format
svchb Dec 1, 2023
3351d74
small update improve accuracy
svchb Dec 12, 2023
a995d03
Merge branch 'main' into plane_interpolation
svchb Dec 12, 2023
6044f55
Merge branch 'plane_interpolation' of github.com:svchb/TrixiParticles…
svchb Dec 12, 2023
cd8ddc5
update
svchb Dec 12, 2023
f6b3829
up
svchb Dec 12, 2023
7a5c42e
fix
svchb Dec 13, 2023
c6165f0
format
svchb Dec 13, 2023
8c58ff6
add JSON library
svchb Dec 18, 2023
e5dd805
postprocess_callback
svchb Dec 19, 2023
23dca83
add rect_3d example
svchb Dec 20, 2023
235f72a
fix
svchb Dec 21, 2023
66af558
format
svchb Dec 21, 2023
a9c99bb
Merge branch 'main' into sensor_cb
svchb Dec 21, 2023
46c9ae7
Merge branch 'more_fixes_for_risc' into sensor_cb
svchb Dec 23, 2023
bf4997d
impl
svchb Jan 5, 2024
4e17772
Merge branch 'main' into sensor_cb
svchb Jan 5, 2024
d9e854e
fixes
svchb Jan 5, 2024
22d8789
fix setting the interval
svchb Jan 5, 2024
e5d2bef
impl other functions
svchb Jan 5, 2024
9226364
Merge branch 'main' into plane_interpolation
svchb Jan 16, 2024
6136f7d
fix plots
svchb Jan 16, 2024
8cddffa
fix plots.jl plot
svchb Jan 16, 2024
f4c2204
cleanup
svchb Jan 16, 2024
fb16b70
fix tests
svchb Jan 16, 2024
1b450dd
cleanup
svchb Jan 16, 2024
babdde0
cleanup
svchb Jan 16, 2024
3025102
fix docs
svchb Jan 16, 2024
bb57d18
fix doc
svchb Jan 16, 2024
a865c41
remove unused func
svchb Jan 16, 2024
073558c
remove unused code
svchb Jan 16, 2024
6b9bb14
fix
svchb Jan 16, 2024
a99f4ee
write missing values
svchb Jan 18, 2024
3d8a6d3
replace incorrect nomenclature
svchb Jan 18, 2024
e9ced79
calc von mises stress
svchb Jan 18, 2024
e0af8eb
rm comment
svchb Jan 18, 2024
743cdad
format
svchb Jan 18, 2024
043a90e
change docs to F
svchb Jan 18, 2024
4e01f48
add test
svchb Jan 18, 2024
2795bb3
format
svchb Jan 18, 2024
22c2acb
Merge branch 'main' into sensor_cb
svchb Jan 19, 2024
d73dbe7
fix merge
svchb Jan 19, 2024
3671952
move files
svchb Jan 19, 2024
ff6bf1b
include exclude bnd
svchb Jan 19, 2024
5891e7f
add version info to meta data
svchb Jan 19, 2024
974859e
fix
svchb Jan 19, 2024
9afa33b
add filename and overwrite
svchb Jan 19, 2024
c69650a
write initial values
svchb Jan 19, 2024
e91d529
format
svchb Jan 19, 2024
d81e4f9
add helper function to obtain latest file
svchb Jan 19, 2024
10f0658
improve func
svchb Jan 19, 2024
b41ad2c
format
svchb Jan 19, 2024
8e85162
fix plots
svchb Jan 19, 2024
95a1e48
rename
svchb Jan 19, 2024
d603ebf
add doc
svchb Jan 19, 2024
10b70fd
add exports
svchb Jan 19, 2024
69043c5
cleanup
svchb Jan 19, 2024
ad313fe
cleanup
svchb Jan 19, 2024
3863ccc
format
svchb Jan 19, 2024
81d9e2b
Merge branch 'plane_interpolation' into sensor_cb3
svchb Jan 19, 2024
93e3310
working example
svchb Jan 19, 2024
aa25735
add plot
svchb Jan 19, 2024
6e1d805
also save the cauchy stress components
svchb Jan 22, 2024
46661b4
format
svchb Jan 22, 2024
769ca47
fix dt
svchb Jan 22, 2024
a9fbf6d
fix
svchb Jan 22, 2024
1893ae9
fix
svchb Jan 22, 2024
497bcd4
fix viscosity
svchb Jan 22, 2024
9486a04
working 3d example for plane interpolation
svchb Jan 23, 2024
586f639
add 2d plot as well for 3d case
svchb Jan 23, 2024
8659c44
add docs
svchb Jan 23, 2024
e2f991d
fix tests
svchb Jan 23, 2024
cf5558f
fix
svchb Jan 23, 2024
e62453c
fix plot
svchb Jan 23, 2024
699beaa
fix comments
svchb Jan 23, 2024
3e7ad09
fix comment
svchb Jan 23, 2024
971be6f
update
svchb Jan 23, 2024
db52b69
format
svchb Jan 23, 2024
e47ae70
add Plots
svchb Jan 23, 2024
86837d1
fix
svchb Jan 23, 2024
12ff4ef
adjust plot
svchb Jan 23, 2024
010ddb9
reduce time
svchb Jan 23, 2024
def6be7
Merge remote-tracking branch 'refs/remotes/origin/plane_interpolation'
svchb Jan 24, 2024
9389659
Merge remote-tracking branch 'origin/sensor_cb' into sensor_cb3
svchb Jan 24, 2024
3967441
Merge branch 'save_TLSPH' into sensor_cb3
svchb Jan 24, 2024
90cbdaa
add reference
svchb Jan 24, 2024
04e62b9
add better digitized curves and error calc
svchb Jan 24, 2024
3df6e54
performance optimization and some slight adjustment to improve error
svchb Jan 25, 2024
95bf29e
Merge branch 'main' into sensor_cb
svchb Jan 25, 2024
b246c78
Merge branch 'main'
svchb Jan 26, 2024
21ec719
format
svchb Jan 26, 2024
8da0acd
update
svchb Feb 1, 2024
550e032
Merge branch 'main' into sensor_cb
svchb Feb 1, 2024
c88bb7f
format
svchb Feb 1, 2024
895925b
Merge branch 'sensor_cb' of github.com:svchb/TrixiParticles.jl into s…
svchb Feb 1, 2024
8a7da40
Merge branch 'main' into sensor_cb3
svchb Feb 1, 2024
0515b84
add reference files
svchb Feb 2, 2024
a648f57
Merge branch 'main' into sensor_cb
svchb Feb 2, 2024
8108bd7
add CSV
svchb Feb 2, 2024
22d71b4
add csv output
svchb Feb 2, 2024
8175205
Merge branch 'sensor_cb' of github.com:svchb/TrixiParticles.jl into s…
svchb Feb 2, 2024
c0a1794
Merge branch 'main' into sensor_cb
svchb Feb 2, 2024
94a4fa1
format
svchb Feb 2, 2024
3755d4f
Merge branch 'sensor_cb' of github.com:svchb/TrixiParticles.jl into s…
svchb Feb 2, 2024
65c3b0b
Merge branch 'main' into sensor_cb
svchb Feb 6, 2024
f835aa5
up
svchb Feb 7, 2024
f9693fc
Merge branch 'main' into sensor_cb
svchb Feb 7, 2024
0cc4e08
fixes
svchb Feb 7, 2024
82f8d5e
update
svchb Feb 7, 2024
7975a7b
Merge branch 'sensor_cb' of github.com:svchb/TrixiParticles.jl into s…
svchb Feb 7, 2024
07017b3
fix paths
svchb Feb 8, 2024
b1cd1fd
fixes
svchb Feb 8, 2024
58691fa
review
svchb Feb 8, 2024
1ac5e2d
review
svchb Feb 8, 2024
b1ca149
change git
svchb Feb 8, 2024
cd2f7ca
change type
svchb Feb 8, 2024
ceacf7e
remove mutable
svchb Feb 8, 2024
b12a122
add new example
svchb Feb 8, 2024
92a88fa
change to plots.jl
svchb Feb 8, 2024
b22bccb
increase the resolution
svchb Feb 8, 2024
4e156d2
include into CI
svchb Feb 8, 2024
20b0c75
move condition
svchb Feb 8, 2024
6e3a999
add more output to summary box
svchb Feb 9, 2024
5f27c34
update
svchb Feb 9, 2024
d7cd92c
remove DataEntry
svchb Feb 12, 2024
dc6905c
Merge branch 'sensor_cb' into sensor_cb3
svchb Feb 13, 2024
70490c8
update file structure
svchb Feb 13, 2024
bc84f81
fix setup
svchb Feb 13, 2024
3e34bce
fix plot
svchb Feb 13, 2024
44b6551
Merge branch 'main' into sensor_cb
svchb Feb 13, 2024
8975bf3
update
svchb Feb 14, 2024
13189a5
Merge branch 'main' into sensor_cb
svchb Feb 14, 2024
1e9f532
fix
svchb Feb 14, 2024
c696664
update
svchb Feb 14, 2024
e38972d
format
svchb Feb 14, 2024
6bf1d93
review update
svchb Feb 14, 2024
439845f
fix test
svchb Feb 14, 2024
aebd697
nvalue->n_values
svchb Feb 14, 2024
b2c9d2d
fix
svchb Feb 14, 2024
f1a073d
fixfix
svchb Feb 14, 2024
8ef914e
add check for anonymous functions
svchb Feb 14, 2024
08bf3f3
fix test
svchb Feb 14, 2024
61271d1
remove unused 'using'
svchb Feb 14, 2024
71d2efa
add simple test
svchb Feb 14, 2024
5a35aa0
fix using statements
svchb Feb 14, 2024
03b4b81
ignore
svchb Feb 15, 2024
4fc8d5c
format
svchb Feb 15, 2024
5533585
fix ignore string
svchb Feb 15, 2024
481bc79
fix json reading in example
svchb Feb 15, 2024
338b8d1
update
svchb Feb 15, 2024
aae9f22
update based on review comments
svchb Feb 16, 2024
521b42e
format
svchb Feb 16, 2024
f327cd0
change funcs to keyword args
svchb Feb 16, 2024
fd98f91
fix docs
svchb Feb 16, 2024
0008c52
format
svchb Feb 16, 2024
3c6e9c5
review comments
svchb Feb 16, 2024
0c7a049
format
svchb Feb 16, 2024
2611e73
Merge branch 'main' into sensor_cb
svchb Feb 16, 2024
128ce2e
fix tests
svchb Feb 16, 2024
153d0e0
fix test
svchb Feb 16, 2024
0e4a6ab
format
svchb Feb 16, 2024
3eb44a8
review
svchb Feb 16, 2024
7852782
format
svchb Feb 16, 2024
b11ad70
fix plot
svchb Feb 16, 2024
ba39f94
fix test
svchb Feb 16, 2024
c43fcf2
remove include
svchb Feb 16, 2024
db38d89
Merge branch 'main' into sensor_cb
efaulhaber Feb 16, 2024
93932c5
fix test
svchb Feb 16, 2024
be5a9be
Merge branch 'sensor_cb' of github.com:svchb/TrixiParticles.jl into s…
svchb Feb 16, 2024
25509d6
Merge branch 'sensor_cb' into sensor_cb3
svchb Feb 20, 2024
40e8a6f
Merge branch 'main' into sensor_cb3
svchb Feb 20, 2024
283e5f3
rm
svchb Feb 20, 2024
acd15a5
move
svchb Feb 20, 2024
bc6d75a
add reference curves
svchb Feb 20, 2024
5ba46e0
fix plot
svchb Feb 20, 2024
c6184f4
fix
svchb Feb 20, 2024
7f99b36
add files
svchb Feb 21, 2024
8a5c9ea
update
svchb Feb 21, 2024
217f9c3
cleanup
svchb Feb 21, 2024
8293d8e
format
svchb Feb 21, 2024
7437abc
update
svchb Feb 21, 2024
ecbdb3b
cleanup plot
svchb Feb 21, 2024
97d0e6c
simplify plot
svchb Feb 21, 2024
6ea4bea
switch to makie
svchb Feb 21, 2024
b0ad145
implement check
svchb Feb 21, 2024
3e7ee92
format
svchb Feb 21, 2024
21c7bcd
update to new reference
svchb Feb 22, 2024
b7c0911
update
svchb Feb 22, 2024
95eecd4
format
svchb Feb 27, 2024
178e68b
rename
svchb Feb 27, 2024
4714431
remove the dependencies
svchb Feb 27, 2024
cbeee99
remove dependencies
svchb Feb 28, 2024
30b7e5f
add 5 resolution back
svchb Feb 28, 2024
b4112b4
format
svchb Feb 28, 2024
caca014
Merge branch 'main' into sensor_cb3
svchb Feb 28, 2024
ca0efab
use include
svchb Feb 28, 2024
fcf2da1
format
svchb Feb 28, 2024
2f2740a
renaming
svchb Feb 28, 2024
b1f1d58
fix readme
svchb Feb 28, 2024
4d46ef0
fix test [skip ci]
svchb Feb 28, 2024
222b8b0
[skip ci] remove save for compare
svchb Feb 28, 2024
552c0af
[skip ci] add tspan back
svchb Feb 28, 2024
9998b53
review comments
svchb Feb 28, 2024
0bf9b85
small fixes [skip ci]
svchb Feb 28, 2024
162540a
update [skip ci]
svchb Feb 29, 2024
ccdf42c
rename [skip ci]
svchb Feb 29, 2024
b2d66b9
update [skip ci]
svchb Feb 29, 2024
dbc0a7f
fix
svchb Mar 1, 2024
ea2684c
exchange interpolation function
svchb Mar 1, 2024
9ae2ba2
rename
svchb Mar 1, 2024
f836223
exchange common time range find code
svchb Mar 1, 2024
d92399e
update reference file
svchb Mar 1, 2024
8324939
update [skip ci]
svchb Mar 1, 2024
2f26a18
format [skip ci]
svchb Mar 1, 2024
d2ba9c8
update
svchb Mar 1, 2024
071d527
Merge branch 'main' into sensor_cb3
svchb Mar 1, 2024
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using DataFrames
using JSON
using Glob
using Printf
using TrixiParticles

elastic_plate = (length=0.35, thickness=0.02)

Expand Down Expand Up @@ -59,8 +60,8 @@ for file_name in input_files
displacements = Float64.(data["values"])

mse_results = occursin(key_pattern_x, key) ?
calculate_mse(ref.time, ref.Ux, data["time"], displacements) :
calculate_mse(ref.time, ref.Uy, data["time"], displacements)
interpolated_mse(ref.time, ref.Ux, data["time"], displacements) :
interpolated_mse(ref.time, ref.Uy, data["time"], displacements)

label = "$label_prefix dp = $(@sprintf("%.8f", particle_spacing)) mse=$(@sprintf("%.8f", mse_results))"
lines!(ax, times, displacements, label=label)
Expand Down
62 changes: 41 additions & 21 deletions validation/oscillating_beam_2d/validation_oscillating_beam_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,44 @@ using OrdinaryDiffEq

svchb marked this conversation as resolved.
Show resolved Hide resolved
tspan = (0, 10)

# for the brave add 35
resolution = [9, 21]
for res in resolution
# Overwrite `sol` assignment to skip time integration
trixi_include(@__MODULE__,
joinpath(examples_dir(), "solid", "oscillating_beam_2d.jl"),
n_particles_y=res, sol=nothing, tspan=tspan,
penalty_force=PenaltyForceGanzenmueller(alpha=0.01))

pp_callback = PostprocessCallback(; deflection_x, deflection_y, dt=0.01,
output_directory="out",
filename="validation_run_oscillating_beam_2d_$res",
write_csv=false, write_file_interval=0)
info_callback = InfoCallback(interval=2500)
saving_callback = SolutionSavingCallback(dt=0.5, prefix="validation_$res")

callbacks = CallbackSet(info_callback, saving_callback, pp_callback)

sol = solve(ode, RDPK3SpFSAL49(), abstol=1e-8, reltol=1e-6, dt=1e-5,
save_everystep=false, callback=callbacks)
end
# Can be used to set the width wise resolution of beam, which needs to be odd,
# use 9, 21, 35 for validation
svchb marked this conversation as resolved.
Show resolved Hide resolved
# Note: 35 takes a very long time!
n_particles_beam_y = 5

# Overwrite `sol` assignment to skip time integration
trixi_include(@__MODULE__,
joinpath(examples_dir(), "solid", "oscillating_beam_2d.jl"),
n_particles_y=n_particles_beam_y, sol=nothing, tspan=tspan,
penalty_force=PenaltyForceGanzenmueller(alpha=0.01))

pp_callback = PostprocessCallback(; deflection_x, deflection_y, dt=0.01,
output_directory="out",
filename="validation_run_oscillating_beam_2d_$n_particles_beam_y",
write_csv=false, write_file_interval=0)
info_callback = InfoCallback(interval=2500)
saving_callback = SolutionSavingCallback(dt=0.5, prefix="validation_$n_particles_beam_y")

callbacks = CallbackSet(info_callback, saving_callback, pp_callback)

sol = solve(ode, RDPK3SpFSAL49(), abstol=1e-8, reltol=1e-6, dt=1e-5,
save_everystep=false, callback=callbacks)

reference_file_name = joinpath(validation_dir(), "oscillating_beam_2d",
"validation_reference_5.json")
run_file_name = joinpath("out", "validation_run_oscillating_beam_2d_5.json")

reference_data = JSON.parsefile(reference_file_name)
run_data = JSON.parsefile(run_file_name)

# error_ = calculate_error(reference_data, run_data)

svchb marked this conversation as resolved.
Show resolved Hide resolved
error_deflection_x = calculate_mse(reference_data["deflection_x_solid_1"]["time"],
reference_data["deflection_x_solid_1"]["values"],
run_data["deflection_x_solid_1"]["time"],
run_data["deflection_x_solid_1"]["values"])

error_deflection_y = calculate_mse(reference_data["deflection_y_solid_1"]["time"],
svchb marked this conversation as resolved.
Show resolved Hide resolved
reference_data["deflection_y_solid_1"]["values"],
run_data["deflection_y_solid_1"]["time"],
run_data["deflection_y_solid_1"]["values"])
Loading