Skip to content

🐛[BUG]: XAeronet-V Preprocessor.py unstructured2voxel function #1269

@LorenzoMattia

Description

@LorenzoMattia

Version

1.0.1

On which installation method(s) does this occur?

Pip

Describe the issue

I was trying to run the XAeronet Volume example with the AhmedML Dataset and having some troubles in the Preprocessor.py script. Theorically the dataset should be structured in the same way as the DrivAerML that is suggested in the repo.

The function unstrctured2voxel takes as input bounds variable containing a tuple of three elements. However, according to the VTK library the function SetSamplingBounds of the vtk.vtkResampleToImage() takes as input a tuple of six elements representing the min and max of the bound of each dimension. Indeed, in the following is the error I am getting.

Error executing job with overrides: []
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib64/python3.12/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/physicsnemo/examples/cfd/external_aerodynamics/xaeronet/volume/preprocessor.py", line 147, in process_file
    voxel_grid = unstructured2voxel(vtu_mesh, grid_size_expanded, bounds)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/physicsnemo/examples/cfd/external_aerodynamics/xaeronet/volume/preprocessor.py", line 62, in unstructured2voxel
    resampler.SetSamplingBounds(bounds)
TypeError: SetSamplingBounds argument 1

In order to avoid this error, I have also tried to not pass the bounds to the functions (since the code also provides theirs auto computing), and in that case I have problems matching dimensions in line 173.

volume_vertices = volume_vertices.reshape(3, *grid_size, order="F")

I don't know exactly the correct size of the AhmedML Dataset but once the grid size is defined for each axis, volume vertices generated should be rearranged to match dimensions, that rearrangement should also take into account the spacing value defined in the config.yaml file but it is never used in the provided code.

I hope to receive from you also some clarifications about how this part of the code works.

Minimum reproducible example

Relevant log output

Environment details

Metadata

Metadata

Labels

? - Needs TriageNeed team to review and classifybugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions