Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Sam Calisch
pyframe3dd
Commits
dff60341
Commit
dff60341
authored
Nov 06, 2017
by
Soma Mitra-Behura
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab:calischs/pyframe3dd
parents
d4bed6d8
b21da26f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
ex/buckle.py
ex/buckle.py
+16
-1
No files found.
ex/buckle.py
View file @
dff60341
...
...
@@ -6,6 +6,18 @@ from pyframe3dd.frame3dd import write_frame3dd_file, read_lowest_mode, read_fram
from
pyframe3dd.util
import
magnitudes
,
close
import
subprocess
def
plot_connections
(
nodes
,
connect
):
#for debug only, this is slow!
import
matplotlib
as
mpl
from
mpl_toolkits.mplot3d
import
Axes3D
import
numpy
as
np
import
matplotlib.pyplot
as
plt
fig
=
plt
.
figure
()
ax
=
fig
.
gca
(
projection
=
'3d'
)
for
seg
in
connect
:
ax
.
plot
(
nodes
[
seg
,
0
],
nodes
[
seg
,
1
],
nodes
[
seg
,
2
],
c
=
'g'
)
plt
.
show
()
def
run_frame3dd
(
args
,
nodes
,
global_args
,
beam_sets
,
constraints
,
loads
):
write_frame3dd_file
(
nodes
,
global_args
,
beam_sets
,
constraints
,
loads
)
cmd
=
[
"frame3dd"
,
"-i"
,
global_args
[
'frame3dd_filename'
]
+
'.csv'
]
...
...
@@ -85,7 +97,7 @@ def find_stability_threshold(args):
if
__name__
==
'__main__'
:
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'-M'
,
'--mode'
,
choices
=
(
'simulate'
,
'search'
),
required
=
True
)
parser
.
add_argument
(
'-M'
,
'--mode'
,
choices
=
(
'simulate'
,
'search'
,
'visualize'
),
required
=
True
)
parser
.
add_argument
(
'-Q'
,
'--quiet'
,
action
=
'store_true'
,
help
=
'Whether to suppress frame3dd output'
)
parser
.
add_argument
(
"-f"
,
"--force"
,
type
=
double
,
default
=
1
,
help
=
"force to apply"
)
parser
.
add_argument
(
"-fr"
,
"--force_res"
,
type
=
double
,
default
=
.
01
,
help
=
"Final resolution of force for search mode"
)
...
...
@@ -112,6 +124,9 @@ if __name__ == '__main__':
res
=
run_simulation
(
args
)
print
"Fundamental frequency: %.3f Hz"
%
res
[
'fundamental_frequency'
]
print
"Stress: %.3f MPa"
%
(
res
[
'stress'
]
/
1e6
)
elif
args
.
mode
==
'visualize'
:
nodes
,
rods
=
build
(
args
)
plot_connections
(
nodes
,
rods
)
else
:
assert
(
0
)
#should not be here
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment