Skip to content

Commit

Permalink
ufl exp instead of np
Browse files Browse the repository at this point in the history
  • Loading branch information
RemDelaporteMathurin committed Oct 19, 2023
1 parent 6c74969 commit fd3b0ef
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions test/test_reaction.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest
import festim as F
import numpy as np
from dolfinx.fem import FunctionSpace, Function
from dolfinx.mesh import create_unit_cube
from mpi4py import MPI
from ufl import exp


def test_reaction_init():
Expand Down Expand Up @@ -88,16 +88,12 @@ def test_reaction_reaction_term(temperature):

# test the reaction term at a given temperature
def arrhenius(pre, act, T):
return pre * np.exp(-act / (F.k_B * T))
return pre * exp(-act / (F.k_B * T))

k = arrhenius(reaction.k_0, reaction.E_k, temperature)
p = arrhenius(reaction.p_0, reaction.E_p, temperature)
expected_reaction_term = (
k * species1.solution * species2.solution - p * product.solution
)
print(expected_reaction_term)
print(reaction.reaction_term(temperature))
from dolfinx import __version__

print(__version__)
assert reaction.reaction_term(temperature) == expected_reaction_term

0 comments on commit fd3b0ef

Please sign in to comment.