feat(pythonInterface/network): added network interface from python module
This commit is contained in:
27
tests/python/network/evaluateNetwork.py
Normal file
27
tests/python/network/evaluateNetwork.py
Normal 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)
|
||||
Reference in New Issue
Block a user