diff --git a/.gitignore b/.gitignore index 22b8554ad..0f243c145 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ *.so *.lock __psydac__/ -__*pyccel__/ +__*pyccel__*/ docs/source/modules/STUBDIR/* build @@ -12,6 +12,7 @@ build *egg* *dist* *cache* +prof *.swp *.log diff --git a/examples/notebooks/Poisson_non_periodic.ipynb b/examples/notebooks/Poisson_non_periodic.ipynb index 038498600..5ff70fe8b 100644 --- a/examples/notebooks/Poisson_non_periodic.ipynb +++ b/examples/notebooks/Poisson_non_periodic.ipynb @@ -27,7 +27,7 @@ "from sympde.topology import Square, PolarMapping\n", "from sympde.utilities.utils import plot_domain\n", "\n", - "from psydac.api.tests.build_domain import build_pretzel\n", + "from psydac.api.tests.build_domain import build_11_patch_pretzel\n", "\n", "# Define the topological geometry for each patch\n", "rmin, rmax = 0.3, 1.\n", @@ -50,7 +50,7 @@ "Omega = Domain.join(patches, connectivity, 'domain')\n", "\n", "# Example of a complex multi-patch domain\n", - "# Omega = build_pretzel()\n", + "# Omega = build_11_patch_pretzel()\n", "\n", "# Simple visualization of the topological domain\n", "plot_domain(Omega, draw=False, isolines=True)" diff --git a/examples/old_examples/maxwell_2d_multi_patch.py b/examples/old_examples/maxwell_2d_multi_patch.py index fe65a6f3d..9405fae18 100644 --- a/examples/old_examples/maxwell_2d_multi_patch.py +++ b/examples/old_examples/maxwell_2d_multi_patch.py @@ -24,7 +24,7 @@ from sympde.expr.equation import find, EssentialBC from psydac.api.discretization import discretize -from psydac.api.tests.build_domain import build_pretzel +from psydac.api.tests.build_domain import build_11_patch_pretzel from psydac.fem.basic import FemField from psydac.api.settings import PSYDAC_BACKEND_GPYCCEL from psydac.feec.pull_push import pull_2d_hcurl @@ -104,11 +104,11 @@ def run_maxwell_2d(uex, f, alpha, domain, ncells, degree, k=None, kappa=None, co from collections import OrderedDict from sympy import lambdify - from psydac.api.tests.build_domain import build_pretzel + from psydac.api.tests.build_domain import build_11_patch_pretzel from psydac.fem.plotting_utilities import get_plotting_grid, get_grid_vals from psydac.fem.plotting_utilities import get_patch_knots_gridlines, my_small_plot - domain = build_pretzel() + domain = build_11_patch_pretzel() x,y = domain.coordinates omega = 1.5 alpha = -omega**2 diff --git a/examples/old_examples/poisson_2d_multi_patch.py b/examples/old_examples/poisson_2d_multi_patch.py index 5069fc84a..d6e26801d 100644 --- a/examples/old_examples/poisson_2d_multi_patch.py +++ b/examples/old_examples/poisson_2d_multi_patch.py @@ -109,11 +109,11 @@ def run_poisson_2d(solution, f, domain, ncells, degree, comm=None): from collections import OrderedDict from sympy import lambdify - from psydac.api.tests.build_domain import build_pretzel + from psydac.api.tests.build_domain import build_11_patch_pretzel from psydac.fem.plotting_utilities import get_plotting_grid, get_grid_vals from psydac.fem.plotting_utilities import get_patch_knots_gridlines, my_small_plot - domain = build_pretzel() + domain = build_11_patch_pretzel() x,y = domain.coordinates solution = x**2 + y**2 f = -4 diff --git a/examples/old_examples/poisson_3d_multi_patch.py b/examples/old_examples/poisson_3d_multi_patch.py index d4cc52861..428a05777 100644 --- a/examples/old_examples/poisson_3d_multi_patch.py +++ b/examples/old_examples/poisson_3d_multi_patch.py @@ -165,7 +165,7 @@ def run_poisson_3d_multi_patch(solution, f, domain, ncells, degree, comm=None, b from collections import OrderedDict from sympy import lambdify - from psydac.api.tests.build_domain import build_pretzel + from psydac.api.tests.build_domain import build_11_patch_pretzel A1 = Cube('A1', bounds1=(0, 0.5), bounds2=(0, 0.5), bounds3=(0, 1)) A2 = Cube('A2', bounds1=(0.5, 1), bounds2=(0, 0.5), bounds3=(0, 1)) diff --git a/examples/old_examples/sample_multi_patch_parallel.py b/examples/old_examples/sample_multi_patch_parallel.py index 69c4508bf..9b8fc6884 100644 --- a/examples/old_examples/sample_multi_patch_parallel.py +++ b/examples/old_examples/sample_multi_patch_parallel.py @@ -8,12 +8,12 @@ from sympde.topology import ScalarFunctionSpace, VectorFunctionSpace from psydac.api.discretization import discretize -from psydac.api.tests.build_domain import build_pretzel +from psydac.api.tests.build_domain import build_11_patch_pretzel from psydac.api.postprocessing import OutputManager, PostProcessManager from psydac.fem.basic import FemField def save_sample_data(ncells, degree, vector, kind, comm=None): - domain = build_pretzel() + domain = build_11_patch_pretzel() if vector or kind in ['hdiv', 'hcurl']: space = VectorFunctionSpace('V', domain, kind=kind) @@ -41,7 +41,7 @@ def save_sample_data(ncells, degree, vector, kind, comm=None): def export_sample_data(npts_per_cell, comm=None): Pm = PostProcessManager( - domain=build_pretzel(), + domain=build_11_patch_pretzel(), space_file='sample_data_pretzel.yml', fields_file='sample_data_pretzel.h5', comm=comm, diff --git a/psydac/api/tests/build_domain.py b/psydac/api/tests/build_domain.py index 3301294c1..b25cc018e 100644 --- a/psydac/api/tests/build_domain.py +++ b/psydac/api/tests/build_domain.py @@ -11,9 +11,6 @@ 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_domain_utilities import sympde_Domain_join - #============================================================================== # small extension to SymPDE: class TransposedPolarMapping(Mapping): @@ -65,10 +62,33 @@ 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): +def build_2_patch_annulus(): """ - design pretzel-like domain + Build a 180º annulus by connecting two 90º annular patches. + """ + bounds1 = (0.5, 1.) + bounds2_A = (0, np.pi/2) + bounds2_B = (np.pi/2, np.pi) + + A = Square('A',bounds1=bounds1, bounds2=bounds2_A) + B = Square('B',bounds1=bounds1, bounds2=bounds2_B) + + mapping_1 = PolarMapping('M1',2, c1= 0., c2= 0., rmin = 0., rmax=1.) + mapping_2 = PolarMapping('M2',2, c1= 0., c2= 0., rmin = 0., rmax=1.) + + D1 = mapping_1(A) + D2 = mapping_2(B) + + connectivity = [((0,1,1), (1,1,-1), 1)] + patches = [D1, D2] + + domain = Domain.join(patches, connectivity, '2_patch_domain') + + return domain + +def build_11_patch_pretzel(domain_name='pretzel', r_min=None, r_max=None): + """ + Build a pretzel-like 2D domain by connecting 11 patches through 13 conforming interfaces. """ if r_min is None: @@ -87,54 +107,18 @@ def build_pretzel(domain_name='pretzel', r_min=None, r_max=None): mapping_1 = PolarMapping('M1',2, c1= h, c2= h, rmin = 0., rmax=1.) domain_1 = mapping_1(dom_log_1) - dom_log_1_1 = Square('dom1_1',bounds1=(r_min, r_max), bounds2=(0, np.pi/4)) - mapping_1_1 = PolarMapping('M1_1',2, c1= h, c2= h, rmin = 0., rmax=1.) - domain_1_1 = mapping_1_1(dom_log_1_1) - - dom_log_1_2 = Square('dom1_2',bounds1=(r_min, r_max), bounds2=(np.pi/4, np.pi/2)) - mapping_1_2 = PolarMapping('M1_2',2, c1= h, c2= h, rmin = 0., rmax=1.) - domain_1_2 = mapping_1_2(dom_log_1_2) - dom_log_2 = Square('dom2',bounds1=(r_min, r_max), bounds2=(np.pi/2, np.pi)) mapping_2 = PolarMapping('M2',2, c1= -h, c2= h, rmin = 0., rmax=1.) domain_2 = mapping_2(dom_log_2) - dom_log_2_1 = Square('dom2_1',bounds1=(r_min, r_max), bounds2=(np.pi/2, np.pi*3/4)) - mapping_2_1 = PolarMapping('M2_1',2, c1= -h, c2= h, rmin = 0., rmax=1.) - domain_2_1 = mapping_2_1(dom_log_2_1) - - dom_log_2_2 = Square('dom2_2',bounds1=(r_min, r_max), bounds2=(np.pi*3/4, np.pi)) - mapping_2_2 = PolarMapping('M2_2',2, c1= -h, c2= h, rmin = 0., rmax=1.) - domain_2_2 = mapping_2_2(dom_log_2_2) - - dom_log_10 = Square('dom10',bounds1=(r_min, r_max), bounds2=(np.pi/2, np.pi)) - mapping_10 = PolarMapping('M10',2, c1= h, c2= h, rmin = 0., rmax=1.) - domain_10 = mapping_10(dom_log_10) - dom_log_3 = Square('dom3',bounds1=(r_min, r_max), bounds2=(np.pi, np.pi*3/2)) mapping_3 = PolarMapping('M3',2, c1= -h, c2= 0, rmin = 0., rmax=1.) domain_3 = mapping_3(dom_log_3) - dom_log_3_1 = Square('dom3_1',bounds1=(r_min, r_max), bounds2=(np.pi, np.pi*5/4)) - mapping_3_1 = PolarMapping('M3_1',2, c1= -h, c2= 0, rmin = 0., rmax=1.) - domain_3_1 = mapping_3_1(dom_log_3_1) - - dom_log_3_2 = Square('dom3_2',bounds1=(r_min, r_max), bounds2=(np.pi*5/4, np.pi*3/2)) - mapping_3_2 = PolarMapping('M3_2',2, c1= -h, c2= 0, rmin = 0., rmax=1.) - domain_3_2 = mapping_3_2(dom_log_3_2) - dom_log_4 = Square('dom4',bounds1=(r_min, r_max), bounds2=(np.pi*3/2, np.pi*2)) mapping_4 = PolarMapping('M4',2, c1= h, c2= 0, rmin = 0., rmax=1.) domain_4 = mapping_4(dom_log_4) - dom_log_4_1 = Square('dom4_1',bounds1=(r_min, r_max), bounds2=(np.pi*3/2, np.pi*7/4)) - mapping_4_1 = PolarMapping('M4_1',2, c1= h, c2= 0, rmin = 0., rmax=1.) - domain_4_1 = mapping_4_1(dom_log_4_1) - - dom_log_4_2 = Square('dom4_2',bounds1=(r_min, r_max), bounds2=(np.pi*7/4, np.pi*2)) - mapping_4_2 = PolarMapping('M4_2',2, c1= h, c2= 0, rmin = 0., rmax=1.) - domain_4_2 = mapping_4_2(dom_log_4_2) - dom_log_5 = Square('dom5',bounds1=(-hr,hr) , bounds2=(-h/2, h/2)) mapping_5 = get_2D_rotation_mapping('M5', c1=h/2, c2=cr , alpha=np.pi/2) domain_5 = mapping_5(dom_log_5) @@ -147,45 +131,21 @@ def build_pretzel(domain_name='pretzel', r_min=None, r_max=None): mapping_7 = get_2D_rotation_mapping('M7', c1=-cr, c2=h/2 , alpha=np.pi) domain_7 = mapping_7(dom_log_7) - dom_log_9 = Square('dom9',bounds1=(-hr,hr) , bounds2=(-h, h)) - mapping_9 = get_2D_rotation_mapping('M9', c1=0, c2=h-cr , alpha=np.pi*3/2) - domain_9 = mapping_9(dom_log_9) - - dom_log_9_1 = Square('dom9_1',bounds1=(-hr,hr) , bounds2=(-h, 0)) - mapping_9_1 = get_2D_rotation_mapping('M9_1', c1=0, c2=h-cr , alpha=np.pi*3/2) - domain_9_1 = mapping_9_1(dom_log_9_1) - - dom_log_9_2 = Square('dom9_2',bounds1=(-hr,hr) , bounds2=(0, h)) - mapping_9_2 = get_2D_rotation_mapping('M9_2', c1=0, c2=h-cr , alpha=np.pi*3/2) - domain_9_2 = mapping_9_2(dom_log_9_2) + dom_log_8 = Square('dom8',bounds1=(-hr,hr) , bounds2=(-h, h)) + mapping_8 = get_2D_rotation_mapping('M8', c1=0, c2=h-cr , alpha=np.pi*3/2) + domain_8 = mapping_8(dom_log_8) - dom_log_12 = Square('dom12',bounds1=(-hr, hr), bounds2=(-h/2, h/2)) - mapping_12 = AffineMapping('M12', 2, c1=cr, c2=h/2, a11=1, a22=-1, a21=0, a12=0) - domain_12 = mapping_12(dom_log_12) - - dom_log_13 = Square('dom13',bounds1=(np.pi*3/2, np.pi*2), bounds2=(r_min, r_max)) - mapping_13 = TransposedPolarMapping('M13',2, c1= -r_min-h, c2= r_min+h, rmin = 0., rmax=1.) - domain_13 = mapping_13(dom_log_13) - - dom_log_13_1 = Square('dom13_1',bounds1=(np.pi*3/2, np.pi*7/4), bounds2=(r_min, r_max)) - mapping_13_1 = TransposedPolarMapping('M13_1',2, c1= -r_min-h, c2= r_min+h, rmin = 0., rmax=1.) - domain_13_1 = mapping_13_1(dom_log_13_1) - - dom_log_13_2 = Square('dom13_2',bounds1=(np.pi*7/4, np.pi*2), bounds2=(r_min, r_max)) - mapping_13_2 = TransposedPolarMapping('M13_2',2, c1= -r_min-h, c2= r_min+h, rmin = 0., rmax=1.) - domain_13_2 = mapping_13_2(dom_log_13_2) - - dom_log_14 = Square('dom14',bounds1=(np.pi, np.pi*3/2), bounds2=(r_min, r_max)) - mapping_14 = TransposedPolarMapping('M14',2, c1= r_min+h, c2= r_min+h, rmin = 0., rmax=1.) - domain_14 = mapping_14(dom_log_14) + dom_log_9 = Square('dom9',bounds1=(-hr, hr), bounds2=(-h/2, h/2)) + mapping_9 = AffineMapping('M9', 2, c1=cr, c2=h/2, a11=1, a22=-1, a21=0, a12=0) + domain_9 = mapping_9(dom_log_9) - dom_log_14_1 = Square('dom14_1',bounds1=(np.pi, np.pi*5/4), bounds2=(r_min, r_max)) - mapping_14_1 = TransposedPolarMapping('M14_1',2, c1= r_min+h, c2= r_min+h, rmin = 0., rmax=1.) - domain_14_1 = mapping_14_1(dom_log_14_1) + dom_log_10 = Square('dom10',bounds1=(np.pi*3/2, np.pi*2), bounds2=(r_min, r_max)) + mapping_10 = TransposedPolarMapping('M10',2, c1= -r_min-h, c2= r_min+h, rmin = 0., rmax=1.) + domain_10 = mapping_10(dom_log_10) - dom_log_14_2 = Square('dom14_2',bounds1=(np.pi*5/4, np.pi*3/2), bounds2=(r_min, r_max)) - mapping_14_2 = TransposedPolarMapping('M14_2',2, c1= r_min+h, c2= r_min+h, rmin = 0., rmax=1.) - domain_14_2 = mapping_14_2(dom_log_14_2) + dom_log_11 = Square('dom11',bounds1=(np.pi, np.pi*3/2), bounds2=(r_min, r_max)) + mapping_11 = TransposedPolarMapping('M11',2, c1= r_min+h, c2= r_min+h, rmin = 0., rmax=1.) + domain_11 = mapping_11(dom_log_11) patches = ([ domain_1, @@ -195,10 +155,10 @@ def build_pretzel(domain_name='pretzel', r_min=None, r_max=None): domain_5, domain_6, domain_7, + domain_8, domain_9, - domain_12, - domain_13, - domain_14, + domain_10, + domain_11, ]) axis_0 = 0 @@ -212,18 +172,17 @@ def build_pretzel(domain_name='pretzel', r_min=None, r_max=None): [(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_3, axis_1, ext_1), (domain_8, axis_1, ext_0), 1], + [(domain_8, axis_1, ext_1), (domain_4, axis_1, ext_0), 1], + [(domain_4, axis_1, ext_1), (domain_9, axis_1, ext_1), 1], + [(domain_9, axis_1, ext_0), (domain_1, axis_1, ext_0), 1], + [(domain_6, axis_0, ext_0), (domain_10, axis_0, ext_1), 1], + [(domain_7, axis_0, ext_0), (domain_10, axis_0, ext_0), 1], + [(domain_5, axis_0, ext_0), (domain_11, axis_0, ext_0), 1], + [(domain_9, axis_0, ext_0), (domain_11, axis_0, ext_1), 1], ] - # domain = Domain.join(patches, connectivity, name=domain_name) - domain = sympde_Domain_join(patches, connectivity, name=domain_name) - + domain = Domain.join(patches, connectivity, name=domain_name) + return domain diff --git a/psydac/api/tests/test_2d_complex.py b/psydac/api/tests/test_2d_complex.py index ae916cd49..85c2479dc 100644 --- a/psydac/api/tests/test_2d_complex.py +++ b/psydac/api/tests/test_2d_complex.py @@ -29,6 +29,7 @@ from psydac.api.discretization import discretize from psydac.api.settings import PSYDAC_BACKEND_GPYCCEL +from psydac.api.tests.build_domain import build_2_patch_annulus # Get the mesh directory import psydac.cad.mesh as mesh_mod @@ -154,11 +155,6 @@ def run_poisson_2d(solution, f, domain, ncells=None, degree=None, filename=None, kappa = 10**3 - #expr_I =- dot(grad(plus(u)),nn)*minus(v) + dot(grad(minus(v)),nn)*plus(u) - kappa*plus(u)*minus(v)\ - # + dot(grad(minus(u)),nn)*plus(v) - dot(grad(plus(v)),nn)*minus(u) - kappa*plus(v)*minus(u)\ - # - dot(grad(plus(v)),nn)*plus(u) + kappa*plus(u)*plus(v)\ - # - dot(grad(minus(v)),nn)*minus(u) + kappa*minus(u)*minus(v) - expr_I =- 0.5*dot(grad( plus(u)), nn) * minus(v) + 0.5*dot(grad(minus(v)), nn) * plus(u) - kappa * plus(u)*minus(v)\ + 0.5*dot(grad(minus(u)), nn) * plus(v) - 0.5*dot(grad( plus(v)), nn) * minus(u) - kappa * plus(v)*minus(u)\ - 0.5*dot(grad(minus(v)), nn) * minus(u) - 0.5*dot(grad(minus(u)), nn) * minus(v) + kappa *minus(u)*minus(v)\ @@ -460,7 +456,8 @@ def test_complex_helmholtz_2d(plot_sol=False): assert( abs(l2_error - expected_l2_error) < 1.e-7) assert( abs(h1_error - expected_h1_error) < 1.e-7) -def test_maxwell_2d_2_patch_dirichlet_2(): +def test_maxwell_2d_1_patch_dirichlet_2(): + # This test solve the maxwell problem with non-homogeneous dirichlet condition with penalization on the border of the exact solution domain = Square('domain', bounds1=(0, 1), bounds2=(0, 1)) x,y = domain.coordinates @@ -480,23 +477,9 @@ def test_maxwell_2d_2_patch_dirichlet_2(): @pytest.mark.mpi def test_maxwell_2d_2_patch_dirichlet_parallel_0(): - # This test solve the maxwell problem with non-homogeneous dirichlet condition with penalization on the border of the exact solution - - bounds1 = (0.5, 1.) - bounds2_A = (0, np.pi/2) - bounds2_B = (np.pi/2, np.pi) - - A = Square('A', bounds1=bounds1, bounds2=bounds2_A) - B = Square('B', bounds1=bounds1, bounds2=bounds2_B) - - mapping_1 = PolarMapping('M1',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - mapping_2 = PolarMapping('M2',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - - D1 = mapping_1(A) - D2 = mapping_2(B) - - domain = Domain.join([D1, D2], [((0, 1, 1), (1, 1, -1))], 'domain') + # This test solve the maxwell problem with non-homogeneous dirichlet condition with penalization on the border of the exact solution + domain = build_2_patch_annulus() x, y = domain.coordinates omega = 1.5 @@ -536,10 +519,10 @@ def teardown_function(): from psydac.fem.plotting_utilities import get_plotting_grid, get_grid_vals from psydac.fem.plotting_utilities import get_patch_knots_gridlines, my_small_plot - from psydac.api.tests.build_domain import build_pretzel + from psydac.api.tests.build_domain import build_11_patch_pretzel from psydac.feec.pull_push import pull_2d_hcurl - domain = build_pretzel() + domain = build_11_patch_pretzel() x,y = domain.coordinates omega = 1.5 diff --git a/psydac/api/tests/test_2d_multipatch_mapping_maxwell.py b/psydac/api/tests/test_2d_multipatch_mapping_maxwell.py index 5620e2979..336066c71 100644 --- a/psydac/api/tests/test_2d_multipatch_mapping_maxwell.py +++ b/psydac/api/tests/test_2d_multipatch_mapping_maxwell.py @@ -24,7 +24,7 @@ from sympde.expr.equation import find, EssentialBC from psydac.api.discretization import discretize -from psydac.api.tests.build_domain import build_pretzel +from psydac.api.tests.build_domain import build_11_patch_pretzel, build_2_patch_annulus from psydac.fem.basic import FemField from psydac.api.settings import PSYDAC_BACKEND_GPYCCEL from psydac.feec.pull_push import pull_2d_hcurl @@ -113,23 +113,7 @@ def run_maxwell_2d(uex, f, alpha, domain, *, ncells=None, degree=None, filename= #------------------------------------------------------------------------------ def test_maxwell_2d_2_patch_dirichlet_0(): - bounds1 = (0.5, 1.) - bounds2_A = (0, np.pi/2) - bounds2_B = (np.pi/2, np.pi) - - A = Square('A',bounds1=bounds1, bounds2=bounds2_A) - B = Square('B',bounds1=bounds1, bounds2=bounds2_B) - - mapping_1 = PolarMapping('M1',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - mapping_2 = PolarMapping('M2',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - - D1 = mapping_1(A) - D2 = mapping_2(B) - - connectivity = [((0,1,1),(1,1,-1))] - patches = [D1,D2] - domain = Domain.join(patches, connectivity, 'domain') - + domain = build_2_patch_annulus() x,y = domain.coordinates omega = 1.5 @@ -144,26 +128,9 @@ def test_maxwell_2d_2_patch_dirichlet_0(): assert abs(l2_error - expected_l2_error) < 1e-7 -#------------------------------------------------------------------------------ -def test_maxwell_2d_2_patch_dirichlet_1(): - - domain = build_pretzel() - x,y = domain.coordinates - - omega = 1.5 - alpha = -omega**2 - Eex = Tuple(sin(pi*y), sin(pi*x)*cos(pi*y)) - f = Tuple(alpha*sin(pi*y) - pi**2*sin(pi*y)*cos(pi*x) + pi**2*sin(pi*y), - alpha*sin(pi*x)*cos(pi*y) + pi**2*sin(pi*x)*cos(pi*y)) - - l2_error, Eh = run_maxwell_2d(Eex, f, alpha, domain, ncells=[2**2, 2**2], degree=[2,2]) - - expected_l2_error = 1.5941322657006822 - - assert abs(l2_error - expected_l2_error) < 1e-7 #------------------------------------------------------------------------------ -def test_maxwell_2d_2_patch_dirichlet_2(): +def test_maxwell_2d_2_patch_dirichlet_1(): filename = os.path.join(mesh_dir, 'multipatch/square_repeated_knots.h5') domain = Domain.from_file(filename) @@ -190,22 +157,7 @@ def test_maxwell_2d_2_patch_dirichlet_2(): @pytest.mark.mpi def test_maxwell_2d_2_patch_dirichlet_parallel_0(): - bounds1 = (0.5, 1.) - bounds2_A = (0, np.pi/2) - bounds2_B = (np.pi/2, np.pi) - - A = Square('A',bounds1=bounds1, bounds2=bounds2_A) - B = Square('B',bounds1=bounds1, bounds2=bounds2_B) - - mapping_1 = PolarMapping('M1',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - mapping_2 = PolarMapping('M2',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - - D1 = mapping_1(A) - D2 = mapping_2(B) - - connectivity = [((0,1,1),(1,1,-1))] - patches = [D1,D2] - domain = Domain.join(patches, connectivity, 'domain') + domain = build_2_patch_annulus() x,y = domain.coordinates omega = 1.5 @@ -257,7 +209,7 @@ def teardown_function(): from psydac.fem.plotting_utilities import get_plotting_grid, get_grid_vals from psydac.fem.plotting_utilities import get_patch_knots_gridlines, my_small_plot - domain = build_pretzel() + domain = build_11_patch_pretzel() x,y = domain.coordinates omega = 1.5 diff --git a/psydac/api/tests/test_2d_multipatch_mapping_poisson.py b/psydac/api/tests/test_2d_multipatch_mapping_poisson.py index d657b1fe9..f730f6bc6 100644 --- a/psydac/api/tests/test_2d_multipatch_mapping_poisson.py +++ b/psydac/api/tests/test_2d_multipatch_mapping_poisson.py @@ -24,7 +24,7 @@ from sympde.expr.equation import find, EssentialBC from psydac.api.discretization import discretize -from psydac.api.tests.build_domain import build_pretzel +from psydac.api.tests.build_domain import build_11_patch_pretzel, build_2_patch_annulus from psydac.api.settings import PSYDAC_BACKEND_GPYCCEL from psydac.fem.plotting_utilities import plot_field_2d as plot_field @@ -99,18 +99,7 @@ def run_poisson_2d(solution, f, domain, ncells=None, degree=None, filename=None, #------------------------------------------------------------------------------ def test_poisson_2d_2_patches_dirichlet_0(): - A = Square('A',bounds1=(0.5, 1.), bounds2=(0, np.pi/2)) - B = Square('B',bounds1=(0.5, 1.), bounds2=(np.pi/2, np.pi)) - - mapping_1 = PolarMapping('M1',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - mapping_2 = PolarMapping('M2',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - - D1 = mapping_1(A) - D2 = mapping_2(B) - - connectivity = [((0,1,1),(1,1,-1))] - patches = [D1,D2] - domain = Domain.join(patches, connectivity, 'domain') + domain = build_2_patch_annulus() x,y = domain.coordinates solution = x**2 + y**2 @@ -127,18 +116,7 @@ def test_poisson_2d_2_patches_dirichlet_0(): #------------------------------------------------------------------------------ def test_poisson_2d_2_patches_dirichlet_1(): - A = Square('A',bounds1=(0.5, 1.), bounds2=(0, np.pi/2)) - B = Square('B',bounds1=(0.5, 1.), bounds2=(np.pi/2, np.pi)) - - mapping_1 = PolarMapping('M1',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - mapping_2 = PolarMapping('M2',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - - D1 = mapping_1(A) - D2 = mapping_2(B) - - connectivity = [((0,1,1),(1,1,-1))] - patches = [D1,D2] - domain = Domain.join(patches, connectivity, 'domain') + domain = build_2_patch_annulus() x,y = domain.coordinates solution = sin(pi*x)*sin(pi*y) @@ -153,7 +131,7 @@ def test_poisson_2d_2_patches_dirichlet_1(): assert ( abs(h1_error - expected_h1_error) < 1e-7 ) #------------------------------------------------------------------------------ -def test_poisson_2d_2_patches_dirichlet_2(): +def test_poisson_2d_3_patches_dirichlet_2(): mapping_1 = IdentityMapping('M1', 2) mapping_2 = PolarMapping ('M2', 2, c1 = 0., c2 = 0.5, rmin = 0., rmax=1.) @@ -189,15 +167,15 @@ def test_poisson_2d_2_patches_dirichlet_2(): #------------------------------------------------------------------------------ def test_poisson_2d_2_patches_dirichlet_3(): - domain = build_pretzel() + domain = build_2_patch_annulus() x,y = domain.coordinates - solution = x**2 + y**2 + solution = (2.654-x)**2 + (1.1-y)**2 f = -4 l2_error, h1_error, uh = run_poisson_2d(solution, f, domain, ncells=[2**2,2**2], degree=[2,2]) - expected_l2_error = 0.009824734742537082 - expected_h1_error = 0.10615177751279731 + expected_l2_error = 0.0014599905413109973 + expected_h1_error = 0.035873834713380987 assert ( abs(l2_error - expected_l2_error) < 1e-7) assert ( abs(h1_error - expected_h1_error) < 1e-7 ) @@ -297,6 +275,22 @@ def test_poisson_2d_4_patch_dirichlet_0(): assert ( abs(l2_error - expected_l2_error) < 1e-7 ) assert ( abs(h1_error - expected_h1_error) < 1e-7 ) +def test_poisson_2d_bretzel_dirichlet_0(): + + domain = build_11_patch_pretzel() + + x,y = domain.coordinates + solution = x**2 + y**2 + f = -4 + + l2_error, h1_error, uh = run_poisson_2d(solution, f, domain, ncells=[2**2,2**2], degree=[2,2]) + + expected_l2_error = 0.009824734742571888 + expected_h1_error = 0.10615177751253213 + + assert ( abs(l2_error - expected_l2_error) < 1e-7 ) + assert ( abs(h1_error - expected_h1_error) < 1e-7 ) + ############################################################################### # PARALLEL TESTS ############################################################################### @@ -305,18 +299,7 @@ def test_poisson_2d_4_patch_dirichlet_0(): @pytest.mark.mpi def test_poisson_2d_2_patches_dirichlet_parallel_0(): - A = Square('A',bounds1=(0.5, 1.), bounds2=(0, np.pi/2)) - B = Square('B',bounds1=(0.5, 1.), bounds2=(np.pi/2, np.pi)) - - mapping_1 = PolarMapping('M1',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - mapping_2 = PolarMapping('M2',2, c1= 0., c2= 0., rmin = 0., rmax=1.) - - D1 = mapping_1(A) - D2 = mapping_2(B) - - connectivity = [((0,1,1),(1,1,-1))] - patches = [D1, D2] - domain = Domain.join(patches, connectivity, 'domain') + domain = build_2_patch_annulus() x,y = domain.coordinates solution = sin(pi*x)*sin(pi*y) @@ -387,7 +370,7 @@ def teardown_function(): from psydac.fem.plotting_utilities import get_patch_knots_gridlines, my_small_plot from collections import OrderedDict - domain = build_pretzel() + domain = build_11_patch_pretzel() x,y = domain.coordinates solution = x**2 + y**2 f = -4 diff --git a/psydac/api/tests/test_2d_multipatch_poisson.py b/psydac/api/tests/test_2d_multipatch_poisson.py index c69a56c3f..297975eba 100644 --- a/psydac/api/tests/test_2d_multipatch_poisson.py +++ b/psydac/api/tests/test_2d_multipatch_poisson.py @@ -39,11 +39,6 @@ def run_poisson_2d(solution, f, domain, ncells, degree): kappa = 10**3 - #expr_I =- dot(grad(plus(u)),nn)*minus(v) + dot(grad(minus(v)),nn)*plus(u) - kappa*plus(u)*minus(v)\ - # + dot(grad(minus(u)),nn)*plus(v) - dot(grad(plus(v)),nn)*minus(u) - kappa*plus(v)*minus(u)\ - # - dot(grad(plus(v)),nn)*plus(u) + kappa*plus(u)*plus(v)\ - # - dot(grad(minus(v)),nn)*minus(u) + kappa*minus(u)*minus(v) - expr_I =- 0.5*dot(grad(plus(u)),nn)*minus(v) + 0.5*dot(grad(minus(v)),nn)*plus(u) - kappa*plus(u)*minus(v)\ + 0.5*dot(grad(minus(u)),nn)*plus(v) - 0.5*dot(grad(plus(v)),nn)*minus(u) - kappa*plus(v)*minus(u)\ - 0.5*dot(grad(minus(v)),nn)*minus(u) - 0.5*dot(grad(minus(u)),nn)*minus(v) + kappa*minus(u)*minus(v)\ @@ -80,11 +75,11 @@ def run_poisson_2d(solution, f, domain, ncells, degree): #------------------------------------------------------------------------------ def test_poisson_2d_2_patch_dirichlet_0(): - A = Square('A',bounds1=(0, 0.5), bounds2=(0, 1)) - B = Square('B',bounds1=(0.5, 1.), bounds2=(0, 1)) + A = Square('A', bounds1=(0, 0.5), bounds2=(0, 1)) + B = Square('B', bounds1=(0.5, 1), bounds2=(0, 1)) - connectivity = [((0,0,1),(1,0,-1))] - patches = [A,B] + connectivity = [((0,0,1), (1,0,-1), 1)] + patches = [A, B] domain = Domain.join(patches, connectivity, 'domain') x,y = domain.coordinates @@ -97,16 +92,16 @@ def test_poisson_2d_2_patch_dirichlet_0(): expected_l2_error = 2.176726763610992e-09 expected_h1_error = 2.9725703533101877e-09 - assert ( abs(l2_error - expected_l2_error) < 1e-7 ) - assert ( abs(h1_error - expected_h1_error) < 1e-7 ) + assert abs(l2_error - expected_l2_error) < 1e-7 + assert abs(h1_error - expected_h1_error) < 1e-7 #------------------------------------------------------------------------------ def test_poisson_2d_2_patch_dirichlet_1(): - A = Square('A',bounds1=(0, 0.5), bounds2=(0, 1)) - B = Square('B',bounds1=(0.5, 1.), bounds2=(0, 1)) + A = Square('A', bounds1=(0, 0.5), bounds2=(0, 1)) + B = Square('B', bounds1=(0.5, 1), bounds2=(0, 1)) - connectivity = [((0,0,1),(1,0,-1))] - patches = [A,B] + connectivity = [((0,0,1), (1,0,-1), 1)] + patches = [A, B] domain = Domain.join(patches, connectivity, 'domain') x,y = domain.coordinates @@ -118,16 +113,16 @@ def test_poisson_2d_2_patch_dirichlet_1(): expected_l2_error = 0.002035229666394183 expected_h1_error = 0.056796387991647795 - assert ( abs(l2_error - expected_l2_error) < 1e-7 ) - assert ( abs(h1_error - expected_h1_error) < 1e-7 ) + assert abs(l2_error - expected_l2_error) < 1e-7 + assert abs(h1_error - expected_h1_error) < 1e-7 #------------------------------------------------------------------------------ def test_poisson_2d_2_patch_dirichlet_2(): - A = Square('A',bounds1=(0, 0.5), bounds2=(0, 1)) - B = Square('B',bounds1=(0.5, 1.), bounds2=(0, 1)) + A = Square('A', bounds1=(0, 0.5), bounds2=(0, 1)) + B = Square('B', bounds1=(0.5, 1), bounds2=(0, 1)) - connectivity = [((0,0,1),(1,0,-1))] - patches = [A,B] + connectivity = [((0,0,1), (1,0,-1), 1)] + patches = [A, B] domain = Domain.join(patches, connectivity, 'domain') x,y = domain.coordinates @@ -139,24 +134,24 @@ def test_poisson_2d_2_patch_dirichlet_2(): expected_l2_error = 0.002035229666394183 expected_h1_error = 0.056796387991647795 - assert ( abs(l2_error - expected_l2_error) < 1e-7 ) - assert ( abs(h1_error - expected_h1_error) < 1e-7 ) + assert abs(l2_error - expected_l2_error) < 1e-7 + assert abs(h1_error - expected_h1_error) < 1e-7 #------------------------------------------------------------------------------ def test_poisson_2d_2_patch_dirichlet_3(): - A = Square('A',bounds1=(0, 0.5), bounds2=(0, 1)) - B = Square('B',bounds1=(0, 0.5), bounds2=(0, 1)) + A = Square('A', bounds1=(0, 0.5), bounds2=(0, 1)) + B = Square('B', bounds1=(0, 0.5), bounds2=(0, 1)) - M1 = IdentityMapping('M1',2) - M2 = AffineMapping('M2',2, c1=1, c2=0, + M1 = IdentityMapping('M1', 2) + M2 = AffineMapping('M2', 2, c1=1, c2=0, a11=-1, a12=0, - a21=0, a22=1) + a21= 0, a22=1) D1 = M1(A) D2 = M2(B) - connectivity = [((0,0,1),(1,0,1))] - patches = [D1,D2] + connectivity = [((0,0,1), (1,0,1), 1)] + patches = [D1, D2] domain = Domain.join(patches, connectivity, 'domain') x,y = domain.coordinates @@ -168,21 +163,26 @@ def test_poisson_2d_2_patch_dirichlet_3(): expected_l2_error = 0.0020352296663948295 expected_h1_error = 0.05679638799164739 - assert ( abs(l2_error - expected_l2_error) < 1e-7 ) - assert ( abs(h1_error - expected_h1_error) < 1e-7 ) + assert abs(l2_error - expected_l2_error) < 1e-7 + assert abs(h1_error - expected_h1_error) < 1e-7 #------------------------------------------------------------------------------ def test_poisson_2d_2_patch_dirichlet_4(): - A = Square('A',bounds1=(0, 0.5), bounds2=(0, 1)) - B = Square('B',bounds1=(0, 0.5), bounds2=(0, 1)) + A = Square('A', bounds1=(0, 0.5), bounds2=(0, 1)) + B = Square('B', bounds1=(0, 0.5), bounds2=(0, 1)) - M1 = AffineMapping('M1',2, c1=0.5, c2=0.,a11=1, a22=1, a12=0, a21=0) - M2 = AffineMapping('M2',2, c1=0.5, c2=0, a11=-1, a12=0, a21=0, a22=1) + M1 = AffineMapping('M1', 2, c1=0.5, c2=0, + a11=1, a12=0, + a21=0, a22=1) + + M2 = AffineMapping('M2', 2, c1=0.5, c2=0, + a11=-1, a12=0, + a21= 0, a22=1) D1 = M1(A) D2 = M2(B) - connectivity = [((0,0,-1),(1,0,-1))] + connectivity = [((0,0,-1), (1,0,-1), 1)] patches = [D1,D2] domain = Domain.join(patches, connectivity, 'domain') @@ -195,8 +195,8 @@ def test_poisson_2d_2_patch_dirichlet_4(): expected_l2_error = 0.0020352296663934746 expected_h1_error = 0.05679638799164659 - assert ( abs(l2_error - expected_l2_error) < 1e-7 ) - assert ( abs(h1_error - expected_h1_error) < 1e-7 ) + assert abs(l2_error - expected_l2_error) < 1e-7 + assert abs(h1_error - expected_h1_error) < 1e-7 #============================================================================== # CLEAN UP SYMPY NAMESPACE @@ -209,4 +209,3 @@ def teardown_module(): def teardown_function(): from sympy.core import cache cache.clear_cache() - diff --git a/psydac/api/tests/test_build_derham_mapping.py b/psydac/api/tests/test_build_derham_mapping.py index 46d001449..cc181caff 100644 --- a/psydac/api/tests/test_build_derham_mapping.py +++ b/psydac/api/tests/test_build_derham_mapping.py @@ -24,7 +24,6 @@ @pytest.mark.parametrize('degree', [[2], [3]]) @pytest.mark.parametrize('ncells', [[4], [10]]) @pytest.mark.parametrize('periodic', [[True], [False]]) - def test_build_derham_spline_mapping_id_1d(degree, ncells, periodic): p1, = degree @@ -78,10 +77,11 @@ def test_build_derham_spline_mapping_id_1d(degree, ncells, periodic): # snapshots='all', fields=('f')) #Pm.close() + +@pytest.mark.xdist_group('h5py') @pytest.mark.parametrize('degree', [[2,2], [3,4]]) @pytest.mark.parametrize('ncells', [[5,6], [10,10]]) @pytest.mark.parametrize('periodic', [[True,True], [True,False]]) - def test_build_derham_spline_mapping_id_2d(degree, ncells, periodic): p1 , p2 = degree @@ -139,10 +139,11 @@ def test_build_derham_spline_mapping_id_2d(degree, ncells, periodic): os.remove("./export_sol.h5") os.remove("./fields_test.0000.vtu") + +@pytest.mark.xdist_group('h5py') @pytest.mark.parametrize('degree', [[2,2,2], [2,3,4]]) @pytest.mark.parametrize('ncells', [[4,6,7], [10,10,10]]) @pytest.mark.parametrize('periodic', [[True,True,True], [True,False,False]]) - def test_build_derham_spline_mapping_id_3d(degree, ncells, periodic): p1 , p2, p3 = degree diff --git a/psydac/feec/multipatch_domain_utilities.py b/psydac/feec/multipatch_domain_utilities.py index b295d973a..16f77578a 100644 --- a/psydac/feec/multipatch_domain_utilities.py +++ b/psydac/feec/multipatch_domain_utilities.py @@ -34,18 +34,6 @@ class TransposedPolarMapping(Mapping): _pdim = 2 -def sympde_Domain_join(patches, connectivity, name): - """ - temporary fix while sympde PR #155 is not merged - """ - connectivity_by_indices = [] - for I in connectivity: - connectivity_by_indices.append( - [(patches.index(I[0][0]), I[0][1], I[0][2]), - (patches.index(I[1][0]), I[1][1], I[1][2]), - I[2]]) - return Domain.join(patches, connectivity_by_indices, name) - def get_2D_rotation_mapping(name='no_name', c1=0., c2=0., alpha=None): @@ -912,8 +900,7 @@ def build_multipatch_domain(domain_name='square_2', r_min=None, r_max=None): else: raise NotImplementedError - # domain = Domain.join(patches, connectivity, name='domain') - domain = sympde_Domain_join(patches, connectivity, name='domain') + domain = Domain.join(patches, connectivity, name='domain') return domain @@ -1005,8 +992,7 @@ def build_cartesian_multipatch_domain(ncells, log_interval_x, log_interval_y, ma (list_patches[j][i+1], axis_1, ext_1), 1] for i in range(nb_patchx -1) if ncells[i][j] is not None and ncells[i+1][j] is not None]) - # domain = Domain.join(patches, connectivity, name='domain') - domain = sympde_Domain_join(patches, connectivity, name='domain') + domain = Domain.join(patches, connectivity, name='domain') return domain - \ No newline at end of file + diff --git a/psydac/feec/tests/test_commuting_projections.py b/psydac/feec/tests/test_commuting_projections.py index a39a2af6e..0986f168c 100644 --- a/psydac/feec/tests/test_commuting_projections.py +++ b/psydac/feec/tests/test_commuting_projections.py @@ -29,7 +29,7 @@ @pytest.mark.parametrize('bc', [True, False]) @pytest.mark.parametrize('p', [2, 3]) @pytest.mark.parametrize('Nq', [5]) -@pytest.mark.parametrize('Nel', [5, 6]) +@pytest.mark.parametrize('Nel', [5]) #, 6]) def test_3d_commuting_pro_1(Nel, Nq, p, bc, m): fun1 = lambda xi1, xi2, xi3 : np.sin(xi1)*np.sin(xi2)*np.sin(xi3) @@ -103,7 +103,7 @@ def test_3d_commuting_pro_1(Nel, Nq, p, bc, m): @pytest.mark.parametrize('bc', [True, False]) @pytest.mark.parametrize('p', [2, 3]) @pytest.mark.parametrize('Nq', [7]) -@pytest.mark.parametrize('Nel', [5, 6]) +@pytest.mark.parametrize('Nel', [5]) #, 6]) def test_3d_commuting_pro_2(Nel, Nq, p, bc, m): fun1 = lambda xi1, xi2, xi3 : np.sin(xi1)*np.sin(xi2)*np.sin(xi3) @@ -195,7 +195,7 @@ def test_3d_commuting_pro_2(Nel, Nq, p, bc, m): @pytest.mark.parametrize('bc', [True, False]) @pytest.mark.parametrize('p', [2, 3]) @pytest.mark.parametrize('Nq', [7]) -@pytest.mark.parametrize('Nel', [5, 6]) +@pytest.mark.parametrize('Nel', [5]) #, 6]) def test_3d_commuting_pro_3(Nel, Nq, p, bc, m): fun1 = lambda xi1, xi2, xi3 : np.sin(xi1)*np.sin(xi2)*np.sin(xi3) @@ -278,7 +278,7 @@ def test_3d_commuting_pro_3(Nel, Nq, p, bc, m): # 2D tests #============================================================================== @pytest.mark.mpi -@pytest.mark.parametrize('Nel', [8, 12]) +@pytest.mark.parametrize('Nel', [8]) #, 12]) @pytest.mark.parametrize('Nq', [5]) @pytest.mark.parametrize('p', [2,3]) @pytest.mark.parametrize('bc', [True, False]) @@ -351,7 +351,7 @@ def test_2d_commuting_pro_1(Nel, Nq, p, bc, m): assert norm2_e1 < 1e-12 @pytest.mark.mpi -@pytest.mark.parametrize('Nel', [8, 12]) +@pytest.mark.parametrize('Nel', [8]) #, 12]) @pytest.mark.parametrize('Nq', [5]) @pytest.mark.parametrize('p', [2,3]) @pytest.mark.parametrize('bc', [True, False]) @@ -424,7 +424,7 @@ def test_2d_commuting_pro_2(Nel, Nq, p, bc, m): assert norm2_e0 < 1e-12 @pytest.mark.mpi -@pytest.mark.parametrize('Nel', [8, 12]) +@pytest.mark.parametrize('Nel', [8]) #, 12]) @pytest.mark.parametrize('Nq', [8]) @pytest.mark.parametrize('p', [2,3]) @pytest.mark.parametrize('bc', [True, False]) @@ -504,7 +504,7 @@ def test_2d_commuting_pro_3(Nel, Nq, p, bc, m): assert norm2_e3 < 1e-12 @pytest.mark.mpi -@pytest.mark.parametrize('Nel', [8, 12]) +@pytest.mark.parametrize('Nel', [8]) #, 12]) @pytest.mark.parametrize('Nq', [8]) @pytest.mark.parametrize('p', [2,3]) @pytest.mark.parametrize('bc', [True, False]) diff --git a/psydac/feec/tests/test_commuting_projections_dual.py b/psydac/feec/tests/test_commuting_projections_dual.py index 6416ab3fa..497479cca 100644 --- a/psydac/feec/tests/test_commuting_projections_dual.py +++ b/psydac/feec/tests/test_commuting_projections_dual.py @@ -15,7 +15,7 @@ import pytest -@pytest.mark.parametrize('Nel', [8, 12]) +@pytest.mark.parametrize('Nel', [8]) #, 12]) @pytest.mark.parametrize('Nq', [5]) @pytest.mark.parametrize('p', [2, 3]) @pytest.mark.parametrize('bc', [True, False]) @@ -58,7 +58,7 @@ def test_transpose_div_3d(Nel, Nq, p, bc, m): assert error < 2e-10 -@pytest.mark.parametrize('Nel', [8, 12]) +@pytest.mark.parametrize('Nel', [8]) #, 12]) @pytest.mark.parametrize('Nq', [6]) @pytest.mark.parametrize('p', [2, 3]) @pytest.mark.parametrize('bc', [True, False]) @@ -116,7 +116,7 @@ def test_transpose_curl_3d(Nel, Nq, p, bc, m): assert error < 2e-9 -@pytest.mark.parametrize('Nel', [8, 12]) +@pytest.mark.parametrize('Nel', [8]) #, 12]) @pytest.mark.parametrize('Nq', [6]) @pytest.mark.parametrize('p', [2, 3]) @pytest.mark.parametrize('bc', [True, False]) diff --git a/psydac/feec/tests/test_feec_conf_projectors_cart_2d.py b/psydac/feec/tests/test_feec_conf_projectors_cart_2d.py index ec97c887e..cf64ecf27 100644 --- a/psydac/feec/tests/test_feec_conf_projectors_cart_2d.py +++ b/psydac/feec/tests/test_feec_conf_projectors_cart_2d.py @@ -54,7 +54,7 @@ def get_polynomial_function(degree, hom_bc_axes, domain): @pytest.mark.parametrize('nc', [5]) @pytest.mark.parametrize('reg', [0]) @pytest.mark.parametrize('hom_bc', [False, True]) -@pytest.mark.parametrize('domain_name', ["1patch", "4patch_nc", "2patch_nc"]) +@pytest.mark.parametrize('domain_name', ["1patch", "4patch_nc"]) #, "2patch_nc"]) @pytest.mark.parametrize("nonconforming, full_mom_pres", [(True, True), (False, True)]) diff --git a/psydac/feec/tests/test_global_projectors.py b/psydac/feec/tests/test_global_projectors.py index 4662aeb93..f4a549e38 100644 --- a/psydac/feec/tests/test_global_projectors.py +++ b/psydac/feec/tests/test_global_projectors.py @@ -26,8 +26,10 @@ @pytest.mark.parametrize('periodic', [False, True]) @pytest.mark.parametrize('multiplicity', [1, 2]) -def test_H1_projector_1d(domain, ncells, degree, periodic, multiplicity): - +def test_H1_projector_1d(domain, ncells, degree, periodic, multiplicity, verbose=False): + if verbose: + print('\n1d_h1') + #change mulitplicity if higher than degree to avoid problems (case p