AMReX-Codes/amrex

How to interpolate a variable field to another grid system.

Closed this issue · 4 comments

I get the current varaible fields on a 100x100 grids. Now I want to use this for the initial fields on another 180x180 grids. How to interpolate the values.

The example you give has a refinement ratio of 1.8. We do not support non-integer refinement ratio. If that's what you need, you could write your own function to do it. You need to create of a temporary MultiFab that has same number of boxes and DistributionMapping as the fine MultiFab. You use that to store the coarse data that can be used to do spatial interpolation. Each Box in that temporary needs to be big enough for the type of interpolation algorithm you choose.

The example you give has a refinement ratio of 1.8. We do not support non-integer refinement ratio. If that's what you need, you could write your own function to do it. You need to create of a temporary MultiFab that has same number of boxes and DistributionMapping as the fine MultiFab. You use that to store the coarse data that can be used to do spatial interpolation. Each Box in that temporary needs to be big enough for the type of interpolation algorithm you choose.

ok, if i use a refinement ratio of 2. how to do the interplation.

Then you can probably use FillPatchSingleLevel and FillPatchTwoLevels. If not, please let us know more details. What are your inputs, what are the outputs you like? What do "the current varaible fields" mean exactly? How are the data stored?

@ztdepztdep - Closing this now due to inactivity -- please let us know if you have more questions!