Skip to content

yoon-gu/Mozart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT licensed Documentation Status Build Status Build status codecov Coverage Status

Mozart

Intallation

Contribution

  1. Fork

  2. Write code

    for each element there are three key functions

    1. function to have matrices corresponding the element and degree : getMatrices(...)
    2. function to solve pde : solve(...)
    3. function to compute error : computeError(...)
  3. Add docstring for documentation. It should contain the following four things:

    1. Description of a function
    2. Parameters
    3. Returns
    4. Example
    5. 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.   ])
      """
  4. Add test code for your code.

    • Without this, you will have failure for automation test system(codecov).
    • run cd /path/to/Mozart/
    • run nosetests
  5. Check documentation by running

    1. cd /path/to/Mozart/
    2. pip uninstall mozart
    3. python setup.py install
    4. cd /path/to/Mozart/docs
    5. make html(UNIX) or ./make.bat html(Windows)
    6. Open Mozart/docs/_build/index.html