Conversation
- Write 3D geometry in parallel without `mpi_dims_mask` - Read 3D geometry in parallel with `mpi_dims_mask` - Verify correct distribution of domain for any number of MPI processes
Add parameter `mpi_dims_mask` to class method `from_discrete_mapping` and bound method `read`.
Use new variable for dictionary with number of cells for each patch.
test methods from_discrete_mapping and from_topological_domain with mpi_dims_mask
- Add new constructor Geometry.from_file - Remove `filename` from __init__ parameters
commit ccbd6e3 Author: Yaman Güçlü <yaman.guclu@gmail.com> Date: Wed Oct 1 06:25:42 2025 +0200 Allow `mpi_dims_mask` with geometry file (#526) Add the optional parameter `mpi_dims_mask` to the constructor of class `Geometry`, as well as its class methods `from_discrete_mapping` and `from_topological_domain`. Add unit tests to verify that the domain is correctly decomposed. --------- Co-authored-by: Alisa Kirkinskaia <alisa.kirkinskaia@tum.de> Co-authored-by: Alisa Kirkinskaia <alisa.kirkinsk@gmail.com>
- Add function `get_available_mappings` - Clean up function `discrete_mapping` and add docstring to it
This reverts commit 7111b8e. These changes will be included in another PR, hence we remove them from here to avoid future conflicts.
4694c33 to
001e592
Compare
Use the custom action `ubuntu_install` for installing non-Python dependencies, like in the `testing` workflow. Add a separate step to install the packages `graphviz` and `pandoc` required for documentation.
| The Geometry object can be created in four ways: | ||
| - case 0 : providing a `Domain` to `__init__` with detailed parameters for each patch. | ||
| - case 1 : passing the path to a geometry file to `from_file`. | ||
| - case 2 : passing a `SplineMapping` to `from_discrete_mapping` (single patch). | ||
| - case 3 : passing a `Domain`, ncells, and periodicity to `from_topological_domain` (single or multi-patch). | ||
|
|
There was a problem hiding this comment.
It's very nice to list these cases!
Maybe we should also specify here which cases should be suggested to users ?
My feeling is that case 0 should only be used "internally", i.e. called by existing functions
edit 1: ok I see now that this is also explained in the PR description. then I suggest to specify it in this docstring as well.
edit2: it would be useful to indicate also here that case 1 and 3 are called by the discretize_domain interface (or just discretize called on a SymPDE Domain)
There was a problem hiding this comment.
In particular, I would suggest to remove or rewrite the direct constructions of Geometry objects in cad/cad.py, to avoid giving bad ideas
| #-------------------------------------------------------------------------- | ||
| @classmethod | ||
| def from_topological_domain(cls, domain, ncells, *, periodic=None, comm=None, mpi_dims_mask=None): | ||
| interior = domain.interior |
There was a problem hiding this comment.
here I suggest checking that domain is of correct type (a symPDE Domain I guess)
| return Geometry.from_file(filename, comm=comm, mpi_dims_mask=mpi_dims_mask) | ||
|
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 10 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes. Give us feedback
from_file__init__method in all factory class methods (from_file,from_discrete_mapping, andfrom_topological_domain)__init__(factory class methods should be preferred)pdimparameter (number of dimensions of physical domain) to__init__@pytest.mark.xdist_group('h5py')to all tests inpsydac.cad.tests.test_geometry, becauseh5pyis not thread-safeMoreover:
clean-multipatch-domain, which will become version0.20.0joinconstructor ofDomainobjects (fromsympde.topology.domain)psydac/cad/mesh/multipatch)