Smoothed_covering_grid and force_periodicity?
Dear YT community and FLASH users, I am new to FLASH (running laserslab like problems in 2D Cylindrical symmetry) and new to YT. We have been using YT to read in FLASH hdf5 files from our 2D R-z laser simulations with cylindrical symmetry. We want to use smoothed_covering_grid to interpolate data to the highest resolution (highest refinement level). Following an example given on Scott Feister's GitHub page (https://github.com/sfeister/flsuite/blob/master/flsuite/flyt/flyt.py), if we use just “covering_grid” like his example, with arguments like he gives (max_level, left_edge, dims), things work well, but there is no interpolation, of course. However, if we simply switch to “smoothed_covering_grid” and then try to get out fields like dens, tele, etc., then we get the following error below. We take the advice in the error message and do: ds.force_periodicity() prior to pulling out the desired fields, and it “works”, but then at data boundaries (r=rmin, z=zmin, r=rmax, z=zmax) we get some funny wrap-around of the data due to the force_periodicity. Is there a way to avoid using "force_periodicity" with "smoothed_covering_grid"? We want the data interpolated to the finest AMR refinement level on a uniform 2D grid. Not sure why covering_grid works okay, but smoothed_covering_grid doesn’t on the same data set? The data are nicely interpolated everywhere except at the boundaries. Any help or advice would be appreciated. Thanks, David Montgomery **** error message we get below when trying something like Te = scg["tele"], where scg = ds.smoothed_covering_grid[max_level, left_edge, dims], where max_level = ds.max_level, left_edge = ds.domain_left_edge, and dims = ds.domain_dimensions * 2**np.array([max_level, max_level, 0]) **** Traceback (most recent call last): File "<python-input-24>", line 1, in <module> Te = scg["tele"] ~~~^^^^^^^^ File "/Users/david/Library/Python/3.13/lib/python/site-packages/yt/data_objects/data_containers.py", line 235, in __getitem__ self.get_data(f) ~~~~~~~~~~~~~^^^ File "/Users/david/Library/Python/3.13/lib/python/site-packages/yt/data_objects/construction_data_containers.py", line 915, in get_data self._fill_fields(fill) ~~~~~~~~~~~~~~~~~^^^^^^ File "/Users/david/Library/Python/3.13/lib/python/site-packages/yt/data_objects/construction_data_containers.py", line 1494, in _fill_fields min_level = self._compute_minimum_level() File "/Users/david/Library/Python/3.13/lib/python/site-packages/yt/data_objects/construction_data_containers.py", line 1478, in _compute_minimum_level for chunk in ils.data_source.chunks([], "io"): ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ File "/Users/david/Library/Python/3.13/lib/python/site-packages/yt/data_objects/selection_objects/data_selection_objects.py", line 94, in chunks self.get_data() # Ensure we have built ourselves ~~~~~~~~~~~~~^^ File "/Users/david/Library/Python/3.13/lib/python/site-packages/yt/data_objects/selection_objects/data_selection_objects.py", line 139, in get_data self.index._identify_base_chunk(self) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/Users/david/Library/Python/3.13/lib/python/site-packages/yt/geometry/grid_geometry_handler.py", line 332, in _identify_base_chunk gi = dobj.selector.select_grids( ^^^^^^^^^^^^^ File "/Users/david/Library/Python/3.13/lib/python/site-packages/yt/data_objects/selection_objects/data_selection_objects.py", line 89, in selector self._selector = sclass(self) ~~~~~~^^^^^^ File "yt/geometry/_selection_routines/region_selector.pxi", line 60, in yt.geometry.selection_routines.RegionSelector.__init__ RuntimeError: yt attempted to read outside the boundaries of a non-periodic domain along dimension 0. Region left edge = -0.0006510416666666666 code_length, Region right edge = 0.25065104166666663 code_length Dataset left edge = 0.0 code_length, Dataset right edge = 0.25 code_length This commonly happens when trying to compute ghost cells up to the domain boundary. Two possible solutions are to select a smaller region that does not border domain edge (see https://yt-project.org/docs/analyzing/objects.html?highlight=region) or override the periodicity with ds.force_periodicity()
participants (1)
-
dsmont80@gmail.com