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

Mix logical and physical coordinates in expression - V2 #291

Draft
wants to merge 33 commits into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
53cdb08
Update pullback operators: use BasicCallableMapping from sympde
yguclu Oct 5, 2022
f160dfb
Use SymPDE branch "fix-psydac-issue-189"
yguclu Oct 5, 2022
75c0844
Update push-forward operators: use BasicCallableMapping from sympde
yguclu Oct 5, 2022
f83398d
Update SplineMapping: subclass BasicCallableMapping from sympde
yguclu Oct 6, 2022
5776b6f
Update visual tests for spline mappings
yguclu Oct 7, 2022
9d25d21
Update function discrete_mapping in module discrete_gallery
yguclu Oct 7, 2022
a2c2f21
Update class DiscreteDerham
yguclu Oct 7, 2022
8b8679b
Fix broken tests
yguclu Oct 7, 2022
1cb0eea
Add some comments and checks
yguclu Oct 14, 2022
dd191c1
Attach spline mapping to sympde Mapping object
yguclu Oct 14, 2022
f3bf330
In discretize_derham get Mapping from Geometry object
yguclu Oct 14, 2022
412543f
Update test_geometry.py
saidctb Oct 15, 2022
5b83cc6
Update geometry.py
saidctb Oct 15, 2022
29b91b6
use mapped domain name
Oct 15, 2022
c51a465
Add draft of FEEC test with spline mapping
yguclu Oct 17, 2022
b72fc3b
Add method jacobian_inv to SplineMapping
yguclu Oct 19, 2022
4258b84
Add FEEC unit test for 2D Maxwell with spline mapping
yguclu Oct 19, 2022
cc3b67c
Add missing argument to broken unit tests
yguclu Oct 20, 2022
5413154
Remove draft FEEC test
yguclu Oct 20, 2022
f17ba9f
Don't use `periodic` argument in unit test when not meaningful
yguclu Oct 20, 2022
124dec1
Use SymPDE version 0.16.0
yguclu Oct 21, 2022
f606fe0
Use Sympde version 0.16.1
yguclu Nov 16, 2022
2cdf882
Merge branch 'devel' into fix-issue-189
yguclu Nov 16, 2022
dd9fa53
Fix 2D Poisson example: use new Mapping class
yguclu Nov 25, 2022
14486bf
Apply formatting to 2D Poisson example
yguclu Nov 25, 2022
aff8e6c
Merge branch 'devel' into fix-issue-189
yguclu Dec 6, 2022
cbf16e2
Try fix issue 257
YzzIzzY Mar 24, 2023
44b087f
fix C1 spaces
YzzIzzY Mar 24, 2023
1280600
Merge branch 'devel' into fix-issue-189
yguclu Mar 28, 2023
e83ef5b
call LogicalExpr always before TerminalExpr
YzzIzzY Mar 28, 2023
dd7db73
Use SymPDE branch "logical_n_physical-coordinates-2"
yguclu Mar 28, 2023
ab678bc
Merge branch 'devel' into logical_n_physical-coordinates-2
yguclu Apr 24, 2023
2bae5fa
Fix merge problem and remove useless function call
yguclu Apr 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions psydac/api/discretization.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,16 +396,21 @@ def discretize(a, *args, **kwargs):
kwargs['symbolic_mapping'] = mapping

if isinstance(a, sym_BasicForm):
if isinstance(a, sym_Norm):
kernel_expr = TerminalExpr(a, domain)
if not mapping is None:
kernel_expr = tuple(LogicalExpr(i, domain) for i in kernel_expr)
else:
if not mapping is None:
a = LogicalExpr (a, domain)
domain = domain.logical_domain

kernel_expr = TerminalExpr(a, domain)
# if isinstance(a, sym_Norm):
# kernel_expr = TerminalExpr(a, domain)
# if not mapping is None:
# kernel_expr = tuple(LogicalExpr(i, domain) for i in kernel_expr)
# else:
# if not mapping is None:
# a = LogicalExpr (a, domain)
# domain = domain.logical_domain

# kernel_expr = TerminalExpr(a, domain)
if not mapping is None:
a = LogicalExpr (a, domain)
domain = domain.logical_domain

kernel_expr = TerminalExpr(a, domain)

if len(kernel_expr) > 1:
return DiscreteSumForm(a, kernel_expr, *args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion psydac/cad/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self, domain=None, ncells=None, periodic=None, mappings=None,
interior_names = sorted(domain.interior_names)
mappings_keys = sorted(list(mappings.keys()))

assert sorted(interior_names) == mappings_keys
assert interior_names == mappings_keys
# ...

if periodic is None:
Expand Down
11 changes: 4 additions & 7 deletions psydac/mapping/discrete_gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,10 @@ def discrete_mapping(mapping, ncells, degree, **kwargs):
periodic = ( False, False, False)

elif mapping == 'spherical shell':
map_analytic = SphericalMapping( 'M', dim=dim )
lims1 = (1, 4)
lims2 = (0, np.pi)
lims3 = (0, np.pi/2)
period1 = False
period2 = False
period3 = False
map_analytic = SphericalMapping('M', dim=dim)
limits = ((1, 4), (0, np.pi), (0, np.pi/2))
periodic = ( False, False, False)

else:
raise ValueError("Required 3D mapping not available")

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
'pyevtk',

# Our packages from PyPi
'sympde==0.16.1',
'sympde @ git+https://github.com/pyccel/sympde@logical_n_physical-coordinates-2',
'pyccel>=1.7.3',
'gelato==0.11',

Expand Down