feat(pythonInterface/network): added network interface from python module

This commit is contained in:
2025-06-17 11:11:19 -04:00
parent 7b173a0cb4
commit ee0c50defe
7 changed files with 186 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
from serif.network.approx8 import Approx8Network
from serif.network import NetIn
from serif.composition import Composition
comp = Composition(
["H-1", "He-3", "He-4", "C-12", "N-14", "O-16", "Ne-20", "Mg-24"]
)
comp.setMassFraction(
["H-1", "He-3", "He-4", "C-12", "N-14", "O-16", "Ne-20", "Mg-24"],
[0.708, 2.94e-5, 0.276, 0.003, 0.0011, 9.62e-3, 1.62e-3, 5.16e-4]
)
comp.finalize(True)
netIn = NetIn()
netIn.composition = comp
netIn.temperature = 1e7
netIn.density = 1e2
netIn.energy = 0.0
netIn.tMax = 3.15e17
netIn.dt0 = 1e12
net = Approx8Network()
netOut = net.evaluate(netIn)
print(netIn)
print(netOut)
print(net)