Skip to content

Commit

Permalink
Merge pull request #17 from ccaprani/dsdfix
Browse files Browse the repository at this point in the history
Fixed DSD scaling for small nodal displacements
  • Loading branch information
ccaprani authored Mar 6, 2024
2 parents eb696a9 + b3b0e72 commit e1c23ab
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 74 deletions.
9 changes: 0 additions & 9 deletions ospgrid/__init__.py

This file was deleted.

66 changes: 59 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,65 @@
[build-system]
requires = ["setuptools >= 64.0",
"oldest-supported-numpy"]
build-backend = "setuptools.build_meta"

[project]
name = "ospgrid"
dynamic = ["version"]
description = "2D grid analysis wrapper for OpenSeesPy"
license = {text = "GNU General Public License v3.0"}
keywords = ["grid","finite element","bridge"]
authors = [{name = "Colin Caprani", email = "[email protected]"}]
classifiers = [
"Development Status :: 4 - Beta",
"Topic :: Scientific/Engineering",
"Environment :: Console",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3 :: Only",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
requires-python = ">=3.8"
dependencies = [
"matplotlib",
"numpy",
"openseespy>=3.3",
"opsvis>=1.0.12",
]

[build-system]
requires = ["wheel >= 0.31.0",
"setuptools >= 48",
"twine>= 1.11.0",
"oldest-supported-numpy",
]
build-backend = "setuptools.build_meta"
[project.readme]
file = "README.md"
content-type = "text/markdown"

[project.urls]
Homepage = "https://ccaprani.github.io/ospgrid/"
Documentation = "https://ccaprani.github.io/ospgrid/"
Source = "https://github.com/ccaprani/ospgrid/"
Tracker = "https://github.com/ccaprani/ospgrid/issues/"

[project.optional-dependencies]
test = ["pytest >= 6.2.2"]

[tool.setuptools]
platforms = ["any"]
include-package-data = true
license-files = ["LICENSE"]

[tool.setuptools.dynamic]
version = {attr = "ospgrid.__version__"}

[tool.distutils.bdist_wheel]
universal = 1

[tool.aliases]
test = "pytest"

[tool.pytest.ini_options]
minversion = "6.0"
Expand Down
54 changes: 0 additions & 54 deletions setup.cfg

This file was deleted.

9 changes: 9 additions & 0 deletions src/ospgrid/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""
ospgrid - A plane grid elastic analysis wrapper for OpenSeesPy
"""

__version__ = "0.5.2"

from .grid import *
from .utils import *
from .post import *
9 changes: 5 additions & 4 deletions ospgrid/grid.py → src/ospgrid/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,10 +833,11 @@ def plot_dsd(
y = [n.y for n in self.nodes]
grid_size = max(max(x) - min(x), max(y) - min(y))

# in case of very small values
max_disp = max(max_disp, 1e-9)
# target about 1/3 the dimension of the grid
sf = 0.33 * grid_size / max_disp
# in case of very small nodal values
max_disp = ospv.max_u_abs_from_beam_defo_interp_3d(max_disp,nep=17)

# target about 1/4 the dimension of the grid
sf = 0.25 * grid_size / max_disp
# But round to some sensible values
mag = 10 ** int(np.ceil(np.log10(sf)))
scale_factor = round(10 * sf / mag) * mag / 10
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit e1c23ab

Please sign in to comment.