Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
d830ae1
add non matching conforming projection operators
FrederikSchnack Jul 14, 2023
a27a062
add some plotting utilities
FrederikSchnack Jul 14, 2023
bbad569
make multipatch examples run
FrederikSchnack Jul 14, 2023
ec10dfd
Use SymPDE development version from GitHub
yguclu Jul 17, 2023
a166d02
allow for non-matching grids in postprocessing
FrederikSchnack Jul 17, 2023
87bbef6
add utils
FrederikSchnack Jul 17, 2023
1a41cd0
adds non-matching domain utilities
FrederikSchnack Jul 18, 2023
e84552a
adds curl-curl test case comparisson
FrederikSchnack Jul 18, 2023
548881a
small changes
FrederikSchnack Jul 24, 2023
b0e64c9
Merge remote-tracking branch 'origin/devel' into non_matching_multipatch
FrederikSchnack Jul 24, 2023
4dbc422
Merge branch 'devel' into non_matching_multipatch
yguclu Jul 25, 2023
b3d1451
add time-domain Maxwell
FrederikSchnack Jul 27, 2023
a806b6d
add time harmonic and time domain maxwell examples
FrederikSchnack Jul 28, 2023
26578f6
add new tests and last example
FrederikSchnack Aug 2, 2023
f68c562
Merge branch 'devel' into non_matching_multipatch
FrederikSchnack Sep 20, 2023
7fbaecf
make Codacy happy
FrederikSchnack Sep 20, 2023
b52041f
add pml example
FrederikSchnack Nov 27, 2023
7f5be32
update non_matching operators and add proposal of tests
FrederikSchnack Nov 27, 2023
1692570
adapt files to new projection
FrederikSchnack Nov 27, 2023
544a237
make codacy happy
FrederikSchnack Nov 28, 2023
7b357bb
add some pml experiments
FrederikSchnack Dec 12, 2023
ebaa9f3
Merge branch 'devel' into non_matching_multipatch
FrederikSchnack Mar 1, 2024
a147990
add docs and readability
FrederikSchnack Mar 5, 2024
c7325da
Merge branch 'devel' into non_matching_multipatch
FrederikSchnack Mar 5, 2024
567ce21
move pml experiments to its own branch
FrederikSchnack Mar 5, 2024
2af29a8
adapt tests
FrederikSchnack Mar 5, 2024
d4fbdbf
change Hodge matrix naming conventions
FrederikSchnack Mar 7, 2024
11a9859
Merge branch 'devel' into non_matching_multipatch
FrederikSchnack Mar 7, 2024
ae90d77
Merge branch 'devel' into non_matching_multipatch
yguclu Mar 19, 2024
05bd083
Merge branch 'devel' into non_matching_multipatch
FrederikSchnack Apr 23, 2024
aa4fd8c
functions stencil index to petsc index and viceversa
e-moral-sanchez May 8, 2024
678de4a
efficient conversion to PETSc of StencilVectors
e-moral-sanchez May 8, 2024
bf176a2
works for 1D stencil matrix with multiple processes
e-moral-sanchez May 13, 2024
c7ac7ce
correct indexing for 2D stencilmatrix
e-moral-sanchez May 15, 2024
6579478
works 1d,2d,3d stencilmatrix without periodic BC
e-moral-sanchez May 15, 2024
a9e0315
efficient conversion of stencilmatrix to PETSc.Mat for 1,2,3D and pe…
e-moral-sanchez May 16, 2024
1579d31
Fixed conversion from 2D BlockStencilVector to Petsc.Vec
e-moral-sanchez May 17, 2024
a78bb93
fix general case also for stencilvector 2D
e-moral-sanchez May 17, 2024
bb05e72
fixed petsc_to_psydac for BlockVectors
e-moral-sanchez May 21, 2024
4174b66
PETSc conversion works for StencilVector and BlockStencilVector of 1 …
e-moral-sanchez May 21, 2024
d019388
conversion works for StencilMatrix
e-moral-sanchez May 21, 2024
4066746
works for BlockLinearOperators, the blocks of which are Stencilmatrices
e-moral-sanchez May 21, 2024
988ba35
Clean up, docstrings
e-moral-sanchez May 21, 2024
6e3a348
fix bugs
e-moral-sanchez May 22, 2024
448670b
sequential case, docstrings
e-moral-sanchez May 22, 2024
22b7646
cleaning
e-moral-sanchez May 22, 2024
32a6a13
erase forgotten comments
e-moral-sanchez May 22, 2024
4a60cd9
Merge branch 'devel' into improve_mat_topetsc
e-moral-sanchez May 22, 2024
ff8c1c0
adds revised Hcurl conforming projections and adapts the tests, prior…
FrederikSchnack May 22, 2024
53c1b3c
adapt conforming examples to new projections
FrederikSchnack May 22, 2024
dcc86b1
update non-matching examples
FrederikSchnack May 23, 2024
df34fe9
fix loop stencil
e-moral-sanchez May 23, 2024
a853a47
work in comments
FrederikSchnack May 23, 2024
5371468
update tests
FrederikSchnack May 23, 2024
9357bdd
Merge branch 'devel' into non_matching_multipatch
FrederikSchnack May 23, 2024
c8b4c07
forgotten prints
e-moral-sanchez May 27, 2024
4de21ca
add pyccel kernel
e-moral-sanchez May 29, 2024
ce1126a
string for type annotations
e-moral-sanchez May 29, 2024
1a45700
clean up plus fix serial case
e-moral-sanchez May 29, 2024
ba230ba
stop using create_domain() -- wip
campospinto May 31, 2024
685f4a5
use Domain.join() to build non-matching domains
campospinto Jun 2, 2024
842f7fc
clean time measurements
e-moral-sanchez Jun 3, 2024
a3a5341
using temp function for sympde Domain.join
campospinto Jun 4, 2024
220f1cf
adding ref
campospinto Jun 4, 2024
73019d1
call exposed domain and codomain in linalg/basic.py
campospinto Jun 7, 2024
52fec60
Merge example scripts and get rid of get_source_and_solution_OBSOLETE
FrederikSchnack Jun 10, 2024
4d5f780
clean up multipatch domain utilities
FrederikSchnack Jun 11, 2024
fffe43f
Coarsen test runs and add timedomain dummy run
FrederikSchnack Jun 11, 2024
d417da4
Make codacy happy
FrederikSchnack Jun 12, 2024
a748a4d
fix typo
FrederikSchnack Jun 12, 2024
25c586b
fix version 12 of macos in tests
e-moral-sanchez Jun 12, 2024
2bceaf6
Expose multipatch modules to docs
FrederikSchnack Jun 17, 2024
383d341
minor documentation related fixes
jowezarek Jun 17, 2024
a9da50e
sphinx fix
campospinto Jun 18, 2024
9995e21
Fixes for CI failures caused by new macOS runner version and numpy 2.0
kvrigor Jun 19, 2024
802ab87
CI: Temporarily disabled docs deployment since base repo is a fork
kvrigor Jun 19, 2024
8a8138f
Merge pull request #3 from campospinto/ci-fixes-jun2024
campospinto Jun 20, 2024
c3f380c
Merge branch 'devel' into improve_mat_topetsc
e-moral-sanchez Jun 21, 2024
cec4c7a
Update macos version
e-moral-sanchez Jun 21, 2024
63f3228
Disable deploy_docs in documentation.yml
FrederikSchnack Jun 21, 2024
ed0427f
Merge branch 'ci-fixes-jun2024' into non_matching_multipatch
FrederikSchnack Jun 21, 2024
d1b9cb0
Merge pull request #4 from campospinto/ci-fixes-jun2024
campospinto Jun 21, 2024
37f2b10
Merge branch 'devel' into improve_mat_topetsc
e-moral-sanchez Jun 21, 2024
4db8dca
simple implementation GeneralLinearOperator
e-moral-sanchez Jun 21, 2024
5d5de58
Merge pull request #1 from campospinto/improve_mat_topetsc
campospinto Jun 21, 2024
6265d1c
Merge branch 'devel' into non_matching_multipatch
FrederikSchnack Jun 21, 2024
bdaa788
Merge pull request #5 from campospinto/non_matching_multipatch
campospinto Jun 21, 2024
618020b
Merge branch 'devel' into minor_bug_fix_linalg_basic
campospinto Jun 21, 2024
a94db57
Merge branch 'devel' into general_linear_operator
e-moral-sanchez Jun 21, 2024
2adf6ad
general linear operator needs toarray, tosparse,transpose method
e-moral-sanchez Jun 23, 2024
6e1bc76
Merge pull request #2 from campospinto/minor_bug_fix_linalg_basic
campospinto Jun 23, 2024
41f3373
improve docstrings
e-moral-sanchez Jul 4, 2024
a567199
Merge branch 'devel' into general_linear_operator
e-moral-sanchez Jul 4, 2024
2067c4c
fixed message notimplementederror
e-moral-sanchez Jul 4, 2024
d32bd98
put import outside class
e-moral-sanchez Jul 4, 2024
b85ec76
set tol to rtol in MINRES
e-moral-sanchez Jul 8, 2024
273ec8f
add features and tests to MatrixFree linear ops
campospinto Jul 12, 2024
9163b3f
tests for matrix free linear ops
campospinto Jul 12, 2024
284f780
commenting imports to igakit
campospinto Jul 12, 2024
aa147c6
update supported python version
campospinto Jul 12, 2024
fa8a8b0
Update continuous-integration.yml
campospinto Jul 12, 2024
1700183
fixing minor bug in example
campospinto Jul 15, 2024
1e53d49
require scipy >= 1.14 in requirements.txt
campospinto Jul 16, 2024
2e898b8
discard tests with python3.8
campospinto Jul 16, 2024
baf0231
avoid minres iteration if converged
campospinto Jul 16, 2024
0bee99c
Update pyproject.toml to use latest sympde version
campospinto Jul 16, 2024
53f335d
Update pyproject.toml to use latest sympde version
campospinto Jul 16, 2024
d21ce02
commenting sympde in pyproject.toml
campospinto Jul 16, 2024
5c29ff0
install dev version of sympde in continuous-integration.yml
campospinto Jul 16, 2024
01da75f
correct continuous-integration.yml
campospinto Jul 16, 2024
82790c6
debugging helmoltz example
campospinto Jul 16, 2024
f06b6e7
fix failing tests
campospinto Jul 16, 2024
0988f76
Merge pull request #7 from campospinto/general_linear_operator
campospinto Jul 19, 2024
d8b397d
Merge branch 'devel' into commenting_igakit
campospinto Jul 19, 2024
ccbe386
comment non-working sympde test
campospinto Jul 20, 2024
9f2717f
convert integral to native python to avoid sympify error
campospinto Jul 20, 2024
dc7aca6
marking xfail test with strange error
campospinto Jul 20, 2024
4735bfc
fixing numpy and sympy sqrt in test
campospinto Jul 20, 2024
4af2be2
mark xfail nurbs geometry tests
campospinto Jul 20, 2024
287fbca
try not restricting Cython version
campospinto Jul 20, 2024
8242b44
Update continuous-integration.yml
campospinto Jul 20, 2024
8cacdcf
Update continuous-integration.yml
campospinto Jul 20, 2024
7db20c7
Update continuous-integration.yml
campospinto Jul 21, 2024
e28e9dd
Update continuous-integration.yml
campospinto Jul 21, 2024
00da37e
Update continuous-integration.yml
campospinto Jul 21, 2024
70764b1
restrict back Cython < 3.0
campospinto Jul 22, 2024
27ae8ef
temp comment of serial tests
campospinto Jul 22, 2024
eb06a74
put back serial tests
campospinto Jul 22, 2024
7abee36
export HDF5_MPI="ON" on separate line
campospinto Jul 22, 2024
deda045
install non editable sympde in CI
campospinto Jul 23, 2024
5bc5c14
CI: Installed sympde-dev after h5py install
kvrigor Jul 23, 2024
9f0a140
CI: Ensure that parallel h5py is installed
kvrigor Jul 23, 2024
fb4bb75
CI: Download and install sympde-dev under /tmp
kvrigor Jul 23, 2024
37f8c7b
CI: Comments on parallel h5py test
kvrigor Jul 23, 2024
bb0a568
commenting failing sympde assert
campospinto Jul 23, 2024
ca3cc09
using specific sympde branch for testing
campospinto Jul 24, 2024
016e7cc
putting back a sympde verification
campospinto Jul 24, 2024
8efd1b3
put back old expected solution norm
campospinto Jul 24, 2024
076d508
reverting tests after sympde revert
campospinto Jul 24, 2024
35546ad
unmarking test as xfail
campospinto Jul 24, 2024
fb3d865
use master version of sympde in continuous-integration.yml
campospinto Jul 24, 2024
750ada1
use upper bound python <= 3.12
campospinto Jul 25, 2024
32f8754
uncommenting non-executed code
campospinto Jul 25, 2024
71d71a1
skip geometry tests using igakit
campospinto Jul 25, 2024
c7fccdd
minor cleaning in tests
campospinto Jul 25, 2024
2831be8
fix typo in formula
campospinto Jul 25, 2024
aae0a6d
fix typo in pyproject.toml
campospinto Jul 25, 2024
99df2f8
allow any python 3.12.* versions
campospinto Jul 25, 2024
5075219
skip igakit test rather than commenting it
campospinto Jul 25, 2024
7240cfd
Merge pull request #9 from campospinto/commenting_igakit
campospinto Jul 25, 2024
502fb1b
Update continuous-integration.yml
campospinto Jul 26, 2024
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
30 changes: 25 additions & 5 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ 3.8, 3.9, '3.10', '3.11' ]
python-version: [ 3.9, '3.10', '3.11', '3.12' ]
isMerge:
- ${{ github.event_name == 'push' && github.ref == 'refs/heads/devel' }}
exclude:
Expand All @@ -25,6 +25,8 @@ jobs:
include:
- os: macos-latest
python-version: '3.10'
- os: macos-latest
python-version: '3.12'

name: ${{ matrix.os }} / Python ${{ matrix.python-version }}

Expand Down Expand Up @@ -96,7 +98,12 @@ jobs:

- name: Download a specific release of PETSc
run: |
git clone --depth 1 --branch v3.20.5 https://gitlab.com/petsc/petsc.git
if [[ "${{ matrix.python-version }}" == "3.12" ]]; then
git clone --depth 1 --branch v3.21.3 https://gitlab.com/petsc/petsc.git
else
git clone --depth 1 --branch v3.20.5 https://gitlab.com/petsc/petsc.git
fi


- name: Install PETSc with complex support, and test it
working-directory: ./petsc
Expand All @@ -116,14 +123,27 @@ jobs:

- name: Install Python dependencies
run: |
export CC="mpicc" HDF5_MPI="ON"
export CC="mpicc"
export HDF5_MPI="ON"
python -m pip install -r requirements.txt
python -m pip install -r requirements_extra.txt --no-build-isolation
python -m pip list

- name: Check h5py installation
- name: Check parallel h5py installation
run: |
python -c "
from mpi4py import MPI
import h5py
# This particular instantiation of h5py.File will fail if parallel h5py isn't installed
f = h5py.File('parallel_test.hdf5', 'w', driver='mpio', comm=MPI.COMM_WORLD)
print(f)"

- name: Download a development version of sympde
working-directory: /tmp
run: |
python -c "from h5py import File; print(File)"
wget https://github.com/pyccel/sympde/archive/refs/heads/terminal_expressions_for_NS.zip
unzip ./terminal_expressions_for_NS.zip
python3 -m pip install ./sympde-terminal_expressions_for_NS

- name: Install project
run: |
Expand Down
36 changes: 19 additions & 17 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@ jobs:
make -C docs clean
make -C docs html
python docs/update_links.py
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'docs/build/html'

deploy_docs:
if: github.event_name != 'pull_request'
needs: build_docs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
# Disable docs deployment for now as we're in psydac fork repo
# - name: Setup Pages
# uses: actions/configure-pages@v3
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v1
# with:
# path: 'docs/build/html'

# deploy_docs:
# if: github.event_name != 'pull_request'
# needs: build_docs
# runs-on: ubuntu-latest
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
# steps:
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.lock
__psydac__/
__*pyccel__/
docs/source/modules/STUBDIR/*

build
*build*
Expand Down
4 changes: 4 additions & 0 deletions docs/source/modules/feec.multipatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ feec.multipatch

multipatch.api
multipatch.fem_linear_operators
multipatch.multipatch_domain_utilities
multipatch.non_matching_operators
multipatch.operators
multipatch.plotting_utilities
multipatch.utilities
multipatch.utils_conga_2d
5 changes: 3 additions & 2 deletions examples/maxwell_2d_multi_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@ def run_maxwell_2d(uex, f, alpha, domain, ncells, degree, k=None, kappa=None, co
N = 20

mappings = OrderedDict([(P.logical_domain, P.mapping) for P in domain.interior])
mappings_list = [m.get_callable_mapping() for m in mappings.values()]
mappings_list = [m for m in mappings.values()]
call_mappings_list = [m.get_callable_mapping() for m in mappings_list]

Eex_x = lambdify(domain.coordinates, Eex[0])
Eex_y = lambdify(domain.coordinates, Eex[1])
Eex_log = [pull_2d_hcurl([Eex_x, Eex_y], f) for f in mappings_list]
Eex_log = [pull_2d_hcurl([Eex_x, Eex_y], f) for f in call_mappings_list]

etas, xx, yy = get_plotting_grid(mappings, N=20)
grid_vals_hcurl = lambda v: get_grid_vals(v, etas, mappings_list, space_kind='hcurl')
Expand Down
2 changes: 2 additions & 0 deletions mesh/generate_pipe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import numpy as np

raise NotImplementedError("igakit is no longer imported to support python 3.12")

from igakit.cad import circle, ruled, bilinear, join
from psydac.cad.geometry import Geometry, export_nurbs_to_hdf5, refine_nurbs

Expand Down
2 changes: 2 additions & 0 deletions mesh/multipatch/create_magnet.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import numpy as np

raise NotImplementedError("igakit is no longer imported to support python 3.12")

from psydac.cad.multipatch import export_multipatch_nurbs_to_hdf5
from igakit.cad import bilinear
from igakit.cad import circle
Expand Down
4 changes: 2 additions & 2 deletions psydac/api/discretization.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_max_degree_of_one_space(Vh):
Vh : FemSpace
The finite element space under investigation.

Results
Returns
-------
list[int]
The maximum polynomial degre of Vh with respect to each coordinate.
Expand Down Expand Up @@ -133,7 +133,7 @@ def get_max_degree(*spaces):
*spaces : tuple[FemSpace]
The finite element spaces under investigation.

Results
Returns
-------
list[int]
The maximum polynomial degree across all spaces, with respect to each
Expand Down
4 changes: 3 additions & 1 deletion psydac/api/fem.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,9 @@ def allocate_matrices(self, backend=None):
elif use_prolongation:
Ps = [knot_insertion_projection_operator(trs, trs.get_refined_space(ncells)) for trs in trial_fem_space.spaces]
P = BlockLinearOperator(trial_fem_space.vector_space, trial_fem_space.get_refined_space(ncells).vector_space)
for ni,Pi in enumerate(Ps):P[ni,ni] = Pi
for ni,Pi in enumerate(Ps):
P[ni,ni] = Pi

mat = ComposedLinearOperator(trial_space, test_space, mat, P)

self._matrix[i,j] = mat
Expand Down
7 changes: 2 additions & 5 deletions psydac/api/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,12 +953,9 @@ def _reconstruct_spaces(self):
for subdomain_names, space_dict in subdomains_to_spaces.items():
if space_dict == {}:
continue
ncells_dict = {interior_name: interior_names_to_ncells[interior_name] for interior_name in subdomain_names}
# No need for a a dict until PR about non-conforming meshes is merged
# Check for conformity
ncells = list(ncells_dict.values())[0]
assert all(ncells_patch == ncells for ncells_patch in ncells_dict.values())

ncells = {interior_name: interior_names_to_ncells[interior_name] for interior_name in subdomain_names}

subdomain = domain.get_subdomain(subdomain_names)
space_name_0 = list(space_dict.keys())[0]
periodic = space_dict[space_name_0][2].get('periodic', None)
Expand Down
22 changes: 18 additions & 4 deletions psydac/api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

PSYDAC_BACKEND_GPYCCEL = {'name': 'pyccel',
'compiler': 'GNU',
'flags' : '-O3 -march=native -mtune=native -ffast-math',
'flags' : '-O3 -ffast-math',
'folder' : '__gpyccel__',
'tag' : 'gpyccel',
'openmp' : False}
Expand Down Expand Up @@ -41,8 +41,22 @@
# ...

# Platform-dependent flags
if platform.machine() == 'x86_64':
PSYDAC_BACKEND_GPYCCEL['flags'] += ' -mavx'
if platform.system() == "Darwin" and platform.machine() == 'arm64':
# Apple silicon requires architecture-specific flags (see https://github.com/pyccel/psydac/pull/411)
import subprocess # nosec B404
cpu_brand = subprocess.check_output(['sysctl','-n','machdep.cpu.brand_string']).decode('utf-8') # nosec B603, B607
if "Apple M1" in cpu_brand:
PSYDAC_BACKEND_GPYCCEL['flags'] += ' -mcpu=apple-m1'
else:
# TODO: Support later Apple CPU models. Perhaps the CPU naming scheme could be easily guessed
# based on the output of 'sysctl -n machdep.cpu.brand_string', but I wouldn't rely on this
# guess unless it has been manually verified. Loud errors are better than silent failures!
raise SystemError(f"Unsupported Apple CPU '{cpu_brand}'.")
else:
# Default architecture flags
PSYDAC_BACKEND_GPYCCEL['flags'] += ' -march=native -mtune=native'
if platform.machine() == 'x86_64':
PSYDAC_BACKEND_GPYCCEL['flags'] += ' -mavx'

#==============================================================================

Expand All @@ -53,4 +67,4 @@
'pyccel-intel' : PSYDAC_BACKEND_IPYCCEL,
'pyccel-pgi' : PSYDAC_BACKEND_PGPYCCEL,
'pyccel-nvidia': PSYDAC_BACKEND_NVPYCCEL,
}
}
45 changes: 30 additions & 15 deletions psydac/api/tests/build_domain.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# coding: utf-8

# todo: this file has a lot of redundant code with psydac/feec/multipatch/multipatch_domain_utilities.py
# it should probably be removed in the future

import numpy as np

from sympde.topology import Square, Domain
from sympde.topology import IdentityMapping, PolarMapping, AffineMapping, Mapping

# remove after sympde PR #155 is merged and call Domain.join instead
from psydac.feec.multipatch.multipatch_domain_utilities import sympde_Domain_join

#==============================================================================
# small extension to SymPDE:
class TransposedPolarMapping(Mapping):
Expand All @@ -20,6 +26,7 @@ class TransposedPolarMapping(Mapping):
_ldim = 2
_pdim = 2

# todo: remove this
def create_domain(patches, interfaces, name):
connectivity = []
patches_interiors = [D.interior for D in patches]
Expand Down Expand Up @@ -54,6 +61,8 @@ def flip_axis(name='no_name', c1=0., c2=0.):
)

#==============================================================================

# todo: use build_multipatch_domain instead
def build_pretzel(domain_name='pretzel', r_min=None, r_max=None):
"""
design pretzel-like domain
Expand Down Expand Up @@ -189,23 +198,29 @@ def build_pretzel(domain_name='pretzel', r_min=None, r_max=None):
domain_14,
])

interfaces = [
[domain_1.get_boundary(axis=1, ext=+1), domain_5.get_boundary(axis=1, ext=-1), 1],
[domain_5.get_boundary(axis=1, ext=+1), domain_6.get_boundary(axis=1, ext=1), 1],
[domain_6.get_boundary(axis=1, ext=-1), domain_2.get_boundary(axis=1, ext=-1), 1],
[domain_2.get_boundary(axis=1, ext=+1), domain_7.get_boundary(axis=1, ext=-1), 1],
[domain_7.get_boundary(axis=1, ext=+1), domain_3.get_boundary(axis=1, ext=-1), 1],
[domain_3.get_boundary(axis=1, ext=+1), domain_9.get_boundary(axis=1, ext=-1), 1],
[domain_9.get_boundary(axis=1, ext=+1), domain_4.get_boundary(axis=1, ext=-1), 1],
[domain_4.get_boundary(axis=1, ext=+1), domain_12.get_boundary(axis=1, ext=1), 1],
[domain_12.get_boundary(axis=1, ext=-1), domain_1.get_boundary(axis=1, ext=-1), 1],
[domain_6.get_boundary(axis=0, ext=-1), domain_13.get_boundary(axis=0, ext=1), 1],
[domain_7.get_boundary(axis=0, ext=-1), domain_13.get_boundary(axis=0, ext=-1), 1],
[domain_5.get_boundary(axis=0, ext=-1), domain_14.get_boundary(axis=0, ext=-1), 1],
[domain_12.get_boundary(axis=0, ext=-1), domain_14.get_boundary(axis=0, ext=+1),1],
axis_0 = 0
axis_1 = 1
ext_0 = -1
ext_1 = +1

connectivity = [
[(domain_1, axis_1, ext_1), (domain_5, axis_1, ext_0), 1],
[(domain_5, axis_1, ext_1), (domain_6, axis_1, ext_1), 1],
[(domain_6, axis_1, ext_0), (domain_2, axis_1, ext_0), 1],
[(domain_2, axis_1, ext_1), (domain_7, axis_1, ext_0), 1],
[(domain_7, axis_1, ext_1), (domain_3, axis_1, ext_0), 1],
[(domain_3, axis_1, ext_1), (domain_9, axis_1, ext_0), 1],
[(domain_9, axis_1, ext_1), (domain_4, axis_1, ext_0), 1],
[(domain_4, axis_1, ext_1), (domain_12, axis_1, ext_1), 1],
[(domain_12, axis_1, ext_0), (domain_1, axis_1, ext_0), 1],
[(domain_6, axis_0, ext_0), (domain_13, axis_0, ext_1), 1],
[(domain_7, axis_0, ext_0), (domain_13, axis_0, ext_0), 1],
[(domain_5, axis_0, ext_0), (domain_14, axis_0, ext_0), 1],
[(domain_12, axis_0, ext_0), (domain_14, axis_0, ext_1), 1],
]

# domain = Domain.join(patches, connectivity, name=domain_name)
domain = sympde_Domain_join(patches, connectivity, name=domain_name)

domain = create_domain(patches, interfaces, domain_name)
return domain

Loading