f3dasm_simulate.abaqus.sphere_particles.SphereParticles
- class SphereParticles(length, width, height, radius_mu, radius_std, vol_req, num_guess_max=50000, num_fiber_max=750, num_cycle_max=15, dist_min_factor=1.1)[source]
Bases:
MicrostructureGenerator
Generate the 3D RVE with different size of sphere
- Parameters:
MicrosctucturaGenerator (class) – parent class of microstructure generator
Initialization
- Parameters:
length (float) – length of RVE
width (float) – width of RVE
height (float) – height of RVE
radius_mu (float) – mean of circle’s radius
radius_std (float) – std of circle’s radius
vol_req (float) – required volume fraction
num_guess_max (int, optional) – maximum guess for fibers, by default 50000
num_fiber_max (int, optional) – maximum fiber inside RVE, by default 750
num_cycle_max (int, optional) – iteration cycles, by default 15
dist_min_factor (float, optional) – distance factor, by default 2.07
List of Public Methods
2d rve plot for circle inclusion
create rgmsh numpy array for crate
calculate the fiber volume of the current fiber
Move fiber to its reference point
generating micro-structure
generate random fibers with different radiis
This function is used to identify the index of closest fiber of every fiber, which is very import for the first heuristic stirring to get more space placing the new disks.
This is the function used to determine the locations of disks considering the boundary of RVE.
overlap check of the new fiber and the orginal ones
plot figure for RVE
contour or voxel plot of the discrete microstructure
generate coordinate of sphere
plot 3d rve with sphere inclusion
convert microstructure to abaqus format
convert microstructure to crate format
Methods
- __init__(length, width, height, radius_mu, radius_std, vol_req, num_guess_max=50000, num_fiber_max=750, num_cycle_max=15, dist_min_factor=1.1)[source]
Initialization
- Parameters:
length (float) – length of RVE
width (float) – width of RVE
height (float) – height of RVE
radius_mu (float) – mean of circle’s radius
radius_std (float) – std of circle’s radius
vol_req (float) – required volume fraction
num_guess_max (int, optional) – maximum guess for fibers, by default 50000
num_fiber_max (int, optional) – maximum fiber inside RVE, by default 750
num_cycle_max (int, optional) – iteration cycles, by default 15
dist_min_factor (float, optional) – distance factor, by default 2.07
- _core_iteration()[source]
core iteration part of the micro-structure generation method
- Return type:
- _procedure_initialization()[source]
This function is used to generate the first sphere and assign the initial values of the algorithm
- Return type:
- static circle_plot(fibers, length, width, vol_frac, save_figure=False, fig_name='microstructure.png', **kwargs)
2d rve plot for circle inclusion
- Parameters:
- Return type:
- crate_rgmsh(num_discrete=10)[source]
create rgmsh numpy array for crate
- Parameters:
num_discrete (int, optional) – number of discrete partition, by default 10
- Returns:
3d numpy array that contains the micro-structure information
- Return type:
np.ndarray
- static generate_first_heuristic_fibers(ref_point, fiber_temp, dist_factor, rng)[source]
Move fiber to its reference point
- Parameters:
ref_point (np.ndarray) – Reference point that the fiber should move to
fiber_temp (np.ndarray) – The considering fiber
dist_factor (float) – the minimum distance factor between two fibers
ang (any) – a random generator
- Returns:
The updated location of the considering fiber
- Return type:
np.ndarray
- generate_microstructure(seed=None)[source]
generating micro-structure
- Parameters:
seed (any, optional) – seed generator or number , by default None
- Return type:
- static generate_random_fibers(len_start, len_end, wid_start, wid_end, hei_start, hei_end, radius_mu, radius_std, rng)[source]
generate random fibers with different radiis
- Parameters:
len_start (float) – the start location of length
len_end (float) – the end location of length
wid_start (float) – the start location of width
wid_end (float) – the end location of width
hei_start (float) – the start height of length
hei_end (float) – the end height of height
radius_mu (float) – mean of radius
radius_std (float) – standard deviation of radius
- Returns:
location information of generated fiber
- Return type:
np.ndarray
- static min_dis_index(temp_fiber, fiber_pos, fiber_min_dis_vector, ii, cycle)[source]
This function is used to identify the index of closest fiber of every fiber, which is very import for the first heuristic stirring to get more space placing the new disks.
- Parameters:
temp_fiber (np.ndarray) – the fiber been processed
fiber_pos (np.ndarray) – fiber position
fiber_min_dis_vector (np.ndarray) – the first column is the index of the closed point, the second column contains the minimum distance between those two points
ii (int) – the index of the being processed point
cycle (int) – the cycle of the algorithm. At different cycles, the criteria of identifying the closed point are different.
- Return type:
- Returns:
fiber_min_dis_vector (np.ndarray) – The updated minimum distance array
two (int) – The index of the minimum distance point
three (float) – The minimum distance to the minimum distance point
- new_positions(x_center, y_center, z_center, radius, width, length, height)[source]
This is the function used to determine the locations of disks considering the boundary of RVE. To be specific, the disk should be divided into two parts or four parts if it is located in the outskirt area
- Parameters:
- Returns:
XC, YC, ZC, radius, and split which are the new locations of this fiber (because in some locations, the circles need to be split)
- Return type:
np.ndarray
- static overlap_check(new_fiber, fiber_pos, dist_factor, fiber_index=0, stage='step_one')[source]
overlap check of the new fiber and the orginal ones
- Parameters:
- Returns:
a flag to indicate overlap status
- Return type:
- Raises:
ValueError – stage not been implemented error
- plot_microstructure(save_figure=False, fig_name='RVE.png')[source]
plot figure for RVE
- Parameters:
- Raises:
NotImplementedError – error report
- Return type:
- rgmsh_plot(save_fig=False, fig_name='rgmsh.png', **kwarg)
contour or voxel plot of the discrete microstructure
- static sphere_coordinate(location_information)
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:
- sphere_plot(fibers, length, width, height, vol_frac, save_figure=False, fig_name='cubic.png')
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:
- 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: