Skip to content

Discussion: Deprecation of InterpFromModel3dToMesh2d #10

@justinh2002

Description

@justinh2002

Context
Following a discussion with @MathieuMorlighem (Nov 12 2025 AEST), we reviewed the relevance of InterpFromModel3dToMesh2d after commit 2f9c9c5, which ports the routine to Python.

Mathieu noted that this function was originally introduced before we had more robust tools like DepthAverage and project2d, and that it is currently unmaintained.
The consensus is that if equivalent workflows can be fully covered by these other utilities, the function can be deprecated and eventually removed.


Key points from the discussion

  • I currently use the function for cases such as:
  T3d = mdT.results.ThermalSolution.Temperature
  T = InterpFromModel3dToMesh2d(mdT, T3d, md.mesh.x, md.mesh.y, np.nan, 253)

to map a 3-D HO temperature field onto a 2-D mesh.

  • Mathieu clarified that:

  • If the 3-D mesh is an extrusion of the same 2-D mesh, then no interpolation is required.

  • In that case, one should instead use:

    md.initialization.temperature = DepthAverage(mdT, T3d)

    or project2d if extracting a specific layer.

  • Therefore, InterpFromModel3dToMesh2d is redundant when:

    • The 3-D model is an extruded version of the 2-D base mesh, and
    • The goal is a vertical average or slice extraction.

Action plan

  • Keep the function for now to avoid breaking existing workflows.
  • Audit current uses across the codebase and examples.
  • If all use cases can be replaced by DepthAverage or project2d, mark the function as deprecated and remove it after a grace period.

📁 References

  • Commit: [2f9c9c5](ISSMteam@2f9c9c5)

  • Related files:

    • src/m/contrib/InterpFromModel3dToMesh2d.m
    • src/m/extrusion/DepthAverage.m
    • src/m/extrusion/project2d.m

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions