Iota Python API
1.0.0
1.0.0
  • Introduction
  • Getting started with Iota Python Library and Iota IPython Terminal
    • Starting a Session
    • Creating a New Project
    • Loading a Project
    • Creating a New Scenario
    • Loading a Scenario
    • Importing a Dataset
    • Running Coarse-graining
  • Writing Scripts
    • Generic Scripts
    • Run(scenario) Scripts
  • Running Scripts
    • Running Generic Scripts
    • Running run(scenario) Scripts
  • Iota Python Reference Library
    • Datasets
    • Graphs
    • Scene renderer
    • Meshing
    • Variable types
    • Session
    • Project
    • Scenario
    • Graph
    • Dataset
    • Mesh
    • Script
    • File
    • Auxiliar
    • Enums
  • Examples
    • Creating a New Project
    • Creating a New Scenario
    • Creating Multiple Scenarios
    • Loading a Project and a Scenario
    • Importing a Dataset into a Scenario
    • Importing Multiple Datasets into different Scenarios
    • Creating a Cut-Plane with Results in a Dataset
    • Creating a New Result in a Dataset
    • Calculating a KPI and Exporting into a Graph
    • Getting the Profile of Result along a Line
    • Creating Multiple Result Line Variations and Plotting them in a Single Graph
    • Integrating a Result over a Mesh
    • Getting the Evolution of the Statistics of a Result
    • Creating Multiple Screenshots of a Dataset
    • Creating Multiple Videos of a Dataset
    • Cloninig Settings and Running Coarse-graining for Multiple Scenarios
    • Automating EDEM Simulations runs and Iota Analyses
Powered by GitBook
On this page

Was this helpful?

  1. Examples

Importing Multiple Datasets into different Scenarios

This is an example of a script that create multiple scenarios and for each scenario a EDEM 2017+ simulation is imported into it. As part of the importing process, the temporal evolution graphs of the reaction force and torque for each geometry present in EDEM simulation is created and saved into each scenario:

''' This scripts starts a new session, loads the project "Backhoe optimization", creates new scenarios based on 
a list of names of scenarios and for each of them a EDEM simulation is imported into it. Also, the reaction force 
and torque graphs are calculated and saved into each scenario during the import dataset'''

import sys                              
import os
import iota
sys.path.append(os.getenv('IOTA_PATH'))                                         # Add iota directory to Python paths

username = 'stephen'                                                            # Set Iota username
home_path = 'C:/Users/stephen/'                                                 # Set user's home directory

ListOfScenarios = ['Design Alpha', 'Design Beta', 'Design Gamma']               # List of names for the scenarios
ListOfEDEMfiles = ['C:/Users/stephe/Backhoe_simulations/Design Alpha.dem',      # List of EDEM simulations files
    'C:/Users/stephe/Backhoe_simulations/Design Beta.dem',
        'C:/Users/stephe/Backhoe_simulations/Design Gamma.dem'] 


my_session = iota.session(username,home_path + 'ParticleAnalytics/config.ini')  # Start new session

my_new_project = my_session.get_project('Backhoe optimization')                 # Load the project "Backhoe optimization"        

for scenario_name, EDEM_file in zipe(ListOfScenarios, ListOfEDEMfiles):         # For each pair (scenario name, EDEM file)

    my_new_scenario = my_new_project.add_scenario(name=scenario_name)           # Create a new scenario

    EDEM_dataset, graphs = my_new_scenario.import_dataset(file = EDEM_file, 
    name = scenario_name, data_format = 'EDEM 2017', include_graphs = True)  # Import the EDEM simulation and reaction force & torque graphs
PreviousImporting a Dataset into a ScenarioNextCreating a Cut-Plane with Results in a Dataset

Last updated 5 years ago

Was this helpful?