BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
corc.tests.test_twist_crosscheck Namespace Reference

Variables

str WORK = "/tmp"
 W
 S = StraightLine(W.length)
 F = Frame(S)
 G = ShellGenerator(W, F, 50.0, 10.0)
 B = Builder()
 angles
 features
 kind
 k0
 start
 count
 rows = B.rings[0]
list ours = []
 L = W.length
 r = W.layers[0].radius
 phi0 = W.layers[0].tapes[0].phi0
 phi1 = W.layers[0].tapes[0].phi1
 nt = count
 ns = W.s_partition_count()
 geo = os.path.join(WORK, "corc_twistcheck.geo")
 out = os.path.join(WORK, "corc_twistcheck.msh")
 res
 nodes
 elements
 tri_nodes = set()
 pts
tuple expected = (ns + 1) * (nt + 1)
float worst = 0.0
 d = np.linalg.norm(ours - p, axis=1).min()
tuple ok = expected and worst < 2e-8

Detailed Description

Independent cross-check: gmsh's own twist extrusion (screw motion,
Layers) must reproduce the analytic strip nodes of tape 0 / layer 0 for
the straight cable — same discretization, positions equal to 1e-9
(file round trip involved).

Variable Documentation

◆ angles

corc.tests.test_twist_crosscheck.angles

◆ B

corc.tests.test_twist_crosscheck.B = Builder()

◆ count

corc.tests.test_twist_crosscheck.count

◆ d

corc.tests.test_twist_crosscheck.d = np.linalg.norm(ours - p, axis=1).min()

◆ elements

corc.tests.test_twist_crosscheck.elements

◆ expected

tuple corc.tests.test_twist_crosscheck.expected = (ns + 1) * (nt + 1)

◆ F

corc.tests.test_twist_crosscheck.F = Frame(S)

◆ features

corc.tests.test_twist_crosscheck.features

◆ G

corc.tests.test_twist_crosscheck.G = ShellGenerator(W, F, 50.0, 10.0)

◆ geo

corc.tests.test_twist_crosscheck.geo = os.path.join(WORK, "corc_twistcheck.geo")

◆ k0

corc.tests.test_twist_crosscheck.k0

◆ kind

corc.tests.test_twist_crosscheck.kind

◆ L

corc.tests.test_twist_crosscheck.L = W.length

◆ nodes

corc.tests.test_twist_crosscheck.nodes

◆ ns

corc.tests.test_twist_crosscheck.ns = W.s_partition_count()

◆ nt

corc.tests.test_twist_crosscheck.nt = count

◆ ok

tuple corc.tests.test_twist_crosscheck.ok = expected and worst < 2e-8

◆ ours

corc.tests.test_twist_crosscheck.ours = []

◆ out

corc.tests.test_twist_crosscheck.out = os.path.join(WORK, "corc_twistcheck.msh")

◆ phi0

corc.tests.test_twist_crosscheck.phi0 = W.layers[0].tapes[0].phi0

◆ phi1

corc.tests.test_twist_crosscheck.phi1 = W.layers[0].tapes[0].phi1

◆ pts

corc.tests.test_twist_crosscheck.pts
Initial value:
= np.array([p for i, p in sorted(nodes.items())
if i in tri_nodes and abs(math.hypot(p[0], p[1]) - r) < 1e-6])

◆ r

corc.tests.test_twist_crosscheck.r = W.layers[0].radius

◆ res

corc.tests.test_twist_crosscheck.res
Initial value:
= subprocess.run(["gmsh", "-2", "-format", "msh22", geo, "-o", out],
capture_output=True, text=True, timeout=300)

◆ rows

corc.tests.test_twist_crosscheck.rows = B.rings[0]

◆ S

corc.tests.test_twist_crosscheck.S = StraightLine(W.length)

◆ start

corc.tests.test_twist_crosscheck.start

◆ tri_nodes

corc.tests.test_twist_crosscheck.tri_nodes = set()

◆ W

corc.tests.test_twist_crosscheck.W
Initial value:
= Winding(tapeWidth=4, gap=1, tapeThickness=100, solderThickness=10,
numTapesPerLayer=3, numLayers=1, pitch=10, numTurns=1,
delta=5, tapeResolution=0.5)

◆ WORK

str corc.tests.test_twist_crosscheck.WORK = "/tmp"

◆ worst

corc.tests.test_twist_crosscheck.worst = 0.0