feectools 0.1.4__tar.gz → 0.1.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {feectools-0.1.4 → feectools-0.1.6}/AUTHORS +8 -6
- {feectools-0.1.4 → feectools-0.1.6}/LICENSE +1 -1
- {feectools-0.1.4/feectools.egg-info → feectools-0.1.6}/PKG-INFO +3 -2
- {feectools-0.1.4 → feectools-0.1.6}/README.md +1 -1
- {feectools-0.1.4 → feectools-0.1.6}/feectools/api/fem_bilinear_form.py +30 -30
- {feectools-0.1.4 → feectools-0.1.6}/feectools/api/fem_common.py +3 -3
- {feectools-0.1.4 → feectools-0.1.6}/feectools/api/fem_sum_form.py +2 -2
- {feectools-0.1.4 → feectools-0.1.6}/feectools/core/bsplines.py +97 -90
- {feectools-0.1.4 → feectools-0.1.6}/feectools/core/bsplines_kernels.py +16 -6
- {feectools-0.1.4 → feectools-0.1.6}/feectools/core/tests/test_bsplines.py +39 -36
- {feectools-0.1.4 → feectools-0.1.6}/feectools/core/tests/test_bsplines_kernel.py +8 -8
- {feectools-0.1.4 → feectools-0.1.6}/feectools/core/tests/test_bsplines_pyccel.py +185 -180
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/basic.py +6 -2
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/blocking_data_exchanger.py +22 -17
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/cart.py +39 -34
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/nonblocking_data_exchanger.py +31 -14
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/partition.py +18 -12
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/petsc.py +10 -6
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/tests/test_cart_1d.py +10 -7
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/tests/test_cart_2d.py +3 -3
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/tests/test_cart_3d.py +3 -3
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/tests/test_multicart_2d.py +12 -8
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/tests/test_partition.py +5 -3
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/utilities.py +6 -2
- {feectools-0.1.4 → feectools-0.1.6}/feectools/feec/derivatives.py +6 -6
- {feectools-0.1.4 → feectools-0.1.6}/feectools/feec/global_geometric_projectors.py +84 -72
- {feectools-0.1.4 → feectools-0.1.6}/feectools/feec/hodge.py +0 -1
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/grid.py +6 -5
- feectools-0.1.6/feectools/fem/lst_preconditioner.py +292 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/partitioning.py +2 -2
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/projectors.py +6 -6
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/splines.py +31 -11
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/tensor.py +30 -29
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/tests/analytical_profiles_1d.py +10 -8
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/tests/analytical_profiles_base.py +5 -3
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/tests/splines_error_bounds.py +6 -3
- feectools-0.1.6/feectools/fem/tests/test_dirichlet_projectors.py +517 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/tests/test_spline_histopolation.py +19 -14
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/tests/test_spline_interpolation.py +19 -20
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/tests/test_splines.py +18 -15
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/tests/test_splines_par.py +3 -3
- feectools-0.1.6/feectools/fem/tests/test_tensor.py +232 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/tests/test_vector_spaces.py +11 -8
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/tests/utilities.py +8 -6
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/vector.py +2 -2
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/basic.py +14 -13
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/block.py +17 -13
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/direct_solvers.py +59 -15
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/fft.py +5 -5
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/kron.py +36 -29
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/solvers.py +6 -6
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/stencil.py +177 -144
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/tests/test_block.py +117 -117
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/tests/test_fft.py +13 -8
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/tests/test_kron_stencil_matrix.py +3 -3
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/tests/test_linalg.py +78 -78
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/tests/test_matrix_free.py +14 -14
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/tests/test_solvers.py +15 -15
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/tests/test_stencil_interface_matrix.py +14 -11
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/tests/test_stencil_vector.py +72 -69
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/tests/test_stencil_vector_space.py +12 -7
- feectools-0.1.6/feectools/linalg/tests/utilities.py +89 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/topetsc.py +49 -49
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/utilities.py +11 -11
- {feectools-0.1.4 → feectools-0.1.6}/feectools/utilities/quadratures.py +16 -15
- {feectools-0.1.4 → feectools-0.1.6}/feectools/utilities/utils.py +20 -18
- feectools-0.1.6/feectools/version.py +35 -0
- {feectools-0.1.4 → feectools-0.1.6/feectools.egg-info}/PKG-INFO +3 -2
- {feectools-0.1.4 → feectools-0.1.6}/feectools.egg-info/SOURCES.txt +4 -1
- {feectools-0.1.4 → feectools-0.1.6}/feectools.egg-info/requires.txt +1 -0
- {feectools-0.1.4 → feectools-0.1.6}/pyproject.toml +14 -1
- feectools-0.1.4/feectools/version.py +0 -1
- feectools-0.1.4/setup.py +0 -47
- {feectools-0.1.4 → feectools-0.1.6}/feectools/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/accelerate/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/accelerate/accelerate.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/accelerate/compile_psydac.mk +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/api/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/api/essential_bc.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/api/settings.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/core/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/core/field_evaluation_kernels.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/core/tests/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/interface_data_exchanger.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/mpi.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/ddm/tests/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/feec/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/feec/dof_kernels.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/basic.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/fem/tests/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/kernels/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/kernels/axpy_kernels.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/kernels/inner_kernels.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/kernels/matvec_kernels.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/kernels/stencil2IJV_kernels.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/kernels/stencil2coo_kernels.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/kernels/transpose_kernels.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/sparse.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/stencil_dot_kernels.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/stencil_transpose_kernels.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/linalg/tests/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools/utilities/__init__.py +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools.egg-info/dependency_links.txt +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools.egg-info/entry_points.txt +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/feectools.egg-info/top_level.txt +0 -0
- {feectools-0.1.4 → feectools-0.1.6}/setup.cfg +0 -0
|
@@ -2,21 +2,23 @@ Maintainers
|
|
|
2
2
|
-----------
|
|
3
3
|
* Yaman Güçlü <yaman.guclu@gmail.com> (original author, project lead)
|
|
4
4
|
* Martin Campos Pinto <martin.campos-pinto@ipp.mpg.de>
|
|
5
|
-
* Ahmed Ratnani <ratnaniahmed@gmail.com> (original author)
|
|
6
5
|
|
|
7
6
|
Contributors
|
|
8
7
|
------------
|
|
8
|
+
* Ahmed Ratnani (original author)
|
|
9
9
|
* Said Hadjout (original author)
|
|
10
|
+
* Jalal Lakhlili (original author)
|
|
11
|
+
* Frederik Schnack
|
|
10
12
|
* Julian Owezarek
|
|
13
|
+
* Elena Moral Sánchez
|
|
11
14
|
* Antoine Lavandier
|
|
12
15
|
* Tom Caruso
|
|
13
|
-
* Elena Moral Sánchez
|
|
14
16
|
* Paul Rigor
|
|
15
|
-
* Frederik Schnack
|
|
16
17
|
* David Schneller
|
|
17
18
|
* Valentin Carlier
|
|
18
19
|
* Stefan Possanner
|
|
19
|
-
* Jalal Lakhlili (original author)
|
|
20
|
-
* William Barham
|
|
21
|
-
* Max Lindqvist
|
|
22
20
|
* Emily Bourne
|
|
21
|
+
* Max Lindqvist
|
|
22
|
+
* William Barham
|
|
23
|
+
* Anushka Singh
|
|
24
|
+
* Alisa Kirkinskaia
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: feectools
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: Slimmed-down fork of Psydac (https://github.com/pyccel/psydac) with less functionality and fewer dependencies.
|
|
5
5
|
Author-email: Psydac development team <psydac@googlegroups.com>
|
|
6
6
|
Maintainer-email: Stefan Possanner <stefan.possanner@ipp.mpg.de>, Max Lindqvist <max.lindqvist@ipp.mpg.de>, Yaman Güçlü <yaman.guclu@gmail.com>, Martin Campos Pinto <martin.campos-pinto@ipp.mpg.de>, Ahmed Ratnani <ratnaniahmed@gmail.com>
|
|
7
7
|
License: MIT License
|
|
8
8
|
|
|
9
|
-
Copyright (c) 2018-
|
|
9
|
+
Copyright (c) 2018-2026, PSYDAC Developers.
|
|
10
10
|
|
|
11
11
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
12
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -42,6 +42,7 @@ Requires-Dist: matplotlib
|
|
|
42
42
|
Requires-Dist: pyyaml>=5.1
|
|
43
43
|
Requires-Dist: packaging
|
|
44
44
|
Requires-Dist: pyevtk
|
|
45
|
+
Requires-Dist: cunumpy
|
|
45
46
|
Requires-Dist: pyccel>=2.1.0
|
|
46
47
|
Requires-Dist: h5py
|
|
47
48
|
Requires-Dist: tblib
|
|
@@ -6,4 +6,4 @@ The latest version can be installed with
|
|
|
6
6
|
```
|
|
7
7
|
pip install -U feectools
|
|
8
8
|
```
|
|
9
|
-
See the [Struphy documentation](https://struphy-hub.github.io/struphy/index.html) for details on how to use.
|
|
9
|
+
See the [Struphy documentation](https://struphy-hub.github.io/struphy/index.html) for details on how to use.
|
|
@@ -2,7 +2,7 @@ import sys
|
|
|
2
2
|
import os
|
|
3
3
|
import importlib
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import cunumpy as xp
|
|
6
6
|
|
|
7
7
|
from sympy import ImmutableDenseMatrix, Matrix, Symbol, sympify
|
|
8
8
|
from sympy.tensor.indexed import Indexed, IndexedBase
|
|
@@ -465,8 +465,8 @@ class DiscreteBilinearForm:
|
|
|
465
465
|
|
|
466
466
|
expr = self.kernel_expr.expr
|
|
467
467
|
target = self.kernel_expr.target
|
|
468
|
-
test_degree =
|
|
469
|
-
trial_degree =
|
|
468
|
+
test_degree = xp.array(self.test_basis.space.degree)
|
|
469
|
+
trial_degree = xp.array(self.trial_basis.space.degree)
|
|
470
470
|
test_space = self.spaces[1].coeff_space
|
|
471
471
|
trial_space = self.spaces[0].coeff_space
|
|
472
472
|
test_fem_space = self.spaces[1]
|
|
@@ -476,20 +476,20 @@ class DiscreteBilinearForm:
|
|
|
476
476
|
is_conformal = True
|
|
477
477
|
|
|
478
478
|
if isinstance(expr, (ImmutableDenseMatrix, Matrix)):
|
|
479
|
-
if not isinstance(test_degree[0],(list, tuple,
|
|
479
|
+
if not isinstance(test_degree[0],(list, tuple, xp.ndarray)):
|
|
480
480
|
test_degree = [test_degree]
|
|
481
481
|
|
|
482
|
-
if not isinstance(trial_degree[0],(list, tuple,
|
|
482
|
+
if not isinstance(trial_degree[0],(list, tuple, xp.ndarray)):
|
|
483
483
|
trial_degree = [trial_degree]
|
|
484
484
|
|
|
485
|
-
pads =
|
|
485
|
+
pads = xp.empty((len(test_degree),len(trial_degree),len(test_degree[0])), dtype=int)
|
|
486
486
|
for i in range(len(test_degree)):
|
|
487
487
|
for j in range(len(trial_degree)):
|
|
488
488
|
td = test_degree[i]
|
|
489
489
|
trd = trial_degree[j]
|
|
490
|
-
pads[i,j][:] =
|
|
490
|
+
pads[i,j][:] = xp.array([td, trd]).max(axis=0)
|
|
491
491
|
else:
|
|
492
|
-
pads =
|
|
492
|
+
pads = xp.maximum(test_degree, trial_degree)
|
|
493
493
|
|
|
494
494
|
if self._matrix is None and (is_broken or isinstance(expr, (ImmutableDenseMatrix, Matrix))):
|
|
495
495
|
self._matrix = BlockLinearOperator(trial_space, test_space)
|
|
@@ -714,8 +714,8 @@ class DiscreteBilinearForm:
|
|
|
714
714
|
bs, d, s, p, mult = construct_test_space_arguments(basis_v)
|
|
715
715
|
basis += bs
|
|
716
716
|
spans += s
|
|
717
|
-
degrees += [
|
|
718
|
-
pads += [
|
|
717
|
+
degrees += [xp.int64(a) for a in d]
|
|
718
|
+
pads += [xp.int64(a) for a in p]
|
|
719
719
|
if v.space.is_multipatch or v.space.is_vector_valued:
|
|
720
720
|
coeffs += (e._data for e in v.coeffs)
|
|
721
721
|
else:
|
|
@@ -1382,12 +1382,12 @@ class DiscreteBilinearForm:
|
|
|
1382
1382
|
I_1 = f'int(floor(i_1/{test_mult[0]})*{trial_mult[0]})' if max(test_mult[0], trial_mult[0]) > 1 else 'i_1'
|
|
1383
1383
|
I_2 = f'int(floor(i_2/{test_mult[1]})*{trial_mult[1]})' if max(test_mult[1], trial_mult[1]) > 1 else 'i_2'
|
|
1384
1384
|
I_3 = f'int(floor(i_3/{test_mult[2]})*{trial_mult[2]})' if max(test_mult[2], trial_mult[2]) > 1 else 'i_3'
|
|
1385
|
-
#MAX_P1 = max(int( ( MAX_P1 +
|
|
1386
|
-
#MAX_P2 = max(int( ( MAX_P2 +
|
|
1387
|
-
#MAX_P3 = max(int( ( MAX_P3 +
|
|
1388
|
-
n_cols_x1 = max( int(MAX_P1 + 1 +
|
|
1389
|
-
n_cols_x2 = max( int(MAX_P2 + 1 +
|
|
1390
|
-
n_cols_x3 = max( int(MAX_P3 + 1 +
|
|
1385
|
+
#MAX_P1 = max(int( ( MAX_P1 + xp.floor(MAX_P1 / test_mult[0]) * trial_mult[0] ) / 2 ), MAX_P1) if max(test_mult[0], trial_mult[0]) > 1 else MAX_P1
|
|
1386
|
+
#MAX_P2 = max(int( ( MAX_P2 + xp.floor(MAX_P2 / test_mult[1]) * trial_mult[1] ) / 2 ), MAX_P2) if max(test_mult[1], trial_mult[1]) > 1 else MAX_P2
|
|
1387
|
+
#MAX_P3 = max(int( ( MAX_P3 + xp.floor(MAX_P3 / test_mult[2]) * trial_mult[2] ) / 2 ), MAX_P3) if max(test_mult[2], trial_mult[2]) > 1 else MAX_P3
|
|
1388
|
+
n_cols_x1 = max( int(MAX_P1 + 1 + xp.floor(MAX_P1 / test_mult[0]) * trial_mult[0]), 2*MAX_P1+1 )
|
|
1389
|
+
n_cols_x2 = max( int(MAX_P2 + 1 + xp.floor(MAX_P2 / test_mult[1]) * trial_mult[1]), 2*MAX_P2+1 )
|
|
1390
|
+
n_cols_x3 = max( int(MAX_P3 + 1 + xp.floor(MAX_P3 / test_mult[2]) * trial_mult[2]), 2*MAX_P3+1 )
|
|
1391
1391
|
MAX_P1 = n_cols_x1 - MAX_P1 - 1
|
|
1392
1392
|
MAX_P2 = n_cols_x2 - MAX_P2 - 1
|
|
1393
1393
|
MAX_P3 = n_cols_x3 - MAX_P3 - 1
|
|
@@ -2024,9 +2024,9 @@ class DiscreteBilinearForm:
|
|
|
2024
2024
|
|
|
2025
2025
|
# keys_2[(u[0], v[1])][3] = (1,2) means that the fourth sub-expression corresponding to the trial-test-function-component-product
|
|
2026
2026
|
# u[0] * v[1] involves a first derivative in x2 direction of the trial function and a second derivative in x2 direction of the test function
|
|
2027
|
-
keys_1[block] =
|
|
2028
|
-
keys_2[block] =
|
|
2029
|
-
keys_3[block] =
|
|
2027
|
+
keys_1[block] = xp.array([(alpha_1, beta_1) for alpha_1, beta_1 in zip(x1_trial_keys[block], x1_test_keys[block])])
|
|
2028
|
+
keys_2[block] = xp.array([(alpha_2, beta_2) for alpha_2, beta_2 in zip(x2_trial_keys[block], x2_test_keys[block])])
|
|
2029
|
+
keys_3[block] = xp.array([(alpha_3, beta_3) for alpha_3, beta_3 in zip(x3_trial_keys[block], x3_test_keys[block])])
|
|
2030
2030
|
|
|
2031
2031
|
# Those are the function values in each direction of a particular component of the trial/test function
|
|
2032
2032
|
global_basis_u_1, global_basis_u_2, global_basis_u_3 = global_basis_u[u_i]
|
|
@@ -2056,9 +2056,9 @@ class DiscreteBilinearForm:
|
|
|
2056
2056
|
# of non-zero product.
|
|
2057
2057
|
# Hence, we assign zeros for each element, each quadrature point on the element, each test and trial function combination,
|
|
2058
2058
|
# and each (or even more than required) appearing partial derivative combination of these functions - in each direction
|
|
2059
|
-
test_trial_1 =
|
|
2060
|
-
test_trial_2 =
|
|
2061
|
-
test_trial_3 =
|
|
2059
|
+
test_trial_1 = xp.zeros((n_element_1, k1, test_v_p1 + 1, trial_u_p1 + 1, max_block_trial_x1_derivative+1, max_block_test_x1_derivative+1), dtype='float64')
|
|
2060
|
+
test_trial_2 = xp.zeros((n_element_2, k2, test_v_p2 + 1, trial_u_p2 + 1, max_block_trial_x2_derivative+1, max_block_test_x2_derivative+1), dtype='float64')
|
|
2061
|
+
test_trial_3 = xp.zeros((n_element_3, k3, test_v_p3 + 1, trial_u_p3 + 1, max_block_trial_x3_derivative+1, max_block_test_x3_derivative+1), dtype='float64')
|
|
2062
2062
|
|
|
2063
2063
|
# And that's how we fill the test_trial arrays
|
|
2064
2064
|
if self._pyccelize_test_trial_computation and assembly_backend['name'] == 'pyccel':
|
|
@@ -2068,7 +2068,7 @@ class DiscreteBilinearForm:
|
|
|
2068
2068
|
[max_block_trial_x1_derivative, max_block_trial_x2_derivative, max_block_trial_x3_derivative], [max_block_test_x1_derivative, max_block_test_x2_derivative, max_block_test_x3_derivative],
|
|
2069
2069
|
[test_trial_1, test_trial_2, test_trial_3]):
|
|
2070
2070
|
|
|
2071
|
-
args = tuple(
|
|
2071
|
+
args = tuple(xp.int64(a) if isinstance(a, int) else a for a in args)
|
|
2072
2072
|
|
|
2073
2073
|
test_trial_func(*args)
|
|
2074
2074
|
else:
|
|
@@ -2118,13 +2118,13 @@ class DiscreteBilinearForm:
|
|
|
2118
2118
|
# to store local information correctly. 2*degree+1 in the simplest case.
|
|
2119
2119
|
n_funs_x2 = n_element_2 + test_v_p2 + (test_mult[1]-1)*(n_element_2-1)
|
|
2120
2120
|
n_funs_x3 = n_element_3 + test_v_p3 + (test_mult[2]-1)*(n_element_3-1)
|
|
2121
|
-
n_cols_x2 = max( int(max_p_2 + 1 +
|
|
2122
|
-
n_cols_x3 = max( int(max_p_3 + 1 +
|
|
2121
|
+
n_cols_x2 = max( int(max_p_2 + 1 + xp.floor(max_p_2 / test_mult[1]) * trial_mult[1]), 2*max_p_2+1 )
|
|
2122
|
+
n_cols_x3 = max( int(max_p_3 + 1 + xp.floor(max_p_3 / test_mult[2]) * trial_mult[2]), 2*max_p_3+1 )
|
|
2123
2123
|
|
|
2124
|
-
a3[block] =
|
|
2125
|
-
a2[block] =
|
|
2124
|
+
a3[block] = xp.zeros((n_expr, n_funs_x3, n_cols_x3), dtype='float64')
|
|
2125
|
+
a2[block] = xp.zeros((n_expr, n_funs_x2, n_funs_x3, n_cols_x2, n_cols_x3), dtype='float64')
|
|
2126
2126
|
|
|
2127
|
-
coupling_terms[block] =
|
|
2127
|
+
coupling_terms[block] = xp.zeros((n_element_2, k2, n_element_3, k3, n_expr), dtype='float64')
|
|
2128
2128
|
|
|
2129
2129
|
# We gather the socalled new args - all other args are being obtained in a similar way using the old assembly implementation
|
|
2130
2130
|
new_args = (*list(test_trial_1s.values()),
|
|
@@ -2158,8 +2158,8 @@ class DiscreteBilinearForm:
|
|
|
2158
2158
|
|
|
2159
2159
|
threads_args = ()
|
|
2160
2160
|
|
|
2161
|
-
args = tuple(
|
|
2162
|
-
threads_args = tuple(
|
|
2161
|
+
args = tuple(xp.int64(a) if isinstance(a, int) else a for a in args)
|
|
2162
|
+
threads_args = tuple(xp.int64(a) if isinstance(a, int) else a for a in threads_args)
|
|
2163
2163
|
|
|
2164
2164
|
#---------- We now generate the assembly file ----------
|
|
2165
2165
|
|
|
@@ -2,7 +2,7 @@ from typing import Iterable
|
|
|
2
2
|
|
|
3
3
|
from sympy import Expr, ImmutableDenseMatrix, Matrix
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import cunumpy as xp
|
|
6
6
|
|
|
7
7
|
from sympde.expr.basic import BasicForm
|
|
8
8
|
from sympde.expr.evaluation import KernelExpression
|
|
@@ -215,8 +215,8 @@ def collect_spaces(space, *args):
|
|
|
215
215
|
|
|
216
216
|
#==============================================================================
|
|
217
217
|
def compute_diag_len(p, md, mc):
|
|
218
|
-
n = ((
|
|
219
|
-
n = n-
|
|
218
|
+
n = ((xp.ceil((p+1)/mc)-1)*md).astype('int')
|
|
219
|
+
n = n-xp.minimum(0, n-p)+p+1
|
|
220
220
|
return n.astype('int')
|
|
221
221
|
|
|
222
222
|
#==============================================================================
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import cunumpy as xp
|
|
2
2
|
|
|
3
3
|
from sympde.expr.expr import (
|
|
4
4
|
BilinearForm as sym_BilinearForm,
|
|
@@ -119,5 +119,5 @@ class DiscreteSumForm(BasicDiscrete):
|
|
|
119
119
|
return self._operator
|
|
120
120
|
else:
|
|
121
121
|
M = [form.assemble(**kwargs) for form in self.forms]
|
|
122
|
-
M =
|
|
122
|
+
M = sum(M)
|
|
123
123
|
return M
|