emerge 0.4.9__py3-none-any.whl → 0.4.11__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 +2 -2
- emerge/_emerge/mesh3d.py +2 -0
- emerge/_emerge/pardiso/pardiso_solver.py +455 -0
- emerge/_emerge/physics/microwave/microwave_bc.py +7 -0
- emerge/_emerge/physics/microwave/microwave_data.py +26 -0
- emerge/_emerge/plot/simple_plots.py +3 -0
- emerge/_emerge/simmodel.py +1 -2
- emerge/_emerge/solver.py +84 -43
- {emerge-0.4.9.dist-info → emerge-0.4.11.dist-info}/METADATA +21 -8
- {emerge-0.4.9.dist-info → emerge-0.4.11.dist-info}/RECORD +13 -11
- emerge-0.4.11.dist-info/licenses/LICENSE +280 -0
- {emerge-0.4.9.dist-info → emerge-0.4.11.dist-info}/WHEEL +0 -0
- {emerge-0.4.9.dist-info → emerge-0.4.11.dist-info}/entry_points.txt +0 -0
emerge/__init__.py
CHANGED
|
@@ -20,8 +20,8 @@ import os
|
|
|
20
20
|
|
|
21
21
|
NTHREADS = "1"
|
|
22
22
|
|
|
23
|
-
os.environ["OMP_NUM_THREADS"] =
|
|
24
|
-
os.environ["MKL_NUM_THREADS"] =
|
|
23
|
+
os.environ["OMP_NUM_THREADS"] = "4"
|
|
24
|
+
os.environ["MKL_NUM_THREADS"] = "4"
|
|
25
25
|
os.environ["OPENBLAS_NUM_THREADS"] = NTHREADS
|
|
26
26
|
os.environ["VECLIB_MAXIMUM_THREADS"] = NTHREADS
|
|
27
27
|
os.environ["NUMEXPR_NUM_THREADS"] = NTHREADS
|
emerge/_emerge/mesh3d.py
CHANGED
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
# Copyright (c) 2016 Adrian Haas and ETH Zürich
|
|
2
|
+
# Modifications Copyright (c) 2025 Robert Fennis
|
|
3
|
+
#
|
|
4
|
+
# SPDX-License-Identifier: BSD-3-Clause AND GPL-2.0-or-later
|
|
5
|
+
#
|
|
6
|
+
# This file incorporates code from the PyPardiso project, which is
|
|
7
|
+
# distributed under the BSD 3-Clause License. You may redistribute
|
|
8
|
+
# and/or modify this file under either
|
|
9
|
+
#
|
|
10
|
+
# * the terms of the BSD 3-Clause License (see below), or
|
|
11
|
+
# * the terms of the GNU General Public License, version 2 or later.
|
|
12
|
+
#
|
|
13
|
+
# ----------------------------------------------------------------------
|
|
14
|
+
# BSD 3-Clause License
|
|
15
|
+
#
|
|
16
|
+
# Redistribution and use in source and binary forms, with or without
|
|
17
|
+
# modification, are permitted provided that the following conditions are
|
|
18
|
+
# met:
|
|
19
|
+
# 1. Redistributions of source code must retain the above copyright
|
|
20
|
+
# notice, this list of conditions and the following disclaimer.
|
|
21
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
|
22
|
+
# notice, this list of conditions and the following disclaimer in the
|
|
23
|
+
# documentation and/or other materials provided with the distribution.
|
|
24
|
+
# 3. Neither the name of ETH Zürich nor the names of its contributors
|
|
25
|
+
# may be used to endorse or promote products derived from this
|
|
26
|
+
# software without specific prior written permission.
|
|
27
|
+
#
|
|
28
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
29
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
30
|
+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
31
|
+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
32
|
+
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
33
|
+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
34
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
35
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
36
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
37
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
|
38
|
+
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
39
|
+
# DAMAGE.
|
|
40
|
+
# ----------------------------------------------------------------------
|
|
41
|
+
|
|
42
|
+
# coding: utf-8
|
|
43
|
+
import scipy.sparse as sp
|
|
44
|
+
# coding: utf-8
|
|
45
|
+
import os
|
|
46
|
+
import sys
|
|
47
|
+
import glob
|
|
48
|
+
import ctypes
|
|
49
|
+
import warnings
|
|
50
|
+
import hashlib
|
|
51
|
+
import site
|
|
52
|
+
from ctypes.util import find_library
|
|
53
|
+
|
|
54
|
+
import numpy as np
|
|
55
|
+
import scipy.sparse as sp
|
|
56
|
+
from scipy.sparse import SparseEfficiencyWarning, csr_matrix
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
_PARDISO_ERROR_CODES = """
|
|
60
|
+
0 | No error.
|
|
61
|
+
-1 | Input inconsistent.
|
|
62
|
+
-2 | Not enough memory.
|
|
63
|
+
-3 | Reordering problem.
|
|
64
|
+
-4 | Zero pivot, numerical fac. or iterative refinement problem.
|
|
65
|
+
-5 | Unclassified (internal) error.
|
|
66
|
+
-6 | Preordering failed (matrix types 11(real and nonsymmetric), 13(complex and nonsymmetric) only).
|
|
67
|
+
-7 | Diagonal Matrix problem.
|
|
68
|
+
-8 | 32-bit integer overflow problem.
|
|
69
|
+
-10 | No license file pardiso.lic found.
|
|
70
|
+
-11 | License is expired.
|
|
71
|
+
-12 | Wrong username or hostname.
|
|
72
|
+
-100 | Reached maximum number of Krylov-subspace iteration in iterative solver.
|
|
73
|
+
-101 | No sufficient convergence in Krylov-subspace iteration within 25 iterations.
|
|
74
|
+
-102 | Error in Krylov-subspace iteration.
|
|
75
|
+
-103 | Bread-Down in Krylov-subspace iteration
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
class MKL_Complex16(ctypes.Structure):
|
|
79
|
+
_fields_ = [("real", ctypes.c_double),
|
|
80
|
+
("imag", ctypes.c_double)]
|
|
81
|
+
|
|
82
|
+
cpx16_p = ctypes.POINTER(MKL_Complex16)
|
|
83
|
+
|
|
84
|
+
class PyPardisoSolver:
|
|
85
|
+
"""
|
|
86
|
+
Python interface to the Intel MKL PARDISO library for solving large sparse linear systems of equations Ax=b.
|
|
87
|
+
|
|
88
|
+
Pardiso documentation: https://software.intel.com/en-us/node/470282
|
|
89
|
+
|
|
90
|
+
--- Basic usage ---
|
|
91
|
+
matrix type: real (float64) and nonsymetric
|
|
92
|
+
methods: solve, factorize
|
|
93
|
+
|
|
94
|
+
- use the "solve(A,b)" method to solve Ax=b for x, where A is a sparse CSR (or CSC) matrix and b is a numpy array
|
|
95
|
+
- use the "factorize(A)" method first, if you intend to solve the system more than once for different right-hand
|
|
96
|
+
sides, the factorization will be reused automatically afterwards
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
--- Advanced usage ---
|
|
100
|
+
methods: get_iparm, get_iparms, set_iparm, set_matrix_type, set_phase
|
|
101
|
+
|
|
102
|
+
- additional options can be accessed by setting the iparms (see Pardiso documentation for description)
|
|
103
|
+
- other matrix types can be chosen with the "set_matrix_type" method. complex matrix types are currently not
|
|
104
|
+
supported. pypardiso is only teste for mtype=11 (real and nonsymetric)
|
|
105
|
+
- the solving phases can be set with the "set_phase" method
|
|
106
|
+
- The out-of-core (OOC) solver either fails or crashes my computer, be careful with iparm[60]
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
--- Statistical info ---
|
|
110
|
+
methods: set_statistical_info_on, set_statistical_info_off
|
|
111
|
+
|
|
112
|
+
- the Pardiso solver writes statistical info to the C stdout if desired
|
|
113
|
+
- if you use pypardiso from within a jupyter notebook you can turn the statistical info on and capture the output
|
|
114
|
+
real-time by wrapping your call to "solve" with wurlitzer.sys_pipes() (https://github.com/minrk/wurlitzer,
|
|
115
|
+
https://pypi.python.org/pypi/wurlitzer/)
|
|
116
|
+
- wurlitzer dosen't work on windows, info appears in notebook server console window if used from jupyter notebook
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
--- Memory usage ---
|
|
120
|
+
methods: remove_stored_factorization, free_memory
|
|
121
|
+
|
|
122
|
+
- remove_stored_factorization can be used to delete the wrapper's copy of matrix A
|
|
123
|
+
- free_memory releases the internal memory of the solver
|
|
124
|
+
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
def __init__(self, mtype=11, phase=13, size_limit_storage=5e7):
|
|
128
|
+
|
|
129
|
+
self.libmkl = None
|
|
130
|
+
|
|
131
|
+
# custom mkl_rt path in environment variable
|
|
132
|
+
mkl_rt = os.environ.get('PYPARDISO_MKL_RT')
|
|
133
|
+
|
|
134
|
+
# Look for the mkl_rt shared library with ctypes.util.find_library
|
|
135
|
+
if mkl_rt is None:
|
|
136
|
+
mkl_rt = find_library('mkl_rt')
|
|
137
|
+
# also look for mkl_rt.1, Windows-specific, see
|
|
138
|
+
# https://github.com/haasad/PyPardisoProject/issues/12
|
|
139
|
+
if mkl_rt is None:
|
|
140
|
+
mkl_rt = find_library('mkl_rt.1')
|
|
141
|
+
|
|
142
|
+
# If we can't find mkl_rt with find_library, we search the directory
|
|
143
|
+
# tree, using a few assumptions:
|
|
144
|
+
# - the shared library can be found in a subdirectory of sys.prefix
|
|
145
|
+
# https://docs.python.org/3.9/library/sys.html#sys.prefix
|
|
146
|
+
# or in the user site in case of user-local installation like
|
|
147
|
+
# `pip install --user`
|
|
148
|
+
# https://peps.python.org/pep-0370/
|
|
149
|
+
# https://docs.python.org/3/library/site.html#site.USER_BASE
|
|
150
|
+
# - either in `lib` (linux and macOS) or `Library\bin` (windows)
|
|
151
|
+
# - if there are multiple matches for `mkl_rt`, try shorter paths
|
|
152
|
+
# first
|
|
153
|
+
if mkl_rt is None:
|
|
154
|
+
globs = glob.glob(
|
|
155
|
+
f'{sys.prefix}/[Ll]ib*/**/*mkl_rt*', recursive=True
|
|
156
|
+
) or glob.glob(
|
|
157
|
+
f'{site.USER_BASE}/[Ll]ib*/**/*mkl_rt*', recursive=True
|
|
158
|
+
)
|
|
159
|
+
for path in sorted(globs, key=len):
|
|
160
|
+
try:
|
|
161
|
+
self.libmkl = ctypes.CDLL(path)
|
|
162
|
+
break
|
|
163
|
+
except (OSError, ImportError):
|
|
164
|
+
pass
|
|
165
|
+
|
|
166
|
+
if self.libmkl is None:
|
|
167
|
+
raise ImportError(
|
|
168
|
+
'Shared library mkl_rt not found. '
|
|
169
|
+
'Use environment variable PYPARDISO_MKL_RT to provide a custom path.'
|
|
170
|
+
)
|
|
171
|
+
else:
|
|
172
|
+
self.libmkl = ctypes.CDLL(mkl_rt)
|
|
173
|
+
|
|
174
|
+
self._mkl_pardiso = self.libmkl.pardiso
|
|
175
|
+
|
|
176
|
+
# determine 32bit or 64bit architecture
|
|
177
|
+
if ctypes.sizeof(ctypes.c_void_p) == 8:
|
|
178
|
+
self._pt_type = (ctypes.c_int64, np.int64)
|
|
179
|
+
else:
|
|
180
|
+
self._pt_type = (ctypes.c_int32, np.int32)
|
|
181
|
+
|
|
182
|
+
self._mkl_pardiso.argtypes = [ctypes.POINTER(self._pt_type[0]), # pt
|
|
183
|
+
ctypes.POINTER(ctypes.c_int32), # maxfct
|
|
184
|
+
ctypes.POINTER(ctypes.c_int32), # mnum
|
|
185
|
+
ctypes.POINTER(ctypes.c_int32), # mtype
|
|
186
|
+
ctypes.POINTER(ctypes.c_int32), # phase
|
|
187
|
+
ctypes.POINTER(ctypes.c_int32), # n
|
|
188
|
+
ctypes.POINTER(None), # a
|
|
189
|
+
ctypes.POINTER(ctypes.c_int32), # ia
|
|
190
|
+
ctypes.POINTER(ctypes.c_int32), # ja
|
|
191
|
+
ctypes.POINTER(ctypes.c_int32), # perm
|
|
192
|
+
ctypes.POINTER(ctypes.c_int32), # nrhs
|
|
193
|
+
ctypes.POINTER(ctypes.c_int32), # iparm
|
|
194
|
+
ctypes.POINTER(ctypes.c_int32), # msglvl
|
|
195
|
+
ctypes.POINTER(None), # b
|
|
196
|
+
ctypes.POINTER(None), # x
|
|
197
|
+
ctypes.POINTER(ctypes.c_int32)] # error
|
|
198
|
+
|
|
199
|
+
self._mkl_pardiso.restype = None
|
|
200
|
+
|
|
201
|
+
self.pt = np.zeros(64, dtype=self._pt_type[1])
|
|
202
|
+
self.iparm = np.zeros(64, dtype=np.int32)
|
|
203
|
+
self.perm = np.zeros(0, dtype=np.int32)
|
|
204
|
+
|
|
205
|
+
self.mtype = mtype
|
|
206
|
+
self.phase = phase
|
|
207
|
+
self.msglvl = False
|
|
208
|
+
|
|
209
|
+
self.factorized_A = csr_matrix((0, 0))
|
|
210
|
+
self.size_limit_storage = size_limit_storage
|
|
211
|
+
self._solve_transposed = False
|
|
212
|
+
|
|
213
|
+
def factorize(self, A):
|
|
214
|
+
"""
|
|
215
|
+
Factorize the matrix A, the factorization will automatically be used if the same matrix A is passed to the
|
|
216
|
+
solve method. This will drastically increase the speed of solve, if solve is called more than once for the
|
|
217
|
+
same matrix A
|
|
218
|
+
|
|
219
|
+
--- Parameters ---
|
|
220
|
+
A: sparse square CSR matrix (scipy.sparse.csr.csr_matrix), CSC matrix also possible
|
|
221
|
+
"""
|
|
222
|
+
|
|
223
|
+
self._check_A(A)
|
|
224
|
+
|
|
225
|
+
if A.nnz > self.size_limit_storage:
|
|
226
|
+
self.factorized_A = self._hash_csr_matrix(A)
|
|
227
|
+
else:
|
|
228
|
+
self.factorized_A = A.copy()
|
|
229
|
+
|
|
230
|
+
self.set_phase(12)
|
|
231
|
+
b = np.zeros((A.shape[0], 1))
|
|
232
|
+
self._call_pardiso(A, b)
|
|
233
|
+
|
|
234
|
+
def solve(self, A, b):
|
|
235
|
+
"""
|
|
236
|
+
solve Ax=b for x
|
|
237
|
+
|
|
238
|
+
--- Parameters ---
|
|
239
|
+
A: sparse square CSR matrix (scipy.sparse.csr.csr_matrix), CSC matrix also possible
|
|
240
|
+
b: numpy ndarray
|
|
241
|
+
right-hand side(s), b.shape[0] needs to be the same as A.shape[0]
|
|
242
|
+
|
|
243
|
+
--- Returns ---
|
|
244
|
+
x: numpy ndarray
|
|
245
|
+
solution of the system of linear equations, same shape as input b
|
|
246
|
+
"""
|
|
247
|
+
|
|
248
|
+
self._check_A(A)
|
|
249
|
+
b = self._check_b(A, b)
|
|
250
|
+
|
|
251
|
+
if self._is_already_factorized(A):
|
|
252
|
+
self.set_phase(33)
|
|
253
|
+
else:
|
|
254
|
+
self.set_phase(13)
|
|
255
|
+
|
|
256
|
+
x = self._call_pardiso(A, b)
|
|
257
|
+
|
|
258
|
+
# it is possible to call the solver with empty columns, but computationally expensive to check this
|
|
259
|
+
# beforehand, therefore only the result is checked for infinite elements.
|
|
260
|
+
# if not np.isfinite(x).all():
|
|
261
|
+
# warnings.warn('The result contains infinite elements. Make sure that matrix A contains no empty columns.',
|
|
262
|
+
# PyPardisoWarning)
|
|
263
|
+
# --> this check doesn't work consistently, maybe add an advanced input check method for A
|
|
264
|
+
|
|
265
|
+
return x
|
|
266
|
+
|
|
267
|
+
def _is_already_factorized(self, A):
|
|
268
|
+
if isinstance(self.factorized_A, str):
|
|
269
|
+
return self._hash_csr_matrix(A) == self.factorized_A
|
|
270
|
+
else:
|
|
271
|
+
return self._csr_matrix_equal(A, self.factorized_A)
|
|
272
|
+
|
|
273
|
+
def _csr_matrix_equal(self, a1, a2):
|
|
274
|
+
return all((np.array_equal(a1.indptr, a2.indptr),
|
|
275
|
+
np.array_equal(a1.indices, a2.indices),
|
|
276
|
+
np.array_equal(a1.data, a2.data)))
|
|
277
|
+
|
|
278
|
+
def _hash_csr_matrix(self, matrix):
|
|
279
|
+
return (hashlib.sha1(matrix.indices).hexdigest() +
|
|
280
|
+
hashlib.sha1(matrix.indptr).hexdigest() +
|
|
281
|
+
hashlib.sha1(matrix.data).hexdigest())
|
|
282
|
+
|
|
283
|
+
def _check_A(self, A):
|
|
284
|
+
if A.shape[0] != A.shape[1]:
|
|
285
|
+
raise ValueError('Matrix A needs to be square, but has shape: {}'.format(A.shape))
|
|
286
|
+
|
|
287
|
+
if sp.issparse(A) and A.format == "csr":
|
|
288
|
+
self._solve_transposed = False
|
|
289
|
+
self.set_iparm(12, 1)
|
|
290
|
+
elif sp.issparse(A) and A.format == "csc":
|
|
291
|
+
self._solve_transposed = True
|
|
292
|
+
self.set_iparm(12, 0)
|
|
293
|
+
else:
|
|
294
|
+
msg = 'PyPardiso requires matrix A to be in CSR or CSC format, but matrix A is: {}'.format(type(A))
|
|
295
|
+
raise TypeError(msg)
|
|
296
|
+
|
|
297
|
+
# scipy allows unsorted csr-indices, which lead to completely wrong pardiso results
|
|
298
|
+
if not A.has_sorted_indices:
|
|
299
|
+
A.sort_indices()
|
|
300
|
+
|
|
301
|
+
# scipy allows csr matrices with empty rows. a square matrix with an empty row is singular. calling
|
|
302
|
+
# pardiso with a matrix A that contains empty rows leads to a segfault, same applies for csc with
|
|
303
|
+
# empty columns
|
|
304
|
+
if not np.diff(A.indptr).all():
|
|
305
|
+
row_col = 'column' if self._solve_transposed else 'row'
|
|
306
|
+
raise ValueError('Matrix A is singular, because it contains empty {}(s)'.format(row_col))
|
|
307
|
+
|
|
308
|
+
def _check_b(self, A, b):
|
|
309
|
+
if sp.issparse(b):
|
|
310
|
+
warnings.warn('PyPardiso requires the right-hand side b to be a dense array for maximum efficiency',
|
|
311
|
+
SparseEfficiencyWarning)
|
|
312
|
+
b = b.todense()
|
|
313
|
+
|
|
314
|
+
# pardiso expects fortran (column-major) order for b
|
|
315
|
+
if not b.flags.f_contiguous:
|
|
316
|
+
b = np.asfortranarray(b)
|
|
317
|
+
|
|
318
|
+
if b.shape[0] != A.shape[0]:
|
|
319
|
+
raise ValueError("Dimension mismatch: Matrix A {} and array b {}".format(A.shape, b.shape))
|
|
320
|
+
|
|
321
|
+
if b.dtype != np.float64:
|
|
322
|
+
if b.dtype in [np.float16, np.float32, np.int16, np.int32, np.int64]:
|
|
323
|
+
warnings.warn("Array b's data type was converted from {} to float64".format(str(b.dtype)),
|
|
324
|
+
PyPardisoWarning)
|
|
325
|
+
b = b.astype(np.float64)
|
|
326
|
+
elif b.dtype in (np.complex128, np.complex64):
|
|
327
|
+
b = b.astype(np.complex128)
|
|
328
|
+
else:
|
|
329
|
+
raise TypeError('Dtype {} for array b is not supported'.format(str(b.dtype)))
|
|
330
|
+
|
|
331
|
+
return b
|
|
332
|
+
|
|
333
|
+
def _call_pardiso(self, A, b):
|
|
334
|
+
self.set_iparm(2,3)
|
|
335
|
+
self.set_iparm(3,6)
|
|
336
|
+
self.set_iparm(10,13)
|
|
337
|
+
self.set_iparm(13,2)
|
|
338
|
+
|
|
339
|
+
x = np.zeros_like(b)
|
|
340
|
+
pardiso_error = ctypes.c_int32(0)
|
|
341
|
+
c_int32_p = ctypes.POINTER(ctypes.c_int32)
|
|
342
|
+
c_float64_p = ctypes.POINTER(ctypes.c_double)
|
|
343
|
+
|
|
344
|
+
# 1-based indexing
|
|
345
|
+
ia = A.indptr + 1
|
|
346
|
+
ja = A.indices + 1
|
|
347
|
+
|
|
348
|
+
mtype = 3
|
|
349
|
+
|
|
350
|
+
if A.dtype == np.complex128:
|
|
351
|
+
val_ptr = A.data.ctypes.data_as(cpx16_p)
|
|
352
|
+
rhs_ptr = b.ctypes.data_as(cpx16_p)
|
|
353
|
+
x_ptr = x.ctypes.data_as(cpx16_p)
|
|
354
|
+
else:
|
|
355
|
+
val_ptr = A.data.ctypes.data_as(c_float64_p)
|
|
356
|
+
rhs_ptr = b.ctypes.data_as(c_float64_p)
|
|
357
|
+
x_ptr = x.ctypes.data_as(c_float64_p)
|
|
358
|
+
|
|
359
|
+
self._mkl_pardiso(self.pt.ctypes.data_as(ctypes.POINTER(self._pt_type[0])), # pt
|
|
360
|
+
ctypes.byref(ctypes.c_int32(1)), # maxfct
|
|
361
|
+
ctypes.byref(ctypes.c_int32(1)), # mnum
|
|
362
|
+
ctypes.byref(ctypes.c_int32(mtype)), # mtype -> 11 for real-nonsymetric
|
|
363
|
+
ctypes.byref(ctypes.c_int32(self.phase)), # phase -> 13
|
|
364
|
+
ctypes.byref(ctypes.c_int32(A.shape[0])), # N -> number of equations/size of matrix
|
|
365
|
+
val_ptr, # A -> non-zero entries in matrix
|
|
366
|
+
ia.ctypes.data_as(c_int32_p), # ia -> csr-indptr
|
|
367
|
+
ja.ctypes.data_as(c_int32_p), # ja -> csr-indices
|
|
368
|
+
self.perm.ctypes.data_as(c_int32_p), # perm -> empty
|
|
369
|
+
ctypes.byref(ctypes.c_int32(1 if b.ndim == 1 else b.shape[1])), # nrhs
|
|
370
|
+
self.iparm.ctypes.data_as(c_int32_p), # iparm-array
|
|
371
|
+
ctypes.byref(ctypes.c_int32(self.msglvl)), # msg-level -> 1: statistical info is printed
|
|
372
|
+
rhs_ptr, # b -> right-hand side vector/matrix
|
|
373
|
+
x_ptr, # x -> output
|
|
374
|
+
ctypes.byref(pardiso_error)) # pardiso error
|
|
375
|
+
|
|
376
|
+
if pardiso_error.value != 0:
|
|
377
|
+
raise PyPardisoError(pardiso_error.value)
|
|
378
|
+
else:
|
|
379
|
+
return np.ascontiguousarray(x) # change memory-layout back from fortran to c order
|
|
380
|
+
|
|
381
|
+
def get_iparms(self):
|
|
382
|
+
"""Returns a dictionary of iparms"""
|
|
383
|
+
return dict(enumerate(self.iparm, 1))
|
|
384
|
+
|
|
385
|
+
def get_iparm(self, i):
|
|
386
|
+
"""Returns the i-th iparm (1-based indexing)"""
|
|
387
|
+
return self.iparm[i-1]
|
|
388
|
+
|
|
389
|
+
def set_iparm(self, i, value):
|
|
390
|
+
"""set the i-th iparm to 'value' (1-based indexing)"""
|
|
391
|
+
if i not in {1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 18, 19, 21, 24, 25, 27, 28, 31, 34, 35, 36, 37, 56, 60}:
|
|
392
|
+
warnings.warn('{} is no input iparm. See the Pardiso documentation.'.format(value), PyPardisoWarning)
|
|
393
|
+
self.iparm[i-1] = value
|
|
394
|
+
|
|
395
|
+
def set_matrix_type(self, mtype):
|
|
396
|
+
"""Set the matrix type (see Pardiso documentation)"""
|
|
397
|
+
self.mtype = mtype
|
|
398
|
+
|
|
399
|
+
def set_statistical_info_on(self):
|
|
400
|
+
"""Display statistical info (appears in notebook server console window if pypardiso is
|
|
401
|
+
used from jupyter notebook, use wurlitzer to redirect info to the notebook)"""
|
|
402
|
+
self.msglvl = 1
|
|
403
|
+
|
|
404
|
+
def set_statistical_info_off(self):
|
|
405
|
+
"""Turns statistical info off"""
|
|
406
|
+
self.msglvl = 0
|
|
407
|
+
|
|
408
|
+
def set_phase(self, phase):
|
|
409
|
+
"""Set the phase(s) for the solver. See the Pardiso documentation for details."""
|
|
410
|
+
self.phase = phase
|
|
411
|
+
|
|
412
|
+
def remove_stored_factorization(self):
|
|
413
|
+
"""removes the stored factorization, this will free the memory in python, but the factorization in pardiso
|
|
414
|
+
is still accessible with a direct call to self._call_pardiso(A,b) with phase=33"""
|
|
415
|
+
self.factorized_A = sp.csr_matrix((0, 0))
|
|
416
|
+
|
|
417
|
+
def free_memory(self, everything=False):
|
|
418
|
+
"""release mkl's internal memory, either only for the factorization (ie the LU-decomposition) or all of
|
|
419
|
+
mkl's internal memory if everything=True"""
|
|
420
|
+
self.remove_stored_factorization()
|
|
421
|
+
A = sp.csr_matrix((0, 0))
|
|
422
|
+
b = np.zeros(0)
|
|
423
|
+
self.set_phase(-1 if everything else 0)
|
|
424
|
+
self._call_pardiso(A, b)
|
|
425
|
+
self.set_phase(13)
|
|
426
|
+
|
|
427
|
+
def pardiso_solve(self, A: csr_matrix, b: np.ndarray):
|
|
428
|
+
if sp.issparse(A) and A.format == "csc":
|
|
429
|
+
A = A.tocsr()
|
|
430
|
+
|
|
431
|
+
self._check_A(A)
|
|
432
|
+
|
|
433
|
+
if not self._is_already_factorized(A):
|
|
434
|
+
self.factorize(A)
|
|
435
|
+
|
|
436
|
+
try:
|
|
437
|
+
x = self.solve(A, b)
|
|
438
|
+
except PyPardisoError as e:
|
|
439
|
+
print('Error Codes:')
|
|
440
|
+
print(_PARDISO_ERROR_CODES)
|
|
441
|
+
|
|
442
|
+
return x.squeeze()
|
|
443
|
+
|
|
444
|
+
class PyPardisoWarning(UserWarning):
|
|
445
|
+
pass
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
class PyPardisoError(Exception):
|
|
449
|
+
|
|
450
|
+
def __init__(self, value):
|
|
451
|
+
self.value = value
|
|
452
|
+
|
|
453
|
+
def __str__(self):
|
|
454
|
+
return ('The Pardiso solver failed with error code {}. '
|
|
455
|
+
'See Pardiso documentation for details.'.format(self.value))
|
|
@@ -46,6 +46,13 @@ class MWBoundaryConditionSet(BoundaryConditionSet):
|
|
|
46
46
|
|
|
47
47
|
self._cell: PeriodicCell = None
|
|
48
48
|
|
|
49
|
+
def get_type(self, bctype: Literal['PEC','ModalPort','LumpedPort','PMC','LumpedElement','RectangularWaveguide','Periodic','FloquetPort']) -> FaceSelection:
|
|
50
|
+
tags = []
|
|
51
|
+
for bc in self.boundary_conditions:
|
|
52
|
+
if bctype in str(bc.__class__):
|
|
53
|
+
tags.extend(bc.selection.tags)
|
|
54
|
+
return FaceSelection(tags)
|
|
55
|
+
|
|
49
56
|
def floquet_port(self, poly: GeoSurface, port_number: int) -> FloquetPort:
|
|
50
57
|
if self._cell is None:
|
|
51
58
|
raise ValueError('Periodic cel must be defined for this simulation.')
|
|
@@ -874,6 +874,32 @@ class MWField:
|
|
|
874
874
|
|
|
875
875
|
return Eff, Hff
|
|
876
876
|
|
|
877
|
+
def optycal(self, faces: FaceSelection | GeoSurface = None) -> tuple:
|
|
878
|
+
"""Export this models exterior to an Optical acceptable dataset
|
|
879
|
+
|
|
880
|
+
Args:
|
|
881
|
+
faces (FaceSelection | GeoSurface): The faces to export. Defaults to None
|
|
882
|
+
|
|
883
|
+
Returns:
|
|
884
|
+
tuple: _description_
|
|
885
|
+
"""
|
|
886
|
+
if faces is None:
|
|
887
|
+
tags = self.mesh.exterior_face_tags
|
|
888
|
+
else:
|
|
889
|
+
tags = faces.tags
|
|
890
|
+
|
|
891
|
+
surface = self.basis.mesh.boundary_surface(tags, None)
|
|
892
|
+
field = self.interpolate(*surface.exyz)
|
|
893
|
+
vertices = surface.nodes
|
|
894
|
+
triangles = surface.tris
|
|
895
|
+
print(surface._origin, surface._alignment_origin)
|
|
896
|
+
origin = surface._origin
|
|
897
|
+
E = field.E
|
|
898
|
+
H = field.H
|
|
899
|
+
k0 = self.k0
|
|
900
|
+
return vertices, triangles, E, H, origin, k0
|
|
901
|
+
|
|
902
|
+
|
|
877
903
|
class MWScalar:
|
|
878
904
|
"""The MWDataSet class stores solution data of FEM Time Harmonic simulations.
|
|
879
905
|
"""
|
|
@@ -400,6 +400,7 @@ def plot_ff(
|
|
|
400
400
|
theta: np.ndarray,
|
|
401
401
|
E: Union[np.ndarray, Sequence[np.ndarray]],
|
|
402
402
|
grid: bool = True,
|
|
403
|
+
dB: bool = False,
|
|
403
404
|
labels: Optional[List[str]] = None,
|
|
404
405
|
xlabel: str = "Theta (rad)",
|
|
405
406
|
ylabel: str = "|E|",
|
|
@@ -453,6 +454,8 @@ def plot_ff(
|
|
|
453
454
|
fig, ax = plt.subplots()
|
|
454
455
|
for i, Ei in enumerate(E_list):
|
|
455
456
|
mag = np.abs(Ei)
|
|
457
|
+
if dB:
|
|
458
|
+
mag = 20*np.log10(mag)
|
|
456
459
|
ax.plot(
|
|
457
460
|
theta, mag,
|
|
458
461
|
linestyle=linestyles[i],
|
emerge/_emerge/simmodel.py
CHANGED
|
@@ -277,8 +277,6 @@ class Simulation3D:
|
|
|
277
277
|
if not self._defined_geometries:
|
|
278
278
|
self.define_geometry()
|
|
279
279
|
|
|
280
|
-
|
|
281
|
-
|
|
282
280
|
# Check if frequencies are defined: TODO: Replace with a more generic check
|
|
283
281
|
if self.mw.frequencies is None:
|
|
284
282
|
raise ValueError('No frequencies defined for the simulation. Please set frequencies before generating the mesh.')
|
|
@@ -296,6 +294,7 @@ class Simulation3D:
|
|
|
296
294
|
raise
|
|
297
295
|
|
|
298
296
|
self.mesh.update(self.mesher._get_periodic_bcs())
|
|
297
|
+
self.mesh.exterior_face_tags = self.mesher.domain_boundary_face_tags
|
|
299
298
|
gmsh.model.occ.synchronize()
|
|
300
299
|
self.set_mesh(self.mesh)
|
|
301
300
|
|
emerge/_emerge/solver.py
CHANGED
|
@@ -32,32 +32,14 @@ from enum import Enum
|
|
|
32
32
|
|
|
33
33
|
_PARDISO_AVAILABLE = False
|
|
34
34
|
_UMFPACK_AVAILABLE = False
|
|
35
|
-
|
|
36
|
-
0 | No error.
|
|
37
|
-
-1 | Input inconsistent.
|
|
38
|
-
-2 | Not enough memory.
|
|
39
|
-
-3 | Reordering problem.
|
|
40
|
-
-4 | Zero pivot, numerical fac. or iterative refinement problem.
|
|
41
|
-
-5 | Unclassified (internal) error.
|
|
42
|
-
-6 | Preordering failed (matrix types 11(real and nonsymmetric), 13(complex and nonsymmetric) only).
|
|
43
|
-
-7 | Diagonal Matrix problem.
|
|
44
|
-
-8 | 32-bit integer overflow problem.
|
|
45
|
-
-10 | No license file pardiso.lic found.
|
|
46
|
-
-11 | License is expired.
|
|
47
|
-
-12 | Wrong username or hostname.
|
|
48
|
-
-100 | Reached maximum number of Krylov-subspace iteration in iterative solver.
|
|
49
|
-
-101 | No sufficient convergence in Krylov-subspace iteration within 25 iterations.
|
|
50
|
-
-102 | Error in Krylov-subspace iteration.
|
|
51
|
-
-103 | Bread-Down in Krylov-subspace iteration
|
|
52
|
-
"""
|
|
35
|
+
|
|
53
36
|
""" Check if the PC runs on a non-ARM architechture
|
|
54
37
|
If so, attempt to import PyPardiso (if its installed)
|
|
55
38
|
"""
|
|
56
39
|
|
|
57
40
|
if 'arm' not in platform.processor():
|
|
58
41
|
try:
|
|
59
|
-
from
|
|
60
|
-
from pypardiso.pardiso_wrapper import PyPardisoError
|
|
42
|
+
from .pardiso.pardiso_solver import PyPardisoSolver, PyPardisoError
|
|
61
43
|
_PARDISO_AVAILABLE = True
|
|
62
44
|
except ModuleNotFoundError as e:
|
|
63
45
|
logger.info('Pardiso not found, defaulting to SuperLU')
|
|
@@ -392,7 +374,7 @@ class SolverUMFPACK(Solver):
|
|
|
392
374
|
super().__init__()
|
|
393
375
|
self.A: np.ndarray = None
|
|
394
376
|
self.b: np.ndarray = None
|
|
395
|
-
self.up: um.UmfpackContext = um.UmfpackContext('
|
|
377
|
+
self.up: um.UmfpackContext = um.UmfpackContext('zl')
|
|
396
378
|
self.up.control[um.UMFPACK_PRL] = 0 #less terminal printing
|
|
397
379
|
self.up.control[um.UMFPACK_IRSTEP] = 2
|
|
398
380
|
self.up.control[um.UMFPACK_STRATEGY] = um.UMFPACK_STRATEGY_SYMMETRIC
|
|
@@ -401,6 +383,7 @@ class SolverUMFPACK(Solver):
|
|
|
401
383
|
self.up.control[um.UMFPACK_SYM_PIVOT_TOLERANCE] = 0.001
|
|
402
384
|
self.up.control[um.UMFPACK_BLOCK_SIZE] = 64
|
|
403
385
|
self.up.control[um.UMFPACK_FIXQ] = -1
|
|
386
|
+
#self.up.control[um.UMFPACK_]
|
|
404
387
|
|
|
405
388
|
self.fact_symb: bool = False
|
|
406
389
|
|
|
@@ -409,6 +392,8 @@ class SolverUMFPACK(Solver):
|
|
|
409
392
|
|
|
410
393
|
def solve(self, A, b, precon, reuse_factorization: bool = False, id: int = -1):
|
|
411
394
|
logger.info(f'Calling UMFPACK Solver. ID={id}')
|
|
395
|
+
A.indptr = A.indptr.astype(np.int64)
|
|
396
|
+
A.indices = A.indices.astype(np.int64)
|
|
412
397
|
if self.fact_symb is False:
|
|
413
398
|
logger.debug('Executing symbollic factorization.')
|
|
414
399
|
self.up.symbolic(A)
|
|
@@ -423,12 +408,12 @@ class SolverUMFPACK(Solver):
|
|
|
423
408
|
|
|
424
409
|
class SolverPardiso(Solver):
|
|
425
410
|
""" Implements the PARDISO solver through PyPardiso. """
|
|
426
|
-
real_only: bool =
|
|
411
|
+
real_only: bool = False
|
|
427
412
|
req_sorter: bool = False
|
|
428
413
|
|
|
429
414
|
def __init__(self):
|
|
430
415
|
super().__init__()
|
|
431
|
-
|
|
416
|
+
self.solver: PyPardisoSolver = PyPardisoSolver()
|
|
432
417
|
self.A: np.ndarray = None
|
|
433
418
|
self.b: np.ndarray = None
|
|
434
419
|
|
|
@@ -436,11 +421,7 @@ class SolverPardiso(Solver):
|
|
|
436
421
|
logger.info(f'Calling Pardiso Solver. ID={id}')
|
|
437
422
|
self.A = A
|
|
438
423
|
self.b = b
|
|
439
|
-
|
|
440
|
-
x = pardiso_solve(A, b)
|
|
441
|
-
except PyPardisoError as e:
|
|
442
|
-
print('Error Codes:')
|
|
443
|
-
print(_PARDISO_ERROR_CODES)
|
|
424
|
+
x = self.solver.solve(A, b)
|
|
444
425
|
return x, 0
|
|
445
426
|
|
|
446
427
|
## ----- DIRECT EIG SOLVERS --------------------------------------
|
|
@@ -647,6 +628,7 @@ class SolveRoutine:
|
|
|
647
628
|
self.parallel: Literal['SI','MT','MP'] = 'SI'
|
|
648
629
|
self.smart_search: bool = False
|
|
649
630
|
self.forced_solver: list[Solver] = []
|
|
631
|
+
self.disabled_solver: list[Solver] = []
|
|
650
632
|
|
|
651
633
|
self.use_sorter: bool = False
|
|
652
634
|
self.use_preconditioner: bool = False
|
|
@@ -655,6 +637,49 @@ class SolveRoutine:
|
|
|
655
637
|
def __str__(self) -> str:
|
|
656
638
|
return f'SolveRoutine({self.sorter},{self.precon},{self.iterative_solver}, {self.direct_solver})'
|
|
657
639
|
|
|
640
|
+
def _legal_solver(self, solver: Solver) -> bool:
|
|
641
|
+
"""Checks if a solver is a legal option.
|
|
642
|
+
|
|
643
|
+
Args:
|
|
644
|
+
solver (Solver): The solver to test against
|
|
645
|
+
|
|
646
|
+
Returns:
|
|
647
|
+
bool: If the solver is legal
|
|
648
|
+
"""
|
|
649
|
+
if any(isinstance(solver, solvertype) for solvertype in self.disabled_solver):
|
|
650
|
+
return False
|
|
651
|
+
return True
|
|
652
|
+
|
|
653
|
+
@property
|
|
654
|
+
def all_solvers(self) -> list[Solver]:
|
|
655
|
+
return list([solver for solver in self.solvers.values() if not isinstance(solver, EigSolver)])
|
|
656
|
+
|
|
657
|
+
@property
|
|
658
|
+
def all_eig_solvers(self) -> list[Solver]:
|
|
659
|
+
return list([solver for solver in self.solvers.values() if isinstance(solver, EigSolver)])
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
def _try_solver(self, solver_type: EMSolver) -> Solver:
|
|
663
|
+
"""Try to use the selected solver or else find another one that is working.
|
|
664
|
+
|
|
665
|
+
Args:
|
|
666
|
+
solver_type (EMSolver): The solver type to try
|
|
667
|
+
|
|
668
|
+
Raises:
|
|
669
|
+
RuntimeError: Error if no valid solver is found.
|
|
670
|
+
|
|
671
|
+
Returns:
|
|
672
|
+
Solver: The working solver.
|
|
673
|
+
"""
|
|
674
|
+
solver = self.solvers[solver_type]
|
|
675
|
+
if self._legal_solver(solver):
|
|
676
|
+
return solver
|
|
677
|
+
for alternative in self.all_solvers:
|
|
678
|
+
if self._legal_solver(alternative):
|
|
679
|
+
logger.debug(f'Falling back on legal solver: {alternative}')
|
|
680
|
+
return alternative
|
|
681
|
+
raise RuntimeError(f'No legal solver could be found. The following are disabled: {self.disabled_solver}')
|
|
682
|
+
|
|
658
683
|
def duplicate(self) -> SolveRoutine:
|
|
659
684
|
"""Creates a copy of this SolveRoutine class object.
|
|
660
685
|
|
|
@@ -667,17 +692,30 @@ class SolveRoutine:
|
|
|
667
692
|
new_routine.forced_solver = self.forced_solver
|
|
668
693
|
return new_routine
|
|
669
694
|
|
|
670
|
-
def set_solver(self, *
|
|
695
|
+
def set_solver(self, *solvers: EMSolver | EigSolver | Solver) -> None:
|
|
671
696
|
"""Set a given Solver class instance as the main solver. Solvers will be checked on validity for the given problem.
|
|
672
697
|
|
|
673
698
|
Args:
|
|
674
699
|
solver (EMSolver | Solver): The solver objects
|
|
675
700
|
"""
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
701
|
+
for solver in solvers:
|
|
702
|
+
if isinstance(solver, EMSolver):
|
|
703
|
+
self.forced_solver.append(solver.get_solver())
|
|
704
|
+
else:
|
|
705
|
+
self.forced_solver.append(solver)
|
|
706
|
+
|
|
707
|
+
def disable(self, *solvers: EMSolver) -> None:
|
|
708
|
+
"""Disable a given Solver class instance as the main solver. Solvers will be checked on validity for the given problem.
|
|
709
|
+
|
|
710
|
+
Args:
|
|
711
|
+
solver (EMSolver): The solver objects
|
|
712
|
+
"""
|
|
713
|
+
for solver in solvers:
|
|
714
|
+
if isinstance(solver, EMSolver):
|
|
715
|
+
self.disabled_solver.append(solver.get_solver().__class__)
|
|
716
|
+
else:
|
|
717
|
+
self.disabled_solver.append(solver.__class__)
|
|
718
|
+
|
|
681
719
|
def configure(self,
|
|
682
720
|
parallel: Literal['SI','MT','MP'] = 'SI', smart_search: bool = False) -> SolveRoutine:
|
|
683
721
|
"""Configure the solver with the given settings
|
|
@@ -705,6 +743,7 @@ class SolveRoutine:
|
|
|
705
743
|
self.parallel: Literal['SI','MT','MP'] = 'SI'
|
|
706
744
|
self.smart_search: bool = False
|
|
707
745
|
self.forced_solver = []
|
|
746
|
+
self.disabled_solver: list[Solver] = []
|
|
708
747
|
|
|
709
748
|
def _get_solver(self, A: lil_matrix, b: np.ndarray) -> Solver:
|
|
710
749
|
"""Returns the relevant Solver object given a certain matrix and source vector
|
|
@@ -720,6 +759,8 @@ class SolveRoutine:
|
|
|
720
759
|
|
|
721
760
|
"""
|
|
722
761
|
for solver in self.forced_solver:
|
|
762
|
+
if not self._legal_solver(solver):
|
|
763
|
+
continue
|
|
723
764
|
if isinstance(solver, Solver):
|
|
724
765
|
return solver
|
|
725
766
|
return self.pick_solver(A,b)
|
|
@@ -738,7 +779,7 @@ class SolveRoutine:
|
|
|
738
779
|
Solver: Returns the direct solver
|
|
739
780
|
|
|
740
781
|
"""
|
|
741
|
-
return self.
|
|
782
|
+
return self._try_solver(EMSolver.SUPERLU)
|
|
742
783
|
|
|
743
784
|
def _get_eig_solver(self, A: lil_matrix, b: lil_matrix, direct: bool = None) -> Solver:
|
|
744
785
|
"""Returns the relevant eigenmode Solver object given a certain matrix and source vector
|
|
@@ -973,21 +1014,21 @@ class AutomaticRoutine(SolveRoutine):
|
|
|
973
1014
|
"""
|
|
974
1015
|
N = b.shape[0]
|
|
975
1016
|
if N < 10_000:
|
|
976
|
-
return self.
|
|
1017
|
+
return self._try_solver(EMSolver.SUPERLU)
|
|
977
1018
|
if self.parallel=='SI':
|
|
978
1019
|
if _PARDISO_AVAILABLE:
|
|
979
|
-
return self.
|
|
1020
|
+
return self._try_solver(EMSolver.PARDISO)
|
|
980
1021
|
elif _UMFPACK_AVAILABLE:
|
|
981
|
-
return self.
|
|
1022
|
+
return self._try_solver(EMSolver.UMFPACK)
|
|
982
1023
|
else:
|
|
983
|
-
return self.
|
|
1024
|
+
return self._try_solver(EMSolver.SUPERLU)
|
|
984
1025
|
elif self.parallel=='MP':
|
|
985
1026
|
if _UMFPACK_AVAILABLE:
|
|
986
|
-
return self.
|
|
1027
|
+
return self._try_solver(EMSolver.UMFPACK)
|
|
987
1028
|
else:
|
|
988
|
-
return self.
|
|
1029
|
+
return self._try_solver(EMSolver.SUPERLU)
|
|
989
1030
|
elif self.parallel=='MT':
|
|
990
|
-
return self.
|
|
991
|
-
return self.
|
|
1031
|
+
return self._try_solver(EMSolver.SUPERLU)
|
|
1032
|
+
return self._try_solver(EMSolver.SUPERLU)
|
|
992
1033
|
|
|
993
1034
|
DEFAULT_ROUTINE = AutomaticRoutine()
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: emerge
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.11
|
|
4
4
|
Summary: An open source EM FEM simulator in Python
|
|
5
5
|
Project-URL: Homepage, https://github.com/FennisRobert/EMerge
|
|
6
6
|
Project-URL: Issues, https://github.com/FennisRobert/EMerge/issues
|
|
7
|
+
License-File: LICENSE
|
|
7
8
|
Requires-Python: <4.0,>=3.10
|
|
8
9
|
Requires-Dist: gmsh>=4.13.1
|
|
9
10
|
Requires-Dist: joblib>=1.5.1
|
|
10
11
|
Requires-Dist: loguru>=0.7.3
|
|
11
12
|
Requires-Dist: matplotlib>=3.8.0
|
|
13
|
+
Requires-Dist: mkl!=2024.0; platform_machine == 'x86_64' or platform_machine == 'AMD64'
|
|
12
14
|
Requires-Dist: numba-progress>=1.1.3
|
|
13
15
|
Requires-Dist: numba>=0.57.0
|
|
14
16
|
Requires-Dist: numpy<2.3,>=1.24
|
|
15
17
|
Requires-Dist: pyvista>=0.45.2
|
|
16
18
|
Requires-Dist: scipy>=1.14.0
|
|
17
|
-
Provides-Extra: pypardiso
|
|
18
|
-
Requires-Dist: pypardiso; (platform_machine == 'x86_64' or platform_machine == 'AMD64') and extra == 'pypardiso'
|
|
19
19
|
Provides-Extra: umfpack
|
|
20
20
|
Requires-Dist: scikit-umfpack; (sys_platform != 'win32') and extra == 'umfpack'
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
@@ -31,14 +31,25 @@ If you have suggestions/changes/questions either use the Github issue system or
|
|
|
31
31
|
|
|
32
32
|
## How to install
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
You can now install the basic version of emerge from PyPi!
|
|
35
35
|
```
|
|
36
|
-
pip install
|
|
36
|
+
pip install emerge
|
|
37
37
|
```
|
|
38
38
|
If you want to install the library with PyPardiso on Intel machines, you can install the optional dependency with EMerge using:
|
|
39
39
|
```
|
|
40
|
-
pip install
|
|
40
|
+
pip install emerge[pypardiso]
|
|
41
41
|
```
|
|
42
|
+
On MacOS and Linux you can install it with the very fast UMFPACK through scikit-umfpack
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
pip install emerge[scikit-umfpack]
|
|
46
|
+
```
|
|
47
|
+
On linux and MacOS with intel or AMD chips you can also include both:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
pip install emerge[scikit-umfpack, pypardiso]
|
|
51
|
+
```
|
|
52
|
+
The `scikit-umfpack` solver can be installed on Windows as well from binaries with conda. This is a bit more complicated and is described in the installation guide.
|
|
42
53
|
|
|
43
54
|
## Compatibility
|
|
44
55
|
|
|
@@ -54,7 +65,7 @@ def main():
|
|
|
54
65
|
if __name__ == "__main__":
|
|
55
66
|
main()
|
|
56
67
|
```
|
|
57
|
-
Otherwise, the parallel solver will default to SuperLU which
|
|
68
|
+
Otherwise, the parallel solver will default to SuperLU which can be slower on larger problems with a very densely connected/compact matrix.
|
|
58
69
|
|
|
59
70
|
## Required libraries
|
|
60
71
|
|
|
@@ -62,13 +73,15 @@ To run this FEM library you need the following libraries
|
|
|
62
73
|
|
|
63
74
|
- numpy
|
|
64
75
|
- scipy
|
|
65
|
-
- pypardiso
|
|
66
76
|
- gmsh
|
|
67
77
|
- loguru
|
|
68
78
|
- numba
|
|
69
79
|
- matplotlib (for the matplotlib base display)
|
|
70
80
|
- pyvista (for the PyVista base display)
|
|
71
81
|
- numba-progress
|
|
82
|
+
|
|
83
|
+
Optional:
|
|
84
|
+
- pypardiso
|
|
72
85
|
- scikit-umfpack
|
|
73
86
|
|
|
74
87
|
## NOTICE
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
emerge/__init__.py,sha256=
|
|
1
|
+
emerge/__init__.py,sha256=WnFoys_CM_EBaFBf7OprK2QJcBbhparelu1uzP8uBJY,1987
|
|
2
2
|
emerge/__main__.py,sha256=WVf16sfrOI910QWohrQDaChZdRifMNoS6VKzCT6f3ZA,92
|
|
3
3
|
emerge/cli.py,sha256=xrNPoX5VtUA0KPRRwZPxC0rGtBDKc2FF8Ro-uPuO-Hg,665
|
|
4
4
|
emerge/lib.py,sha256=usURQQhFdk5oSmcbr6AAUT50-Z-k6jnePdE3BdvUaYY,2548
|
|
@@ -14,14 +14,14 @@ emerge/_emerge/geometry.py,sha256=gWLdmkP4Sb-OHinCSuXiNw1BV7hQ8_zmo0PrcfEJXEA,16
|
|
|
14
14
|
emerge/_emerge/howto.py,sha256=63AwiLbBN0aou12qDOhWuPk7GiBmDySixv5xmRzctV8,8208
|
|
15
15
|
emerge/_emerge/logsettings.py,sha256=eq0hIikrtx4TLFx3W1qlV5CpcH2JRForQb9fi6eXXGI,144
|
|
16
16
|
emerge/_emerge/material.py,sha256=8c3bEov76xqpH1w9s3ZGZ47EuofUNjVeI_IO4RG15Rk,3879
|
|
17
|
-
emerge/_emerge/mesh3d.py,sha256=
|
|
17
|
+
emerge/_emerge/mesh3d.py,sha256=bHy3YxshTFDmzb816udcF0NfKClCHucSx7YAyfMu9cQ,29874
|
|
18
18
|
emerge/_emerge/mesher.py,sha256=cYq6AS1xUWpCrx3JCml5OCoDwNR0Z6FnFFOcH7QoSa4,12654
|
|
19
19
|
emerge/_emerge/periodic.py,sha256=s6B6-zQQ_7MZ4tNRd2a1jzTR3p-RGCW0Y97vLGwirco,9874
|
|
20
20
|
emerge/_emerge/plot.py,sha256=cf1I9mj7EIUJcq8vmANlUkqoV6QqVaJaP-zlC-T9E18,8041
|
|
21
21
|
emerge/_emerge/selection.py,sha256=HoRILOW52pJG1griLqdI5NsIEa3kwB0lsSojVcWtaBA,21087
|
|
22
|
-
emerge/_emerge/simmodel.py,sha256=
|
|
22
|
+
emerge/_emerge/simmodel.py,sha256=xlQoS1ecj7w1vXHI_X5NRpvkqDTqOSAbpt5vUIQK1-w,17300
|
|
23
23
|
emerge/_emerge/simulation_data.py,sha256=E3567Ro1YxQlidwZrc5G8IxG46Gnfy-k0wYWxckt1Iw,14128
|
|
24
|
-
emerge/_emerge/solver.py,sha256=
|
|
24
|
+
emerge/_emerge/solver.py,sha256=LjFEYMQYl1vnbVg_gd8HW5o_YhWjXHccIaJHJpX1gXU,37943
|
|
25
25
|
emerge/_emerge/system.py,sha256=p4HNz7d_LMRNE9Gk75vVdFecDH2iN_groAM9u-yQTpk,1618
|
|
26
26
|
emerge/_emerge/elements/__init__.py,sha256=I3n9aic6lJW-oGeqTEZ-Fpxvyl2i-WqsHdnrM3v1oB8,799
|
|
27
27
|
emerge/_emerge/elements/femdata.py,sha256=Gul5JJQq_gEDjFyf9RwLU-E7Aoh7hIpmrR7nL8SX4Hg,7893
|
|
@@ -44,12 +44,13 @@ emerge/_emerge/geo/pcb_tools/macro.py,sha256=ZlKDIZQTXjgklUJZVkaDa17eHIfo9ssq1jX
|
|
|
44
44
|
emerge/_emerge/mth/common_functions.py,sha256=23_5QpwvoCSTHSkRVuDJlE1ANEPMSe6hSAH56aEmcxc,1233
|
|
45
45
|
emerge/_emerge/mth/integrals.py,sha256=E-vfe21_VGlyJRhqNADdALUhXIKPrwuekTo4GwUyZGA,2702
|
|
46
46
|
emerge/_emerge/mth/optimized.py,sha256=oI3D_hUZXSUMGODMdyY9NZggV2Y7YP5Ky09ZmO4VMZ8,13710
|
|
47
|
+
emerge/_emerge/pardiso/pardiso_solver.py,sha256=u3qCr4wXmUA7MZjTCDMq_2Ho3YWjtlelUQtFuBEPe2s,19043
|
|
47
48
|
emerge/_emerge/physics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
49
|
emerge/_emerge/physics/microwave/__init__.py,sha256=QHeILGYWmvbfLl1o9wrTiWLm0evfXDgS0JiikUoMTts,28
|
|
49
50
|
emerge/_emerge/physics/microwave/adaptive_freq.py,sha256=5Ph2V4TTDjrFMeI7MI20JID9BNUNQ_ygtDSHj5Bkpmw,9736
|
|
50
51
|
emerge/_emerge/physics/microwave/microwave_3d.py,sha256=X4hR1wKpnp0BEYj7zkgnDyFgqPX4BIugJokHAeoTwQU,46966
|
|
51
|
-
emerge/_emerge/physics/microwave/microwave_bc.py,sha256=
|
|
52
|
-
emerge/_emerge/physics/microwave/microwave_data.py,sha256=
|
|
52
|
+
emerge/_emerge/physics/microwave/microwave_bc.py,sha256=ko1yCzbJgoXoQ2QYtzWblCDFkraZsbMDrW6VhtvHMxo,35585
|
|
53
|
+
emerge/_emerge/physics/microwave/microwave_data.py,sha256=jm2PZu4zjcWn6caof4y0xa5wFlFkkYZ58PTxq-1m3tY,43691
|
|
53
54
|
emerge/_emerge/physics/microwave/periodic.py,sha256=wYSUgLFVtCLqSG3EDKoCDRU93iPUzBdXzVRdHTRmbpI,3000
|
|
54
55
|
emerge/_emerge/physics/microwave/port_functions.py,sha256=aVU__AkVk8b1kH2J_oDLF5iNReCxC9nzCtesFSSSSQo,2112
|
|
55
56
|
emerge/_emerge/physics/microwave/sc.py,sha256=EjbbHEZ1zc42V0s8ItrN8jIXkrg3N5R495gfurZ2Wck,4992
|
|
@@ -63,7 +64,7 @@ emerge/_emerge/physics/microwave/assembly/robinbc.py,sha256=tJg5GzOGuNybu5qdtOuI
|
|
|
63
64
|
emerge/_emerge/plot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
65
|
emerge/_emerge/plot/display.py,sha256=akwFUOgVEZEIyY6eo05jeFgNvKXy41blwpHohAtn8OM,18247
|
|
65
66
|
emerge/_emerge/plot/grapher.py,sha256=A-FftkaKTHI405hcxP00_FQ9Z6GnvkiP6qRVosiWVcw,2596
|
|
66
|
-
emerge/_emerge/plot/simple_plots.py,sha256=
|
|
67
|
+
emerge/_emerge/plot/simple_plots.py,sha256=Sy-x1RYsNy2n9t8o34ux7Rp4--TYxvgL0uCNMRBbNEk,18544
|
|
67
68
|
emerge/_emerge/plot/matplotlib/mpldisplay.py,sha256=szKafDrgdAW5Nyc5UOHuJC87n0WGkXYackOVv182TDQ,8671
|
|
68
69
|
emerge/_emerge/plot/pyvista/__init__.py,sha256=CPclatEu6mFnJZzCQk09g6T6Fh20WTbiLAJGSwAnPXU,30
|
|
69
70
|
emerge/_emerge/plot/pyvista/display.py,sha256=PJnM5yDSYrTPT0Ts7Sia2LOkaSs8h1Mj_Gt7q9lF-i4,32908
|
|
@@ -72,7 +73,8 @@ emerge/_emerge/projects/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
|
72
73
|
emerge/_emerge/projects/_gen_base.txt,sha256=oQ1y985IeqLo4T7jmKiXLUukn2rSMXfXQS09FoYOqkk,607
|
|
73
74
|
emerge/_emerge/projects/_load_base.txt,sha256=JTAhWvHXJQYKe-aDD4HDdmE7f3VXxeurhDzwFCegrEg,511
|
|
74
75
|
emerge/_emerge/projects/generate_project.py,sha256=TNw-0SpLc82MBq0bd9hB_yqvBZCgmuPonCBsHTp91uk,1450
|
|
75
|
-
emerge-0.4.
|
|
76
|
-
emerge-0.4.
|
|
77
|
-
emerge-0.4.
|
|
78
|
-
emerge-0.4.
|
|
76
|
+
emerge-0.4.11.dist-info/METADATA,sha256=GSNdpruqnvbva-q-O6S8vae9jRXJ4JLa15TK24azZJI,2901
|
|
77
|
+
emerge-0.4.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
78
|
+
emerge-0.4.11.dist-info/entry_points.txt,sha256=8rFvAXticpKg4OTC8JEvAksnduW72KIEskCGG9XnFf8,43
|
|
79
|
+
emerge-0.4.11.dist-info/licenses/LICENSE,sha256=6tAv8fkWA_-Ell_nboaXajWH3H-vRftIr_4CU2t0S4Y,15180
|
|
80
|
+
emerge-0.4.11.dist-info/RECORD,,
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
GNU GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 2, June 1991
|
|
3
|
+
|
|
4
|
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
|
5
|
+
<https://fsf.org/>
|
|
6
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
7
|
+
of this license document, but changing it is not allowed.
|
|
8
|
+
|
|
9
|
+
Preamble
|
|
10
|
+
|
|
11
|
+
The licenses for most software are designed to take away your
|
|
12
|
+
freedom to share and change it. By contrast, the GNU General Public
|
|
13
|
+
License is intended to guarantee your freedom to share and change free
|
|
14
|
+
software--to make sure the software is free for all its users. This
|
|
15
|
+
General Public License applies to most of the Free Software
|
|
16
|
+
Foundation's software and to any other program whose authors commit to
|
|
17
|
+
using it. (Some other Free Software Foundation software is covered by
|
|
18
|
+
the GNU Lesser General Public License instead.) You can apply it to
|
|
19
|
+
your programs, too.
|
|
20
|
+
|
|
21
|
+
When we speak of free software, we are referring to freedom, not
|
|
22
|
+
price. Our General Public Licenses are designed to make sure that you
|
|
23
|
+
have the freedom to distribute copies of free software (and charge for
|
|
24
|
+
this service if you wish), that you receive source code or can get it
|
|
25
|
+
if you want it, that you can change the software or use pieces of it
|
|
26
|
+
in new free programs; and that you know you can do these things.
|
|
27
|
+
|
|
28
|
+
To protect your rights, we need to make restrictions that forbid
|
|
29
|
+
anyone to deny you these rights or to ask you to surrender the rights.
|
|
30
|
+
These restrictions translate to certain responsibilities for you if you
|
|
31
|
+
distribute copies of the software, or if you modify it.
|
|
32
|
+
|
|
33
|
+
For example, if you distribute copies of such a program, whether
|
|
34
|
+
gratis or for a fee, you must give the recipients all the rights that
|
|
35
|
+
you have. You must make sure that they, too, receive or can get the
|
|
36
|
+
source code. And you must show them these terms so they know their
|
|
37
|
+
rights.
|
|
38
|
+
|
|
39
|
+
We protect your rights with two steps: (1) copyright the software, and
|
|
40
|
+
(2) offer you this license which gives you legal permission to copy,
|
|
41
|
+
distribute and/or modify the software.
|
|
42
|
+
|
|
43
|
+
Also, for each author's protection and ours, we want to make certain
|
|
44
|
+
that everyone understands that there is no warranty for this free
|
|
45
|
+
software. If the software is modified by someone else and passed on, we
|
|
46
|
+
want its recipients to know that what they have is not the original, so
|
|
47
|
+
that any problems introduced by others will not reflect on the original
|
|
48
|
+
authors' reputations.
|
|
49
|
+
|
|
50
|
+
Finally, any free program is threatened constantly by software
|
|
51
|
+
patents. We wish to avoid the danger that redistributors of a free
|
|
52
|
+
program will individually obtain patent licenses, in effect making the
|
|
53
|
+
program proprietary. To prevent this, we have made it clear that any
|
|
54
|
+
patent must be licensed for everyone's free use or not licensed at all.
|
|
55
|
+
|
|
56
|
+
The precise terms and conditions for copying, distribution and
|
|
57
|
+
modification follow.
|
|
58
|
+
|
|
59
|
+
GNU GENERAL PUBLIC LICENSE
|
|
60
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
61
|
+
|
|
62
|
+
0. This License applies to any program or other work which contains
|
|
63
|
+
a notice placed by the copyright holder saying it may be distributed
|
|
64
|
+
under the terms of this General Public License. The "Program", below,
|
|
65
|
+
refers to any such program or work, and a "work based on the Program"
|
|
66
|
+
means either the Program or any derivative work under copyright law:
|
|
67
|
+
that is to say, a work containing the Program or a portion of it,
|
|
68
|
+
either verbatim or with modifications and/or translated into another
|
|
69
|
+
language. (Hereinafter, translation is included without limitation in
|
|
70
|
+
the term "modification".) Each licensee is addressed as "you".
|
|
71
|
+
|
|
72
|
+
Activities other than copying, distribution and modification are not
|
|
73
|
+
covered by this License; they are outside its scope. The act of
|
|
74
|
+
running the Program is not restricted, and the output from the Program
|
|
75
|
+
is covered only if its contents constitute a work based on the
|
|
76
|
+
Program (independent of having been made by running the Program).
|
|
77
|
+
Whether that is true depends on what the Program does.
|
|
78
|
+
|
|
79
|
+
1. You may copy and distribute verbatim copies of the Program's
|
|
80
|
+
source code as you receive it, in any medium, provided that you
|
|
81
|
+
conspicuously and appropriately publish on each copy an appropriate
|
|
82
|
+
copyright notice and disclaimer of warranty; keep intact all the
|
|
83
|
+
notices that refer to this License and to the absence of any warranty;
|
|
84
|
+
and give any other recipients of the Program a copy of this License
|
|
85
|
+
along with the Program.
|
|
86
|
+
|
|
87
|
+
You may charge a fee for the physical act of transferring a copy, and
|
|
88
|
+
you may at your option offer warranty protection in exchange for a fee.
|
|
89
|
+
|
|
90
|
+
2. You may modify your copy or copies of the Program or any portion
|
|
91
|
+
of it, thus forming a work based on the Program, and copy and
|
|
92
|
+
distribute such modifications or work under the terms of Section 1
|
|
93
|
+
above, provided that you also meet all of these conditions:
|
|
94
|
+
|
|
95
|
+
a) You must cause the modified files to carry prominent notices
|
|
96
|
+
stating that you changed the files and the date of any change.
|
|
97
|
+
|
|
98
|
+
b) You must cause any work that you distribute or publish, that in
|
|
99
|
+
whole or in part contains or is derived from the Program or any
|
|
100
|
+
part thereof, to be licensed as a whole at no charge to all third
|
|
101
|
+
parties under the terms of this License.
|
|
102
|
+
|
|
103
|
+
c) If the modified program normally reads commands interactively
|
|
104
|
+
when run, you must cause it, when started running for such
|
|
105
|
+
interactive use in the most ordinary way, to print or display an
|
|
106
|
+
announcement including an appropriate copyright notice and a
|
|
107
|
+
notice that there is no warranty (or else, saying that you provide
|
|
108
|
+
a warranty) and that users may redistribute the program under
|
|
109
|
+
these conditions, and telling the user how to view a copy of this
|
|
110
|
+
License. (Exception: if the Program itself is interactive but
|
|
111
|
+
does not normally print such an announcement, your work based on
|
|
112
|
+
the Program is not required to print an announcement.)
|
|
113
|
+
|
|
114
|
+
These requirements apply to the modified work as a whole. If
|
|
115
|
+
identifiable sections of that work are not derived from the Program,
|
|
116
|
+
and can be reasonably considered independent and separate works in
|
|
117
|
+
themselves, then this License, and its terms, do not apply to those
|
|
118
|
+
sections when you distribute them as separate works. But when you
|
|
119
|
+
distribute the same sections as part of a whole which is a work based
|
|
120
|
+
on the Program, the distribution of the whole must be on the terms of
|
|
121
|
+
this License, whose permissions for other licensees extend to the
|
|
122
|
+
entire whole, and thus to each and every part regardless of who wrote it.
|
|
123
|
+
|
|
124
|
+
Thus, it is not the intent of this section to claim rights or contest
|
|
125
|
+
your rights to work written entirely by you; rather, the intent is to
|
|
126
|
+
exercise the right to control the distribution of derivative or
|
|
127
|
+
collective works based on the Program.
|
|
128
|
+
|
|
129
|
+
In addition, mere aggregation of another work not based on the Program
|
|
130
|
+
with the Program (or with a work based on the Program) on a volume of
|
|
131
|
+
a storage or distribution medium does not bring the other work under
|
|
132
|
+
the scope of this License.
|
|
133
|
+
|
|
134
|
+
3. You may copy and distribute the Program (or a work based on it,
|
|
135
|
+
under Section 2) in object code or executable form under the terms of
|
|
136
|
+
Sections 1 and 2 above provided that you also do one of the following:
|
|
137
|
+
|
|
138
|
+
a) Accompany it with the complete corresponding machine-readable
|
|
139
|
+
source code, which must be distributed under the terms of Sections
|
|
140
|
+
1 and 2 above on a medium customarily used for software interchange; or,
|
|
141
|
+
|
|
142
|
+
b) Accompany it with a written offer, valid for at least three
|
|
143
|
+
years, to give any third party, for a charge no more than your
|
|
144
|
+
cost of physically performing source distribution, a complete
|
|
145
|
+
machine-readable copy of the corresponding source code, to be
|
|
146
|
+
distributed under the terms of Sections 1 and 2 above on a medium
|
|
147
|
+
customarily used for software interchange; or,
|
|
148
|
+
|
|
149
|
+
c) Accompany it with the information you received as to the offer
|
|
150
|
+
to distribute corresponding source code. (This alternative is
|
|
151
|
+
allowed only for noncommercial distribution and only if you
|
|
152
|
+
received the program in object code or executable form with such
|
|
153
|
+
an offer, in accord with Subsection b above.)
|
|
154
|
+
|
|
155
|
+
The source code for a work means the preferred form of the work for
|
|
156
|
+
making modifications to it. For an executable work, complete source
|
|
157
|
+
code means all the source code for all modules it contains, plus any
|
|
158
|
+
associated interface definition files, plus the scripts used to
|
|
159
|
+
control compilation and installation of the executable. However, as a
|
|
160
|
+
special exception, the source code distributed need not include
|
|
161
|
+
anything that is normally distributed (in either source or binary
|
|
162
|
+
form) with the major components (compiler, kernel, and so on) of the
|
|
163
|
+
operating system on which the executable runs, unless that component
|
|
164
|
+
itself accompanies the executable.
|
|
165
|
+
|
|
166
|
+
If distribution of executable or object code is made by offering
|
|
167
|
+
access to copy from a designated place, then offering equivalent
|
|
168
|
+
access to copy the source code from the same place counts as
|
|
169
|
+
distribution of the source code, even though third parties are not
|
|
170
|
+
compelled to copy the source along with the object code.
|
|
171
|
+
|
|
172
|
+
4. You may not copy, modify, sublicense, or distribute the Program
|
|
173
|
+
except as expressly provided under this License. Any attempt
|
|
174
|
+
otherwise to copy, modify, sublicense or distribute the Program is
|
|
175
|
+
void, and will automatically terminate your rights under this License.
|
|
176
|
+
However, parties who have received copies, or rights, from you under
|
|
177
|
+
this License will not have their licenses terminated so long as such
|
|
178
|
+
parties remain in full compliance.
|
|
179
|
+
|
|
180
|
+
5. You are not required to accept this License, since you have not
|
|
181
|
+
signed it. However, nothing else grants you permission to modify or
|
|
182
|
+
distribute the Program or its derivative works. These actions are
|
|
183
|
+
prohibited by law if you do not accept this License. Therefore, by
|
|
184
|
+
modifying or distributing the Program (or any work based on the
|
|
185
|
+
Program), you indicate your acceptance of this License to do so, and
|
|
186
|
+
all its terms and conditions for copying, distributing or modifying
|
|
187
|
+
the Program or works based on it.
|
|
188
|
+
|
|
189
|
+
6. Each time you redistribute the Program (or any work based on the
|
|
190
|
+
Program), the recipient automatically receives a license from the
|
|
191
|
+
original licensor to copy, distribute or modify the Program subject to
|
|
192
|
+
these terms and conditions. You may not impose any further
|
|
193
|
+
restrictions on the recipients' exercise of the rights granted herein.
|
|
194
|
+
You are not responsible for enforcing compliance by third parties to
|
|
195
|
+
this License.
|
|
196
|
+
|
|
197
|
+
7. If, as a consequence of a court judgment or allegation of patent
|
|
198
|
+
infringement or for any other reason (not limited to patent issues),
|
|
199
|
+
conditions are imposed on you (whether by court order, agreement or
|
|
200
|
+
otherwise) that contradict the conditions of this License, they do not
|
|
201
|
+
excuse you from the conditions of this License. If you cannot
|
|
202
|
+
distribute so as to satisfy simultaneously your obligations under this
|
|
203
|
+
License and any other pertinent obligations, then as a consequence you
|
|
204
|
+
may not distribute the Program at all. For example, if a patent
|
|
205
|
+
license would not permit royalty-free redistribution of the Program by
|
|
206
|
+
all those who receive copies directly or indirectly through you, then
|
|
207
|
+
the only way you could satisfy both it and this License would be to
|
|
208
|
+
refrain entirely from distribution of the Program.
|
|
209
|
+
|
|
210
|
+
If any portion of this section is held invalid or unenforceable under
|
|
211
|
+
any particular circumstance, the balance of the section is intended to
|
|
212
|
+
apply and the section as a whole is intended to apply in other
|
|
213
|
+
circumstances.
|
|
214
|
+
|
|
215
|
+
It is not the purpose of this section to induce you to infringe any
|
|
216
|
+
patents or other property right claims or to contest validity of any
|
|
217
|
+
such claims; this section has the sole purpose of protecting the
|
|
218
|
+
integrity of the free software distribution system, which is
|
|
219
|
+
implemented by public license practices. Many people have made
|
|
220
|
+
generous contributions to the wide range of software distributed
|
|
221
|
+
through that system in reliance on consistent application of that
|
|
222
|
+
system; it is up to the author/donor to decide if he or she is willing
|
|
223
|
+
to distribute software through any other system and a licensee cannot
|
|
224
|
+
impose that choice.
|
|
225
|
+
|
|
226
|
+
This section is intended to make thoroughly clear what is believed to
|
|
227
|
+
be a consequence of the rest of this License.
|
|
228
|
+
|
|
229
|
+
8. If the distribution and/or use of the Program is restricted in
|
|
230
|
+
certain countries either by patents or by copyrighted interfaces, the
|
|
231
|
+
original copyright holder who places the Program under this License
|
|
232
|
+
may add an explicit geographical distribution limitation excluding
|
|
233
|
+
those countries, so that distribution is permitted only in or among
|
|
234
|
+
countries not thus excluded. In such case, this License incorporates
|
|
235
|
+
the limitation as if written in the body of this License.
|
|
236
|
+
|
|
237
|
+
9. The Free Software Foundation may publish revised and/or new versions
|
|
238
|
+
of the General Public License from time to time. Such new versions will
|
|
239
|
+
be similar in spirit to the present version, but may differ in detail to
|
|
240
|
+
address new problems or concerns.
|
|
241
|
+
|
|
242
|
+
Each version is given a distinguishing version number. If the Program
|
|
243
|
+
specifies a version number of this License which applies to it and "any
|
|
244
|
+
later version", you have the option of following the terms and conditions
|
|
245
|
+
either of that version or of any later version published by the Free
|
|
246
|
+
Software Foundation. If the Program does not specify a version number of
|
|
247
|
+
this License, you may choose any version ever published by the Free Software
|
|
248
|
+
Foundation.
|
|
249
|
+
|
|
250
|
+
10. If you wish to incorporate parts of the Program into other free
|
|
251
|
+
programs whose distribution conditions are different, write to the author
|
|
252
|
+
to ask for permission. For software which is copyrighted by the Free
|
|
253
|
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
|
254
|
+
make exceptions for this. Our decision will be guided by the two goals
|
|
255
|
+
of preserving the free status of all derivatives of our free software and
|
|
256
|
+
of promoting the sharing and reuse of software generally.
|
|
257
|
+
|
|
258
|
+
NO WARRANTY
|
|
259
|
+
|
|
260
|
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
|
261
|
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
|
262
|
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
|
263
|
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
|
264
|
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
265
|
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
|
266
|
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
|
267
|
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
|
268
|
+
REPAIR OR CORRECTION.
|
|
269
|
+
|
|
270
|
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
271
|
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
|
272
|
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
273
|
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
|
274
|
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
|
275
|
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
|
276
|
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
|
277
|
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
278
|
+
POSSIBILITY OF SUCH DAMAGES.
|
|
279
|
+
|
|
280
|
+
END OF TERMS AND CONDITIONS
|
|
File without changes
|
|
File without changes
|