Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Commit

Permalink
Cylinder mismatch (#132)
Browse files Browse the repository at this point in the history
* bug fixes to geometric primitives and bump version
  • Loading branch information
Keith Roberts authored Nov 6, 2020
1 parent 723061d commit 9107717
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,13 @@ Changelog
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## Unreleased
- None

## [3.1.3] - 2020-11-06
### Fixed
- Cylinder radius and height are now correct.
- Torus, Prism, and Cylinder now have `dim` tag.

### Improved
- More control over the `grad` option in the mesh sizing function.
Expand Down
7 changes: 5 additions & 2 deletions SeismicMesh/geometry/signed_distance_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ def eval(self, x):
class Torus:
def __init__(self, r1, r2):
"""A torus with outer radius `r1` and inner radius of `r2`"""
assert r1 > 0.0 or r2 > 0.0
assert r1 > 0.0 and r2 > 0.0
z = 2 * max(r1, r2)
self.dim = 3
self.bbox = (-2 * z, 2 * z, -2 * z, 2 * z, -2 * z, 2 * z)
self.t = (r1, r2)
self.corners = None
Expand All @@ -181,6 +182,7 @@ class Prism:
def __init__(self, b, h):
self.bbox = (-b, +b, -b, +b, -h, +h)
self.h = (b, h)
self.dim = 3
self.corners = None

def eval(self, x):
Expand All @@ -193,8 +195,9 @@ def eval(self, x):

class Cylinder:
def __init__(self, h=1.0, r=0.5):
assert h > 0.0 or r > 0.0
assert h > 0.0 and r > 0.0
sz = max(h, r)
self.dim = 3
self.bbox = (-2 * sz, 2 * sz, -2 * sz, 2 * sz, -2 * sz, 2 * sz)
self.h = (r, h)
self.corners = None
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = SeismicMesh
version = 3.1.2
version = 3.1.3
url = https://github.com/krober10nd/SeismicMesh
author = Keith Roberts
email = [email protected]
Expand Down

0 comments on commit 9107717

Please sign in to comment.