Output extractor

P4A Module to load and interact with AMITEX simulation results.

AmitexOutput class is the public API of the P4A package to interact with Amitex output data.

@author: amarano

class py4amitex.output.amitexoutput.AmitexOutput(output_basename=None)

Class to load, store and manipulate Amitex fftp simulation results.

get_concentration_field(increment)

Return the requested strain field component.

Parameters

increment : int, time increment associated to the requested field

Returns

a : (Nx, Ny, Nz) numpy array –> concentration field

get_diffusionflux_field(component, increment)

Return the requested strain field component.

Parameters

component : str, requested flux component. ex: ‘x’, ‘y’ or ‘z’ increment : int, time increment associated to the requested field

Returns

a : (Nx, Ny, Nz) numpy array –> flux field component

get_mean_values(variable, matId=None, zoneId=None)

Return time serie of the requested variable mean values.

Parameters

variablestring

Name of the variable to retrieve. Accepted names are ‘strain’, ‘epsilon’, ‘grad_u’, ‘greenlagrange’, ‘stress’, ‘boussinesq’, ‘time’, ‘niter’. For internal variables, use “varInt” For root mean square time series, use ‘X_rms’, with X one of the aformentionned accepted names.

matIdint, optional

Id (numM) of the material. Use to request the mean over the material (.mstd) or a zone(.ztsd) of a variable. The default value is ‘None’, which return the mean over the unit cell. To load the mean over a material, specify ‘matId’ value, and set ‘zoneId’ value tu ‘None’.

zoneIdint, optional

Id (numM) of the material. Use to request the mean over the material (.mstd) or a zone(.ztsd) of a variable. The default value is ‘None’.

Returns

a(Nincr, Ncomp) numpy array

Time serie of requested variable values, with all components for tensorial variables.

get_piola_stress_field(component, increment)

Return the requested piola stress field component.

Parameters

component : str, requested piola stress component. ex: ‘xx’, ‘yz’ increment : int, time increment associated to the requested field

Returns

a : (Nx, Ny, Nz) numpy array –> piola stress field component

get_strain_field(component, increment)

Return the requested strain field component.

Parameters

component : str, requested strain component. ex: ‘xx’, ‘yz’ increment : int, time increment associated to the requested field

Returns

a : (Nx, Ny, Nz) numpy array –> strain field component

get_stress_field(component, increment)

Return the requested stress field component.

Parameters

component : str, requested stress component. ex: ‘xx’, ‘yz’ increment : int, time increment associated to the requested field

Returns

a : (Nx, Ny, Nz) numpy array –> stress field component

get_varInt_field(varInt_idx, increment, matId)

Return the requested internal variable field.

Parameters

varInt_idx : int, index of requested internal variable. increment : int, time increment associated to the requested field

Returns

a : (Nx, Ny, Nz) numpy array –> internal variable field

load_all_fields(variables='all')

Load all available fields in output directory vtk files.

load_concentration_fields(increments_list=None, output_slice=None)

Load concentration fields for requested increments.

Parameters

increments_listlist(str), optional

List of time increments to read. The default is None, which reads all time increment data for the requested field.

output_slicenumpy array (3,2), optional

Specific slice of field data to return. The default is None.

load_diffusionflux_fields(components_list='all', increments_list=None, output_slice=None)

Load flux fields for requested increments and components.

Parameters

components_listlist(str), optional

List of components of the flux field to read. Components can be indices or letters (like ‘0’ or ‘x’). The default is ‘all’.

increments_listlist(str), optional

List of time increments to read. The default is None, which reads all time increment data for the requested field/components.

output_slice : numpy array (3,2), optional Specific slice of field data to return. The default is None.

load_mean_values(variables='all')

Load all data in available .std, mstd, zstd files.

load_strain_fields(components_list='all', increments_list=None, output_slice=None)

Load strain fields for requested increments and components.

Parameters

components_listlist(str), optional

List of components of the field to read. Components can be indices or letters (like ‘0’ or ‘xx’). The default is ‘all’.

increments_listlist(str), optional

List of time increments to read. The default is None, which reads all time increment data for the requested field/components.

output_slicenumpy array (3,2), optional

Specific slice of field data to return. The default is None.

load_stress_fields(components_list='all', increments_list=None, output_slice=None)

Load stress fields for requested increments and components.

Parameters

components_listlist(str), optional

List of components of the field to read. Components can be indices or letters (like ‘0’ or ‘xx’). The default is ‘all’.

increments_listlist(str), optional

List of time increments to read. The default is None, which reads all time increment data for the requested field/components.

output_slicenumpy array (3,2), optional

Specific slice of field data to return. The default is None.

load_varInt_fields(components_list='all', increments_list=None, output_slice=None)

Load strain fields for requested increments and components.

Parameters

components_listlist(str), optional

List of components of the field to read. Components can be indices or letters (like ‘0’ or ‘xx’). The default is ‘all’.

increments_listlist(str), optional

List of time increments to read. The default is None, which reads all time increment data for the requested field/components.

output_slicenumpy array (3,2), optional

Specific slice of field data to return. The default is None.

print_available_data()

Print available AMITEX results in output directory.

set_output(output_basename)

Set names of output files from basename, update finite strain flag.

Parameters

output_basenamestr, optional

basename of the output files to read (with or without extension).