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
  • Methods
  • __init__(filename, [mode])
  • name()
  • software()
  • type()
  • reader_format()
  • timesteps()
  • timestep_exists(timestep, mesh)
  • timesteps_count(mesh)
  • result_max(result, analysis)
  • result_min(result, analysis)
  • result_type(result, analysis)
  • results([mesh])
  • results_count(mesh)
  • result_exists(step, mesh, result, analysis)
  • get_result_component(step, mesh, result, analysis, component)
  • get_result_min(step,mesh,result,analysis)
  • get_result_max(step,mesh,result,analysis)
  • get_result_component_minmax(step,mesh,result,analysis,component)
  • get_result_info(result,analysis)
  • get_result_interpreter(result,analysis)
  • get_result_legend(result,analysis,component)
  • get_result_legends(result,analysis)
  • get_result_type(result,analysis)
  • get_result(step,mesh,result,analysis)
  • mesh_type(mesh)
  • meshes()
  • get_mesh(mesh,step)
  • get_mesh_vertices(mesh,step)
  • get_mesh_info(mesh)
  • get_particles_mesh(step,mesh,variable)
  • point_evolution(mesh,point,result,analysis,component,[step])
  • statistics_evolution(mesh,result,analysis,component,[step],[data])
  • line_variation(mesh,point_start,point_end,num_points,result,analysis,component,step,[x_type])
  • mesh_integral(mesh,result,analysis,component,[step])
  • set_name(name)
  • add_dem_mesh(step,mesh,[name])
  • add_mesh(step,mesh)
  • add_result(step,mesh,result,analsis,data)
  • add_slice()
  • add_timestep(timestep)
  • delete_mesh(mesh)
  • delete_mesh_finished()

Was this helpful?

  1. Iota Python Reference Library

Datasets

PreviousIota Python Reference LibraryNextGraphs

Last updated 5 years ago

Was this helpful?

iota.Dataset()

Description

Iota Dataset object.

Methods

Methods

Dataset constructor

Arguments

  • filename: (str) file path of the dataset (extension .meta required)

  • mode: (IO_Type) access mode: WRITE or READ_ONLY. (Default: iota.IO_Type.WRITE)

Example

my_dataset = iota.Dataset(
    filename = 'C:\Users\particle\Desktop\my_new_dataset.meta',
    mode = iota.IO_Type.WRITE
)

Get dataset name Return the name as a string

Example

name = my_dataset.name()
print(name)

Get dataset software

Example

dataset_software = my_dataset.software()
print(dataset_software)

Get dataset type Returns a value of type iota.DatasetType

Example

dataset_type = my_dataset.type()
print(dataset_type)

Get dataset reader format Returns the internal reader format as string

Example

dataset_reader_format = my_dataset.reader_format()
print(dataset_reader_format)

Get the list of timesteps Returns a list of string that contains the timesteps of the dataset

Example

dataset_timesteps = my_dataset.timesteps()
print(dataset_timesteps)

Checks for the existsence of a timestep on a given mesh Returns a boolean value True if timestep exists, or False otherwise

Arguments

  • timestep : (int) timestep index to be checked

  • mesh : (str) name of the mesh to be checked

Example

mesh_exists_at_timestep = my_dataset.timestep_exists(0,'my_mesh')
print(mesh_exists_at_timestep)

Get the number of timesteps for a given mesh Returns the number of timesteps as an integer

Arguments

  • mesh : (str) name of the mesh

Example

Number_timesteps_for_mesh = my_dataset.timesteps_count('my_mesh')
print(Number_timesteps_for_mesh)

Get maximum global value for pair (result,analysis) for the whole simulation dataset Returns a value of type equal to the result type

Arguments

  • result : (str) name of the result

  • analysis : (str) name of the analysis

Example

result_max = my_dataset.result_max('Density','none')
print(result_max)

Get minimum global value for pair (result,analysis) for the whole simulation dataset Returns a value of type equal to the result type

Arguments

  • result : (str) name of the result

  • analysis : (str) name of the analysis

Example

result_min = my_dataset.result_min('Density','none')
print(result_min)

Get type of the result pair (result,analysis) Returns a value of type iota.ResultType representing the type

Arguments

  • result : (str) name of the result

  • analysis : (str) name of the analysis

Example

result_type = my_dataset.result_max('Density','none')
print(result_type)

Get the list of all results in the dataset for all the meshes, or for a specific mesh Returns a list of strings if no mesh defined, of a list of (string,string) pairs with result name and analysis if a mesh is defined

Arguments

  • mesh : (str) name of the mesh (Default: None)

Example

results_list = my_dataset.results()
print(results_list)

result_list_mesh = my_dataset.results('my_mesh')
print(results_list_mesh)

Get the number of results for for a specific mesh Returns an integer that corresponds to the number of results for the specified mesh

Arguments

  • mesh : (str) name of the mesh

Example

Number_results_mesh = my_dataset.results_count('my_mesh')
print(Number_results_mesh)

Check for the existence of a result on a given timestep and mesh

Arguments

  • step : (int) timestep index

  • mesh : (str) mesh name

  • result : (str) result name

  • analysis : (str) analysis name

Example

result_exists = my_dataset(0,'my_mesh','Density','none')
print(result_exists)

Get a list of values per vertex/particle of a specific result,analysis and component Returns a value of type iota.ArrayXX representing the values of result component. If component is iota.ALL_COMPONENTS, all components of the result are returned. Otherwise, an iota.ArrayFloat is returned

Arguments

  • step : (int) timestep index

  • mesh : (str) mesh name

  • result : (str) result name

  • analysis : (str) analysis name

Example

result_component_values = my_dataset.get_result_component(1,'my_mesh','Velocity','none',2)
print(result_component_values)

Get minimum result value for a given step, mesh, result and analysis Returns a value of type equal to the result

Arguments

  • step : (int) timestep index

  • mesh : (str) mesh name

  • result : (str) result name

  • analysis : (str) analysis name

Example

result_min_value = my_dataset.get_result_min(1,'my_mesh','Velocity','none')
print(result_min_value)

Get maximum result value for a given step, mesh, result and analysis Returns a value of type equal to the result type

Arguments

  • step : (int) timestep index

  • mesh : (str) mesh name

  • result : (str) result name

  • analysis : (str) analysis name

Example

result_max_value = my_dataset.get_result_max(1,'my_mesh','Velocity','none')
print(result_max_value)

Get a result array for a given step, mesh ad result/analysis, including min and max values Returns a tuple (iota.ArrayXX, min_value, max_value), where XX is a Float or Int depending on the result type

Arguments

  • step : (int) timestep index

  • mesh : (str) mesh name

  • result : (str) result name

  • analysis : (str) analysis name

  • component : (int) component index

Example

result_min_max = my_dataset.get_result_component_minmax(1,'my_mesh','Velocity','none',2)
print(result_min_max)

Get information of a given result Returns a dictionary containing: type, name, analysis and list of meshes

Arguments

  • result : (str) result name

  • analysis : (str) analysis name

Example

result_info = my_dataset.result_info('Velocity','none')
print(result_info)

Get the list of component labels for a given result/analysis

  • result : (str) result name

  • analysis : (str) analysis name

Example

result_interpreter = my_dataset.result_interpreter('Velocity','none')
print(result_interpreter)

Get the legend of the result as shown in the colorbar of result screenshot/animation Returns the string used as label for a given result/analysis, including result name, component and units (if available). If component is iota.ALL_COMPONENTS, a list with legend for each component is returned

  • result : (str) result name

  • analysis : (str) analysis name

  • component : (int) component index

Example

result_legend = my_dataset.result_legend('Velocity','none',0)
print(result_legend)
  • result : (str) result name

  • analysis : (str) analysis name

Example

result_legends = my_dataset.result_legends('Velocity','none')
print(result_legends)

Get result type Returns a variable of type iota.ResultType

  • result : (str) result name

  • analysis : (str) analysis name

Example

result_type = my_dataset.get_result_type('Velocity','none')
print(result_type)

Get values of a result for a given step, mesh, result and analysis Returns an iota.ArrayXX where XX is a Float or Int depending on the result type

Arguments

  • step : (int) timestep index

  • mesh : (str) mesh name

  • result : (str) result name

  • analysis : (str) analysis name

Example

result_values = my_dataset.get_result(5,'my_mesh','Velocity','none')

Get type of a mesh in the dataset Returns a variable of type iota.MeshType

Arguments

  • mesh : (str) mesh name

Example

mesh_type = my_dataset.mesh_type('my_mesh')
print(mesh_type)

Get the list of meshes in the dataset Returns a list of strings representing the name of the meshes

Example

meshes_name = my_dataset.meshes()
print(meshes_name)

Get a mesh for a given step in the dataset Returns a variable of type iota.mesh.Mesh

Arguments

  • mesh : (str) mesh name

  • step : (int) timestep index

Example

mesh = my_dataset.get_mesh('my_mesh',0)
print(mesh)

Get the vertices of a mesh vertices for a given step in the dataset Returns an array containing the position of each vertex in the mesh

Arguments

  • mesh : (str) mesh name

  • step : (int) timestep index

Example

mesh_vertices = my_dataset.get_mesh_vertices('my_mesh',0)
print(mesh_vertices)

Get the information on a specific mesh Returns a dictionary containing the variables name, type and dynamic

Arguments

  • mesh : (str) mesh name

Example

mesh_info = my_dataset.get_mesh_info('my_mesh')
print(mesh_info)

Get the value of an attribute/variable for a given step and particle mesh Returns an array of values representing for the given attribute/variable: position, orientation, type, group, labels or spheres

Arguments

  • step : (int) timestep index

  • mesh : (str) particles mesh name

  • variable : (str) attribute name: position, orientation, type, group, labels or spheres

Example

particle_mesh_variable = my_dataset.get_particles_mesh(3,'my_particles_mesh','position')

Get the value of a result/analysis in a given point for one or all timesteps Returns a pair (iota.ArrayFloat,list[iota.ArrayFloat]),where the first element is the array of values representing the timesteps and the second one is the list of result arrays per component

Arguments

  • mesh : (str) mesh name

  • point : (iota.Vector3d) point to evaluate the result

  • result : (str) result name

  • analysis : (str) analysis name

  • component : (int) component index

  • step : (int) timestep index (Default: iota.ALL_STEPS)

Example

x, y = my_dataset.statistics_evolution('my_mesh',iota.Vector3d(0,0.1,0.5),'Velocity','none',3,step=iota.ALL_STEPS)
print(x)
print(y)

Get the evolution of different statistical variables for a given mesh/result/analsys Returns a pair (iota.ArrayFloat,list[iota.ArrayFloat]),where the first element is the array of values representing the timesteps and the second one is the list of result arrays per variable

Arguments

  • mesh : (str) mesh name

  • result : (str) result name

  • analysis : (str) analysis name

  • component : (int) component index

  • step : (int) timestep index (Default: iota.ALL_STEPS)

  • data : (list[str]) list of statistical values to be evaluated: min, max, mean, stdev, median, cov (Default: [])

Example

x, y = my_dataset.statistics_evolution('my_mesh','Velocity','none',3,step=iota.ALL_STEPS,data=['min','max', 'mean'])
print(x)
print(y)

Get the results evaluated in a give line through a mesh Returns a pair (iota.ArrayFloat,list[iota.ArrayFloat]),where the first element is the array of values representing the point/positions in the line and the second one is the list of result arrays per component

Arguments

  • mesh : (str) mesh name

  • point_start : (iota.Vector3d) point representing the start of the line

  • point_end : (iota.Vector3d) point representing the end of the line

  • num_points : (int) number of points in the line to evaluate the result

  • result : (str) result name

  • analysis : (str) analysis name

  • component : (int) component index

  • step : (int) timestep index

  • x_type : (str) variable to be used in the x axis of the graph: 'x', 'y', 'z', 'dist' (Default: 'dist')

Example

x, y = my_dataset.line_variation('my_mesh',iota.Vector3d(0,0,0),iota.Vector3d(0,0,2.5),50,'Velocity','none',3,5,'z')
print(x)
print(y)

Get the volume/area integral of a result/analysis over a given mesh Returns a pair (iota.ArrayFloat,list[iota.ArrayFloat]),where the first element is the array of values representing the timesteps and the second one is the list of result arrays per component

Arguments

  • mesh : (str) mesh name

  • result : (str) result name

  • analysis : (str) analysis name

  • component : (int) component index

  • step : (int) timestep index (Default: iota.ALL_STEPS)

Example

x, y = my_dataset.mesh_integral('my_mesh','Velocity','none',3,step=5)
print(x)
print(y)

Sets the name of the dataset

Arguments

  • name : (str) new name of the dataset

Example

my_dataset.set_name('new name')
print(my_dataset.name())

Adds a mesh of particles (DEM) to a existing step in the dataset

Arguments

  • step : (int) timestep index

  • mesh : (iota.mesh.DEM_Mesh) particle (DEM) mesh class

  • name : (str) mesh name (Default: 'particles')

Example

my_dataset.add_dem_mesh(0,my_DEM_particles_mesh)

Adds a mesh to a existing step in the dataset

Arguments

  • step : (int) timestep index or iota.STATIC_MESH if the mesh to be added is static

  • mesh : (iota.mesh.Mesh) mesh to be added to the dataset

Examples

my_dataset.add_mesh(5, my_mesh)
my_dataset.add_mesh(iota.STATIC_MESH, my_static_mesh)

Adds a result to a existing mesh and step in the dataset

Arguments

  • step : (int) timestep index

  • mesh : (str) mesh name

  • result : (str) result name

  • analysis : (str) analysis name

  • data : (iota.ArrayXX) array of results to be added to dataset

Example

my_dataset.add_result(5,'my_mesh','my_new_result','none', my_new_result_data)

Creates a mesh slice/cut-plane defined by a pair of vectors (origin,normal) representing the plane and it is added to the dataset as new mesh

Arguments

  • mesh : (str) name of the mesh to be cut

  • normal : (iota.Vector3d) vector representing the normal direction to define the slice/cut-plane

  • origin : (iota.Vector3d) vector contained in the slice/cut-plane plane

  • result : (str) name of an existing result in the dataset to be interpolated on the slice/cut-plane. If empty, all results in the dataset are included (Default: '')

  • analysis : (str) name of the analysis of an existing result in the dataset. If empty, all analysis are included (Default: '')

  • step : (int) timestep index (Default: iota.ALL_STEPS)

Examples

my_dataset.add_slice('my_mesh',iota.Vector3d(0,0,1), iota.Vector3d(0,0,0),'Velocity','none')
my_dataset.add_slice('my_mesh',iota.Vector3d(0,0,1), iota.Vector3d(0,0,0),'Velocity','none', 3)

Adds a new timestep to the dataset

Arguments

  • timestep : (str) timestep to be added

Example

my_dataset.add_timestep('15.65')
print(my_dataset.timesteps())

Deletes a mesh from the dataset

Arguments

  • mesh : (str) mesh name

Example

my_dataset.delete_mesh('my_mesh')

Check of a mesh deletion process have finished Returns a pair (bool,str) with the status of the process. If process finished correctly, the boolean is True and message empty. In case of error, the error message is added as the second element of the pair

Example

status, msg = my_dataset.delete_mesh_finished()
print(status, msg)

Get list of result legends to shown in graph/animation for a given result/analysis Returns a list of strings representing the labels per component. Equivalent to

__init__
name
software
type
reader_format
timesteps
timestep_exists
timestep_count
result_max
result_min
result_type
results
results_count
result_exists
get_result_component
get_result_min
get_result_max
get_result_component_minmax
get_result_info
get_result_interpreter
get_result_legend
get_result_legends
get_result_type
get_result
mesh_type
meshes
get_mesh
get_mesh_vertices
get_mesh_info
get_particles_mesh
point_evolution
statistics_evolution
line_variation
mesh_integral
set_name
add_dem_mesh
add_mesh
add_result
add_slice
add_timestep
delete_mesh
delete_mesh_finished
__init__(filename, [mode])
name()
software()
type()
reader_format()
timesteps()
timestep_exists(timestep, mesh)
timesteps_count(mesh)
result_max(result, analysis)
result_min(result, analysis)
result_type(result, analysis)
results([mesh])
results_count(mesh)
result_exists(step, mesh, result, analysis)
get_result_component(step, mesh, result, analysis, component)
get_result_min(step,mesh,result,analysis)
get_result_max(step,mesh,result,analysis)
get_result_component_minmax(step,mesh,result,analysis,component)
get_result_info(result,analysis)
get_result_interpreter(result,analysis)
get_result_legend(result,analysis,component)
get_result_legends(result,analysis)
get_result_legend(result,name,iota.ALL_COMPONENTS)
get_result_type(result,analysis)
get_result(step,mesh,result,analysis)
mesh_type(mesh)
meshes()
get_mesh(mesh,step)
get_mesh_vertices(mesh,step)
get_mesh_info(mesh)
get_particles_mesh(step,mesh,variable)
point_evolution(mesh,point,result,analysis,component,[step])
statistics_evolution(mesh,result,analysis,component,[step],[data])
line_variation(mesh,point_start,point_end,num_points,result,analysis,component,step,[x_type])
mesh_integral(mesh,result,analysis,component,[step])
set_name(name)
add_dem_mesh(step,mesh,[name])
add_mesh(step,mesh)
add_result(step,mesh,result,analsis,data)
add_slice()
add_timestep(timestep)
delete_mesh(mesh)
delete_mesh_finished()