Skip to content

Improve Geometry class - #527

Open
yguclu wants to merge 78 commits into
develfrom
yguclu-improve-Geometry
Open

yguclu wants to merge 78 commits into
develfrom
yguclu-improve-Geometry

Conversation

@yguclu

@yguclu yguclu commented Oct 7, 2025 •

Copy link
Copy Markdown
Member
  • Add new factory class method from_file
  • Use __init__ method in all factory class methods (from_file, from_discrete_mapping, and from_topological_domain)
  • Discourage direct use of __init__ (factory class methods should be preferred)
  • Add mandatory pdim parameter (number of dimensions of physical domain) to __init__
  • Clean up and document (with docstrings) the factory class methods
  • Add Pytest mark @pytest.mark.xdist_group('h5py') to all tests in psydac.cad.tests.test_geometry, because h5py is not thread-safe

Moreover:

  • Use SymPDE version 0.20.0
  • Always provide interface orientation to the join constructor of Domain objects (from sympde.topology.domain)
  • Add interface orientation to multipatch geometry files (in the folder psydac/cad/mesh/multipatch)
  • Use ubuntu_installations action in documentation workflow

TO DO:

  • In from_file, make sure that the domain argument (an instance of sympde.topology.Domain) is compatible with the topological domain defined in the .yml section of the HDF5 file.
  • Update unit tests in cad.tests.test_geometry:
    • Add some 1D unit tests
    • Add proper asserts statements to test_geometry_2d_1 and test_geometry_2d_2
    • Remove obsolete test function test_geometry_1
    • Test functions from cad.cad in new module cad.tests.test_cad
  • After release of SymPDE version 0.20.0, update pyproject.toml and run all unit tests once again on all platforms
  • Mention SymPDE 0.20.0 in PR description
  • Mention SymPDE 0.20.0 in CHANGELOG.md
  • Reactivate unit tests on all Python versions

yguclu and others added 28 commits September 18, 2025 15:27
- 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
@yguclu
yguclu marked this pull request as draft September 11, 2026 16:22
@yguclu
yguclu marked this pull request as ready for review September 11, 2026 16:22
@yguclu
yguclu marked this pull request as draft September 11, 2026 16:36
@yguclu
yguclu marked this pull request as ready for review September 11, 2026 16:36
@yguclu
yguclu marked this pull request as draft October 3, 2026 06:08
@yguclu
yguclu marked this pull request as ready for review October 3, 2026 06:08
@yguclu
yguclu marked this pull request as draft October 3, 2026 09:12
@yguclu
yguclu marked this pull request as ready for review October 3, 2026 09:12
@yguclu
yguclu marked this pull request as draft October 4, 2026 08:43
@yguclu
yguclu marked this pull request as ready for review October 4, 2026 08:43
yguclu added 4 commits October 6, 2026 11:29
`plot_solution` still called the old `Geometry(filename=...)` constructor,
which raised a TypeError after the redesign of `Geometry.__init__` when
running the example with a spline mapping (option -S).
The example is meant to be run as a script, so imports are made local
to the functions that use them. Only the base classes PolarModel2D and
LinearOperator, needed at class definition, remain at module level.
Silence Pylint's import-outside-toplevel check for the whole file, with
a comment explaining the reason.
The `mappings` parameter defaults to None, meaning that no patch has a
mapping, but the type check rejected None. The code handling None was
therefore never reached, and it would have failed anyway for single-patch
domains, where `domain.interior` is not iterable. Accept None in the type
check and build the default dictionary from `domain.interior_names`.

Add `test_geometry_init_without_mappings` for single- and two-patch
domains.
The demo used an API that no longer exists (`Geometry(patches=...)`,
`geo.patches`) and a geometry file that is not in the repository. The
functions in this module will be covered by unit tests in
`psydac.cad.tests.test_cad`.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CAD Geometric operations on NURBS, geometry files, etc... Next Release Must be in next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants