Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyframe3dd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sam Calisch
pyframe3dd
Commits
dff60341
Commit
dff60341
authored
7 years ago
by
Soma Mitra-Behura
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab:calischs/pyframe3dd
parents
d4bed6d8
b21da26f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ex/buckle.py
+16
-1
16 additions, 1 deletion
ex/buckle.py
with
16 additions
and
1 deletion
ex/buckle.py
+
16
−
1
View file @
dff60341
...
@@ -6,6 +6,18 @@ from pyframe3dd.frame3dd import write_frame3dd_file, read_lowest_mode, read_fram
...
@@ -6,6 +6,18 @@ from pyframe3dd.frame3dd import write_frame3dd_file, read_lowest_mode, read_fram
from
pyframe3dd.util
import
magnitudes
,
close
from
pyframe3dd.util
import
magnitudes
,
close
import
subprocess
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
):
def
run_frame3dd
(
args
,
nodes
,
global_args
,
beam_sets
,
constraints
,
loads
):
write_frame3dd_file
(
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
'
]
cmd
=
[
"
frame3dd
"
,
"
-i
"
,
global_args
[
'
frame3dd_filename
'
]
+
'
.csv
'
]
...
@@ -85,7 +97,7 @@ def find_stability_threshold(args):
...
@@ -85,7 +97,7 @@ def find_stability_threshold(args):
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
parser
=
argparse
.
ArgumentParser
()
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
(
'
-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
(
"
-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
"
)
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__':
...
@@ -112,6 +124,9 @@ if __name__ == '__main__':
res
=
run_simulation
(
args
)
res
=
run_simulation
(
args
)
print
"
Fundamental frequency: %.3f Hz
"
%
res
[
'
fundamental_frequency
'
]
print
"
Fundamental frequency: %.3f Hz
"
%
res
[
'
fundamental_frequency
'
]
print
"
Stress: %.3f MPa
"
%
(
res
[
'
stress
'
]
/
1e6
)
print
"
Stress: %.3f MPa
"
%
(
res
[
'
stress
'
]
/
1e6
)
elif
args
.
mode
==
'
visualize
'
:
nodes
,
rods
=
build
(
args
)
plot_connections
(
nodes
,
rods
)
else
:
else
:
assert
(
0
)
#should not be here
assert
(
0
)
#should not be here
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment