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

Creating a Cut-Plane with Results in a Dataset

This is an example of a run(scenario) script that creates and adds a cut-plane with results of mesh in a coarse-graining (cg) dataset of a scenario:

''' This scripts loads the cg_dataset of a scenario and it creates a cut-plane of a specific mesh at each timestep and it is added to the dataset'''

import iota

def run(scenario):

    ## Settings for the cut-plane generation ##
    mesh_name = 'Simulation_Domain'                           #Name of the mesh to be cut
    origin = [0,0,0]                                          #Position [X,Y,Z] for the origin of the cut-plane 
    direction = [0,0,1]                                       #Normal direction [X,Y,Z] of the cut-plane 
    ###########################################

    cg_dataset = scenario.get_cg_dataset()                    # Get the coarse-graining dataset of the scenario
    cg_data = cg.data()                                       # Load the data of the coarse-graining dataset
    NumberOfSteps = len(cg_data.timesteps())                  # Get the number of timesteps of the dataset

    for cont in range(0, 
            cg_data.add_slice(step = cont, mesh=mesh_name,            # Create and save the cut plane for all results and timesteps
                normal=iota.Vector3d(direction), origin=iota.Vector3d(origin))
PreviousImporting Multiple Datasets into different ScenariosNextCreating a New Result in a Dataset

Last updated 5 years ago

Was this helpful?