-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unified handling of filenames and paths in export routines
- Loading branch information
1 parent
f31beeb
commit 902249a
Showing
5 changed files
with
163 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
""" | ||
Create an RVE with oblate grains based on statistical information of a microstructure. | ||
Author: Alexander Hartmaier | ||
ICAMS, Ruhr University Bochum, Germany | ||
January 2024 | ||
""" | ||
|
||
import kanapy as knpy | ||
from math import pi | ||
|
||
texture = 'unimodal' # chose texture type 'random' or 'unimodal' | ||
matname = 'Rolled' # Material name | ||
nvox = 30 # number of voxels in each Cartesian direction | ||
size = 40 # size of RVE in micron | ||
periodic = True # create periodic (True) or non-periodic (False) RVE | ||
# define statistical information on microstructure | ||
ms_elong = {'Grain type': 'Elongated', | ||
'Equivalent diameter': {'std': 1.0, 'mean': 12.0, 'offs': 4.0, 'cutoff_min': 8.0, 'cutoff_max': 18.0}, | ||
'Aspect ratio': {'std': 1.0, 'mean': 1.5, 'offs': -0.1, 'cutoff_min': 0.0, 'cutoff_max': 2.4}, | ||
"Tilt angle": {"std": 0.5, "mean": 0.5*pi, "cutoff_min": 0.25*pi, "cutoff_max": 0.75*pi}, | ||
'RVE': {'sideX': size, 'sideY': size, 'sideZ': size, 'Nx': nvox, 'Ny': nvox, 'Nz': nvox}, | ||
'Simulation': {'periodicity': str(periodic), 'output_units': 'um'}} | ||
|
||
# create and visualize synthetic RVE | ||
# create kanapy microstructure object | ||
ms = knpy.Microstructure(descriptor=ms_elong, name=matname + '_' + texture + '_texture') | ||
ms.init_RVE() # initialize RVE including particle distribution and structured mesh | ||
ms.plot_stats_init() # plot initial statistics of equivalent grain diameter and aspect ratio | ||
ms.pack() # perform particle simulation to distribute grain nuclei in RVE volume | ||
ms.plot_ellipsoids() # plot final configuration of particles | ||
ms.voxelize() # assign voxels to grains according to particle configuration | ||
ms.plot_voxels(sliced=True) # plot voxels colored according to grain number | ||
ms.generate_grains() # generate a polyhedral hull around each voxelized grain | ||
ms.plot_grains() # plot polyhedral grains | ||
ms.plot_stats() # compared final grain statistics with initial parameters | ||
|
||
# create grain orientations for Goss or random texture | ||
if knpy.MTEX_AVAIL: | ||
ms.generate_orientations(texture, ang=[0, 45, 0], omega=7.5) | ||
|
||
# output rve in voxel format | ||
ms.write_voxels(script_name=__file__, mesh=False, system=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,11 +27,8 @@ | |
if os.path.exists(adm_path): | ||
with open(adm_path, 'r') as file: | ||
adm_flag = file.read() | ||
print('*** adm_flag =', adm_flag) | ||
if '1' in adm_flag or 'true' in adm_flag.lower(): | ||
WORK_DIR = MAIN_DIR | ||
else: | ||
print('*** adm_flag not found.') | ||
|
||
path_path = os.path.join(WORK_DIR, 'PATHS.json') | ||
path_dict = {'MAIN_DIR': MAIN_DIR, | ||
|
@@ -51,7 +48,7 @@ | |
|
||
setup( | ||
name='kanapy', | ||
version='6.0.5', | ||
version='6.1.0', | ||
author='Mahesh R.G. Prasad, Abhishek Biswas, Golsa Tolooei Eshlaghi, Napat Vajragupta, Alexander Hartmaier', | ||
author_email='[email protected]', | ||
classifiers=[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.