- run
pip install git+https://github.com/yoon-gu/Mozart.git
- document : http://mozart.readthedocs.io/en/latest/
-
Fork
-
Write code
for each element there are three key functions
- function to have
matrices
corresponding theelement
anddegree
:getMatrices(...)
- function to solve
pde
:solve(...)
- function to compute
error
:computeError(...)
- function to have
-
Add
docstring
for documentation. It should contain the following four things:- Description of a function
Parameters
Returns
Example
- For example
def one_dim(c4n, n4e, n4Db, f, u_D, degree = 1): """ Computes the coordinates of nodes and elements. Parameters - ``c4n`` (``float64 array``) : coordinates - ``n4e`` (``int32 array``) : nodes for elements - ``n4Db`` (``int32 array``) : Dirichlet boundary nodes - ``f`` (``lambda``) : source term - ``u_D`` (``lambda``) : Dirichlet boundary condition - ``degree`` (``int32``) : Polynomial degree Returns - ``x`` (``float64 array``) : solution Example >>> N = 3 >>> c4n, n4e = unit_interval(N) >>> n4Db = [0, N-1] >>> f = lambda x: np.ones_like(x) >>> u_D = lambda x: np.zeros_like(x) >>> from mozart.poisson.solve import one_dim >>> x = one_dim(c4n, n4e, n4Db, f, u_D) >>> print(x) array([ 0. , 0.125, 0. ]) """
-
Add test code for your code.
- Without this, you will have failure for automation test system(
codecov
). - run
cd /path/to/Mozart/
- run
nosetests
- Without this, you will have failure for automation test system(
-
Check documentation by running
cd /path/to/Mozart/
pip uninstall mozart
python setup.py install
cd /path/to/Mozart/docs
make html
(UNIX) or./make.bat html
(Windows)- Open
Mozart/docs/_build/index.html