Project
Methods
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
if project.exists_scenario('my_scenario'):
print('scenario exist')scenario = project.get_scenario(name='my_scenario')for scenario in project.get_scenarios():
print('scenario: {}'.format(scenario.name))new_scenario = project.add_scenario(
name = 'scenario 01',
description = 'simulation mixing analysis with speeed = 30 RPM'
)dataset = project.get_dataset(
name = 'mixing_rpm_30',
data_format = 'PADEM'
)print('List of datasets in the project')
for dataset in project.get_datasets():
print('dataset: {} (format: {})'.format(dataset.name,dataset.data_format))project.add_dataset(
name = 'mixing_rpm_32',
data_format = 'PADEM',
file = '/path/to/my/dataset/mixing_rpm_32.meta',
description = 'mixing analysis with drum speed of 32 RPM'
)project.import_dataset(
file = '/path/to/my/edem/dataset/simulation.dem',
name = 'mixing_rpm_34',
data_format = 'EDEM 2017',
include_graphs = True,
description = 'mixing analysis with drum speed of 34 RPM'
)exists_graph = project.exists_graph(
name = 'Reaction Force',
tags = {
'dataset': 'mixing_rpm_34'
}
)
if exists_graph:
print('graph exist!')graph = project.get_graph(
name = 'Reaction Force',
tags = {
'dataset': 'mixing_rpm_34'
}
)print('List of graphs:')
for graph in project.get_graphs():
print('Graph: {}'.format(graph.name))x_values = iota.ArrayFloat([0,1,2,3,4,5,6])
average_force = iota.ArrayFloat(len(x_values),10.0)
graph = project.add_graph(
name = 'Average Force',
title = 'Average Force',
xtitle = 'Step',
xdata = x_values,
ytitle = 'Force',
legend = ['Force'],
ydata = [average_force],
tags = {
'dataset': 'mixing_rpm_34'
},
overwrite = True
)
graph2 = project.add_graph(
name = 'Average Torque',
csvfile = '/path/to/my/graph/torque.csv',
tags = {
'dataset': 'mixing_rpm_34'
}
)mesh_record = project.get_mesh(
name = 'mixing_drum_v02'
)print('List of meshes:')
for mesh in project.get_meshes():
print(' mesh: {}'.format(mesh.name))project.add_mesh(
file = '/path/to/my/mesh/mixing_drum_v2.stl',
description = 'Mixing drum with inclinantion of 30 degrees'
)file = project.get_file(
name = 'list of values test 2'
)print('List of files:')
for file in project.get_files():
print(' file: {}'.format(file.name))project.add_file(
name = 'my text file',
filepath= '/path/to/my/file/text.txt',
description='this file contains the summary of parameters used for the simulations'
)script_file = project.get_script(
name = 'calculate mixing index'
)print('List of scripts:')
for script in project.get_scripts():
print(' script: {}'.format(script.name))project.add_script(
name = 'calculate mixing index',
filepath = '/path/to/my/scripts/calculate_mixing_index.py',
description = 'This script calculate the Lacey mixing index using binning'
)project.add_video(
file = '/path/to/my/videos/mixer_rpm_32_velocity_X.mp4',
name = 'Mixer at 32 RPM',
description = 'This video shows the velocity profile in X direction for the case with drum speed at 32 RPM',
tags = {
'dataset': 'mixer_rpm_32',
'result': 'Velocity (X)'
}
)project.add_video(
file = '/path/to/my/images/mixer_rpm_32_velocity-Y_time3.42.png',
name = 'Mixer at 32 RPM',
description = 'Velocity profile in Y direction for the case with drum speed at 32 RPM. Time = 3.42s',
tags = {
'dataset': 'mixer_rpm_32',
'result': 'Velocity (Y)',
'timestep': '3.42'
}
)name = project.name
project.delete()
if not session.exist_project(name):
print('project removed')