jakubcerveny / gilbert

Space-filling curve for rectangular domains or arbitrary size.
BSD 2-Clause "Simplified" License
121 stars 11 forks source link

How to modify it to a curve generation algorithm for local encryption #12

Closed tjuym closed 5 months ago

tjuym commented 5 months ago

1

jakubcerveny commented 5 months ago

Please elaborate on what the modification should do exactly.

tjuym commented 5 months ago

Please elaborate on what the modification should do exactly.

I'm just getting started with space fill curves, and I'm going to use space fill curves to divide the computational domain. I ran your program and got the curve in the readme, which corresponds to the computation domain of the uniform grid. Now I want to generate a computational domain for non-uniform grids. You mean I don't need to change the algorithm that generates the curve, but I need to change the way I call the function?

jakubcerveny commented 5 months ago

This algorithm only handles uniform rectangular grids. If you need adaptive subdivision, you need another "level" of the curve inside the grid cells, presumably a standard Hilbert curve (depending on how you subdivide the cells). That is the approach used for example here: https://mfem.org/howto/ncmesh/#load-balancing, where the subdivision of the computational elements defines another local SFC, obtained by a traversal of the local refinement tree. The Gilbert curve is used as a preprocessing step to order the coarsest mesh in case it is rectangular (more complete info can be found here https://arxiv.org/abs/1905.04033).

tjuym commented 5 months ago

This algorithm only handles uniform rectangular grids. If you need adaptive subdivision, you need another "level" of the curve inside the grid cells, presumably a standard Hilbert curve (depending on how you subdivide the cells). That is the approach used for example here: https://mfem.org/howto/ncmesh/#load-balancing, where the subdivision of the computational elements defines another local SFC, obtained by a traversal of the local refinement tree. The Gilbert curve is used as a preprocessing step to order the coarsest mesh in case it is rectangular (more complete info can be found here https://arxiv.org/abs/1905.04033).此算法仅处理均匀的矩形网格。如果需要自适应细分,则需要网格单元格内曲线的另一个“级别”,大概是标准希尔伯特曲线(取决于如何细分单元格)。例如,这里使用的方法如下:https://mfem.org/howto/ncmesh/#load-balancing,其中计算元素的细分定义了另一个局部 SFC,通过遍历局部细化树获得。吉尔伯特曲线用作预处理步骤,以对矩形最粗的网格进行排序(更完整的信息可以在这里找到 https://arxiv.org/abs/1905.04033)。

Thank you. I see what you mean. I will try it.