Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/codecov_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
- name: Install package
run: python -m pip install -e .[test]

- name: Install system dependencies (BLAS)
run: sudo apt-get update && sudo apt-get install -y libblas3 liblapack3

- name: Generate Report
run: |
pip install coverage
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
- name: Install package
run: python -m pip install -e .[test]

- name: Install system dependencies (BLAS)
run: sudo apt-get update && sudo apt-get install -y libblas3 liblapack3

- name: Test package
run: python -m pytest

Expand Down Expand Up @@ -63,6 +66,9 @@ jobs:
- name: Install package
run: python -m pip install -e .[test]

- name: Install system dependencies (BLAS)
run: sudo apt-get update && sudo apt-get install -y libblas3 liblapack3

- name: Generate Report
run: |
pip install coverage
Expand Down
2 changes: 1 addition & 1 deletion src/ospgrillage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ospgrillage.static import *
from ospgrillage.utils import *
from ospgrillage.mesh import *
from ospgrillage.load import *
from ospgrillage.material import *
Expand Down
74 changes: 38 additions & 36 deletions src/ospgrillage/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,35 +667,32 @@ def _define_patch_edge_lines(self):
# create equation of plane from four straight lines

# create interpolate object f
p = np.array(
[
[self.load_point_1.p, self.load_point_2.p],
[self.load_point_3.p, self.load_point_4.p],
]
)

x = np.array(
[
[self.load_point_1.x, self.load_point_2.x],
[self.load_point_3.x, self.load_point_4.x],
self.load_point_1.x,
self.load_point_2.x,
self.load_point_3.x,
self.load_point_4.x,
]
)
z = np.array(
[
[self.load_point_1.z, self.load_point_2.z],
[self.load_point_3.z, self.load_point_4.z],
self.load_point_1.z,
self.load_point_2.z,
self.load_point_3.z,
self.load_point_4.z,
]
)

# create function to get interpolation of p
self.patch_mag_interpolate = interpolate.interp2d(x, z, p)
mod_list = [ls for ls in self.point_list if ls is not None]
self.patch_min_dim = min(
p = np.array(
[
get_distance(p1, p2)
for (p1, p2) in zip(mod_list, mod_list[1:] + [mod_list[0]])
if all([p1 is not None, p2 is not None])
self.load_point_1.p,
self.load_point_2.p,
self.load_point_3.p,
self.load_point_4.p,
]
)

elif self.load_point_4 is None:
# update line 3
self.line_3 = LineLoading(
Expand All @@ -704,35 +701,28 @@ def _define_patch_edge_lines(self):

# TODO create equation of plane from 3 points
# create interpolate object f
p = np.array(
[
[self.load_point_1.p, self.load_point_2.p],
[self.load_point_3.p, self.load_point_4.p],
]
)
x = np.array(
[
[self.load_point_1.x, self.load_point_2.x],
[self.load_point_3.x, self.load_point_4.x],
self.load_point_1.x,
self.load_point_2.x,
self.load_point_3.x,
]
)
z = np.array(
[
[self.load_point_1.z, self.load_point_2.z],
[self.load_point_3.z, self.load_point_4.z],
self.load_point_1.z,
self.load_point_2.z,
self.load_point_3.z,
]
)

# create function to get interpolation of p
self.patch_mag_interpolate = interpolate.interp2d(x, z, p)
mod_list = [ls for ls in self.point_list if ls is not None]
self.patch_min_dim = min(
p = np.array(
[
get_distance(p1, p2)
for (p1, p2) in zip(mod_list, mod_list[1:] + [mod_list[0]])
if all([p1 is not None, p2 is not None])
self.load_point_1.p,
self.load_point_2.p,
self.load_point_3.p,
]
)

elif self.load_point_8 is not None:
# TODO
# point 1 2 3
Expand All @@ -745,6 +735,18 @@ def _define_patch_edge_lines(self):
raise ValueError(
"Patch load points for patch load {} not valid".format(self.name)
)
# create function to get interpolation of p
self.patch_mag_interpolate = interpolate.LinearNDInterpolator(
list(zip(x, z)), p
)
mod_list = [ls for ls in self.point_list if ls is not None]
self.patch_min_dim = min(
[
get_distance(p1, p2)
for (p1, p2) in zip(mod_list, mod_list[1:] + [mod_list[0]])
if all([p1 is not None, p2 is not None])
]
)


# ---------------------------------------------------------------------------------------------------------------
Expand Down
10 changes: 6 additions & 4 deletions src/ospgrillage/members.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# if TYPE_CHECKING:
# from material import Material
g = 9.81
mm = 1e3


def create_section(**kwargs):
Expand Down Expand Up @@ -233,7 +235,7 @@ def __init__(
self.section_command_flag = False #

# determine mass from section area and material density
self.mass = self.section.A * self.material.density
self.mass = self.section.A * self.material.density * mm # kg/mm
elif any(
[
self.section.op_ele_type == "ShellMITC4",
Expand Down Expand Up @@ -423,7 +425,7 @@ def get_element_command_str(
ele_str = None
if self.section.op_ele_type == "ElasticTimoshenkoBeam":
section_input = self.get_member_prop_arguments(ele_width)
ele_str = 'ops.element("{type}", {tag}, *{node_tag_list}, *{memberprop}, {transftag}, {mass})\n'.format(
ele_str = 'ops.element("{type}", {tag}, *{node_tag_list}, *{memberprop}, {transftag},"-mass", {mass})\n'.format(
type=self.section.op_ele_type,
tag=ele_tag,
node_tag_list=node_tag_list,
Expand All @@ -433,7 +435,7 @@ def get_element_command_str(
)
elif self.section.op_ele_type == "elasticBeamColumn":
section_input = self.get_member_prop_arguments(ele_width)
ele_str = 'ops.element("{type}", {tag}, *{node_tag_list}, *{memberprop}, {transftag}, {mass})\n'.format(
ele_str = 'ops.element("{type}", {tag}, *{node_tag_list}, *{memberprop}, {transftag}, "-mass", {mass})\n'.format(
type=self.section.op_ele_type,
tag=ele_tag,
node_tag_list=node_tag_list,
Expand All @@ -442,7 +444,7 @@ def get_element_command_str(
mass=self.mass,
)
elif self.section.op_ele_type == "nonlinearBeamColumn":
ele_str = 'ops.element("{type}",{tag},*{node_tag_list},{num_int_pt},{sectag},{transftag},{mass})\n'.format(
ele_str = 'ops.element("{type}",{tag},*{node_tag_list},{num_int_pt},{sectag},{transftag},"-mass", {mass})\n'.format(
type=self.section.op_ele_type,
tag=ele_tag,
node_tag_list=node_tag_list,
Expand Down
6 changes: 3 additions & 3 deletions src/ospgrillage/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""
import math

from ospgrillage.static import *
from ospgrillage.utils import *
from collections import namedtuple


Expand Down Expand Up @@ -1486,7 +1486,7 @@ def _get_geo_transform_tag(self, ele_nodes: list, offset=None):
node_i = self.node_spec[ele_nodes[0]]["coordinate"]
node_j = self.node_spec[ele_nodes[1]]["coordinate"]
vxz = self._get_vector_xz(node_i, node_j)
vxz = [np.round(num, decimals=self.decimal_lim) for num in vxz]
vxz = [np.round(num, decimals=self.decimal_lim).tolist() for num in vxz]
tag_value = self.transform_dict.setdefault(
repr(vxz) + "|" + repr(offset), self.transform_counter + 1
)
Expand Down Expand Up @@ -2178,7 +2178,7 @@ def _get_geo_transform_tag(self, ele_nodes, offset=None):
global_offset_i = [a + b for a, b in zip(node_i, local_offset)]
global_offset_j = [a - b for a, b in zip(node_j, local_offset)]
global_offset = [global_offset_i, global_offset_j]
vxz = [np.round(num, decimals=self.decimal_lim) for num in vxz]
vxz = [np.round(num, decimals=self.decimal_lim).tolist() for num in vxz]
tag_value = self.transform_dict.setdefault(
repr(vxz) + "|" + repr(global_offset), self.transform_counter + 1
)
Expand Down
Loading