Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Latest commit

 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unit Cell Generator

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.

Installation

julia> using Pkg
julia> Pkg.add("https://github.com/338rajesh/UnitCellGenerator.jl#main")

Note: for development version, replace main with dev in the above link.

Documentation

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 information
      • verbose = 0 prints no process information
      • verbose > 1 Also, prints summary of the optimization process and RVE information (TODO)
      • verbose > 10 Also, prints iteration progress

Generating unit cells with custom inclusion shapes

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.

Flow of the source code

  • 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

Procedure to perform unit cell generation for a custom inclusion shape

Do the following for the inclusion shape of interest,

  • define the inclusion data type, for example MyInclusion. Also, define the following for MyInclusion

    • function area(::MyInclusion) in 2D or volume(::MyInclusion) in 3D
    • function perimeter(::MyInclusion) in 2D or surface_area(::MyInclusion) in 3D
    • function with name get_data(::MyInclusion) to return 1D array of positional varaibles, given the inclusion object
  • 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, r as columns and (num_ns, 4) shape in 3D with x, y, z, r as 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.

About

A Julia package for generating the virtual microstructures containing arbitrary inclusion shapes, using a constrained optimisation.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages