f3dasm_simulate.abaqus.microstructure_generator.MicrostructureGenerator

class MicrostructureGenerator[source]

Bases: object

base class of mirostructure generator

List of Public Methods

circle_plot

2d rve plot for circle inclusion

generate_microstructure

generating micro-structure

plot_microstructure

plot figure for RVE

rgmsh_plot

contour or voxel plot of the discrete microstructure

sphere_coordinate

generate coordinate of sphere

sphere_plot

plot 3d rve with sphere inclusion

to_abaqus_format

convert microstructure to abaqus format

to_crate_format

convert microstructure to crate format

Methods

static circle_plot(fibers, length, width, vol_frac, save_figure=False, fig_name='microstructure.png', **kwargs)[source]

2d rve plot for circle inclusion

Parameters:
  • fibers (np.ndarray) – fiber locations/positions

  • length (float) – length of the rve

  • width (float) – with of the rve

  • vol_frac (float) – reached volume fraction

  • save_figure (bool, optional) – save figure , by default False

  • fig_name (str, optional) – figure name , by default “microstrcuture.png”

Return type:

None

generate_microstructure(seed=None)[source]

generating micro-structure

Parameters:

seed (any, optional) – seed generator or number , by default None

Return type:

float

plot_microstructure(save_figure=False, fig_name='RVE.png')[source]

plot figure for RVE

Parameters:
  • save_figure (bool, optional) – save figure or not , by default False

  • fig_name (str, optional) – figure name, by default “RVE.png”

Raises:

NotImplementedError – error report

Return type:

None

rgmsh_plot(save_fig=False, fig_name='rgmsh.png', **kwarg)[source]

contour or voxel plot of the discrete microstructure

Parameters:
  • save_fig (bool, optional) – save figure, by default False

  • fig_name (str, optional) – figure name, by default “rgmsh.png”

Return type:

None

static sphere_coordinate(location_information)[source]

generate coordinate of sphere

Parameters:
  • location_information (np.ndarray) – a numpy array contains center and radius info of a sphere [x, y, z, r]

  • Returns

  • -------ss

  • tuple – coordinate of x, y, z

Return type:

tuple

sphere_plot(fibers, length, width, height, vol_frac, save_figure=False, fig_name='cubic.png')[source]

plot 3d rve with sphere inclusion

Parameters:
  • location_information (np.ndarray) – location information

  • length (float) – length of cubic

  • width (float) – width of cubic

  • height (float) – height of cubic

  • vol_frac (float) – volume fraction

  • save_figure (bool, optional) – a flag to indicate if we want save the figure or not, by default False

  • fig_name (str, optional) – fig name, by default “cubic_rve.png”

Return type:

None

to_abaqus_format(file_name='micro_structure_info.json')[source]

convert microstructure to abaqus format

Parameters:

file_name (str, optional) – file name, by default “micro_structure_info.json”

Raises:

NotImplementedError – error report

Return type:

None

to_crate_format(file_name='microstructure.rgmsh')[source]

convert microstructure to crate format

Parameters:

file_name (str, optional) – _description_, by default “microstructure.rgmsh”

Return type:

None