-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6c22521
Showing
20 changed files
with
9,035 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
config.json | ||
*.pyc | ||
*.log | ||
downloaded_results/* | ||
.vscode/* | ||
*.bin | ||
**aview.cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import os | ||
import time | ||
import json | ||
|
||
from rescalesim.rescalesim import Session | ||
|
||
# Get the authorization token key | ||
with open('config.json') as fid: | ||
config = json.load(fid) | ||
|
||
acf_file = os.path.join('rescale_analysis.acf') | ||
adm_file = os.path.join('rescale_analysis.adm') | ||
|
||
# Create a rescale session | ||
session = Session(config['api_token'], config['licensing']) | ||
|
||
job_results = session.get_job_details('CjmxEc') | ||
core_types = session.get_core_types() | ||
|
||
# job_id = 'xbMTEc' | ||
# Create the job | ||
job_id = session.create_adams_solver_job('api_test_job', acf_file=acf_file, adm_file=adm_file) | ||
|
||
# Submit the job | ||
response = session.submit_job(job_id) | ||
|
||
# Monitor job status | ||
while True: | ||
status = session.get_job_status(job_id)[0]['status'] | ||
print(status) | ||
if status == 'Completed': | ||
break | ||
time.sleep(5) | ||
|
||
# List the results | ||
results = session.list_job_results(job_id) | ||
|
||
# Download the results files | ||
os.makedirs(os.path.join('downloaded_results', job_id)) | ||
for file in session.list_job_results_files(job_id): | ||
(filename, file_id) = [(k, v) for k,v in file.items()][0] | ||
dst = os.path.join('downloaded_results', job_id, filename) | ||
session.download_file(file_id, dst) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
file command read file_name=rescale_model.cmd | ||
file adams_data_set write model_name=.rescale_model file_name=rescale_analysis_from_batch | ||
simulation script write_acf sim_script_name=.rescale_model.SIM_SCRIPT_1 file_name=rescale_analysis_from_batch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
file/model=rescale_analysis | ||
! Insert ACF commands here: | ||
SIMULATE/STATIC | ||
SIMULATE/DYNAMIC, END=5.0, DTOUT=1.0E-02 | ||
stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
Adams View model name: rescale_analysis | ||
! | ||
!-------------------------------- SYSTEM UNITS --------------------------------- | ||
! | ||
UNITS/ | ||
, FORCE = POUND_FORCE | ||
, MASS = POUND_MASS | ||
, LENGTH = INCH | ||
, TIME = SECOND | ||
! | ||
!----------------------------------- PARTS ------------------------------------- | ||
! | ||
!----------------------------------- Ground ------------------------------------ | ||
! | ||
! adams_view_name='ground' | ||
PART/1 | ||
, GROUND | ||
! | ||
! adams_view_name='MARKER_4' | ||
MARKER/4 | ||
, PART = 1 | ||
, QP = 0, 12, 0 | ||
! | ||
!------------------------------------ Part ------------------------------------- | ||
! | ||
! adams_view_name='PART_2' | ||
PART/2 | ||
, MASS = 40.60564164 | ||
, CM = 7 | ||
, IP = 726.1959478, 726.1959478, 65.03247294 | ||
! | ||
! adams_view_name='MARKER_1' | ||
MARKER/1 | ||
, PART = 2 | ||
, QP = 0, 12, 0 | ||
, REULER = 24.77514057D, 90D, 0D | ||
! | ||
! adams_view_name='MARKER_3' | ||
MARKER/3 | ||
, PART = 2 | ||
, QP = 0, 12, 0 | ||
! | ||
! adams_view_name='MARKER_6' | ||
MARKER/6 | ||
, PART = 2 | ||
, QP = 6, -1, 0 | ||
! | ||
! adams_view_name='cm' | ||
MARKER/7 | ||
, PART = 2 | ||
, QP = 3, 5.5, 0 | ||
, REULER = 24.77514057D, 90D, 0D | ||
! | ||
! adams_view_name='CYLINDER_1' | ||
GRAPHICS/1 | ||
, CYLINDER | ||
, CM = 1 | ||
, LENGTH = 14.31782106 | ||
, RADIUS = 1.789727633 | ||
! | ||
!------------------------------------ Part ------------------------------------- | ||
! | ||
! adams_view_name='PART_3' | ||
PART/3 | ||
, MASS = 26.71217658 | ||
, CM = 8 | ||
, IP = 85.47896506, 85.47896506, 85.47896506 | ||
! | ||
! adams_view_name='MARKER_2' | ||
MARKER/2 | ||
, PART = 3 | ||
, QP = 6, -1, 0 | ||
! | ||
! adams_view_name='MARKER_5' | ||
MARKER/5 | ||
, PART = 3 | ||
, QP = 6, -1, 0 | ||
! | ||
! adams_view_name='cm' | ||
MARKER/8 | ||
, PART = 3 | ||
, QP = 6, -1, 0 | ||
, REULER = 180D, 90D, 90D | ||
! | ||
! adams_view_name='ELLIPSOID_2' | ||
GRAPHICS/2 | ||
, ELLIPSOID | ||
, CM = 2 | ||
, XSCALE = 5.656854249 | ||
, YSCALE = 5.656854249 | ||
, ZSCALE = 5.656854249 | ||
! | ||
!-------------------------------- CONSTRAINTS ---------------------------------- | ||
! | ||
! adams_view_name='JOINT_1' | ||
JOINT/1 | ||
, REVOLUTE | ||
, I = 3 | ||
, J = 4 | ||
! | ||
! adams_view_name='JOINT_2' | ||
JOINT/2 | ||
, FIXED | ||
, I = 5 | ||
, J = 6 | ||
! | ||
!------------------------- GRAVITATIONAL ACCELERATION -------------------------- | ||
! | ||
ACCGRAV/ | ||
, JGRAV = -386.0885827 | ||
! | ||
!----------------------------- ANALYSIS SETTINGS ------------------------------- | ||
! | ||
OUTPUT/ | ||
, REQSAVE | ||
, GRSAVE | ||
! | ||
RESULTS/ | ||
, XRF | ||
! | ||
END |
Oops, something went wrong.