emerge 0.5.4__py3-none-any.whl → 0.5.6__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.
Potentially problematic release.
This version of emerge might be problematic. Click here for more details.
- emerge/__init__.py +3 -0
- emerge/_emerge/cs.py +2 -2
- emerge/_emerge/elements/ned2_interp.py +21 -26
- emerge/_emerge/elements/nedleg2.py +25 -43
- emerge/_emerge/geo/shapes.py +26 -3
- emerge/_emerge/geometry.py +27 -1
- emerge/_emerge/material.py +1 -0
- emerge/_emerge/mesh3d.py +63 -14
- emerge/_emerge/mesher.py +7 -4
- emerge/_emerge/mth/optimized.py +30 -0
- emerge/_emerge/periodic.py +46 -16
- emerge/_emerge/physics/microwave/assembly/assembler.py +4 -21
- emerge/_emerge/physics/microwave/assembly/generalized_eigen.py +23 -19
- emerge/_emerge/physics/microwave/assembly/generalized_eigen_hb.py +465 -0
- emerge/_emerge/physics/microwave/assembly/robinbc.py +59 -18
- emerge/_emerge/physics/microwave/microwave_3d.py +22 -4
- emerge/_emerge/physics/microwave/microwave_bc.py +101 -35
- emerge/_emerge/physics/microwave/microwave_data.py +1 -1
- emerge/_emerge/plot/pyvista/display.py +40 -7
- emerge/_emerge/plot/pyvista/display_settings.py +1 -0
- emerge/_emerge/simmodel.py +15 -1
- emerge/_emerge/solve_interfaces/cudss_interface.py +44 -2
- emerge/_emerge/solve_interfaces/pardiso_interface.py +1 -0
- emerge/_emerge/solver.py +28 -22
- emerge/ext.py +4 -0
- emerge/lib.py +1 -1
- {emerge-0.5.4.dist-info → emerge-0.5.6.dist-info}/METADATA +5 -3
- {emerge-0.5.4.dist-info → emerge-0.5.6.dist-info}/RECORD +31 -30
- emerge/_emerge/elements/legrange2.py +0 -172
- {emerge-0.5.4.dist-info → emerge-0.5.6.dist-info}/WHEEL +0 -0
- {emerge-0.5.4.dist-info → emerge-0.5.6.dist-info}/entry_points.txt +0 -0
- {emerge-0.5.4.dist-info → emerge-0.5.6.dist-info}/licenses/LICENSE +0 -0
emerge/_emerge/periodic.py
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
# EMerge is an open source Python based FEM EM simulation module.
|
|
2
|
+
# Copyright (C) 2025 Robert Fennis.
|
|
3
|
+
|
|
4
|
+
# This program is free software; you can redistribute it and/or
|
|
5
|
+
# modify it under the terms of the GNU General Public License
|
|
6
|
+
# as published by the Free Software Foundation; either version 2
|
|
7
|
+
# of the License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with this program; if not, see
|
|
16
|
+
# <https://www.gnu.org/licenses/>.
|
|
17
|
+
|
|
1
18
|
from .cs import Axis, _parse_axis, GCS, _parse_vector
|
|
2
|
-
from .selection import
|
|
19
|
+
from .selection import SELECTOR_OBJ, Selection
|
|
3
20
|
from .geo import GeoPrism, XYPolygon, Alignment, XYPlate
|
|
4
21
|
from .bc import BoundaryCondition
|
|
5
22
|
from typing import Generator
|
|
@@ -7,7 +24,6 @@ from .bc import Periodic
|
|
|
7
24
|
import numpy as np
|
|
8
25
|
|
|
9
26
|
|
|
10
|
-
|
|
11
27
|
############################################################
|
|
12
28
|
# FUNCTIONS #
|
|
13
29
|
############################################################
|
|
@@ -21,7 +37,9 @@ def _rotnorm(v: np.ndarray) -> np.ndarray:
|
|
|
21
37
|
ax = ax/np.linalg.norm(ax)
|
|
22
38
|
return ax
|
|
23
39
|
|
|
24
|
-
def _pair_selection(f1: Selection,
|
|
40
|
+
def _pair_selection(f1: Selection,
|
|
41
|
+
f2: Selection,
|
|
42
|
+
translation: tuple[float, float, float]):
|
|
25
43
|
if len(f1.tags) == 1:
|
|
26
44
|
return [f1,], [f2,]
|
|
27
45
|
c1s = [np.array(c) for c in f1.centers]
|
|
@@ -175,13 +193,17 @@ class RectCell(PeriodicCell):
|
|
|
175
193
|
def cell_data(self):
|
|
176
194
|
f1s = SELECTOR_OBJ.inplane(*self.fleft[0], *self.fleft[1])
|
|
177
195
|
f2s = SELECTOR_OBJ.inplane(*self.fright[0], *self.fright[1])
|
|
178
|
-
vec = (self.fright[0][0]-self.fleft[0][0],
|
|
196
|
+
vec = (self.fright[0][0]-self.fleft[0][0],
|
|
197
|
+
self.fright[0][1]-self.fleft[0][1],
|
|
198
|
+
self.fright[0][2]-self.fleft[0][2])
|
|
179
199
|
for f1, f2 in zip(*_pair_selection(f1s, f2s, vec)):
|
|
180
200
|
yield f1, f2, vec
|
|
181
201
|
|
|
182
202
|
f1s = SELECTOR_OBJ.inplane(*self.fbot[0], *self.fbot[1])
|
|
183
203
|
f2s = SELECTOR_OBJ.inplane(*self.ftop[0], *self.ftop[1])
|
|
184
|
-
vec = (self.ftop[0][0]-self.fbot[0][0],
|
|
204
|
+
vec = (self.ftop[0][0]-self.fbot[0][0],
|
|
205
|
+
self.ftop[0][1]-self.fbot[0][1],
|
|
206
|
+
self.ftop[0][2]-self.fbot[0][2])
|
|
185
207
|
for f1, f2 in zip(*_pair_selection(f1s, f2s, vec)):
|
|
186
208
|
yield f1, f2, vec
|
|
187
209
|
|
|
@@ -206,13 +228,15 @@ class HexCell(PeriodicCell):
|
|
|
206
228
|
point1: tuple[float, float, float],
|
|
207
229
|
point2: tuple[float, float, float],
|
|
208
230
|
point3: tuple[float, float, float]):
|
|
209
|
-
"""
|
|
210
|
-
|
|
231
|
+
"""
|
|
232
|
+
Generates a Hexagonal periodic tiling by providing three coordinates.
|
|
233
|
+
The layout of the tiling assumes a hexagon with a single vertex at the top and bottom,
|
|
234
|
+
and one vertex on the bottom and right faces (⬢).
|
|
211
235
|
|
|
212
236
|
Args:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
237
|
+
point1 (tuple[float, float, float]): left face top vertex
|
|
238
|
+
point2 (tuple[float, float, float]): left face bottom vertex
|
|
239
|
+
point3 (tuple[float, float, float]): bottom vertex
|
|
216
240
|
"""
|
|
217
241
|
p1, p2, p3 = np.array(point1), np.array(point2), np.array(point3)
|
|
218
242
|
p4 = -p1
|
|
@@ -249,8 +273,10 @@ class HexCell(PeriodicCell):
|
|
|
249
273
|
o = self.o1[:-1]
|
|
250
274
|
n = self.f11[1][:-1]
|
|
251
275
|
w = nrm(self.p2-self.p1)/2
|
|
252
|
-
f1s = SELECTOR_OBJ.inplane(*self.f11[0], *self.f11[1])
|
|
253
|
-
|
|
276
|
+
f1s = SELECTOR_OBJ.inplane(*self.f11[0], *self.f11[1])\
|
|
277
|
+
.exclude(lambda x, y, z: (nrm(np.array([x,y])-o)>w) or (abs((np.array([x,y])-o) @ n ) > 1e-6))
|
|
278
|
+
f2s = SELECTOR_OBJ.inplane(*self.f12[0], *self.f12[1])\
|
|
279
|
+
.exclude(lambda x, y, z: (nrm(np.array([x,y])+o)>w) or (abs((np.array([x,y])+o) @ n ) > 1e-6))
|
|
254
280
|
vec = - (self.p1 + self.p2)
|
|
255
281
|
|
|
256
282
|
for f1, f2 in zip(*_pair_selection(f1s, f2s, vec)): # type: ignore
|
|
@@ -259,8 +285,10 @@ class HexCell(PeriodicCell):
|
|
|
259
285
|
o = self.o2[:-1]
|
|
260
286
|
n = self.f21[1][:-1]
|
|
261
287
|
w = nrm(self.p3-self.p2)/2
|
|
262
|
-
f1s = SELECTOR_OBJ.inplane(*self.f21[0], *self.f21[1])
|
|
263
|
-
|
|
288
|
+
f1s = SELECTOR_OBJ.inplane(*self.f21[0], *self.f21[1])\
|
|
289
|
+
.exclude(lambda x, y, z: (nrm(np.array([x,y])-o)>w) or (abs((np.array([x,y])-o) @ n ) > 1e-6))
|
|
290
|
+
f2s = SELECTOR_OBJ.inplane(*self.f22[0], *self.f22[1])\
|
|
291
|
+
.exclude(lambda x, y, z: (nrm(np.array([x,y])+o)>w) or (abs((np.array([x,y])+o) @ n ) > 1e-6))
|
|
264
292
|
vec = - (self.p2 + self.p3)
|
|
265
293
|
for f1, f2 in zip(*_pair_selection(f1s, f2s, vec)): # type: ignore
|
|
266
294
|
yield f1, f2, vec
|
|
@@ -268,8 +296,10 @@ class HexCell(PeriodicCell):
|
|
|
268
296
|
o = self.o3[:-1]
|
|
269
297
|
n = self.f31[1][:-1]
|
|
270
298
|
w = nrm(-self.p1-self.p3)/2
|
|
271
|
-
f1s = SELECTOR_OBJ.inplane(*self.f31[0], *self.f31[1])
|
|
272
|
-
|
|
299
|
+
f1s = SELECTOR_OBJ.inplane(*self.f31[0], *self.f31[1])\
|
|
300
|
+
.exclude(lambda x, y, z: (nrm(np.array([x,y])-o)>w) or (abs((np.array([x,y])-o) @ n ) > 1e-6))
|
|
301
|
+
f2s = SELECTOR_OBJ.inplane(*self.f32[0], *self.f32[1])\
|
|
302
|
+
.exclude(lambda x, y, z: (nrm(np.array([x,y])+o)>w) or (abs((np.array([x,y])+o) @ n ) > 1e-6))
|
|
273
303
|
vec = - (self.p3 - self.p1)
|
|
274
304
|
for f1, f2 in zip(*_pair_selection(f1s, f2s, vec)): # type: ignore
|
|
275
305
|
yield f1, f2, vec
|
|
@@ -132,7 +132,7 @@ class Assembler:
|
|
|
132
132
|
Returns:
|
|
133
133
|
tuple[np.ndarray, np.ndarray, np.ndarray, NedelecLegrange2]: The E, B, solve ids and Mixed order field object.
|
|
134
134
|
"""
|
|
135
|
-
from .
|
|
135
|
+
from .generalized_eigen_hb import generelized_eigenvalue_matrix
|
|
136
136
|
logger.debug('Assembling Boundary Mode Matrices')
|
|
137
137
|
|
|
138
138
|
bcs = bc_set.boundary_conditions
|
|
@@ -167,8 +167,6 @@ class Assembler:
|
|
|
167
167
|
pec_ids.extend(list(nedlegfield.tri_to_field[:,it]))
|
|
168
168
|
|
|
169
169
|
# Process all PEC Boundary Conditions
|
|
170
|
-
pec_edges = []
|
|
171
|
-
pec_vertices = []
|
|
172
170
|
for pec in pecs:
|
|
173
171
|
logger.trace(f'.implementing {pec}')
|
|
174
172
|
face_tags = pec.tags
|
|
@@ -180,16 +178,6 @@ class Assembler:
|
|
|
180
178
|
continue
|
|
181
179
|
eids = nedlegfield.edge_to_field[:, i2]
|
|
182
180
|
pec_ids.extend(list(eids))
|
|
183
|
-
pec_edges.append(eids[0])
|
|
184
|
-
pec_vertices.append(eids[3]-nedlegfield.n_xy)
|
|
185
|
-
pec_vertices.append(eids[4]-nedlegfield.n_xy)
|
|
186
|
-
|
|
187
|
-
for ii in tri_ids:
|
|
188
|
-
i2 = nedlegfield.mesh.from_source_tri(ii)
|
|
189
|
-
if i2 is None:
|
|
190
|
-
continue
|
|
191
|
-
tids = nedlegfield.tri_to_field[:, i2]
|
|
192
|
-
pec_ids.extend(list(tids))
|
|
193
181
|
|
|
194
182
|
# Process all port boundary Conditions
|
|
195
183
|
pec_ids_set: set[int] = set(pec_ids)
|
|
@@ -312,16 +300,11 @@ class Assembler:
|
|
|
312
300
|
gamma = bc.get_gamma(K0)
|
|
313
301
|
logger.trace(f'..robin bc γ={gamma:.3f}')
|
|
314
302
|
|
|
315
|
-
def Ufunc(x,y):
|
|
316
|
-
return bc.get_Uinc(x,y,K0)
|
|
303
|
+
def Ufunc(x,y,z):
|
|
304
|
+
return bc.get_Uinc(x,y,z,K0)
|
|
317
305
|
|
|
318
|
-
ibasis = bc.get_inv_basis()
|
|
319
|
-
if ibasis is None:
|
|
320
|
-
basis = plane_basis_from_points(mesh.nodes[:,nodes]) + 1e-16
|
|
321
|
-
ibasis = np.linalg.pinv(basis)
|
|
322
|
-
logger.trace(f'..Using computed basis: {ibasis.flatten()}')
|
|
323
306
|
if bc._include_force:
|
|
324
|
-
Bempty, b_p = assemble_robin_bc_excited(field, Bempty, tri_ids, Ufunc, gamma,
|
|
307
|
+
Bempty, b_p = assemble_robin_bc_excited(field, Bempty, tri_ids, Ufunc, gamma, gauss_points) # type: ignore
|
|
325
308
|
port_vectors[bc.port_number] += b_p # type: ignore
|
|
326
309
|
logger.trace(f'..included force vector term with norm {np.linalg.norm(b_p):.3f}')
|
|
327
310
|
else:
|
|
@@ -19,7 +19,7 @@ import numpy as np
|
|
|
19
19
|
from ....elements.nedleg2 import NedelecLegrange2
|
|
20
20
|
from scipy.sparse import csr_matrix
|
|
21
21
|
from numba_progress import ProgressBar, ProgressBarType
|
|
22
|
-
from ....mth.optimized import local_mapping, matinv, compute_distances
|
|
22
|
+
from ....mth.optimized import local_mapping, matinv, compute_distances, gaus_quad_tri
|
|
23
23
|
from numba import c16, types, f8, i8, njit, prange
|
|
24
24
|
|
|
25
25
|
|
|
@@ -52,7 +52,7 @@ def generelized_eigenvalue_matrix(field: NedelecLegrange2,
|
|
|
52
52
|
nT = tris.shape[1]
|
|
53
53
|
tri_to_field = field.tri_to_field
|
|
54
54
|
|
|
55
|
-
nodes =
|
|
55
|
+
nodes = field.local_nodes
|
|
56
56
|
|
|
57
57
|
with ProgressBar(total=nT, ncols=100, dynamic_ncols=False) as pgb:
|
|
58
58
|
dataE, dataB, rows, cols = _matrix_builder(nodes, tris, edges, tri_to_field, ur, er, k0, pgb)
|
|
@@ -179,6 +179,7 @@ def _ne1_curl(coeff, coords):
|
|
|
179
179
|
ys = coords[1,:]
|
|
180
180
|
return -3*a1*b1*c2 + 3*a1*b2*c1 - 3*b1**2*c2*xs + 3*b1*b2*c1*xs - 3*b1*c1*c2*ys + 3*b2*c1**2*ys + 0j
|
|
181
181
|
|
|
182
|
+
|
|
182
183
|
@njit(c16[:](f8[:,:], f8[:,:]), cache=True, nogil=True)
|
|
183
184
|
def _ne2_curl(coeff, coords):
|
|
184
185
|
a1, b1, c1 = coeff[:,0]
|
|
@@ -195,7 +196,7 @@ def _nf1_curl(coeff, coords):
|
|
|
195
196
|
xs = coords[0,:]
|
|
196
197
|
ys = coords[1,:]
|
|
197
198
|
return -b2*(c1*(a3 + b3*xs + c3*ys) - c3*(a1 + b1*xs + c1*ys)) + c2*(b1*(a3 + b3*xs + c3*ys) - b3*(a1 + b1*xs + c1*ys)) + 2*(b1*c3 - b3*c1)*(a2 + b2*xs + c2*ys) + 0*1j
|
|
198
|
-
|
|
199
|
+
|
|
199
200
|
@njit(c16[:](f8[:,:], f8[:,:]), cache=True, nogil=True)
|
|
200
201
|
def _nf2_curl(coeff, coords):
|
|
201
202
|
a1, b1, c1 = coeff[:,0]
|
|
@@ -204,7 +205,7 @@ def _nf2_curl(coeff, coords):
|
|
|
204
205
|
xs = coords[0,:]
|
|
205
206
|
ys = coords[1,:]
|
|
206
207
|
return b3*(c1*(a2 + b2*xs + c2*ys) - c2*(a1 + b1*xs + c1*ys)) - c3*(b1*(a2 + b2*xs + c2*ys) - b2*(a1 + b1*xs + c1*ys)) - 2*(b1*c2 - b2*c1)*(a3 + b3*xs + c3*ys) + 0*1j
|
|
207
|
-
|
|
208
|
+
|
|
208
209
|
|
|
209
210
|
############################################################
|
|
210
211
|
# TRIANGLE BARYCENTRIC COORDINATE LIN. COEFFICIENTS #
|
|
@@ -243,9 +244,9 @@ def tri_coefficients(vxs, vys):
|
|
|
243
244
|
|
|
244
245
|
|
|
245
246
|
DPTS = np.array([[0.22338159, 0.22338159, 0.22338159, 0.10995174, 0.10995174, 0.10995174],
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
[0.10810302, 0.44594849, 0.44594849, 0.81684757, 0.09157621, 0.09157621],
|
|
248
|
+
[0.44594849, 0.44594849, 0.10810302, 0.09157621, 0.09157621, 0.81684757],
|
|
249
|
+
[0.44594849, 0.10810302, 0.44594849, 0.09157621, 0.81684757, 0.09157621]], dtype=np.float64)
|
|
249
250
|
|
|
250
251
|
|
|
251
252
|
############################################################
|
|
@@ -266,7 +267,6 @@ def generalized_matrix_GQ(tri_vertices, local_edge_map, Ms, Mm, k0):
|
|
|
266
267
|
Dzz2 = np.zeros((6,6), dtype=np.complex128)
|
|
267
268
|
|
|
268
269
|
Ls = np.ones((14,14), dtype=np.float64)
|
|
269
|
-
#Ls2 = np.ones((14,14), dtype=np.float64)
|
|
270
270
|
|
|
271
271
|
WEIGHTS = DPTS[0,:]
|
|
272
272
|
DPTS1 = DPTS[1,:]
|
|
@@ -297,13 +297,11 @@ def generalized_matrix_GQ(tri_vertices, local_edge_map, Ms, Mm, k0):
|
|
|
297
297
|
Ms = Ms[:2,:2]
|
|
298
298
|
Mm = Mm[:2,:2]
|
|
299
299
|
|
|
300
|
-
fid = np.array([0,1,2], dtype=np.int64)
|
|
301
|
-
|
|
302
300
|
Ls[3,:] *= Ds[0,2]
|
|
303
301
|
Ls[7,:] *= Ds[0,1]
|
|
304
302
|
Ls[:,3] *= Ds[0,2]
|
|
305
303
|
Ls[:,7] *= Ds[0,1]
|
|
306
|
-
|
|
304
|
+
|
|
307
305
|
for iv1 in range(3):
|
|
308
306
|
ie1 = local_edge_map[:, iv1]
|
|
309
307
|
|
|
@@ -318,9 +316,12 @@ def generalized_matrix_GQ(tri_vertices, local_edge_map, Ms, Mm, k0):
|
|
|
318
316
|
F4 = _ne2(coeff[:,ie1], cs)
|
|
319
317
|
F5 = _lv_grad(coeff[:,iv1],cs)
|
|
320
318
|
F6 = _le_grad(coeff[:,ie1],cs)
|
|
319
|
+
|
|
321
320
|
for iv2 in range(3):
|
|
322
321
|
ei2 = local_edge_map[:, iv2]
|
|
323
322
|
|
|
323
|
+
H1 = matmul(Ms,_ne1(coeff[:,ei2],cs))
|
|
324
|
+
H2 = matmul(Ms,_ne2(coeff[:,ei2],cs))
|
|
324
325
|
|
|
325
326
|
Att[iv1,iv2] = _gqi(F1, Msz * _ne1_curl(coeff[:,ei2],cs), WEIGHTS)
|
|
326
327
|
Att[iv1+4,iv2] = _gqi(F2, Msz * _ne1_curl(coeff[:,ei2],cs), WEIGHTS)
|
|
@@ -332,15 +333,15 @@ def generalized_matrix_GQ(tri_vertices, local_edge_map, Ms, Mm, k0):
|
|
|
332
333
|
Btt[iv1,iv2+4] = _gqi2(F3, matmul(Mm,_ne2(coeff[:,ei2],cs)), WEIGHTS)
|
|
333
334
|
Btt[iv1+4,iv2+4] = _gqi2(F4, matmul(Mm,_ne2(coeff[:,ei2],cs)), WEIGHTS)
|
|
334
335
|
|
|
335
|
-
Dtt[iv1,iv2] = _gqi2(F3,
|
|
336
|
-
Dtt[iv1+4,iv2] = _gqi2(F4,
|
|
337
|
-
Dtt[iv1,iv2+4] = _gqi2(F3,
|
|
338
|
-
Dtt[iv1+4,iv2+4] = _gqi2(F4,
|
|
336
|
+
Dtt[iv1,iv2] = _gqi2(F3, H1, WEIGHTS)
|
|
337
|
+
Dtt[iv1+4,iv2] = _gqi2(F4, H1, WEIGHTS)
|
|
338
|
+
Dtt[iv1,iv2+4] = _gqi2(F3, H2, WEIGHTS)
|
|
339
|
+
Dtt[iv1+4,iv2+4] = _gqi2(F4, H2, WEIGHTS)
|
|
339
340
|
|
|
340
|
-
Dzt[iv1, iv2] = _gqi2(F5,
|
|
341
|
-
Dzt[iv1+3, iv2] = _gqi2(F6,
|
|
342
|
-
Dzt[iv1, iv2+4] = _gqi2(F5,
|
|
343
|
-
Dzt[iv1+3, iv2+4] = _gqi2(F6,
|
|
341
|
+
Dzt[iv1, iv2] = _gqi2(F5, H1, WEIGHTS)
|
|
342
|
+
Dzt[iv1+3, iv2] = _gqi2(F6, H1, WEIGHTS)
|
|
343
|
+
Dzt[iv1, iv2+4] = _gqi2(F5, H2, WEIGHTS)
|
|
344
|
+
Dzt[iv1+3, iv2+4] = _gqi2(F6, H2, WEIGHTS)
|
|
344
345
|
|
|
345
346
|
Dzz1[iv1, iv2] = _gqi2(_lv_grad(coeff[:,iv1], cs), matmul(Ms,_lv_grad(coeff[:,iv2],cs)), WEIGHTS)
|
|
346
347
|
Dzz1[iv1, iv2+3] = _gqi2(_lv_grad(coeff[:,iv1], cs), matmul(Ms,_le_grad(coeff[:,ei2],cs)), WEIGHTS)
|
|
@@ -357,6 +358,7 @@ def generalized_matrix_GQ(tri_vertices, local_edge_map, Ms, Mm, k0):
|
|
|
357
358
|
G2 = matmul(Mm,_nf2(coeff,cs))
|
|
358
359
|
G3 = matmul(Ms,_nf1(coeff,cs))
|
|
359
360
|
G4 = matmul(Ms,_nf2(coeff,cs))
|
|
361
|
+
|
|
360
362
|
Att[iv1,3] = _gqi(F1, Msz * _nf1_curl(coeff,cs), WEIGHTS)
|
|
361
363
|
Att[iv1+4,3] = _gqi(_ne2_curl(coeff[:,ie1], cs), Msz * _nf1_curl(coeff,cs), WEIGHTS)
|
|
362
364
|
Att[iv1,7] = _gqi(F1, Msz * _nf2_curl(coeff,cs), WEIGHTS)
|
|
@@ -412,6 +414,8 @@ def generalized_matrix_GQ(tri_vertices, local_edge_map, Ms, Mm, k0):
|
|
|
412
414
|
B[:8,8:] = Dzt.T
|
|
413
415
|
B[8:,8:] = Dzz1 - k0**2 * Dzz2
|
|
414
416
|
|
|
417
|
+
#Ls = np.ones((14,14), dtype=np.float64)
|
|
418
|
+
|
|
415
419
|
B = Ls*B*np.abs(Area)
|
|
416
420
|
A = Ls*A*np.abs(Area)
|
|
417
421
|
return A, B
|