Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2d solver A matrix. #44

Merged
merged 53 commits into from
Dec 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
7d8f520
Initial commit
amanabt Oct 2, 2017
c613111
examples/results added in .gitignore
amanabt Oct 3, 2017
97a16a6
Pull from Quazartech master
amanabt Oct 4, 2017
6bcb54e
2d_wave_equation added.
amanabt Oct 6, 2017
54a3fb1
2d wave derivative functions documentation added
amanabt Oct 6, 2017
b3bfd82
2d wave equation documentation modified.
amanabt Oct 6, 2017
c2ed985
Unit tests, function in utils added.
amanabt Oct 6, 2017
0921daf
Unit tests for wave_equation_2d derivatives added, utils.csv_to_numpy…
amanabt Oct 6, 2017
2b98977
Travis build failing because gitignore ignoring mesh files. [FIXED]
amanabt Oct 6, 2017
521e192
dg_maxwell/tests/2d_wave_equation moved to dg_maxwell/tests/wave_equa…
amanabt Oct 6, 2017
41b389f
Jacobian for 2D wave equation added.
amanabt Oct 8, 2017
10a77e1
2D wave equation's Jacobian function unit test added[PASSING].
amanabt Oct 8, 2017
76e8e76
derivative functions now accepting arrayfire array.
amanabt Oct 8, 2017
a1c7401
Temporary commit
amanabt Oct 8, 2017
e8c135e
Temporary commit
amanabt Oct 9, 2017
49b2e39
Temporary commit
amanabt Oct 14, 2017
eb92501
cmake installation changed because apt was installing cmake3.2, cmake…
amanabt Oct 14, 2017
f882fc5
cmake installation changed because apt was installing cmake3.2, cmake…
amanabt Oct 14, 2017
2ea9f14
Minor changes
amanabt Oct 14, 2017
7ad6934
Minor changes
amanabt Oct 14, 2017
cd9ec73
apt install cmake changed to cmake3
amanabt Oct 15, 2017
1f373f1
Travis minor bugfix
amanabt Oct 15, 2017
300c80f
Pull from quazartech master
amanabt Oct 15, 2017
c3d782a
outer product Lp_Li_Lj_Lq WIP.
amanabt Oct 16, 2017
021bbd8
Bugfix for outer product function
amanabt Oct 16, 2017
4278a80
Merge from outer_product_debug. Temporary bugfix.
amanabt Oct 16, 2017
ecd7921
Tensor product assembly prototype developed.
amanabt Oct 16, 2017
30f6293
Merge from master
amanabt Oct 17, 2017
fac01f4
af backend now being set by storing a variable backend in the params …
amanabt Oct 17, 2017
a9a9993
polyval_1d function added in utils, polyval example added.
amanabt Oct 19, 2017
8a6b4db
A 3D matrix multiplication function.
amanabt Oct 19, 2017
29dd771
matmul3d added.
amanabt Oct 21, 2017
298f30f
Poly1d multiplication using convolve 1D added.
amanabt Oct 21, 2017
18c8fbc
poly1d_product function added.
amanabt Oct 21, 2017
ebb83d4
1d polynomial integration function added.
amanabt Oct 21, 2017
5794c88
2D integrate function completed.
amanabt Oct 21, 2017
90e4f16
A matrix function written.
amanabt Oct 22, 2017
a539ae6
Checked with CODACY and made suggested changes.
amanabt Oct 22, 2017
e8bfa99
removed main.py and CODACY suggestion implemented.
amanabt Oct 22, 2017
0094e2a
Trailing spaces removed from all files in the library
amanabt Oct 22, 2017
68f8083
Examples made more illustrative.
amanabt Oct 22, 2017
c490822
Removed trailing whitespaces.
amanabt Oct 22, 2017
dc05ed4
Removed trailing whitespaces.
amanabt Oct 22, 2017
3b42c3f
Removed trailing whitespaces.
amanabt Oct 22, 2017
82854a4
backend changed to cpu and removed trailing whitespaces
amanabt Oct 22, 2017
bd3c9cf
Coveralls configured
amanabt Oct 22, 2017
ef940b0
Coveralls badge added
amanabt Oct 22, 2017
55aa39b
2d_solver_A_matrix_coveralls merge
amanabt Oct 22, 2017
c6a955b
2D wave equation A matrix reference values updated.
amanabt Oct 23, 2017
488c509
print statements removed from unit tests
amanabt Oct 23, 2017
14b5805
Update README.md
amanabt Oct 23, 2017
b849954
Update README.md
amanabt Oct 23, 2017
8fb5302
Update README.md
amanabt Oct 23, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,11 @@ Thumbs.db
!examples/read_and_plot_mesh/mesh/*
!dg_maxwell/tests/mesh/*
!dg_maxwell/tests/msh_parser/mesh/*
examples/results
!docs/quazar_logo.png
!dg_maxwell/tests/wave_equation_2d/files/*

*.kate-swp

*.ipynb_checkpoints*

4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ install:

script:
- python -c "import dg_maxwell"
- pytest --verbose -r P --color=yes
- pytest --verbose -r P --color=yes --cov dg_maxwell
after_success:
- coveralls
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/QuazarTech/DG_Maxwell.svg?branch=master)](https://travis-ci.org/QuazarTech/DG_Maxwell)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e8733cdbf1454af0ac35ae5b2d017d9f)](https://www.codacy.com/app/aman2official/DG_Maxwell_2?utm_source=github.com&utm_medium=referral&utm_content=QuazarTech/DG_Maxwell&utm_campaign=Badge_Grade)
[![Documentation Status](http://readthedocs.org/projects/dg-maxwell/badge/?version=latest)](http://dg-maxwell.readthedocs.io/en/latest/?badge=latest)

[![Coverage Status](https://coveralls.io/repos/github/QuazarTech/DG_Maxwell/badge.svg?branch=master)](https://coveralls.io/github/QuazarTech/DG_Maxwell?branch=master)
```
_____ _____ __ __ _ _
| __ \ / ____| | \/ | | | |
Expand Down Expand Up @@ -67,6 +67,8 @@ solving the wave equation in a rectangular domain in the
- [arrayfire](http://arrayfire.org)
- [gmshtranslate](https://github.com/amanabt/gmshtranslator)
- [texlive](https://www.tug.org/texlive/)
- [coveralls](https://pypi.python.org/pypi/coveralls)
- [python-coveralls](https://pypi.python.org/pypi/python-coveralls/)

## Documentation
The documenation for the project can be generated using `sphinx`
Expand All @@ -79,12 +81,12 @@ The unit tests are located in the

### Dependencies
- [pytest](https://docs.pytest.org/en/latest/#)

- [pytest-cov](https://pypi.python.org/pypi/pytest-cov)
### Running Unit Tests
To run the unit tests, enter the following commands
```
$ cd path/to/the/DG_Maxwell/repo
$ pytest
$ pytest --verbose -r P --color=yes --cov dg_maxwell
```
* The parameters of the simulation are stored in params.py in
the app folder, These can be changed accordingly.
Expand Down
3 changes: 2 additions & 1 deletion dg_maxwell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-

import arrayfire as af
af.set_backend('cpu')

from dg_maxwell import params

af.set_backend(params.backend)
35 changes: 18 additions & 17 deletions dg_maxwell/isoparam.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
# -*- coding: utf-8 -*-

import arrayfire as af
af.set_backend('cpu')

from dg_maxwell import utils
from dg_maxwell import params

af.set_backend(params.backend)

def isoparam_1D(x_nodes, xi):
'''
Expand All @@ -12,27 +15,27 @@ def isoparam_1D(x_nodes, xi):

Parameters
----------

x_nodes : arrayfire.Array [2 1 1 1]
Element nodes.

xi : arrayfire.Array [N 1 1 1]
Value of :math:`\\xi` coordinate for which the corresponding
:math:`x` coordinate is to be found.

Returns
-------
x : arrayfire.Array
:math:`x` value in the element corresponding to :math:`\\xi`.
'''
N_0 = (1 - xi) / 2
N_1 = (1 + xi) / 2

N0_x0 = af.broadcast(utils.multiply, N_0, x_nodes[0])
N1_x1 = af.broadcast(utils.multiply, N_1, x_nodes[1])

x = N0_x0 + N1_x1

return x

def isoparam_x_2D(x_nodes, xi, eta):
Expand All @@ -43,7 +46,7 @@ def isoparam_x_2D(x_nodes, xi, eta):

Here :math:`P_i` corresponds to :math:`(\\xi_i, \\eta_i)` coordinates,
:math:`i \in \\{0, 1, ..., 7\\}` respectively, where,

.. math:: (\\xi_0, \\eta_0) &\equiv (-1, 1) \\\\
(\\xi_1, \\eta_1) &\equiv (-1, 0) \\\\
(\\xi_2, \\eta_2) &\equiv (-1, -1) \\\\
Expand All @@ -52,12 +55,12 @@ def isoparam_x_2D(x_nodes, xi, eta):
(\\xi_5, \\eta_5) &\equiv ( 1, 0) \\\\
(\\xi_6, \\eta_6) &\equiv ( 1, 1) \\\\
(\\xi_7, \\eta_7) &\equiv ( 0, 1)

Parameters
----------
x_nodes : np.ndarray [8]
:math:`x` nodes.

xi : float
:math:`\\xi` coordinate for which :math:`x` has to be found.

Expand All @@ -68,7 +71,6 @@ def isoparam_x_2D(x_nodes, xi, eta):
-------
x : float
:math:`x` coordinate corresponding to :math:`(\\xi, \\eta)` coordinate.

'''
N_0 = (-1.0 / 4.0) * (1 - xi) * (1 + eta) * (1 + xi - eta)
N_1 = (1.0 / 2.0) * (1 - xi) * (1 - eta**2)
Expand All @@ -95,12 +97,12 @@ def isoparam_y_2D(y_nodes, xi, eta):
'''
This function allows isoparametric mapping of a :math:`2^{nd}` order
element with :math:`8` nodes

.. math:: (P_0, P_1, P_2, P_3, P_4, P_5, P_6, P_7)

Here :math:`P_i` corresponds to :math:`(\\xi_i, \\eta_i)` coordinates,
:math:`i \in \\{0, 1, ..., 7\\}` respectively, where,

.. math:: (\\xi_0, \\eta_0) &\equiv (-1, 1) \\\\
(\\xi_1, \\eta_1) &\equiv (-1, 0) \\\\
(\\xi_2, \\eta_2) &\equiv (-1, -1) \\\\
Expand All @@ -109,12 +111,12 @@ def isoparam_y_2D(y_nodes, xi, eta):
(\\xi_5, \\eta_5) &\equiv ( 1, 0) \\\\
(\\xi_6, \\eta_6) &\equiv ( 1, 1) \\\\
(\\xi_7, \\eta_7) &\equiv ( 0, 1)

Parameters
----------
y_nodes : np.ndarray [8]
:math:`y` nodes.

xi : float
:math:`\\xi` coordinate for which :math:`y` has to be found.

Expand All @@ -125,6 +127,5 @@ def isoparam_y_2D(y_nodes, xi, eta):
-------
float
:math:`y` coordinate corresponding to :math:`(\\xi, \\eta)` coordinate.

'''
return isoparam_x_2D(y_nodes, xi, eta)
Loading