Skip to content

Commit

Permalink
More materials for ProStudio
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Aug 24, 2024
1 parent 7986502 commit 8a315f6
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 23 deletions.
3 changes: 0 additions & 3 deletions data/materials/almost_rigid.h5

This file was deleted.

3 changes: 3 additions & 0 deletions data/materials/door_iron.h5
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/materials/floor_wood_on_concrete.h5
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/materials/glas_thick.h5
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/materials/leather_arm_chair.h5
Git LFS file not shown
13 changes: 7 additions & 6 deletions data/models/ProStudio/ProStudio_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@
'ATC Left': 'floor_wood.h5',
'ATC Right': 'floor_wood.h5',
'Ceiling': 'absorber_8000_200mm_gap_200mm.h5',
'Console': 'floor_wood.h5',
# 'Couch': 'absorber_8000_50mm.h5',
'Console': 'door_iron.h5',
'Couch': 'leather_arm_chair.h5',
# 'Diffusor': 'floor_wood.h5',
'Floor': 'floor_wood.h5',
'Outboard': 'floor_wood.h5',
'Floor': 'floor_wood_on_concrete.h5',
'Outboard': 'door_iron.h5',
'Rack': 'floor_wood.h5',
'Raised Floor': 'floor_wood.h5',
'Walls Back': 'absorber_8000_200mm_gap_200mm.h5',
'Walls Front': 'absorber_8000_200mm_gap_100mm.h5',
'Walls Side': 'absorber_8000_100mm.h5',
'Walls Side': 'absorber_8000_50mm.h5',
'Windows': 'glas_thick.h5',
},
duration=1.2,
Tc=20,
Expand All @@ -29,7 +30,7 @@
fmax=800.0,
save_folder='../../sim_data/ProStudio/cpu',
save_folder_gpu='../../sim_data/ProStudio/gpu',
draw_vox=False,
draw_vox=True,
draw_backend='polyscope',
compress=0,
rot_az_el=[0, 0],
Expand Down
3 changes: 2 additions & 1 deletion data/models/ProStudio/ProStudio_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def main():
m.add("ATC Right", obj / 'atc_right.obj', [5, 5, 5], reverse=True)
m.add("Ceiling", obj / 'ceiling.obj', [60, 60, 60])
m.add("Console", obj / 'console.obj', [60, 60, 60], reverse=True)
# m.add("Couch", obj / 'couch.obj', [5, 5, 48], reverse=True)
m.add("Couch", obj / 'couch.obj', [5, 5, 48], reverse=True)
# m.add("Diffusor", obj / 'diffusor.obj', [53, 33, 0], reverse=True)
m.add("Floor", obj / 'floor.obj', [53, 33, 0])
m.add("Outboard", obj / 'outboard.obj', [0, 0, 0], reverse=True)
Expand All @@ -139,6 +139,7 @@ def main():
m.add("Walls Back", obj / 'walls_back.obj', [100, 100, 100])
m.add("Walls Front", obj / 'walls_front.obj', [100, 100, 100])
m.add("Walls Side", obj / 'walls_side.obj', [180, 180, 180])
m.add("Windows", obj / 'windows.obj', [137, 207, 240], reverse=True)
m.add_source("S1", s1)
m.add_source("S2", s2)
m.add_source("S3", s3)
Expand Down
2 changes: 1 addition & 1 deletion data/models/ProStudio/model.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions data/models/ProStudio/obj/windows.obj
Git LFS file not shown
14 changes: 7 additions & 7 deletions run_3d.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ set -e
root_dir="$(cd "$(dirname "$0")" && pwd)"
engine_exe="$root_dir/build/src/cpp/main_3d/pffdtd_3d"

sim_name="Localization"
sim_name="ProStudio"
sim_setup="${sim_name}_cpu.py"
sim_model_gen="${sim_name}_model.py"
sim_dir="$root_dir/data/sim_data/$sim_name/cpu"

model_dir="$root_dir/data/models/$sim_name"
materials_dir="$root_dir/data/materials"

fmin=20
fmin=25
fmax=800
smoothing=0

Expand All @@ -33,13 +33,13 @@ cd "$sim_dir"
$engine_exe

# Post-process
python -m pffdtd.sim3d.process_outputs --data_dir="$sim_dir" --fcut_lowpass "$fmax" --N_order_lowpass=8 --symmetric --fcut_lowcut "$fmin" --N_order_lowcut=4 --air_abs_filter="none" --save_wav --plot
python -m pffdtd.sim3d.process_outputs --data_dir="$sim_dir" --fcut_lowpass "$fmax" --N_order_lowpass=8 --symmetric --fcut_lowcut "$fmin" --N_order_lowcut=4 --air_abs_filter="stokes" --save_wav --plot
python -m pffdtd.analysis.response --fmin=10 --target="-2.5" --smoothing=$smoothing --fmax=$fmax $sim_dir/R001_out_normalised.wav $sim_dir/R002_out_normalised.wav
python -m pffdtd.analysis.response --fmin=10 --target="-2.0" --smoothing=$smoothing --fmax=$fmax $sim_dir/R001_out_normalised.wav $sim_dir/R003_out_normalised.wav
python -m pffdtd.analysis.response --fmin=10 --target="-1.5" --smoothing=$smoothing --fmax=$fmax $sim_dir/R001_out_normalised.wav $sim_dir/R004_out_normalised.wav
# python -m pffdtd.analysis.response --fmin=10 --target="-1.0" --smoothing=$smoothing --fmax=$fmax $sim_dir/R001_out_normalised.wav $sim_dir/R005_out_normalised.wav
# python -m pffdtd.analysis.response --fmin=10 --target="-0.5" --smoothing=$smoothing --fmax=$fmax $sim_dir/R001_out_normalised.wav $sim_dir/R006_out_normalised.wav
python -m pffdtd.analysis.response --fmin=10 --target="-1.0" --smoothing=$smoothing --fmax=$fmax $sim_dir/R001_out_normalised.wav $sim_dir/R005_out_normalised.wav
python -m pffdtd.analysis.response --fmin=10 --target="-0.5" --smoothing=$smoothing --fmax=$fmax $sim_dir/R001_out_normalised.wav $sim_dir/R006_out_normalised.wav
python -m pffdtd.analysis.waterfall $sim_dir/R001_out_normalised.wav
# python -m pffdtd.analysis.t60 --fmin=$fmin --fmax="$fmax" --target=0.3 $sim_dir/R001_out_normalised.wav
# python -m pffdtd.analysis.t60 --data_dir="$sim_dir" --fmin=$fmin --fmax="$fmax" --target=0.25
python -m pffdtd.analysis.t60 --fmin=$fmin --fmax="$fmax" --target=0.3 $sim_dir/R001_out_normalised.wav
python -m pffdtd.analysis.t60 --data_dir="$sim_dir" --fmin=$fmin --fmax="$fmax" --target=0.25
# python -m pffdtd.analysis.room_modes --data_dir="$sim_dir" --fmin=$fmin --fmax=$fmax --modes=20
12 changes: 9 additions & 3 deletions src/python/pffdtd/materials/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,24 @@ def main():
absorber_8000_200mm_gap_200mm = np.array([0.19, 0.38, 0.69, 0.84, 0.88, 0.93, 0.95, 0.95, 0.94, 0.93, 0.90])
concrete_painted = np.array([0.01, 0.01, 0.01, 0.05, 0.06, 0.07, 0.09, 0.08, 0.08, 0.08, 0.08])
floor_wood = np.array([0.10, 0.11, 0.13, 0.15, 0.11, 0.10, 0.07, 0.06, 0.07, 0.07, 0.07])
floor_wood_on_concrete = np.array([0.01, 0.01, 0.01, 0.04, 0.04, 0.07, 0.06, 0.06, 0.07, 0.06, 0.06])
door_iron = np.array([0.01, 0.01, 0.01, 0.01, 0.01, 0.02, 0.02, 0.03, 0.03, 0.03, 0.02])
door_wood = np.array([0.06, 0.08, 0.14, 0.14, 0.10, 0.06, 0.08, 0.10, 0.10, 0.10, 0.08])
almost_rigid = np.array([0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03])
glas_thick = np.array([0.15, 0.30, 0.27, 0.18, 0.06, 0.04, 0.03, 0.02, 0.02, 0.02, 0.01])
leather_arm_chair = np.array([0.04, 0.08, 0.16, 0.20, 0.25, 0.29, 0.31, 0.29, 0.25, 0.22, 0.30])

fit_to_Sabs_oct_11(absorber_8000_50mm , filename=Path(write_folder / 'absorber_8000_50mm.h5') , plot=plot)
fit_to_Sabs_oct_11(absorber_8000_100mm , filename=Path(write_folder / 'absorber_8000_100mm.h5') , plot=plot)
fit_to_Sabs_oct_11(absorber_8000_200mm , filename=Path(write_folder / 'absorber_8000_200mm.h5') , plot=plot)
fit_to_Sabs_oct_11(absorber_8000_200mm_gap_100mm , filename=Path(write_folder / 'absorber_8000_200mm_gap_100mm.h5') , plot=plot)
fit_to_Sabs_oct_11(absorber_8000_200mm_gap_200mm , filename=Path(write_folder / 'absorber_8000_200mm_gap_200mm.h5') , plot=plot)
fit_to_Sabs_oct_11(concrete_painted , filename=Path(write_folder / 'concrete_painted.h5') , plot=plot)
fit_to_Sabs_oct_11(floor_wood , filename=Path(write_folder / 'floor_wood.h5') , plot=plot)
fit_to_Sabs_oct_11(door_iron , filename=Path(write_folder / 'door_iron.h5') , plot=plot)
fit_to_Sabs_oct_11(door_wood , filename=Path(write_folder / 'door_wood.h5') , plot=plot)
fit_to_Sabs_oct_11(almost_rigid , filename=Path(write_folder / 'almost_rigid.h5') , plot=plot)
fit_to_Sabs_oct_11(floor_wood , filename=Path(write_folder / 'floor_wood.h5') , plot=plot)
fit_to_Sabs_oct_11(floor_wood_on_concrete , filename=Path(write_folder / 'floor_wood_on_concrete.h5') , plot=plot)
fit_to_Sabs_oct_11(glas_thick , filename=Path(write_folder / 'glas_thick.h5') , plot=plot)
fit_to_Sabs_oct_11(leather_arm_chair , filename=Path(write_folder / 'leather_arm_chair.h5') , plot=plot)

#freq-independent impedance from Sabine abs coefficient
write_freq_ind_mat_from_Yn(convert_Sabs_to_Yn(0.01),filename=Path(write_folder / 'sabine_01.h5'))
Expand Down
8 changes: 6 additions & 2 deletions src/python/pffdtd/voxelizer/vox_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,12 @@ def draw(self,backend='mayavi'):
mode='sphere',resolution=8,scale_factor=sf)

elif backend == 'polyscope':
ps_cloud_in = ps.register_point_cloud(mat,\
np.c_[xv[bn_ix[qq]],yv[bn_iy[qq]],zv[bn_iz[qq]]], color=color)
ps_cloud_in = ps.register_point_cloud(
mat,
np.c_[xv[bn_ix[qq]],yv[bn_iy[qq]],zv[bn_iz[qq]]],
color=color,
point_render_mode="sphere"
)
ps_cloud_in.set_radius(sf/2, relative=False)


Expand Down

0 comments on commit 8a315f6

Please sign in to comment.