Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh splitting and selection #346

Merged
merged 106 commits into from
Jul 21, 2023
Merged

Mesh splitting and selection #346

merged 106 commits into from
Jul 21, 2023

Conversation

PProfizi
Copy link
Contributor

@PProfizi PProfizi commented Mar 24, 2023

Introduces Meshes, a container for multiple Mesh instances (wraps a MeshesContainer).

The goal is to allow for lazy Mesh queries, where a first splitting step is used with a further selection to work only on the MeshedRegion of interest.

Adds Mesh.split_by_properties(), Mesh.select(), Mesh.plot()
Adds Meshes, Meshes[{"mat": 1, "elshape":1}] or Meshes[0], Meshes.plot()

To do:

  • Treat split by with specific property values
  • Improve coverage
  • Improve documentation
  • Add example

@PProfizi PProfizi added the enhancement New feature or request label Mar 24, 2023
@PProfizi PProfizi added this to the v0.3.1 milestone Mar 24, 2023
@PProfizi PProfizi self-assigned this Mar 24, 2023
@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #346 (3e271a4) into master (7917821) will increase coverage by 1.84%.
The diff coverage is 97.92%.

@@            Coverage Diff             @@
##           master     #346      +/-   ##
==========================================
+ Coverage   81.64%   83.49%   +1.84%     
==========================================
  Files          39       44       +5     
  Lines        4124     4640     +516     
==========================================
+ Hits         3367     3874     +507     
- Misses        757      766       +9     

):
"""Constructs a _ConnectivityList by wrapping the given PropertyField.

Arguments:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameters ?

Suggested change
Arguments:
Parameters:

raise TypeError("Given argument is not an int nor an ElementDescriptor")

@property
def enum_id(self) -> dpf.element_types:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any other naming that enum_id ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are using "elem_type_id" in the DataFrame

new_name = copy.copy(self._name)
return NamedSelection(name=new_name, scoping=new_scoping)

def as_local_scoping(self) -> NamedSelection:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that needed?

"""Length of the list of IDs."""
return self._scoping.size

def deep_copy(self, server=None) -> NamedSelection:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not performant at the moment in core side as discussed with @rafacanton, do we need on the post side?

>>> print(simulation.mesh.num_nodes) # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
81
"""
return len(self.node_ids)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use the core API for the number of nodes here please? We will eventually have a better implementation in core and I'ld like to inherit from it here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same for elements)

def mesh_info(self):
"""Return available mesh information."""
mesh_selection_manager_provider_op = (
dpf.operators.metadata.mesh_selection_manager_provider(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we using the mesh_selection_manager_provider ?

@PProfizi PProfizi merged commit c9b5fc9 into master Jul 21, 2023
@PProfizi PProfizi deleted the feat/mesh_api branch July 21, 2023 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants