feectools 0.1.0__py3-none-any.whl
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/__init__.py +0 -0
- feectools/accelerate/__init__.py +0 -0
- feectools/accelerate/accelerate.py +220 -0
- feectools/accelerate/compile_psydac.mk +52 -0
- feectools/api/__init__.py +0 -0
- feectools/api/essential_bc.py +122 -0
- feectools/api/fem_bilinear_form.py +2226 -0
- feectools/api/fem_common.py +286 -0
- feectools/api/fem_sum_form.py +123 -0
- feectools/api/settings.py +82 -0
- feectools/core/__init__.py +11 -0
- feectools/core/bsplines.py +1107 -0
- feectools/core/bsplines_kernels.py +1349 -0
- feectools/core/field_evaluation_kernels.py +5015 -0
- feectools/core/tests/__init__.py +0 -0
- feectools/core/tests/test_bsplines.py +263 -0
- feectools/core/tests/test_bsplines_kernel.py +40 -0
- feectools/core/tests/test_bsplines_pyccel.py +752 -0
- feectools/ddm/__init__.py +3 -0
- feectools/ddm/basic.py +78 -0
- feectools/ddm/blocking_data_exchanger.py +348 -0
- feectools/ddm/cart.py +1835 -0
- feectools/ddm/interface_data_exchanger.py +122 -0
- feectools/ddm/mpi.py +109 -0
- feectools/ddm/nonblocking_data_exchanger.py +331 -0
- feectools/ddm/partition.py +207 -0
- feectools/ddm/petsc.py +112 -0
- feectools/ddm/tests/__init__.py +0 -0
- feectools/ddm/tests/test_cart_1d.py +138 -0
- feectools/ddm/tests/test_cart_2d.py +164 -0
- feectools/ddm/tests/test_cart_3d.py +158 -0
- feectools/ddm/tests/test_multicart_2d.py +173 -0
- feectools/ddm/tests/test_partition.py +124 -0
- feectools/ddm/utilities.py +24 -0
- feectools/feec/__init__.py +0 -0
- feectools/feec/derivatives.py +780 -0
- feectools/feec/dof_kernels.py +210 -0
- feectools/feec/global_geometric_projectors.py +1073 -0
- feectools/feec/hodge.py +148 -0
- feectools/fem/__init__.py +0 -0
- feectools/fem/basic.py +465 -0
- feectools/fem/grid.py +181 -0
- feectools/fem/partitioning.py +344 -0
- feectools/fem/projectors.py +160 -0
- feectools/fem/splines.py +559 -0
- feectools/fem/tensor.py +1393 -0
- feectools/fem/tests/__init__.py +0 -0
- feectools/fem/tests/analytical_profiles_1d.py +100 -0
- feectools/fem/tests/analytical_profiles_base.py +34 -0
- feectools/fem/tests/splines_error_bounds.py +155 -0
- feectools/fem/tests/test_spline_histopolation.py +120 -0
- feectools/fem/tests/test_spline_interpolation.py +182 -0
- feectools/fem/tests/test_splines.py +184 -0
- feectools/fem/tests/test_splines_par.py +46 -0
- feectools/fem/tests/test_vector_spaces.py +150 -0
- feectools/fem/tests/utilities.py +47 -0
- feectools/fem/vector.py +729 -0
- feectools/linalg/__init__.py +0 -0
- feectools/linalg/basic.py +1386 -0
- feectools/linalg/block.py +1451 -0
- feectools/linalg/direct_solvers.py +201 -0
- feectools/linalg/fft.py +258 -0
- feectools/linalg/kernels/__init__.py +0 -0
- feectools/linalg/kernels/axpy_kernels.py +57 -0
- feectools/linalg/kernels/inner_kernels.py +100 -0
- feectools/linalg/kernels/matvec_kernels.py +206 -0
- feectools/linalg/kernels/stencil2IJV_kernels.py +227 -0
- feectools/linalg/kernels/stencil2coo_kernels.py +179 -0
- feectools/linalg/kernels/transpose_kernels.py +263 -0
- feectools/linalg/kron.py +911 -0
- feectools/linalg/solvers.py +1914 -0
- feectools/linalg/sparse.py +114 -0
- feectools/linalg/stencil.py +2923 -0
- feectools/linalg/stencil_dot_kernels.py +317 -0
- feectools/linalg/stencil_transpose_kernels.py +372 -0
- feectools/linalg/tests/__init__.py +0 -0
- feectools/linalg/tests/test_block.py +1588 -0
- feectools/linalg/tests/test_fft.py +106 -0
- feectools/linalg/tests/test_kron_stencil_matrix.py +114 -0
- feectools/linalg/tests/test_linalg.py +1065 -0
- feectools/linalg/tests/test_matrix_free.py +128 -0
- feectools/linalg/tests/test_solvers.py +213 -0
- feectools/linalg/tests/test_stencil_interface_matrix.py +379 -0
- feectools/linalg/tests/test_stencil_vector.py +1036 -0
- feectools/linalg/tests/test_stencil_vector_space.py +440 -0
- feectools/linalg/topetsc.py +522 -0
- feectools/linalg/utilities.py +200 -0
- feectools/utilities/__init__.py +0 -0
- feectools/utilities/quadratures.py +113 -0
- feectools/utilities/utils.py +166 -0
- feectools/version.py +1 -0
- feectools-0.1.0.dist-info/METADATA +66 -0
- feectools-0.1.0.dist-info/RECORD +98 -0
- feectools-0.1.0.dist-info/WHEEL +5 -0
- feectools-0.1.0.dist-info/entry_points.txt +3 -0
- feectools-0.1.0.dist-info/licenses/AUTHORS +22 -0
- feectools-0.1.0.dist-info/licenses/LICENSE +21 -0
- feectools-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
#==============================================================================
|
|
2
|
+
# 1D DEGREES OF FREEDOM
|
|
3
|
+
#==============================================================================
|
|
4
|
+
def evaluate_dofs_1d_0form(f : 'float[:]', f_pts : 'float[:]'):
|
|
5
|
+
|
|
6
|
+
(n1,) = f.shape
|
|
7
|
+
for i1 in range(n1):
|
|
8
|
+
f[i1] = f_pts[i1]
|
|
9
|
+
|
|
10
|
+
#------------------------------------------------------------------------------
|
|
11
|
+
def evaluate_dofs_1d_1form(quad_w1 : 'float[:,:]', f : 'float[:]', f_pts : 'float[:]'):
|
|
12
|
+
|
|
13
|
+
k1 = quad_w1.shape[1]
|
|
14
|
+
|
|
15
|
+
(n1,) = f.shape
|
|
16
|
+
for i1 in range(n1):
|
|
17
|
+
f[i1] = 0.0
|
|
18
|
+
for g1 in range(k1):
|
|
19
|
+
f[i1] += quad_w1[i1, g1] * f_pts[i1*k1 + g1]
|
|
20
|
+
|
|
21
|
+
#==============================================================================
|
|
22
|
+
# 2D DEGREES OF FREEDOM
|
|
23
|
+
#==============================================================================
|
|
24
|
+
def evaluate_dofs_2d_0form(f : 'float[:,:]', f_pts : 'float[:,:]'):
|
|
25
|
+
|
|
26
|
+
n1, n2 = f.shape
|
|
27
|
+
for i1 in range(n1):
|
|
28
|
+
for i2 in range(n2):
|
|
29
|
+
f[i1, i2] = f_pts[i1, i2]
|
|
30
|
+
|
|
31
|
+
#------------------------------------------------------------------------------
|
|
32
|
+
def evaluate_dofs_2d_1form_hcurl(quad_w1 : 'float[:,:]', quad_w2 : 'float[:,:]', f1 : 'float[:,:]', f2 : 'float[:,:]', f1_pts : 'float[:,:]', f2_pts : 'float[:,:]'):
|
|
33
|
+
|
|
34
|
+
k1 = quad_w1.shape[1]
|
|
35
|
+
k2 = quad_w2.shape[1]
|
|
36
|
+
|
|
37
|
+
n1, n2 = f1.shape
|
|
38
|
+
for i1 in range(n1):
|
|
39
|
+
for i2 in range(n2):
|
|
40
|
+
f1[i1, i2] = 0.0
|
|
41
|
+
for g1 in range(k1):
|
|
42
|
+
f1[i1, i2] += quad_w1[i1, g1] * f1_pts[i1*k1 + g1, i2]
|
|
43
|
+
|
|
44
|
+
n1, n2 = f2.shape
|
|
45
|
+
for i1 in range(n1):
|
|
46
|
+
for i2 in range(n2):
|
|
47
|
+
f2[i1, i2] = 0.0
|
|
48
|
+
for g2 in range(k2):
|
|
49
|
+
f2[i1, i2] += quad_w2[i2, g2] * f2_pts[i1, i2*k2 + g2]
|
|
50
|
+
|
|
51
|
+
#------------------------------------------------------------------------------
|
|
52
|
+
def evaluate_dofs_2d_1form_hdiv(quad_w1 : 'float[:,:]', quad_w2 : 'float[:,:]', f1 : 'float[:,:]', f2 : 'float[:,:]', f1_pts : 'float[:,:]', f2_pts : 'float[:,:]'):
|
|
53
|
+
|
|
54
|
+
k1 = quad_w1.shape[1]
|
|
55
|
+
k2 = quad_w2.shape[1]
|
|
56
|
+
|
|
57
|
+
n1, n2 = f1.shape
|
|
58
|
+
for i1 in range(n1):
|
|
59
|
+
for i2 in range(n2):
|
|
60
|
+
f1[i1, i2] = 0.0
|
|
61
|
+
for g2 in range(k2):
|
|
62
|
+
f1[i1, i2] += quad_w2[i2, g2] * f1_pts[i1, i2*k2 + g2]
|
|
63
|
+
|
|
64
|
+
n1, n2 = f2.shape
|
|
65
|
+
for i1 in range(n1):
|
|
66
|
+
for i2 in range(n2):
|
|
67
|
+
f2[i1, i2] = 0.0
|
|
68
|
+
for g1 in range(k1):
|
|
69
|
+
f2[i1, i2] += quad_w1[i1, g1] * f2_pts[i1*k1 + g1, i2]
|
|
70
|
+
|
|
71
|
+
#------------------------------------------------------------------------------
|
|
72
|
+
def evaluate_dofs_2d_2form(quad_w1 : 'float[:,:]', quad_w2 : 'float[:,:]', f : 'float[:,:]', f_pts : 'float[:,:]'):
|
|
73
|
+
|
|
74
|
+
k1 = quad_w1.shape[1]
|
|
75
|
+
k2 = quad_w2.shape[1]
|
|
76
|
+
|
|
77
|
+
n1, n2 = f.shape
|
|
78
|
+
for i1 in range(n1):
|
|
79
|
+
for i2 in range(n2):
|
|
80
|
+
f[i1, i2] = 0.0
|
|
81
|
+
for g1 in range(k1):
|
|
82
|
+
for g2 in range(k2):
|
|
83
|
+
f[i1, i2] += quad_w1[i1, g1] * quad_w2[i2, g2] * f_pts[i1*k1 + g1, i2*k2 + g2]
|
|
84
|
+
|
|
85
|
+
#------------------------------------------------------------------------------
|
|
86
|
+
def evaluate_dofs_2d_vec(f1 : 'float[:,:]', f2 : 'float[:,:]', f1_pts : 'float[:,:]', f2_pts : 'float[:,:]'):
|
|
87
|
+
|
|
88
|
+
n1, n2 = f1.shape
|
|
89
|
+
for i1 in range(n1):
|
|
90
|
+
for i2 in range(n2):
|
|
91
|
+
f1[i1, i2] = f1_pts[i1, i2]
|
|
92
|
+
|
|
93
|
+
n1, n2 = f2.shape
|
|
94
|
+
for i1 in range(n1):
|
|
95
|
+
for i2 in range(n2):
|
|
96
|
+
f2[i1, i2] = f2_pts[i1, i2]
|
|
97
|
+
|
|
98
|
+
#==============================================================================
|
|
99
|
+
# 3D DEGREES OF FREEDOM
|
|
100
|
+
#==============================================================================
|
|
101
|
+
def evaluate_dofs_3d_0form(f : 'float[:,:,:]', f_pts : 'float[:,:,:]'):
|
|
102
|
+
|
|
103
|
+
n1, n2, n3 = f.shape
|
|
104
|
+
for i1 in range(n1):
|
|
105
|
+
for i2 in range(n2):
|
|
106
|
+
for i3 in range(n3):
|
|
107
|
+
f[i1, i2, i3] = f_pts[i1, i2, i3]
|
|
108
|
+
|
|
109
|
+
#------------------------------------------------------------------------------
|
|
110
|
+
def evaluate_dofs_3d_1form(quad_w1 : 'float[:,:]', quad_w2 : 'float[:,:]', quad_w3 : 'float[:,:]', f1 : 'float[:,:,:]', f2 : 'float[:,:,:]', f3 : 'float[:,:,:]', f1_pts : 'float[:,:,:]', f2_pts : 'float[:,:,:]', f3_pts : 'float[:,:,:]'):
|
|
111
|
+
|
|
112
|
+
k1 = quad_w1.shape[1]
|
|
113
|
+
k2 = quad_w2.shape[1]
|
|
114
|
+
k3 = quad_w3.shape[1]
|
|
115
|
+
|
|
116
|
+
n1, n2, n3 = f1.shape
|
|
117
|
+
for i1 in range(n1):
|
|
118
|
+
for i2 in range(n2):
|
|
119
|
+
for i3 in range(n3):
|
|
120
|
+
f1[i1, i2, i3] = 0.0
|
|
121
|
+
for g1 in range(k1):
|
|
122
|
+
f1[i1, i2, i3] += quad_w1[i1, g1] * f1_pts[i1*k1 + g1, i2, i3]
|
|
123
|
+
|
|
124
|
+
n1, n2, n3 = f2.shape
|
|
125
|
+
for i1 in range(n1):
|
|
126
|
+
for i2 in range(n2):
|
|
127
|
+
for i3 in range(n3):
|
|
128
|
+
f2[i1, i2, i3] = 0.0
|
|
129
|
+
for g2 in range(k2):
|
|
130
|
+
f2[i1, i2, i3] += quad_w2[i2, g2] * f2_pts[i1, i2*k2 + g2, i3]
|
|
131
|
+
|
|
132
|
+
n1, n2, n3 = f3.shape
|
|
133
|
+
for i1 in range(n1):
|
|
134
|
+
for i2 in range(n2):
|
|
135
|
+
for i3 in range(n3):
|
|
136
|
+
f3[i1, i2, i3] = 0.0
|
|
137
|
+
for g3 in range(k3):
|
|
138
|
+
f3[i1, i2, i3] += quad_w3[i3, g3] * f3_pts[i1, i2, i3*k3 + g3]
|
|
139
|
+
|
|
140
|
+
#------------------------------------------------------------------------------
|
|
141
|
+
def evaluate_dofs_3d_2form(quad_w1 : 'float[:,:]', quad_w2 : 'float[:,:]', quad_w3 : 'float[:,:]', f1 : 'float[:,:,:]', f2 : 'float[:,:,:]', f3 : 'float[:,:,:]', f1_pts : 'float[:,:,:]', f2_pts : 'float[:,:,:]', f3_pts : 'float[:,:,:]'):
|
|
142
|
+
|
|
143
|
+
k1 = quad_w1.shape[1]
|
|
144
|
+
k2 = quad_w2.shape[1]
|
|
145
|
+
k3 = quad_w3.shape[1]
|
|
146
|
+
|
|
147
|
+
n1, n2, n3 = f1.shape
|
|
148
|
+
for i1 in range(n1):
|
|
149
|
+
for i2 in range(n2):
|
|
150
|
+
for i3 in range(n3):
|
|
151
|
+
f1[i1, i2, i3] = 0.0
|
|
152
|
+
for g2 in range(k2):
|
|
153
|
+
for g3 in range(k3):
|
|
154
|
+
f1[i1, i2, i3] += quad_w2[i2, g2] * quad_w3[i3, g3] * f1_pts[i1, i2*k2 + g2, i3*k3 + g3]
|
|
155
|
+
|
|
156
|
+
n1, n2, n3 = f2.shape
|
|
157
|
+
for i1 in range(n1):
|
|
158
|
+
for i2 in range(n2):
|
|
159
|
+
for i3 in range(n3):
|
|
160
|
+
f2[i1, i2, i3] = 0.0
|
|
161
|
+
for g1 in range(k1):
|
|
162
|
+
for g3 in range(k3):
|
|
163
|
+
f2[i1, i2, i3] += quad_w1[i1, g1] * quad_w3[i3, g3] * f2_pts[i1*k1 + g1, i2, i3*k3 + g3]
|
|
164
|
+
|
|
165
|
+
n1, n2, n3 = f3.shape
|
|
166
|
+
for i1 in range(n1):
|
|
167
|
+
for i2 in range(n2):
|
|
168
|
+
for i3 in range(n3):
|
|
169
|
+
f3[i1, i2, i3] = 0.0
|
|
170
|
+
for g1 in range(k1):
|
|
171
|
+
for g2 in range(k2):
|
|
172
|
+
f3[i1, i2, i3] += quad_w1[i1, g1] * quad_w2[i2, g2] * f3_pts[i1*k1 + g1, i2*k2 + g2, i3]
|
|
173
|
+
|
|
174
|
+
#------------------------------------------------------------------------------
|
|
175
|
+
def evaluate_dofs_3d_3form(quad_w1 : 'float[:,:]', quad_w2 : 'float[:,:]', quad_w3 : 'float[:,:]', f : 'float[:,:,:]', f_pts : 'float[:,:,:]'):
|
|
176
|
+
|
|
177
|
+
k1 = quad_w1.shape[1]
|
|
178
|
+
k2 = quad_w2.shape[1]
|
|
179
|
+
k3 = quad_w3.shape[1]
|
|
180
|
+
|
|
181
|
+
n1, n2, n3 = f.shape
|
|
182
|
+
for i1 in range(n1):
|
|
183
|
+
for i2 in range(n2):
|
|
184
|
+
for i3 in range(n3):
|
|
185
|
+
f[i1, i2, i3] = 0.0
|
|
186
|
+
for g1 in range(k1):
|
|
187
|
+
for g2 in range(k2):
|
|
188
|
+
for g3 in range(k3):
|
|
189
|
+
f[i1, i2, i3] += quad_w1[i1, g1] * quad_w2[i2, g2] * quad_w3[i3, g3] * f_pts[i1*k1 + g1, i2*k2 + g2, i3*k3 + g3]
|
|
190
|
+
|
|
191
|
+
#------------------------------------------------------------------------------
|
|
192
|
+
def evaluate_dofs_3d_vec(f1 : 'float[:,:,:]', f2 : 'float[:,:,:]', f3 : 'float[:,:,:]', f1_pts : 'float[:,:,:]', f2_pts : 'float[:,:,:]', f3_pts : 'float[:,:,:]'):
|
|
193
|
+
|
|
194
|
+
n1, n2, n3 = f1.shape
|
|
195
|
+
for i1 in range(n1):
|
|
196
|
+
for i2 in range(n2):
|
|
197
|
+
for i3 in range(n3):
|
|
198
|
+
f1[i1, i2, i3] = f1_pts[i1, i2, i3]
|
|
199
|
+
|
|
200
|
+
n1, n2, n3 = f2.shape
|
|
201
|
+
for i1 in range(n1):
|
|
202
|
+
for i2 in range(n2):
|
|
203
|
+
for i3 in range(n3):
|
|
204
|
+
f2[i1, i2, i3] = f2_pts[i1, i2, i3]
|
|
205
|
+
|
|
206
|
+
n1, n2, n3 = f3.shape
|
|
207
|
+
for i1 in range(n1):
|
|
208
|
+
for i2 in range(n2):
|
|
209
|
+
for i3 in range(n3):
|
|
210
|
+
f3[i1, i2, i3] = f3_pts[i1, i2, i3]
|