Skip to content

Commit 8f80889

Browse files
authored
Add Nedelec on prism (#96)
* remove core/ folder. Start adding prism nedelec * higher order prism nedelec * pydocstyle * fix tests and docs * don't update pip and apt * add -x to stop failing tests running forever * ++version
1 parent 28d5cff commit 8f80889

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+273
-224
lines changed

.github/workflows/coveralls.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ jobs:
1515
uses: actions/setup-python@v2
1616
with:
1717
python-version: 3.8
18-
- run: |
19-
sudo apt-get update
20-
pip install --upgrade pip
21-
name: Update apt and pip
2218
- run: |
2319
sudo apt-get install -y libeigen3-dev libopenblas-dev liblapack-dev ninja-build
2420
pip install pybind11

.github/workflows/run-tests.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ jobs:
2222
uses: actions/setup-python@v2
2323
with:
2424
python-version: ${{ matrix.python-version }}
25-
- run: |
26-
sudo apt-get update
27-
pip install --upgrade pip
28-
name: Update apt and pip
2925
- run: |
3026
pip install pytest numpy scipy coverage coveralls pytest-cov pytest-xdist
3127
name: Install test dependencies
@@ -36,7 +32,7 @@ jobs:
3632
python3 setup.py install
3733
rm -rf symfem
3834
name: Install symfem
39-
- run: python3 -m pytest -n=auto --durations=50 test/
35+
- run: python3 -m pytest -n=auto --durations=50 test/ -x
4036
name: Run unit tests
4137
- run: python3 -m pytest demo/test_demos.py
4238
name: Run demos
@@ -52,10 +48,6 @@ jobs:
5248
uses: actions/setup-python@v2
5349
with:
5450
python-version: ${{ matrix.python-version }}
55-
- run: |
56-
sudo apt-get update
57-
pip install --upgrade pip
58-
name: Update apt and pip
5951
- run: |
6052
sudo apt-get install -y libeigen3-dev libopenblas-dev liblapack-dev ninja-build
6153
pip install pybind11
@@ -83,5 +75,5 @@ jobs:
8375
sudo cmake --install build-dir
8476
pip install ./python/
8577
name: Install basix
86-
- run: python3 -m pytest -n=auto --durations=50 test/test_against_basix.py --has-basix 1
78+
- run: python3 -m pytest -n=auto --durations=50 test/test_against_basix.py --has-basix 1 -x
8779
name: Run unit tests

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2021.6.1
1+
2021.6.2

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld", "@type": "Code", "author": [{"@id": "0000-0002-4658-2443", "@type": "Person", "email": "[email protected]", "name": "Matthew Scroggs", "affiliation": "Department of Engineering, University of Cambridge"}], "identifier": "", "codeRepository": "https://github.com/mscroggs/symfem", "datePublished": "2021-01-23", "dateModified": "2021-06-13", "dateCreated": "2021-01-23", "description": "A symbolic finite element definition library", "keywords": "Python, finite element method, numerical analysis", "license": "MIT", "title": "Symfem", "version": "2021.6.1"}
1+
{"@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld", "@type": "Code", "author": [{"@id": "0000-0002-4658-2443", "@type": "Person", "email": "[email protected]", "name": "Matthew Scroggs", "affiliation": "Department of Engineering, University of Cambridge"}], "identifier": "", "codeRepository": "https://github.com/mscroggs/symfem", "datePublished": "2021-01-23", "dateModified": "2021-06-17", "dateCreated": "2021-01-23", "description": "A symbolic finite element definition library", "keywords": "Python, finite element method, numerical analysis", "license": "MIT", "title": "Symfem", "version": "2021.6.2"}

demo/custom_element.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import symfem
22
import sympy
3-
from symfem.core.finite_element import CiarletElement
4-
from symfem.core.symbolic import x
5-
from symfem.core.functionals import PointEvaluation
3+
from symfem.finite_element import CiarletElement
4+
from symfem.symbolic import x
5+
from symfem.functionals import PointEvaluation
66

77

88
class CustomElement(CiarletElement):

demo/stiffness_matrix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import symfem
2-
from symfem.core.vectors import vdot
3-
from symfem.core.calculus import grad
2+
from symfem.vectors import vdot
3+
from symfem.calculus import grad
44

55
matrix = [[0 for i in range(4)] for j in range(4)]
66

docs/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ For example, some elements are created in the following snippet:
3939
nedelec = symfem.create_element("triangle", "N2curl", 1)
4040
qcurl = symfem.create_element("quadrilateral", "Qcurl", 2)
4141
42-
`create_element` will create a :class:`symfem.core.finite_element.FiniteElement` object.
42+
`create_element` will create a :class:`symfem.finite_element.FiniteElement` object.
4343
From this object, the polynomial basis of the element can be obtained:
4444

4545
.. code-block:: python
@@ -67,9 +67,9 @@ snippet.
6767
6868
::
6969

70-
[<symfem.core.functionals.PointEvaluation object at 0x{ADDRESS}>, <symfem.core.functionals.PointEvaluation object at 0x{ADDRESS}>, <symfem.core.functionals.PointEvaluation object at 0x{ADDRESS}>]
70+
[<symfem.functionals.PointEvaluation object at 0x{ADDRESS}>, <symfem.functionals.PointEvaluation object at 0x{ADDRESS}>, <symfem.functionals.PointEvaluation object at 0x{ADDRESS}>]
7171

72-
Each functional will be a functional defined in :mod:`symfem.core.functionals`.
72+
Each functional will be a functional defined in :mod:`symfem.functionals`.
7373

7474
The basis functions spanning the finite element space can be obtained, or tabulated
7575
at a set of points:
@@ -91,7 +91,7 @@ at a set of points:
9191

9292
Reference elements
9393
------------------
94-
Reference elements can be obtained from a :class:`symfem.core.finite_element.FiniteElement`:
94+
Reference elements can be obtained from a :class:`symfem.finite_element.FiniteElement`:
9595

9696
.. code-block:: python
9797

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
author_email="[email protected]",
3636
maintainer_email="[email protected]",
3737
url="https://github.com/mscroggs/symfem",
38-
packages=["symfem", "symfem.core", "symfem.elements"],
38+
packages=["symfem", "symfem.elements"],
3939
data_files=data_files,
4040
include_package_data=True,
4141
install_requires=requirements

symfem/core/basis_function.py renamed to symfem/basis_function.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ def __getattr__(self, attr):
1818
"""Forward all other function calls to symbolic function."""
1919
return getattr(self.get_function(), attr)
2020

21-
def __rmul__(self, other):
21+
def __getitem__(self, key):
22+
"""Forward all other function calls to symbolic function."""
23+
return self.get_function()[key]
24+
25+
def __mul__(self, other):
2226
"""Multiply."""
2327
return self.get_function() * other
2428

25-
def __lmul__(self, other):
29+
def __rmul__(self, other):
2630
"""Multiply."""
27-
return self.__rmul__(other)
31+
return self.__mul__(other)
2832

2933
def __truediv__(self, other):
3034
"""Divide."""
File renamed without changes.

0 commit comments

Comments
 (0)