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

Inconsistent from_file when reading a topological domain from a file, that has been exported #144

Open
ratnania opened this issue Jan 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ratnania
Copy link
Contributor

We consider the following code:

from sympde.topology import Domain
from sympde.topology import InteriorDomain
from sympde.topology import Union
from sympde.topology import Interface
from sympde.topology import Connectivity
from sympde.topology import Boundary

# ... create a domain with 2 subdomains A and B
A = InteriorDomain('A', dim=2)
B = InteriorDomain('B', dim=2)

connectivity = Connectivity()

bnd_A_1 = Boundary('Gamma_1', A)
bnd_A_2 = Boundary('Gamma_2', A)
bnd_A_3 = Boundary('Gamma_3', A)

bnd_B_1 = Boundary('Gamma_1', B)
bnd_B_2 = Boundary('Gamma_2', B)
bnd_B_3 = Boundary('Gamma_3', B)

connectivity['I'] = Interface('I', bnd_A_1, bnd_B_2)

Omega = Domain('Omega',
               interiors=[A, B],
               boundaries=[bnd_A_2, bnd_A_3, bnd_B_1, bnd_B_3],
               connectivity=connectivity)

# export
Omega.export('omega.h5')

Now when reading the topological domain from the exported file, using;

domain = Domain.from_file('omega.h5')

we get the following error

File ~/PYCCEL/IGA-Python/.iga-python/lib/python3.10/site-packages/sympde/topology/domain.py:355, in Domain.from_file(cls, filename)
    352 if dtype == 'None': dtype = None
    354 assert dtype is not None
--> 355 assert all(dtype)
    356 if isinstance(d_interior, dict):
    357     d_interior = [d_interior]

AssertionError: 
@yguclu yguclu added the bug Something isn't working label Jan 24, 2024
@yguclu
Copy link
Member

yguclu commented Jan 24, 2024

In Psydac we read files with the call

domain_h = Geometry(filename = 'geom.h5')

I suspect that Domain.from_file() is not used there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants