This module implements unit cell generation scheme as it is developed in A computationally efficient approach for generating RVEs of various inclusion/fibre shapes. Here, the word unit cell is used interchangeably with representative volume element (RVE) or repeating unit cell (RUC) or statistically equivalent volume element (SEVE) or statistically equivalent unit cell (SEUC). In any case, mathematically, the unit cell is a domain in 2D or 3D, where inclusions are placed following a specified distribution. So, it could be used in any problem where you need to generate a domain with inclusion distribution. For example, to model a porous media, composite materials, etc.
Warning
The development of this module is freezed. Please use the existing functionality as it is. If you want to add new features, please fork the repository and do the changes in your forked repository. We are working on a python version of this module ShapeForge which will have more features and better usability.
julia> using Pkg
julia> Pkg.add("https://github.com/338rajesh/UnitCellGenerator.jl#main")Note: for development version, replace
mainwithdevin the above link.
This module exports the following single function.
julia> using UnitCellGenerator
julia> unit_cell = generate_unit_cell(ruc_data, inclusions_data; <kwargs>)where,
ruc_data::RUC_data,inclusions_data::::Tuple{Vararg{Inclusion_data}},- kwargs, Keyword Arguments
projection_buffer::Float64 = 2.0,max_num_iterations::Int64 = 2000,max_num_fg_evaluations::Int64 = 4000,max_num_line_search_steps::Int64 = 25,non_monotone_memory::Int64 = 50,min_spectral_step_length::Float64 = 0.1,max_spectral_step_length::Float64 = 10.0,min_non_monotone_step_length::Float64 = 0.01,max_non_monotone_step_length::Float64 = 0.9,c1::Float64 = 0.0001,adjust_ruc_bbox::Bool = True,verbose::Int64 = 1, defaults to printing only convergence informationverbose = 0prints no process informationverbose > 1Also, prints summary of the optimization process and RVE information (TODO)verbose > 10Also, prints iteration progress
If you want to generate unite cell of different shape than that is existing in the library, please take a look at the flow of the code and then which parts are need to be modified to accomodate new inclusion shape.
generate()create_inclusions()create_2D_inclusions()<==create_2D_inclusion(inc_shape, inc_size_params)<==inclusion(inc_size_params)create_3D_inclusions()<==create_3D_inclusion(inc_shape, inc_size_params)<==inclusion(inc_size_params)
initialize_inclusions!()<==pick_pose(bbox, init_type)optimize_inclusion_distance!(ruc_info, inclusions; <kwargs>)get_positional_variables()get_uns()overlap_metrics(opt_var_k, incl_uns, ruc_info, ssd)update_position!()band_projection!()
- get_inclusions_data
Do the following for the inclusion shape of interest,
-
define the inclusion data type, for example
MyInclusion. Also, define the following forMyInclusion- function
area(::MyInclusion)in 2D orvolume(::MyInclusion)in 3D - function
perimeter(::MyInclusion)in 2D orsurface_area(::MyInclusion)in 3D - function with name
get_data(::MyInclusion)to return 1D array of positional varaibles, given the inclusion object
- function
-
update
create_2D_inclusion(inc_shape::DataType, inc_size_params::Dict{String, Float64})::Abstract2DGShape-
write a function to return an instance of the inclusion with specified size parameterss. size parameters can be supplied as a dictionary with size-parameter idenitfier and values as key-value pairs.
-
write a function to return an union of n-spheres (uns) form of the inclusion shape of interest, which returns a matrix of (num_ns, n+1) shape. That is, (num_ns, 3) in 2D with
x, y, ras columns and (num_ns, 4) shape in 3D withx, y, z, ras columns. Here, num_ns is the number of n-Spheres used in the uns representation. Note that, each row of the uns matrix represents a circle/ sphere.
-