esmf-org / esmf

The Earth System Modeling Framework (ESMF) is a suite of software tools for developing high-performance, multi-component Earth science modeling applications.
https://earthsystemmodeling.org/
Other
156 stars 75 forks source link

Add ability to change mesh mask via subroutine in ESMPy #208

Open billsacks opened 8 months ago

billsacks commented 8 months ago

We want to add the ability to set an element mask on the Mesh from ESMPy. This emerges from support ticket https://github.com/esmf-org/esmf-support/issues/84 - see there for details. The most relevant comment there is from @rokuingh

Adding the ability to set an element mask on the Mesh from ESMPy would involve adding a C interface for MeshCap::setElemInfo(), the corresponding cbindings in the ESMP layer, and the top level Mesh::set_mask() interface in the ESMPy layer. The element mask can already be added through ESMPy Mesh creation, but there is no way to retrieve it (so that ESMPy would not have to save a copy of the mask data allocated in the C++ mesh, and so that ESMPy could view mask data set by a mesh created from file). There is a general lack of MeshGet functionality in ESMPy, for historical reasons, but this is now available to the C/Python interface after the Mesh layering refactor. Node masking would be a much larger task that would involve lower level ESMF work in the Fortran/C++ layers. Get and node masking should probably be separate tickets, a simple Set for element mask (this ticket) is relatively quick, a day or two.