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

pyNastran 1.4.0 update #295

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get_mpi_flags():
"numpy<2.0.0",
"mpi4py>=3.1.1",
"scipy>=1.2.1",
"pynastran>=1.3.3",
"pynastran>=1.4.0",
"numba",
],
extras_require=optional_dependencies,
Expand Down
47 changes: 2 additions & 45 deletions tacs/pytacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1736,8 +1736,8 @@ def createTACSProbsFromBDF(self):
timeSteps, dscale
)
elif dloadInfo.type == "TLOAD2":
loadScales = _tload2_get_load_at_time(
dloadInfo, timeSteps, dscale
loadScales = dloadInfo.get_load_at_time(
timeSteps, dscale
)
if dloadInfo.Type != "LOAD":
self._TACSWarning(
Expand Down Expand Up @@ -2487,46 +2487,3 @@ def _createElements(self, elemCallBack):
# Default to 6
if self.varsPerNode is None:
self.varsPerNode = 6


def _tload2_get_load_at_time(tload2, time, scale=1.0):
"""
This is a function for interpolating the time series for the NASTRAN TLOAD2 card.
Usually, this would be done through pyNastran, but there's bug in its implementation
that prevents it from being run.
"""
if isinstance(time, float):
time = np.array([time])
else:
time = np.asarray(time)

if isinstance(tload2.delay, float):
tau = tload2.delay
elif tload2.delay == 0 or tload2.delay is None:
tau = 0.0
else:
tau = tload2.delay_ref.get_delay_at_time(time)

t1 = tload2.T1 + tau
t2 = tload2.T2 + tau
freq = tload2.frequency
p = tload2.phase
f = np.zeros(time.shape, dtype=time.dtype)

i = np.where(t1 <= time)[0]
j = np.where(time[i] <= t2)[0]
i = i[j]
f[i] = (
scale
* time[i] ** tload2.b
* np.exp(tload2.c * time[i])
* np.cos(2 * np.pi * freq * time[i] + p)
)

is_spcd = False
# resp = f
if tload2.Type == "VELO" and is_spcd:
f[0] = tload2.us0
if tload2.Type == "ACCE" and is_spcd:
f[0] = tload2.vs0
return f
6 changes: 3 additions & 3 deletions tests/integration_tests/test_trans_beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ class ProblemTest(PyTACSTestCase.PyTACSTest):
N_PROCS = 2 # this is how many MPI processes to use for this TestCase.

FUNC_REFS = {
"ramp_compliance": 10.917589919679486,
"ramp_compliance": 0.6911725719135957,
"ramp_x_disp": 0.06931471805599457,
"ramp_y_disp": 12.191784286714391,
"ramp_y_disp": 6.227712362945539,
"ramp_z_disp": 0.06931471805599457,
"sinusoid_compliance": 23.113858857368683,
"sinusoid_x_disp": 0.06931471805599457,
"sinusoid_y_disp": 25.47755094553053,
"sinusoid_y_disp": 25.47755094553055,
"sinusoid_z_disp": 0.06931471805599457,
}

Expand Down
Loading