flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
mac2dc.py
Go to the documentation of this file.
1"""mac2d generalised to per-cell planes (architect follow-up Q-A, 2026-10-31).
2
3Only the production configuration of mac2d: scheme 'sharp', SHARP_BASE 'facef', FCORR 'fit', DNN_W 'all'.
4Geometry goes through a geo object so that a curved interface (circle) can carry one PLIC plane per mixed
5cell, edge (node) owners, and a per-cell fit normal chosen by a rule. PlanarGeo reproduces mac2d.
6tau rules: 'band-avg' (mean over band cells among the 4), 'mixed-avg' (interfacial cells only), 'owner'.
7"""
8import os
9import sys
10import numpy as np
11import scipy.sparse as sp
12import scipy.sparse.linalg as spla
13
14sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
15import mac2d as M0 # noqa: E402
16
17GL_X, GL_W = M0.GL_X, M0.GL_W
18G8_X, G8_W = np.polynomial.legendre.leggauss(8)
19
20
21def poly_frac(phi, x0, y0, h):
22 poly = [(x0, y0), (x0 + h, y0), (x0 + h, y0 + h), (x0, y0 + h)]
23 out = []
24 for k in range(4):
25 P, Q = poly[k], poly[(k + 1) % 4]
26 fp, fq = phi(*P), phi(*Q)
27 if fp < 0:
28 out.append(P)
29 if (fp < 0) != (fq < 0):
30 w = fp / (fp - fq)
31 out.append((P[0] + w * (Q[0] - P[0]), P[1] + w * (Q[1] - P[1])))
32 if len(out) < 3:
33 return 0.0
34 A = 0.0
35 for k in range(len(out)):
36 A += out[k][0] * out[(k + 1) % len(out)][1] - out[(k + 1) % len(out)][0] * out[k][1]
37 return abs(A) / 2 / (h * h)
38
39
40def seg_frac(n, ref, s0, x0, y0, e, kern, h):
41 p0 = n[0] * (x0 - ref[0]) + n[1] * (y0 - ref[1]) - s0
42 g = n[0] * e[0] + n[1] * e[1]
43 cdf = M0.cdf_box if kern == "box" else M0.cdf_hat
44 if abs(g) < 1e-14:
45 return 1.0 if p0 < 0 else 0.0
46 ss = -p0 / g
47 F = float(cdf(ss, h))
48 return F if g > 0 else 1.0 - F
49
50
52 def __init__(self, case):
53 self.case, N, h = case, case.N, case.h
54 self.N, self.h = N, h
55 C = np.zeros((N + 2, N + 2))
56 for i in range(-1, N + 1):
57 for j in range(-1, N + 1):
58 x0, y0 = i * h, j * h
59 ph = [case.phi(x0, y0), case.phi(x0 + h, y0), case.phi(x0, y0 + h), case.phi(x0 + h, y0 + h)]
60 if max(ph) < 0:
61 C[i + 1, j + 1] = 1.0
62 elif min(ph) >= 0:
63 C[i + 1, j + 1] = 0.0
64 else:
65 C[i + 1, j + 1] = case.frac_cell(x0, y0)
66 self.Ca = C
67
68 def C(self, i, j):
69 return self.Ca[i + 1, j + 1]
70
71 def node_frac(self, i, j, e, kern):
72 return self.case.frac_line(i * self.h, j * self.h, e, kern)
73
74 def mid_frac(self, i, j, e):
75 return self.case.frac_line((i + 0.5) * self.h, (j + 0.5) * self.h, e, "box")
76
77 def node_nt(self, i, j):
78 return self.case.n, self.case.t
79
80 cell_nt = node_nt
81 fit_nt = node_nt
82
83 def owner(self, node, cells, mixed):
84 N, h = self.N, self.h
85 cand = [(ci, cj) for (ci, cj) in cells if 0 <= ci <= N - 1 and 0 <= cj <= N - 1 and mixed[ci + 1, cj + 1]]
86 if not cand:
87 cand = [(ci, cj) for (ci, cj) in cells if 0 <= ci <= N - 1 and 0 <= cj <= N - 1]
88 return min(cand, key=lambda q: (abs(self.case.phi((q[0] + 0.5) * h, (q[1] + 0.5) * h)), q))
89
90
92 """Two-layer azimuthal Stokes flow U(r) e_theta; side A = inside r < r0. 'couette': g = 0; 'poiseuille':
93 azimuthal body force g e_theta. tau(r0) = tau0, p = const, D_nn = 0."""
94
95 def __init__(self, N, cx, cy, r0, muA, muB, kind, g=1.0, tau0=1.0):
96 self.N, self.h = N, 1.0 / N
97 self.c = np.array([cx, cy])
98 self.r0, self.muA, self.muB, self.kind, self.tau0 = r0, muA, muB, kind, tau0
99 self.g = g if kind == "poiseuille" else 0.0
100 beta = -(tau0 + self.g * r0 / 3.0) * r0 ** 2 / 2.0
101 self.BA, self.BB, self.AB = beta / muA, beta / muB, 0.0
102 UB0 = -self.g * r0 ** 2 / (3 * muB) + self.BB / r0
103 self.AA = (UB0 + self.g * r0 ** 2 / (3 * muA) - self.BA / r0) / r0
104
105 def phi(self, x, y):
106 return np.hypot(x - self.c[0], y - self.c[1]) - self.r0
107
108 def U(self, r):
109 ins = r < self.r0
110 mu = np.where(ins, self.muA, self.muB)
111 A = np.where(ins, self.AA, self.AB)
112 B = np.where(ins, self.BA, self.BB)
113 return -self.g * r * r / (3 * mu) + A * r + B / r
114
115 def vel(self, x, y):
116 dx, dy = x - self.c[0], y - self.c[1]
117 r = np.hypot(dx, dy)
118 U = self.U(r)
119 return -U * dy / r, U * dx / r
120
121 def face_avg(self, comp, x0, y0, e):
122 h = self.h
123 d0, d1 = x0 - self.c[0], y0 - self.c[1]
124 b = e[0] * d0 + e[1] * d1
125 q = d0 * d0 + d1 * d1 - self.r0 ** 2
126 disc = b * b - q
127 cuts = [-0.5 * h, 0.5 * h]
128 if disc > 0:
129 for s in (-b - np.sqrt(disc), -b + np.sqrt(disc)):
130 if -0.5 * h < s < 0.5 * h:
131 cuts.append(s)
132 cuts.sort()
133 tot = 0.0
134 for k in range(len(cuts) - 1):
135 a, bb = cuts[k], cuts[k + 1]
136 sq = 0.5 * (a + bb) + 0.5 * (bb - a) * G8_X
137 v = self.vel(x0 + sq * e[0], y0 + sq * e[1])[comp]
138 tot += 0.5 * (bb - a) * np.dot(G8_W, v)
139 return tot / h
140
141 def row_force(self, comp, xf, yf):
142 if self.g == 0.0:
143 return 0.0
144 h = self.h
145 X, Y = np.meshgrid(xf + 0.5 * h * GL_X, yf + 0.5 * h * GL_X, indexing="ij")
146 W = np.outer(GL_W, GL_W) / 4.0
147 dx, dy = X - self.c[0], Y - self.c[1]
148 r = np.hypot(dx, dy)
149 f = (-dy / r) if comp == 0 else (dx / r)
150 return float(self.g * np.sum(W * f))
151
152 def cell_frac(self, x0, y0):
153 h, cx, cy, r0 = self.h, self.c[0], self.c[1], self.r0
154 bps = [x0, x0 + h]
155 for yb in (y0, y0 + h):
156 dd = r0 * r0 - (yb - cy) ** 2
157 if dd > 0:
158 for xs in (cx - np.sqrt(dd), cx + np.sqrt(dd)):
159 if x0 < xs < x0 + h:
160 bps.append(xs)
161 for xs in (cx - r0, cx + r0):
162 if x0 < xs < x0 + h:
163 bps.append(xs)
164 bps.sort()
165 tot = 0.0
166 for a, b in zip(bps[:-1], bps[1:]):
167 xs = 0.5 * (a + b) + 0.5 * (b - a) * G8_X
168 w = np.sqrt(np.maximum(r0 * r0 - (xs - cx) ** 2, 0.0))
169 L = np.clip(np.minimum(y0 + h, cy + w) - np.maximum(y0, cy - w), 0.0, None)
170 tot += 0.5 * (b - a) * np.dot(G8_W, L)
171 return tot / (h * h)
172
173
175 """PLIC plane per mixed cell: exact normal at the cell centre's closest point, offset matching C exactly.
176 Node (edge) owner: mixed cell among the 4 with the smallest |phi_J(node)|, ties in fixed offset order.
177 fitrule for non-interfacial band cells: 'nearest' | 'mean' | 'oracle'."""
178
179 def __init__(self, case, fitrule="nearest"):
180 self.case, self.fitrule = case, fitrule
181 N, h = case.N, case.h
182 self.N, self.h = N, h
183 C = np.zeros((N + 2, N + 2))
184 for i in range(-1, N + 1):
185 for j in range(-1, N + 1):
186 f = case.cell_frac(i * h, j * h)
187 C[i + 1, j + 1] = 0.0 if f < 1e-13 else (1.0 if f > 1 - 1e-13 else f)
188 self.Ca = C
189 self.pl = {}
190 for i in range(-1, N + 1):
191 for j in range(-1, N + 1):
192 f = C[i + 1, j + 1]
193 if 0.0 < f < 1.0:
194 xc, yc = (i + 0.5) * h, (j + 0.5) * h
195 n = np.array([xc - case.c[0], yc - case.c[1]])
196 n /= np.linalg.norm(n)
197 t = np.array([-n[1], n[0]])
198 ref = (xc, yc)
199 lo, hi = -0.75 * h, 0.75 * h
200 for _ in range(64):
201 s0 = 0.5 * (lo + hi)
202 fr = poly_frac(lambda x, y: n[0] * (x - ref[0]) + n[1] * (y - ref[1]) - s0, i * h, j * h, h)
203 if fr < f:
204 lo = s0
205 else:
206 hi = s0
207 self.pl[(i, j)] = (n, t, ref, 0.5 * (lo + hi))
208 self.own = {}
209 for i in range(0, N + 1):
210 for j in range(0, N + 1):
211 best, bd = None, None
212 for q in ((i - 1, j - 1), (i, j - 1), (i - 1, j), (i, j)):
213 if q in self.pl:
214 n, t, ref, s0 = self.pl[q]
215 d = abs(n[0] * (i * h - ref[0]) + n[1] * (j * h - ref[1]) - s0)
216 if bd is None or d < bd:
217 best, bd = q, d
218 self.own[(i, j)] = best
219 if best is None:
220 ph = {self.Ca[q[0] + 1, q[1] + 1] for q in ((i - 1, j - 1), (i, j - 1), (i - 1, j), (i, j))}
221 assert len(ph) == 1, "grid-aligned interface: not supported in this harness"
222 self.fn = {}
223
224 def C(self, i, j):
225 return self.Ca[i + 1, j + 1]
226
227 def node_frac(self, i, j, e, kern):
228 q = self.own[(i, j)]
229 if q is None:
230 return self.Ca[i + 1, j + 1]
231 n, t, ref, s0 = self.pl[q]
232 return seg_frac(n, ref, s0, i * self.h, j * self.h, e, kern, self.h)
233
234 def mid_frac(self, i, j, e):
235 if (i, j) not in self.pl:
236 return self.Ca[i + 1, j + 1]
237 n, t, ref, s0 = self.pl[(i, j)]
238 return seg_frac(n, ref, s0, (i + 0.5) * self.h, (j + 0.5) * self.h, e, "box", self.h)
239
240 _dummy = (np.array([1.0, 0.0]), np.array([0.0, 1.0]))
241
242 def node_nt(self, i, j):
243 q = self.own[(i, j)]
244 return self._dummy if q is None else self.pl[q][:2]
245
246 def cell_nt(self, i, j):
247 return self.pl[(i, j)][:2] if (i, j) in self.pl else self._dummy
248
249 def fit_nt(self, i, j):
250 if (i, j) in self.pl:
251 return self.pl[(i, j)][:2]
252 if (i, j) in self.fn:
253 return self.fn[(i, j)]
254 h = self.h
255 xc, yc = (i + 0.5) * h, (j + 0.5) * h
256 if self.fitrule == "oracle":
257 n = np.array([xc - self.case.c[0], yc - self.case.c[1]])
258 n /= np.linalg.norm(n)
259 elif self.fitrule == "mean":
260 s = np.zeros(2)
261 for dj in (-1, 0, 1):
262 for di in (-1, 0, 1):
263 if (i + di, j + dj) in self.pl:
264 s += self.pl[(i + di, j + dj)][0]
265 n = s / np.linalg.norm(s)
266 else:
267 best, bd = None, None
268 for dj in (-1, 0, 1):
269 for di in (-1, 0, 1):
270 q = (i + di, j + dj)
271 if q in self.pl:
272 nn, tt, ref, s0 = self.pl[q]
273 d = abs(nn[0] * (xc - ref[0]) + nn[1] * (yc - ref[1]) - s0)
274 if bd is None or d < bd:
275 best, bd = q, d
276 n = self.pl[best][0]
277 self.fn[(i, j)] = (n, np.array([-n[1], n[0]]))
278 return self.fn[(i, j)]
279
280 def owner(self, node, cells, mixed):
281 return self.own[node]
282
283
284def build(case, geo, rule="band-avg"):
285 N, h = case.N, case.h
286 m = M0.Mac(N)
287 muA, muB = case.muA, case.muB
288 ex, ey = np.array([1.0, 0.0]), np.array([0.0, 1.0])
289 Cc = geo.C
290 mu_of = lambda f: f * muA + (1 - f) * muB
291 R_of = lambda f: f / muA + (1 - f) / muB
292 lowA = muA < muB
293 mulo, muhi = (muA, muB) if lowA else (muB, muA)
294 rr = mulo / muhi
295
296 def cell_links(i, j):
297 f = Cc(i, j)
298 return [("xx", 0, 0, (m.iu(i + 1, j), m.iu(i, j)), f), ("yy", 1, 1, (m.iv(i, j + 1), m.iv(i, j)), f)]
299
300 def node_links(i, j):
301 thy = geo.node_frac(i, j, ey, "hat")
302 thx = geo.node_frac(i, j, ex, "hat")
303 return [("yu", 1, 0, (m.iu(i, j), m.iu(i, j - 1)), thy), ("xv", 0, 1, (m.iv(i, j), m.iv(i - 1, j)), thx)]
304
305 mixed = np.zeros((N + 2, N + 2), bool)
306 for i in range(-1, N + 1):
307 for j in range(-1, N + 1):
308 mixed[i + 1, j + 1] = 0.0 < Cc(i, j) < 1.0
309 band = mixed.copy()
310 for di in (-1, 0, 1):
311 for dj in (-1, 0, 1):
312 band[1:-1, 1:-1] |= mixed[1 + di:N + 1 + di, 1 + dj:N + 1 + dj]
313 tauexpr, dnnexpr = {}, {}
314
315 def tau_fit(i, j):
316 if (i, j) in tauexpr:
317 return tauexpr[(i, j)]
318 n, t = geo.fit_nt(i, j)
319 rows = []
320 for di in (-1, 0, 1):
321 for dj in (-1, 0, 1):
322 ci, cj = i + di, j + dj
323 if not (0 <= ci <= N - 1 and 0 <= cj <= N - 1):
324 continue
325 for L in cell_links(ci, cj):
326 rows.append(L)
327 for ni in range(i - 1, i + 3):
328 for nj in range(j - 1, j + 3):
329 if not (0 <= ni <= N and 0 <= nj <= N):
330 continue
331 for L in node_links(ni, nj):
332 rows.append(L)
333 A = np.zeros((len(rows), 4))
334 for r, (_, a, c, _, thA) in enumerate(rows):
335 thlo = thA if lowA else 1 - thA
336 A[r, 2 * a + c] += 1.0
337 k = (1 - thlo) * n[a] * t[c] * (rr - 1)
338 for p in range(2):
339 for q in range(2):
340 A[r, 2 * p + q] += k * (t[p] * n[q] + t[q] * n[p])
341 G = np.linalg.pinv(A)
342 wv = np.array([[t[p] * n[q] + t[q] * n[p] for q in range(2)] for p in range(2)]).ravel()
343 coef = mulo * (wv @ G)
344 nn = np.array([[n[p] * n[q] for q in range(2)] for p in range(2)]).ravel()
345 cdn = nn @ G
346 expr, dexpr = {}, {}
347 for r, (_, a, c, (ip, im), _) in enumerate(rows):
348 expr[ip] = expr.get(ip, 0.0) + coef[r] / h
349 expr[im] = expr.get(im, 0.0) - coef[r] / h
350 dexpr[ip] = dexpr.get(ip, 0.0) + cdn[r] / h
351 dexpr[im] = dexpr.get(im, 0.0) - cdn[r] / h
352 tauexpr[(i, j)] = expr
353 dnnexpr[(i, j)] = dexpr
354 return expr
355
356 def avg_over(cs):
357 e = {}
358 for cc in cs:
359 for k, v in tau_fit(*cc).items():
360 e[k] = e.get(k, 0.0) + v / len(cs)
361 return e
362
363 def tau_at(cells, node):
364 ind = [(ci, cj) for (ci, cj) in cells if 0 <= ci <= N - 1 and 0 <= cj <= N - 1]
365 if rule == "owner":
366 if node is None:
367 return tau_fit(*cells[0])
368 q = geo.owner(node, cells, mixed)
369 if q is not None and q in ind:
370 return tau_fit(*q)
371 if rule == "mixed-avg":
372 cs = [q for q in ind if mixed[q[0] + 1, q[1] + 1]]
373 if cs:
374 return avg_over(cs)
375 cs = [q for q in ind if band[q[0] + 1, q[1] + 1]]
376 if not cs:
377 cs = ind
378 return avg_over(cs)
379
380 def stress(links, beta, factor, cells_adj, nt, node):
381 n, t = nt
382 e, const = {}, 0.0
383 for (nm, a, c, (ip, im), thA) in links:
384 e[ip] = e.get(ip, 0.0) + factor * beta / h
385 e[im] = e.get(im, 0.0) - factor * beta / h
386 for (_, a, c, (ip, im), thA) in links:
387 k = factor * n[a] * t[c] * (1.0 - beta * R_of(thA))
388 if abs(k) < 1e-300 or thA in (0.0, 1.0) and abs(1.0 - beta * R_of(thA)) < 1e-12:
389 continue
390 for kk, v in tau_at(cells_adj, node).items():
391 e[kk] = e.get(kk, 0.0) + k * v
392 return e, const
393
394 def beta_cell(i, j, row):
395 return mu_of(geo.mid_frac(i, j, ey if row == "u" else ex))
396
397 def beta_node(i, j, row):
398 return mu_of(geo.node_frac(i, j, ex if row == "u" else ey, "box"))
399
400 cache = {}
401
402 def sig_cell(i, j, comp):
403 key = ("c", i, j, comp)
404 if key not in cache:
405 L = cell_links(i, j)[comp]
406 cache[key] = stress([L], beta_cell(i, j, "u" if comp == 0 else "v"), 2.0, [(i, j)], geo.cell_nt(i, j), None)
407 return cache[key]
408
409 def sig_node(i, j, row):
410 key = ("n", i, j, row)
411 if key not in cache:
412 L = node_links(i, j)
413 cache[key] = stress(L, beta_node(i, j, row), 1.0, [(i - 1, j - 1), (i, j - 1), (i - 1, j), (i, j)],
414 geo.node_nt(i, j), (i, j))
415 return cache[key]
416
417 uidx = {}
418 for i in range(N + 1):
419 for j in range(-1, N + 1):
420 if m.unknown_u(i, j):
421 uidx[m.iu(i, j)] = len(uidx)
422 for i in range(-1, N + 1):
423 for j in range(N + 1):
424 if m.unknown_v(i, j):
425 uidx[m.iv(i, j)] = len(uidx)
426 nvel = len(uidx)
427 npr = N * N
428 ntot = nvel + npr + 1
429 pid = lambda i, j: nvel + i * N + j
430 xall = np.zeros(m.nu + m.nv)
431 for i in range(N + 1):
432 for j in range(-1, N + 1):
433 xall[m.iu(i, j)] = case.face_avg(0, i * h, (j + 0.5) * h, ey)
434 for i in range(-1, N + 1):
435 for j in range(N + 1):
436 xall[m.iv(i, j)] = case.face_avg(1, (i + 0.5) * h, j * h, ex)
437 planar_f = case.force() if hasattr(case, "force") else None
438 rowf = (lambda comp, x, y: planar_f[comp]) if planar_f is not None else case.row_force
439 R, Cl, V = [], [], []
440 b = np.zeros(ntot)
441
442 def add(row, expr, const, sgn):
443 for k, v in expr.items():
444 if k in uidx:
445 R.append(row); Cl.append(uidx[k]); V.append(sgn * v)
446 else:
447 b[row] -= sgn * v * xall[k]
448 b[row] -= sgn * const
449
450 def add_J(row, ci, cj, w):
451 tau_fit(ci, cj)
452 add(row, {k: w * 2 * (muB - muA) * v for k, v in dnnexpr[(ci, cj)].items()}, 0.0, 1.0)
453
454 for i in range(N + 1):
455 for j in range(N):
456 if not m.unknown_u(i, j):
457 continue
458 r = uidx[m.iu(i, j)]
459 e, c0 = sig_cell(i, j, 0); add(r, e, c0, 1.0 / h)
460 e, c0 = sig_cell(i - 1, j, 0); add(r, e, c0, -1.0 / h)
461 e, c0 = sig_node(i, j + 1, "u"); add(r, e, c0, 1.0 / h)
462 e, c0 = sig_node(i, j, "u"); add(r, e, c0, -1.0 / h)
463 R += [r, r]; Cl += [pid(i, j), pid(i - 1, j)]; V += [-1.0 / h, 1.0 / h]
464 b[r] -= rowf(0, i * h, (j + 0.5) * h)
465 for (ci, sg) in ((i, 1.0), (i - 1, -1.0)):
466 dq = geo.mid_frac(ci, j, ey) - Cc(ci, j)
467 if abs(dq) > 1e-15:
468 add_J(r, ci, j, sg * dq / h)
469 for i in range(N):
470 for j in range(N + 1):
471 if not m.unknown_v(i, j):
472 continue
473 r = uidx[m.iv(i, j)]
474 e, c0 = sig_node(i + 1, j, "v"); add(r, e, c0, 1.0 / h)
475 e, c0 = sig_node(i, j, "v"); add(r, e, c0, -1.0 / h)
476 e, c0 = sig_cell(i, j, 1); add(r, e, c0, 1.0 / h)
477 e, c0 = sig_cell(i, j - 1, 1); add(r, e, c0, -1.0 / h)
478 R += [r, r]; Cl += [pid(i, j), pid(i, j - 1)]; V += [-1.0 / h, 1.0 / h]
479 b[r] -= rowf(1, (i + 0.5) * h, j * h)
480 for (cj, sg) in ((j, 1.0), (j - 1, -1.0)):
481 dq = geo.mid_frac(i, cj, ex) - Cc(i, cj)
482 if abs(dq) > 1e-15:
483 add_J(r, i, cj, sg * dq / h)
484 for i in range(N):
485 for j in range(N):
486 r = pid(i, j)
487 div = {m.iu(i + 1, j): 1.0 / h, m.iu(i, j): -1.0 / h, m.iv(i, j + 1): 1.0 / h, m.iv(i, j): -1.0 / h}
488 add(r, div, 0.0, 1.0)
489 R.append(r); Cl.append(ntot - 1); V.append(1.0)
490 R.append(ntot - 1); Cl.append(r); V.append(1.0)
491 A = sp.csr_matrix((V, (R, Cl)), shape=(ntot, ntot))
492 return A, b, uidx, xall
493
494
495def solve_err(case, geo, rule="band-avg"):
496 A, b, uidx, xall = build(case, geo, rule)
497 x = spla.spsolve(A.tocsc(), b)
498 ex = np.array([xall[k] for k in uidx])
499 err = np.abs(x[: len(uidx)] - ex)
500 scale = np.max(np.abs(ex))
501 return float(err.max() / scale), float(err.mean() / scale)
__init__(self, N, cx, cy, r0, muA, muB, kind, g=1.0, tau0=1.0)
Definition mac2dc.py:95
row_force(self, comp, xf, yf)
Definition mac2dc.py:141
cell_frac(self, x0, y0)
Definition mac2dc.py:152
face_avg(self, comp, x0, y0, e)
Definition mac2dc.py:121
phi(self, x, y)
Definition mac2dc.py:105
vel(self, x, y)
Definition mac2dc.py:115
node_nt(self, i, j)
Definition mac2dc.py:242
fit_nt(self, i, j)
Definition mac2dc.py:249
node_frac(self, i, j, e, kern)
Definition mac2dc.py:227
mid_frac(self, i, j, e)
Definition mac2dc.py:234
C(self, i, j)
Definition mac2dc.py:224
__init__(self, case, fitrule="nearest")
Definition mac2dc.py:179
cell_nt(self, i, j)
Definition mac2dc.py:246
C(self, i, j)
Definition mac2dc.py:68
mid_frac(self, i, j, e)
Definition mac2dc.py:74
node_frac(self, i, j, e, kern)
Definition mac2dc.py:71
node_nt(self, i, j)
Definition mac2dc.py:77
__init__(self, case)
Definition mac2dc.py:52
poly_frac(phi, x0, y0, h)
Definition mac2dc.py:21
seg_frac(n, ref, s0, x0, y0, e, kern, h)
Definition mac2dc.py:40
solve_err(case, geo, rule="band-avg")
Definition mac2dc.py:495
build(case, geo, rule="band-avg")
Definition mac2dc.py:284
Definition owner.py:1
static constexpr double U