-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose mesh data, add plotting capability. (#231)
Add `elemental_data` and `nodal_data` attributes to tree objects, which fetch the data from the mesh query API. The returned objects have a method `to_pyvista`, to convert to a plottable object. Currently, this requires the `Model.mesh` to be passed in; we may consider how this can be avoided. Optionally, a `component` (name to be improved) can be passed, to select which data to add to the PyVista mesh. If a vector component is selected, the data is converted to arrows. The possible string constants for `component` are exposed in the `ElementalDataType` and `NodalDataType` enums, which are auto-converted from their protobuf equivalent. Helper classes and functions for wrapping mesh query data are defined in `_mesh_data.py`: - a base class `MeshDataBase` which implements `to_pyvista`, as well as the construction from a mesh query response - base classes `ElementalData` and `NodalData`, which are the classes to be used to define the mesh data classes for each tree object type - property helpers `elemental_data_property` and `nodal_data_property`, for defining the `elemental_data` and `nodal_data` properties, respectively. The mesh data itself is exposed in a separate `mesh` on the `Model`. Its class `MeshData` also implements a `to_pyvista` method. Add a `__slots__` class attribute in some places where it was missing, to disallow setting attributes that are not explicitly defined on tree objects.
- Loading branch information
Showing
17 changed files
with
2,793 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.