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

scenario2 run fails due to mesh conversion #26

Open
jampekka opened this issue Dec 13, 2024 · 0 comments
Open

scenario2 run fails due to mesh conversion #26

jampekka opened this issue Dec 13, 2024 · 0 comments

Comments

@jampekka
Copy link

Running examples/scenario2/main.py fails giving the following output:

Info    : Reading '/home/jampekka/pro/natural-acoustics/model-simulation/edg-acoustics/examples/scenario2/Corridor.geo'...
Info    : Done reading '/home/jampekka/pro/natural-acoustics/model-simulation/edg-acoustics/examples/scenario2/Corridor.geo'
generating the mesh with the characteristic length of 0.549 m
volume of the space =  65.239 m^3
The generated mesh (based on characteristic length of 0.549 m) has PPW = 17.943 and 2606 tetrahedra elements
PPW is not between 8 and 10. Changing the characteristic length of the mesh and generating a new mesh
generating the mesh with the characteristic length of 0.549 m
PPW is greater than 10. Increasing the characteristic length of the mesh
generating the mesh with the characteristic length of 4.39 m
The generated mesh (based on characteristic length of 4.39 m) has PPW = 8.53 and 280 tetrahedra elements, it fits the mesh requirements! Continue with the simulation.

boundary parameter with label: 1 has passed the physical admissbility test
boundary parameter with label: 2 has passed the physical admissbility test
boundary parameter with label: 3 has passed the physical admissbility test
boundary parameter with label: 4 has passed the physical admissbility test
boundary parameter with label: 5 has passed the physical admissbility test
Traceback (most recent call last):
  File "/home/jampekka/pro/natural-acoustics/model-simulation/edg-acoustics/examples/scenario2/main.py", line 94, in <module>
    sim.init_rec(
  File "/home/jampekka/pro/natural-acoustics/model-simulation/edg-acoustics/edg_acoustics/acoustics_simulation.py", line 918, in init_rec
    self.sampleWeight, self.nodeindex = self.sample3D(methodLocate)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jampekka/pro/natural-acoustics/model-simulation/edg-acoustics/edg_acoustics/acoustics_simulation.py", line 877, in sample3D
    old_nodes = self.xyz[:, :, nodeindex]  # old_nodes.shape = (3, Np, N_rec) #type: ignore
                ~~~~~~~~^^^^^^^^^^^^^^^^^
IndexError: index 321 is out of bounds for axis 2 with size 280

This can be worked around by after a failed run changing mesh_name = "Corridor.msh" to use the generated .msh. Or alternatively creating the mesh like this:

edg_acoustics.Mesh.create_mesh_from_geo_file(mesh_filename, freq_upper_limit, Nx)
mesh_filename = mesh_filename[:-4] + '.msh'
mesh = edg_acoustics.Mesh(mesh_filename, BC_labels, Nx, freq_max=freq_upper_limit)

It's not immediately clear to me why calling Mesh.create_mesh_from_geo_file in Mesh.__init__ as currently done doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant