1. Functions overview

1.1. Loading data

xarray_craft.loadData_craft.craft1time_2d(adr_data, time)

Function to load the data from craft

The input file should be in the adr_data folder and the output file should be in adr_data/output folder. It must contained at least *strain.vtk, *stress.vtk, *gamma.vtk

Parameters
  • adr_data (str) – path to the simulation

  • time (str) – time as written in the output file

Note

to open the vtk file you vtk_plit install from craft. It will be nice to find a better solution

1.2. Craft xr.Dataset accessor

class xarray_craft.craft.craft(xarray_obj)

This is a classe to work on aita data in xarray environnement.

Note

xarray does not support heritage from xr.DataArray may be the day it support it, we could move to it

__init__(xarray_obj)

Constructor for aita.

The xarray_obj should contained at least : 1. orientation : DataArray that is compatiblmultiplese with uvec structure 2. quality : DataArray of dim (m,n,1)

It can contained : 1. micro : DataArray of dim (m,n,1) 2. grainId : DataArray of dim (m,n,1)

Parameters

xarray_obj (xr.Dataset) –

__weakref__

list of weak references to the object (if defined)

elastic_strain(S=array([[0.000103, - 4.29e-05, - 2.32e-05, 0.0, 0.0, 0.0], [- 4.29e-05, 0.000103, - 2.32e-05, 0.0, 0.0, 0.0], [- 2.32e-05, - 2.32e-05, 8.44e-05, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0003318, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0003318, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.000292]]))

Compute elastic_strain

Warning

Function not tested. It probably doesn’t give the right answer

strain_energy()

Strain energy map compute as : w=1/2*e_ij*s_ij (Einstein notation)

1.3. Gamma xr.DataArray accessor

This is an object to take care of unit vector

class xarray_craft.gamma.gamma(xarray_obj)

This is a classe to work on slip system output from CraFT

Note

xarray does not support heritage from xr.DataArray may be the day it support it, we could move to it

__init__(xarray_obj)
Parameters

xarray_obj (xr.DataArray) – dimention should be (n,m,12)

__weakref__

list of weak references to the object (if defined)

gamma_activity(plane='ba', norm=True)
Parameters

plane (str) – relative activity of ‘ba’ for basal, ‘pr’ for prismatic, ‘py’ for pyramidal

Returns

relative basal activity map

Return type

im2d.image2d