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

Improvements to skfem.io.meshio #680

Merged
merged 33 commits into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1a57b1f
Add support for exporting cell_sets
kinnala Aug 3, 2021
c8d0610
Add flags for writing facets and converting to/from integer data
kinnala Aug 4, 2021
f68c697
Fix flake8
kinnala Aug 4, 2021
3c46d6e
Workaround for a bug in meshio
kinnala Aug 4, 2021
d09de69
Simplify and test using gmsh22
kinnala Aug 5, 2021
ba563dd
Encode subdomains/boundaries as cell_data during export
kinnala Aug 6, 2021
c62c81c
Write tags using point_data for Paraview visualization
kinnala Aug 6, 2021
507b310
Fix flake8
kinnala Aug 6, 2021
84e136b
Add a new test dependency
kinnala Aug 6, 2021
679bfde
Simplifications
kinnala Aug 6, 2021
44a16a4
Do not encode subdomains as vertex data; it's already in cell data
kinnala Aug 6, 2021
d0a8de6
Test point_data export
kinnala Aug 6, 2021
8f107f6
Add a changelog entry
kinnala Aug 6, 2021
ed0b867
Encode boundaries to point_data and subdomains to cell_data
kinnala Aug 8, 2021
d0febca
Fix flake8
kinnala Aug 8, 2021
70c49d1
Update changelog
kinnala Aug 8, 2021
fd31db8
Add docstring
kinnala Aug 8, 2021
6e28603
Make methods private
kinnala Aug 8, 2021
bde7545
Make more robust
kinnala Aug 9, 2021
1a95eec
Use the approach from #681
kinnala Aug 9, 2021
b86e7c7
Shorter tags, support and test internal facet sets
kinnala Aug 9, 2021
9878700
Fix the case with no boundaries/subdomains and add tests
kinnala Aug 9, 2021
d7d5d40
Optionally export mesh data
kinnala Aug 9, 2021
f7220bc
Add a changelog entry
kinnala Aug 9, 2021
5540c68
Remove unused lines from ex28 and modify the license accordingly
kinnala Aug 9, 2021
07d9486
Move subdomain/boundary encoding to Mesh class
kinnala Aug 9, 2021
503eeb5
Fix test
kinnala Aug 9, 2021
90fe988
Fix changelog entry
kinnala Aug 9, 2021
6c49c78
Update docstrings
kinnala Aug 10, 2021
2297b2f
Change dict to list
kinnala Aug 10, 2021
509db9a
Fix bug
kinnala Aug 10, 2021
79f5729
just load Path
gdmcbain Aug 11, 2021
0fef727
Merge pull request #685 from gdmcbain/load-path-no-need-to-cast-to-str
kinnala Aug 11, 2021
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
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright 2018-21 scikit-fem developers

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 changes: 0 additions & 55 deletions LICENSE.md

This file was deleted.

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ with respect to documented and/or tested features.

### Unreleased

- Added: `Mesh.save`/`Mesh.load` now exports/imports `Mesh.subdomains` and
`Mesh.boundaries`
- Added: `Mesh.load` now optionally writes any mesh data to a list passed via
the keyword argument `out`
- Added: `Mesh.with_boundaries` now allows the definition of internal boundaries/interfaces
via the flag `boundaries_only=False`

### [3.2.0] - 2021-08-02

- Added: `ElementTriCCR` and `ElementTetCCR`, conforming Crouzeix-Raviart finite elements
Expand Down
74 changes: 1 addition & 73 deletions docs/examples/ex28.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
r"""Conjugate heat transfer.

.. note::
This example requires the external package
`pygmsh <https://pypi.org/project/pygmsh/>`_.

The forced convection example can be extended to conjugate heat transfer by
giving a finite thickness and thermal conductivity to one of the walls.

Expand Down Expand Up @@ -54,24 +50,6 @@
14th International Conference on Heat Transfer, Fluid Mechanics and
Thermodynamics, Wicklow, Ireland.

License
-------

Copyright 2018-2020 scikit-fem developers

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

"""
from packaging import version
from pathlib import Path
Expand All @@ -85,10 +63,6 @@
from matplotlib.pyplot import subplots
import numpy as np

import pygmsh


geometrycontext = pygmsh.geo.Geometry()

halfheight = 1.
length = 10.
Expand All @@ -98,53 +72,7 @@

peclet = 357.


def make_mesh(halfheight: float, # mm
length: float,
thickness: float) -> MeshTri:
with geometrycontext as geom:

points = []
lines = []

lcar = halfheight / 2 ** 2

for xy in [(0., halfheight),
(0., -halfheight),
(length, -halfheight),
(length, halfheight),
(0., -halfheight - thickness),
(length, -halfheight - thickness)]:
points.append(geom.add_point([*xy, 0.], lcar))

lines.append(geom.add_line(*points[:2]))
geom.add_physical(lines[-1], 'fluid-inlet')

lines.append(geom.add_line(*points[1:3]))

lines.append(geom.add_line(*points[2:4]))
geom.add_physical(lines[-1], 'fluid-outlet')

lines.append(geom.add_line(points[3], points[0]))

geom.add_physical(geom.add_plane_surface(geom.add_curve_loop(lines)),
'fluid')

lines.append(geom.add_line(points[1], points[4]))
geom.add_physical(lines[-1], 'solid-inlet')

lines.append(geom.add_line(*points[4:6]))
geom.add_physical(lines[-1], 'heated')

lines.append(geom.add_line(points[5], points[2]))
geom.add_physical(lines[-1], 'solid-outlet')

geom.add_physical(geom.add_plane_surface(geom.add_curve_loop(
[*lines[-3:], -lines[1]])), 'solid')

return from_meshio(geom.generate_mesh(dim=2))

mesh = from_file(Path(__file__).parent / 'meshes' / 'ex28.json')
mesh = Mesh.load(Path(__file__).parent / 'meshes' / 'ex28.msh')
element = ElementTriP1()
basis = {
'heat': Basis(mesh, element),
Expand Down
1 change: 0 additions & 1 deletion docs/examples/meshes/ex28.json

This file was deleted.

Binary file added docs/examples/meshes/ex28.msh
Binary file not shown.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ flake8
dmsh
sphinx
sphinx_rtd_theme
h5py
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ project_urls =
long_description = file: README.md
long_description_content_type = text/markdown
license = BSD-3-Clause
license_file = LICENSE.md
license_file = LICENSE
classifiers =
Intended Audience :: Science/Research
Operating System :: OS Independent
Expand Down
Loading