Skip to content

Commit

Permalink
added usage to docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
RemDelaporteMathurin committed Oct 17, 2023
1 parent 53cf12d commit f13d3d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions festim/boundary_conditions/dirichlet_bc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ class DirichletBC:
species (str): the name of the species
value_fenics (fem.Function or fem.Constant): the value of the boundary condition in
fenics format
Usage:
>>> from festim import DirichletBC
>>> DirichletBC(subdomain=my_subdomain, value=1, species="H")
>>> DirichletBC(subdomain=my_subdomain, value=lambda x: 1 + x[0], species="H")
>>> DirichletBC(subdomain=my_subdomain, value=lambda t: 1 + t, species="H")
>>> DirichletBC(subdomain=my_subdomain, value=lambda T: 1 + T, species="H")
>>> DirichletBC(subdomain=my_subdomain, value=lambda x, t: 1 + x[0] + t, species="H")
"""

def __init__(self, subdomain, value, species) -> None:
Expand Down
8 changes: 8 additions & 0 deletions festim/boundary_conditions/sieverts_bc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ class SievertsBC(F.DirichletBC):
S_0 (float or fem.Constant): the Sieverts constant pre-exponential factor (H/m3/Pa0.5)
E_S (float or fem.Constant): the Sieverts constant activation energy (eV)
pressure (float or callable): the pressure at the boundary (Pa)
Usage:
>>> from festim import SievertsBC
>>> SievertsBC(subdomain=my_subdomain, S_0=1e-6, E_S=0.2, pressure=1e5, species="H")
>>> SievertsBC(subdomain=my_subdomain, S_0=1e-6, E_S=0.2, pressure=lambda x: 1e5 + x[0], species="H")
>>> SievertsBC(subdomain=my_subdomain, S_0=1e-6, E_S=0.2, pressure=lambda t: 1e5 + t, species="H")
>>> SievertsBC(subdomain=my_subdomain, S_0=1e-6, E_S=0.2, pressure=lambda T: 1e5 + T, species="H")
>>> SievertsBC(subdomain=my_subdomain, S_0=1e-6, E_S=0.2, pressure=lambda x, t: 1e5 + x[0] + t, species="H")
"""

def __init__(self, subdomain, S_0, E_S, pressure, species) -> None:
Expand Down

0 comments on commit f13d3d7

Please sign in to comment.