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
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
There was a problem hiding this comment.
Do you mean the script-like code on the bottom of cad/cad.py? I believe that code does not work right now, so we could either remove it or try to create a unit test out of it
There was a problem hiding this comment.
yes, I guess I was referring to these calls to the Geometry constructor. Since these are not advised the best is probably to remove them
There was a problem hiding this comment.
Excluding some unit tests (which naturally have to test also the __init__ function), I can find those calls only at the bottom of cad/cad.py. That is why I was asking
| #-------------------------------------------------------------------------- | ||
| @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 | 18 |
| Duplication | 0 |
🟢 Coverage 81.91% diff coverage
Metric Results Coverage variation Report missing for 41a0cd71 Diff coverage ✅ 81.91% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (41a0cd7) Report Missing Report Missing Report Missing Head commit (2cb2971) 49506 32929 66.52% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#527) 199 163 81.91% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
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.
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:
0.20.0joinconstructor ofDomainobjects (fromsympde.topology.domain)psydac/cad/mesh/multipatch)ubuntu_installationsaction indocumentationworkflowcmd.mesh>>cmd.psydac_meshTO DO:
from_file, make sure that thedomainargument (an instance ofsympde.topology.Domain) is compatible with the topological domain defined in the.ymlsection of the HDF5 file.cad.tests.test_geometry:test_geometry_2d_1andtest_geometry_2d_2test_geometry_1cad.cadin new modulecad.tests.test_cadpyproject.tomland run all unit tests once again on all platforms