Skip to content

Commit 79b4c39

Browse files
authored
Allow discontinuous elements (#293)
* add discontinuous elements * ++version * mypy
1 parent 186f17a commit 79b4c39

File tree

10 files changed

+25
-12
lines changed

10 files changed

+25
-12
lines changed

.github/workflows/test-packages.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
python-version: ${{ matrix.python-version }}
1919
- uses: actions/checkout@v4
2020
with:
21-
ref: v2024.10.0
21+
ref: v2025.3.0
2222
name: Get latest Symfem version
2323
- run: rm -rf symfem VERSION
2424
name: Remove downloaded symfem
@@ -51,7 +51,7 @@ jobs:
5151
activate-environment: symfem
5252
- uses: actions/checkout@v4
5353
with:
54-
ref: v2024.10.0
54+
ref: v2025.3.0
5555
name: Get latest Symfem version
5656
- run: rm -rf symfem VERSION
5757
name: Remove downloaded symfem
@@ -83,15 +83,15 @@ jobs:
8383
python-version: ${{ matrix.python-version }}
8484
- uses: actions/checkout@v4
8585
with:
86-
ref: v2024.10.0
86+
ref: v2025.3.0
8787
path: symfem-src
8888
- name: Move tests and delete Symfem source
8989
run: |
9090
mv symfem-src/test .
9191
mv symfem-src/README.md .
9292
rm -r symfem-src
9393
- run: |
94-
wget -O symfem.tar.gz https://pypi.io/packages/source/s/symfem/symfem-2024.10.0.tar.gz
94+
wget -O symfem.tar.gz https://pypi.io/packages/source/s/symfem/symfem-2025.3.0.tar.gz
9595
tar -xvzf symfem.tar.gz
9696
name: Download and unpack latest version of Symfem
9797
- name: Install LaTeΧ
@@ -101,7 +101,7 @@ jobs:
101101
- run: pip install pytest
102102
name: Install pytest
103103
- run: |
104-
cd symfem-2024.10.0
104+
cd symfem-2025.3.0
105105
pip install .[optional]
106106
name: Install requirements
107107
- run: |

CHANGELOG_SINCE_LAST_VERSION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
- Correct Guzman-Neilan second kind element
44
- Add Guzman-Neilan first kind element
55
- Correct Guzman-Neilan bubbles
6+
- Add discontinuous elements

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ authors:
55
given-names: Matthew W.
66
orcid: 0000-0002-4658-2443
77
title: Symfem
8-
version: 2024.10.0
9-
date-released: 2024-10-05
8+
version: 2025.3.0
9+
date-released: 2025-03-03
1010
license: MIT
1111
url: https://github.com/mscroggs/symfem
1212
preferred-citation:

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2024 Matthew Scroggs
3+
Copyright (c) 2020-2025 Matthew Scroggs
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024.10.0
1+
2025.3.0

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": "2024-10-05", "dateCreated": "2021-01-23", "description": "A symbolic finite element definition library", "keywords": "Python, finite element method, numerical analysis", "license": "MIT", "title": "Symfem", "version": "2024.10.0"}
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": "2025-03-03", "dateCreated": "2021-01-23", "description": "A symbolic finite element definition library", "keywords": "Python, finite element method, numerical analysis", "license": "MIT", "title": "Symfem", "version": "2025.3.0"}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
44

55
[project]
66
name = "symfem"
7-
version = "2024.10.0"
7+
version = "2025.3.0"
88
description = "a symbolic finite element definition library"
99
readme = "README.md"
1010
requires-python = ">=3.8.0"

symfem/create.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import symfem.references as _references
88
from symfem.finite_element import FiniteElement as _FiniteElement
9+
from symfem.finite_element import CiarletElement as _CiarletElement
910
from symfem.geometry import SetOfPointsInput as _SetOfPointsInput
1011
from symfem.geometry import parse_set_of_points_input as _parse_set_of_points_input
1112

@@ -196,6 +197,16 @@ def create_element(
196197
raise ValueError(f"Order {order} {element_type} element cannot be created.")
197198
return element_class(reference, order, **kwargs)
198199

200+
if element_type.startswith("discontinuous "):
201+
e = create_element(cell_type, element_type[14:], order, vertices, **kwargs)
202+
if isinstance(e, _CiarletElement):
203+
for d in e.dofs:
204+
d.entity = (reference.tdim, 0)
205+
e.continuity = "L2"
206+
e.names = ["discontinuous " + i for i in e.names]
207+
208+
return e
209+
199210
raise ValueError(f"Unsupported element type: {element_type}")
200211

201212

symfem/finite_element.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ def name(self) -> str:
585585
last_updated = version
586586
cache = True
587587
value_type = "unknown"
588+
continuity: typing.Optional[str] = None
588589
_max_continuity_test_order = 4
589590

590591

symfem/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Version number."""
22

3-
version = "2024.10.0"
3+
version = "2025.3.0"

0 commit comments

Comments
 (0)