Skip to content

Commit

Permalink
Merge pull request GazzolaLab#98 from armantekinalp/97_warning_mass_m…
Browse files Browse the repository at this point in the history
…oment_inertia

update: warning for too small mass moment inertia
  • Loading branch information
armantekinalp committed Dec 22, 2021
2 parents 2ce9808 + dee22d6 commit 1fd6ea8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions elastica/rod/factory_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ def allocate(
mass_second_moment_of_inertia_temp[i, :],
)
# sanity check of mass second moment of inertia
for k in range(n_elements):
for i in range(0, MaxDimension.value()):
assert mass_second_moment_of_inertia[i, i, k] > Tolerance.atol()
if (mass_second_moment_of_inertia < Tolerance.atol()).all():
message = "Mass moment of inertia matrix smaller than tolerance, please check provided radius, density and length."
warnings.warn(message, category=UserWarning)

# Inverse of second moment of inertia
inv_mass_second_moment_of_inertia = np.zeros(
Expand Down

0 comments on commit 1fd6ea8

Please sign in to comment.