MCPcopy Create free account
hub / github.com/Cantera/cantera / test_misc

Method test_misc

test/python/test_reactor.py:2912–2932  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2910 r.component_index("fail")
2911
2912 def test_misc(self):
2913 class DummyReactor(ct.ExtensibleReactor):
2914 def __init__(self, gas):
2915 super().__init__(gas)
2916 self.sync_calls = 0
2917
2918 def after_species_index(self, name):
2919 # This will cause returned species indices to be higher by 5 than they
2920 # would be otherwise
2921 return 5
2922
2923 def before_sync_state(self):
2924 self.sync_calls += 1
2925
2926 r = DummyReactor(self.gas)
2927 net = ct.ReactorNet([r])
2928 assert r.component_index("H2") == 5 + 3 + self.gas.species_index("H2")
2929 r.syncState()
2930 net.advance(1)
2931 r.syncState()
2932 assert r.sync_calls == 2
2933
2934 def test_RHS_LHS(self):
2935 # set initial state

Callers

nothing calls this directly

Calls 4

advanceMethod · 0.95
DummyReactorClass · 0.85
ReactorNetMethod · 0.45
syncStateMethod · 0.45

Tested by

no test coverage detected