Skip to content

feature: structured grid interpolation #1699

@wpbonelli

Description

@wpbonelli

Is your feature request related to a problem? Please describe.

StructuredGrid can interpolate between grid features with

  • array_at_verts_basic(a): cell center (node) to vertices with neighbor averaging
  • array_at_verts(a): cell center or face center to vertices (bi or trilinear)
  • array_at_faces(a, direction): cell center to pair of faces normal to x, y, or z axis (linear)

This is nice but may be hard for users to find, and not all possible mappings are supported

Describe the solution you'd like

Unifying the API could help make it more discoverable, maybe something like

interpolate(self, a, feat="c2v", **kwargs)

where a is a 3D array of known values and feat selects the site mapping. Would need to check that a's dimensions match the input feature. The direction for interpolation to faces, and other mapping-specific params, could be passed with **kwargs. Implementation could wrap the existing functions and add other mappings to/from edge midpoints, vertices to cell centers, etc

A signature with an option selected from an enumeration seems like a common choice for many-to-many conversions/mappings (e.g. OpenCV, discretize), though docs would be key as shape of input/output would vary

Minimal draft implementation with some expanded testing and docs

Describe alternatives you've considered

If flopy's focus is more to drive modflow and less fully-featured post-processing this may be out of scope. Could also be missing some reason it's misguided or not possible

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions