Connect to MI
Specify a database and table.Create a new record
Define names for a new record, and an attribute on that record.Types of functional data in Scripting Toolkit
Granta MI represents float functional data as either series functional or grid functional. Additionally, the schema defines a float functional attribute as containing either point or range data. As a result, there are four possible representations of float functional data in Scripting Toolkit:- Point series functional data as an
AttributeFunctionalSeriesPointobject - Range series functional data as an
AttributeFunctionalSeriesRangeobject - Point grid functional data as an
AttributeFunctionalGridPointobject - Range grid functional data as an
AttributeFunctionalGridRangeobject
type()
function shows that a AttributeFunctionalSeriesPoint object has been created accordingly.
x_axis property.
.with_new_x_axis() method, with the name of the parameter to be used as
the x-axis.
Create and import series functional data
This section shows how to create and import series-based data. Since this is a point-based functional attribute, createSeriesPoint objects to create single-valued series functional data. This example imports stress-strain data
as a function of temperature.
A series functional attribute value is defined as a tuple of series objects. There are two series types available,
SeriesPoint and SeriesRange. Use the appropriate object depending on the attribute value object type. For
series data, each series must be created with two equal-length tuples of x values and y values. Each series may also
have a tuple of parameter values and a decoration type.
In this example, create two SeriesPoint objects for our two series, each with an additional ‘Temperature’ value.
Assign both series to the functional attribute value.
.unit property
.parameters property.
functional_attribute.table_view.table_view property to see the underlying data structure of the attribute
represented as a list of lists. It shows all parameters supported by the attribute. Parameters that were not
populated during the import have been set to None.
mi.update() method to import the data into Granta MI.
Editing float functional data
This section shows how to modify series functional data.SeriesPoint objects are immutable, so they cannot be modified. However, existing values can be used when creating a
new series. The cell below adds two additional points to the series_2 value.
functional_attribute.value attribute is a tuple, so it is also immutable. To update the series objects
assigned to the value, all series objects must be provided. The cell below defines an entirely new series, and then
adds the original first series, the modified second series, and the new third series to the attribute value.
Using immutable values in this way provides greater validation, ensuring that any errors in the data are raised as
exceptions as soon as they are associated with the attribute value.
mi.update() method to import the data into Granta MI.
Convert series data to grid data
The final section shows how to convert between series and grid representations of float functional data. Use thegenerate_grid_version() method to convert the series functional attribute value to the equivalent grid
functional attribute value object. In this case, our AttributeFunctionalSeriesPoint attribute value is converted
to an AttributeFunctionalGridPoint object. This method raises a ValueError if the series functional data cannot
be represented as grid functional data.
SeriesPoint objects has been converted to a single GridPoint object. This contains the same
information, but note that the temperature values have been expanded to fully populate the grid.
AttributeFunctionalGridPoint
object.