RingsPy 1.0.2__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ringspy-1.0.2/ringspy.egg-info → ringspy-1.2.0}/PKG-INFO +142 -93
- ringspy-1.0.2/PKG-INFO → ringspy-1.2.0/README.md +118 -107
- ringspy-1.2.0/pyproject.toml +56 -0
- {ringspy-1.0.2 → ringspy-1.2.0}/ringspy/MeshGenTools.py +898 -1566
- ringspy-1.2.0/ringspy/__init__.py +13 -0
- ringspy-1.2.0/ringspy/__main__.py +5 -0
- ringspy-1.2.0/ringspy/cli.py +46 -0
- ringspy-1.2.0/ringspy/config.py +230 -0
- ringspy-1.2.0/ringspy/pipeline.py +276 -0
- ringspy-1.2.0/ringspy.egg-info/PKG-INFO +341 -0
- {ringspy-1.0.2 → ringspy-1.2.0}/ringspy.egg-info/SOURCES.txt +10 -8
- ringspy-1.2.0/ringspy.egg-info/entry_points.txt +2 -0
- ringspy-1.2.0/ringspy.egg-info/requires.txt +22 -0
- ringspy-1.2.0/setup.cfg +4 -0
- ringspy-1.2.0/tests/test_config.py +225 -0
- ringspy-1.2.0/tests/test_examples.py +130 -0
- ringspy-1.2.0/tests/test_legacy_template.py +37 -0
- ringspy-1.2.0/tests/test_regressions.py +232 -0
- ringspy-1.2.0/tests/test_speedups.py +145 -0
- ringspy-1.0.2/README.md +0 -259
- ringspy-1.0.2/pyproject.toml +0 -9
- ringspy-1.0.2/ringspy/__init__.py +0 -8
- ringspy-1.0.2/ringspy.egg-info/not-zip-safe +0 -1
- ringspy-1.0.2/ringspy.egg-info/requires.txt +0 -12
- ringspy-1.0.2/setup.cfg +0 -65
- ringspy-1.0.2/setup.py +0 -11
- ringspy-1.0.2/tests/test_hexalattice_hex.py +0 -304
- ringspy-1.0.2/tests/test_hexalattice_tri.py +0 -304
- ringspy-1.0.2/tests/test_lloyd.py +0 -304
- ringspy-1.0.2/tests/test_read_existing_sites.py +0 -305
- ringspy-1.0.2/tests/test_wood_cube.py +0 -304
- {ringspy-1.0.2 → ringspy-1.2.0}/LICENSE +0 -0
- {ringspy-1.0.2 → ringspy-1.2.0}/ringspy/py.typed +0 -0
- {ringspy-1.0.2 → ringspy-1.2.0}/ringspy.egg-info/dependency_links.txt +0 -0
- {ringspy-1.0.2 → ringspy-1.2.0}/ringspy.egg-info/top_level.txt +0 -0
|
@@ -1,35 +1,40 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: ringspy
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: A geometric generation tool for prismatic cellular solids
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Platform: unix
|
|
10
|
-
Platform: linux
|
|
11
|
-
Platform: osx
|
|
12
|
-
Platform: cygwin
|
|
13
|
-
Platform: win32
|
|
5
|
+
Author-email: Hao Yin <haoyin2022@u.northwestern.edu>
|
|
6
|
+
License-Expression: GPL-3.0-only
|
|
7
|
+
Project-URL: Homepage, https://github.com/kingyin3613/ringspy
|
|
8
|
+
Project-URL: Paper, https://doi.org/10.21105/joss.04945
|
|
14
9
|
Classifier: Programming Language :: Python :: 3
|
|
15
10
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
21
11
|
Classifier: Development Status :: 4 - Beta
|
|
22
12
|
Classifier: Intended Audience :: Science/Research
|
|
23
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
24
13
|
Classifier: Operating System :: OS Independent
|
|
25
14
|
Classifier: Topic :: Scientific/Engineering
|
|
26
15
|
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
27
16
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
28
17
|
Classifier: Topic :: Software Development :: Libraries
|
|
29
|
-
Requires-Python: >=3.
|
|
18
|
+
Requires-Python: >=3.10
|
|
30
19
|
Description-Content-Type: text/markdown
|
|
31
|
-
Provides-Extra: testing
|
|
32
20
|
License-File: LICENSE
|
|
21
|
+
Requires-Dist: numpy
|
|
22
|
+
Requires-Dist: scipy
|
|
23
|
+
Requires-Dist: matplotlib>=3.2.2
|
|
24
|
+
Requires-Dist: tomli>=1.1; python_version < "3.11"
|
|
25
|
+
Provides-Extra: vtk
|
|
26
|
+
Requires-Dist: vtk; extra == "vtk"
|
|
27
|
+
Provides-Extra: hex
|
|
28
|
+
Requires-Dist: hexalattice>=1.2.1; extra == "hex"
|
|
29
|
+
Provides-Extra: all
|
|
30
|
+
Requires-Dist: vtk; extra == "all"
|
|
31
|
+
Requires-Dist: hexalattice>=1.2.1; extra == "all"
|
|
32
|
+
Provides-Extra: test
|
|
33
|
+
Requires-Dist: pytest>=7; extra == "test"
|
|
34
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
35
|
+
Requires-Dist: vtk; extra == "test"
|
|
36
|
+
Requires-Dist: hexalattice>=1.2.1; extra == "test"
|
|
37
|
+
Dynamic: license-file
|
|
33
38
|
|
|
34
39
|
# RingsPy
|
|
35
40
|
[](https://www.python.org/)
|
|
@@ -38,123 +43,132 @@ License-File: LICENSE
|
|
|
38
43
|
[](https://www.gnu.org/licenses/gpl-3.0.html)
|
|
39
44
|
[](https://github.com/kingyin3613/ringspy/actions/workflows/tests.yml)
|
|
40
45
|
[](https://codecov.io/gh/kingyin3613/ringspy)
|
|
41
|
-
[](https://doi.org/10.21105/joss.04945)
|
|
47
|
+
|
|
48
|
+

|
|
42
49
|
|
|
43
50
|
RingsPy is a Voronoi diagrams-based geometric generation tool that generates 3D meshes and models of prismatic cellular solids with radial growth rules.
|
|
44
51
|
|
|
45
52
|
## Dependencies and Installation
|
|
46
|
-
RingsPy depends on mainstream Python libraries ``numpy`` and ``
|
|
53
|
+
RingsPy needs Python 3.10 or newer and depends on mainstream Python libraries ``numpy``, ``scipy`` and ``matplotlib``. It optionally depends on library ``hexalattice``, if a regular hexagonal lattice (e.g. honeycomb) is wanted, and on ``vtk``, if the 3D model (STL) files are also wanted.
|
|
47
54
|
### 1. pip install
|
|
48
|
-
To install RingsPy, one may use `pip`:
|
|
55
|
+
To install RingsPy with all optional features, one may use `pip`:
|
|
49
56
|
```bash
|
|
50
|
-
pip install ringspy
|
|
57
|
+
pip install "ringspy[all]"
|
|
51
58
|
```
|
|
52
|
-
or use:
|
|
59
|
+
`pip install ringspy` installs the core package only; add the extras `[vtk]` (STL export) or `[hex]` (`regular_hexagonal` growth rule) as needed. One may also use:
|
|
53
60
|
```bash
|
|
54
|
-
pip install git+https://github.com/kingyin3613/ringspy.git
|
|
61
|
+
pip install "ringspy[all] @ git+https://github.com/kingyin3613/ringspy.git"
|
|
55
62
|
```
|
|
56
63
|
to get updates beyond the latest release.
|
|
57
64
|
|
|
58
65
|
### 2. conda install
|
|
59
|
-
|
|
66
|
+
To install RingsPy in `conda` environments, one can also use `conda-forge` channel:
|
|
60
67
|
```bash
|
|
61
68
|
conda install -c conda-forge ringspy
|
|
62
69
|
```
|
|
63
70
|
|
|
64
71
|
### 3. Installation Check
|
|
65
72
|
|
|
66
|
-
There are some unit tests in [tests](https://github.com/kingyin3613/ringspy/tree/main/tests/). One can use ``pytest`` to check whether the installation is successful by
|
|
73
|
+
There are some unit tests in [tests](https://github.com/kingyin3613/ringspy/tree/main/tests/). One can use ``pytest`` to check whether the installation is successful by installing the test dependencies in the cloned ``ringspy`` directory and then running ``pytest`` there (generated files go to temporary folders):
|
|
67
74
|
|
|
68
75
|
```bash
|
|
69
|
-
|
|
76
|
+
pip install -e ".[test]"
|
|
77
|
+
pytest
|
|
70
78
|
```
|
|
71
79
|
|
|
72
|
-
|
|
80
|
+
`pytest -m "not slow"` skips the end-to-end runs of the examples and takes well under a minute.
|
|
81
|
+
|
|
82
|
+
## Getting Started (Current version: v1.2.0)
|
|
73
83
|
Once all required components are installed and one is ready to begin, a path forward should be established for generating the mesh. The basic steps for running/viewing a cellular mesh are listed as the following:
|
|
74
84
|
|
|
75
|
-
1. Edit geometry and algorithm parameters
|
|
76
|
-
2. Generate mesh
|
|
85
|
+
1. Edit geometry and algorithm parameters in an input file
|
|
86
|
+
2. Generate mesh with the command `ringspy run` (or with `ringspy.generate` in Python)
|
|
77
87
|
3. Visualize 2D view using Matplotlib or 3D model in `ParaView`
|
|
78
88
|
4. (Optional) Export 3D STL model for 3D editing and/or printing
|
|
79
|
-
|
|
89
|
+
5. (Optional) Export input file for numerical simulations with software `Abaqus`
|
|
80
90
|
|
|
81
91
|
### 1. Geometry and Parameters
|
|
82
92
|
The first step to generate a cellular geometry is selecting geometry and appropriate parameters.
|
|
83
93
|
|
|
84
94
|
### 1.1. Geometry
|
|
85
|
-
|
|
95
|
+
An input file in [TOML](https://toml.io) format, for example [`wood_cube.toml`](https://github.com/kingyin3613/ringspy/tree/main/examples/wood_cube.toml) in the [examples](https://github.com/kingyin3613/ringspy/tree/main/examples/) directory, holds the parameters for the generation of a cubic wood specimen. The other examples there are a wood specimen with more regular cells (`wood_cube_lloyd.toml`), honeycombs clipped by a hexagon or a triangle (`honeycomb_hex.toml`, `honeycomb_tri.toml`), and a mesh of previously saved cells (`saved_sites.toml`). Copy the one closest to the wanted geometry and edit it.
|
|
86
96
|
|
|
87
|
-
*Note: The Mesh Generation Tool by now only accepts many of pre-defined boundary geometries (for v1.
|
|
97
|
+
*Note: The Mesh Generation Tool by now only accepts many of pre-defined boundary geometries (for v1.x, the following 3 shapes are supported: triangle, square, hexagon), importing of CAD and/or other 3D model files will be implemented in subsequent versions.*
|
|
88
98
|
|
|
89
99
|
*Note: for greatest compatibility create the geometry using all millimeters.*
|
|
90
100
|
|
|
91
101
|
### 1.2. Parameters
|
|
92
102
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
radial_growth_rule =
|
|
100
|
-
iter_max = 500
|
|
101
|
-
print_interval = 500
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
#
|
|
105
|
-
r_min = 0
|
|
106
|
-
r_max = 4
|
|
107
|
-
nrings = 4
|
|
108
|
-
width_heart = 0.3
|
|
109
|
-
width_sparse = 0.7
|
|
110
|
-
width_dense = 0.3
|
|
111
|
-
generation_center =
|
|
103
|
+
By opening an input file, e.g., `examples/wood_cube.toml` in any text editor, a file format similar to what is shown below will be displayed:
|
|
104
|
+
```toml
|
|
105
|
+
geoName = "wood_cube"
|
|
106
|
+
path = "meshes" # output folder: the files go to meshes/wood_cube/
|
|
107
|
+
|
|
108
|
+
# Cell placement
|
|
109
|
+
radial_growth_rule = "binary" # binary, binary_lloyd, regular_hexagonal, or a saved *_sites.npy file
|
|
110
|
+
iter_max = 500 # increase this number to achieve a more regular geometry
|
|
111
|
+
print_interval = 500 # interval for printing progress info
|
|
112
|
+
seed = 2023 # random seed; remove it for a different geometry on every run
|
|
113
|
+
|
|
114
|
+
# Radial cell growth
|
|
115
|
+
r_min = 0 # inner radius of generation domain
|
|
116
|
+
r_max = 4 # outer radius of generation domain
|
|
117
|
+
nrings = 4 # number of rings
|
|
118
|
+
width_heart = 0.3 # ring width of the innermost ring (left out: 0.3*(r_max-r_min)/nrings)
|
|
119
|
+
width_sparse = 0.7 # ring width of rings with sparse cells (left out: 0.7*(r_max-r_min)/nrings)
|
|
120
|
+
width_dense = 0.3 # ring width of rings with dense cells (left out: 0.3*(r_max-r_min)/nrings)
|
|
121
|
+
generation_center = [0, 0] # coordinates of generation domain center
|
|
112
122
|
|
|
113
123
|
cellsize_sparse = 0.02
|
|
114
124
|
cellsize_dense = 0.01
|
|
115
|
-
cellwallthickness_sparse = 0.
|
|
116
|
-
cellwallthickness_dense = 0.
|
|
117
|
-
|
|
118
|
-
#
|
|
119
|
-
boundaryFlag =
|
|
120
|
-
box_shape =
|
|
121
|
-
box_center =
|
|
122
|
-
box_size = 4.0
|
|
123
|
-
|
|
124
|
-
#
|
|
125
|
-
nsegments = 2
|
|
126
|
-
theta_min = 0
|
|
127
|
-
theta_max = 0.05
|
|
125
|
+
cellwallthickness_sparse = 0.006
|
|
126
|
+
cellwallthickness_dense = 0.010
|
|
127
|
+
|
|
128
|
+
# Clipping box
|
|
129
|
+
boundaryFlag = true
|
|
130
|
+
box_shape = "square" # square, triangle or hexagon
|
|
131
|
+
box_center = [0, 0] # coordinates of clipping box center
|
|
132
|
+
box_size = 4.0 # side length
|
|
133
|
+
|
|
134
|
+
# Longitudinal direction
|
|
135
|
+
nsegments = 2 # increase this number to achieve a smoother transition in longitudinal direction if theta is large
|
|
136
|
+
theta_min = 0 # unit: radian
|
|
137
|
+
theta_max = 0.05 # unit: radian
|
|
128
138
|
z_min = 0
|
|
129
|
-
z_max =
|
|
130
|
-
long_connector_ratio = 0.02
|
|
139
|
+
z_max = 4.0 # segment_length = (z_max - z_min) / nsegments (left out: box_size)
|
|
140
|
+
long_connector_ratio = 0.02 # longitudinal joint length = ratio * segment_length
|
|
131
141
|
|
|
132
|
-
#
|
|
133
|
-
skeleton_density = 1.5e-9
|
|
142
|
+
# Material
|
|
143
|
+
skeleton_density = 1.5e-9 # unit: tonne/mm3
|
|
134
144
|
|
|
135
|
-
#
|
|
136
|
-
merge_operation =
|
|
145
|
+
# Mesh operations
|
|
146
|
+
merge_operation = true # merge cell walls shorter than merge_tol
|
|
137
147
|
merge_tol = 0.01
|
|
138
148
|
|
|
139
|
-
precrackFlag =
|
|
149
|
+
precrackFlag = false
|
|
140
150
|
precrack_widths = 0.1
|
|
141
151
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
inpFlag =
|
|
145
|
-
inpType =
|
|
152
|
+
# Output files
|
|
153
|
+
stlFlag = true # 3D model (needs vtk: pip install "ringspy[vtk]")
|
|
154
|
+
inpFlag = true # input file for simulations
|
|
155
|
+
inpType = "Abaqus"
|
|
156
|
+
save_sites = false # also save wood_cube_sites.npy and wood_cube_radii.npy, to reuse the cells later
|
|
146
157
|
```
|
|
147
158
|
|
|
148
|
-
|
|
149
|
-
|
|
159
|
+
A parameter that is left out takes its default value, which is its value in `wood_cube.toml`; a misspelled parameter name is an error. Flags take `true`/`false` (the `'on'`/`'off'` strings of earlier versions also work).
|
|
160
|
+
|
|
161
|
+
- `geoName` is the geometry name, `path` is the folder where the mesh files will be generated (relative to the folder where `ringspy run` is started).
|
|
162
|
+
- `radial_growth_rule` is the radial growth rule for cell placement. When a file name with extension`.npy` is specified, a saved cell data file will be loaded (for v1.x, choose one of these rules: `binary`, `binary_lloyd`, `regular_hexagonal`, or a file name with extension `.npy`). The `.npy` file and its `_radii.npy` partner are looked for in the folder of the input file and its parents, or in `sites_dir` if given; `save_sites = true` saves them for a generated geometry.
|
|
150
163
|
- `iter_max` is the max number of iteration for randomly placing non-overlapping cell particles in the 2D toroidal cell placement region. Noticing that, larger `iter_max` leads to more centroidal Voronoi cells, for more reference, see [Wiki - Centroidal Voronoi Tessellation](https://en.wikipedia.org/wiki/Centroidal_Voronoi_tessellation/).
|
|
151
164
|
- `print_interval` is the print interval when every n cell particles are placed in the placement region.
|
|
165
|
+
- `seed` makes the random cell placement repeatable: the same seed gives the same files. Without a seed, every run gives a different geometry (the cells then come from NumPy's global random state, as in earlier versions). The seed is written to the report log.
|
|
152
166
|
- `r_min` and `r_max` are the upper and lower bounds of radii of toroidal cell placement regions (generation rings), `nrings` is the total number of rings.
|
|
153
167
|
- `width_heart`, `width_sparse`, and `width_dense`, are ring widths for innermost ring, rings with sparse cells, and rings with dense cells, respectively, which all together determine the morphology of the cellular structure.
|
|
154
168
|
- `generation_center` is the location of the placement region.
|
|
155
169
|
- `cellsize_sparse`,`cellsize_dense`, `cellwallthickness_sparse`, and `cellwallthickness_dense` are parameters for the sparse and dense cells.
|
|
156
170
|
- `boundaryFlag` flag can be turned on/off for generating neat boundaries consisting of grains.
|
|
157
|
-
- `box_shape` is the shape of cutting box (for v1.
|
|
171
|
+
- `box_shape` is the shape of cutting box (for v1.x, choose one of following shapes: `triangle`, `square`, or `hexagon`).
|
|
158
172
|
- `box_center`, and `box_size` are for describing the cutting box.
|
|
159
173
|
- `nsegments` is the number of segments consisting the prismatic cells during the z- (longitudinal) extrusion, with `segment_length = (z_max - z_min) / nsegments`.
|
|
160
174
|
- `theta_min` and `theta_max` determine the twisting angles (unit: radian) of the 2D mesh around the `generation_center`, during the spiral z-extrusion.
|
|
@@ -162,26 +176,44 @@ inpType = 'Abaqus'
|
|
|
162
176
|
- `long_connector_ratio` is the length of longitudinal joints, with `longitudinal joint length = ratio * segment_length`.
|
|
163
177
|
- `skeleton_density` is the density of the skeleton (substance) material, e.g. density of wood cell walls in the wood microstructure.
|
|
164
178
|
- `merge_operation` flag can be turned on/off for the merging operation, when flag is on, cell ridges that are shorter than the threshold `merge_tol` in the 2D mesh will be deleted, and their vertices will be merged respectively, the mesh will be reconstructed. This is designed for eliminating small cell ridges/walls which fall out of the resolution range of the 3D printing and for avoiding having elements with too small stable time increments in numerical simulations.
|
|
165
|
-
- `precrackFlag` flag is for inserting
|
|
179
|
+
- `precrackFlag` flag is for inserting pre-cracks, for the notched specimens. `precrack_nodes = [[x1, y1, x2, y2], ...]` gives the line segments of the cracks; when it is left out, a horizontal crack of length `0.1*box_size` through `box_center`, starting `0.12*box_size` from the left side of the box, is inserted. `precrack_widths` is the width of the cracks.
|
|
166
180
|
- `stlFlag` flag can be turned on/off for generating 3D STL files.
|
|
167
181
|
- `inpFlag` flag can be turned on/off for generating input files for numerical simulations.
|
|
168
182
|
- `inpType` indicates the software(s) that the mesh generation should generate input files for.
|
|
169
183
|
|
|
170
184
|

|
|
171
185
|
### 2.1. Run Mesh Generation
|
|
172
|
-
Open a Command Prompt or Terminal window
|
|
173
|
-
```
|
|
174
|
-
|
|
186
|
+
Open a Command Prompt or Terminal window, set the current directory to [examples](https://github.com/kingyin3613/ringspy/tree/main/examples/) or the folder of your own input file, then run the command:
|
|
187
|
+
```bash
|
|
188
|
+
ringspy run wood_cube.toml
|
|
175
189
|
```
|
|
176
|
-
|
|
190
|
+
(`python -m ringspy run wood_cube.toml` does the same.) The options `--seed`, `--path` and `--geoName` override the values in the file, e.g. `ringspy run wood_cube.toml --seed 7 --geoName wood_cube_7`.
|
|
177
191
|
|
|
178
|
-
|
|
192
|
+
Functions in `MeshGenTools` library will be called to create the initial mesh, wood cell particles following certain cell size distribution will be placed, then `Scipy.voronoi` function will be called to form the initial 2D Voronoi tessellation, additional code reforms the tesselation and generates the desired files. A successful generation will end with the line "Mesh files written to ..." in the Terminal window.
|
|
179
193
|
|
|
180
|
-
|
|
194
|
+
A new folder should have been created in the `.\meshes` directory with the same name as the `geoName` in `wood_cube.toml`.
|
|
181
195
|
|
|
182
|
-
The
|
|
196
|
+
The same generation can be run from Python, e.g. to loop over parameters:
|
|
197
|
+
```python
|
|
198
|
+
import ringspy
|
|
199
|
+
|
|
200
|
+
result = ringspy.generate("wood_cube.toml") # same as: ringspy run wood_cube.toml
|
|
201
|
+
for seed in range(5):
|
|
202
|
+
ringspy.generate("wood_cube.toml", seed=seed, geoName=f"wood_cube_{seed}", stlFlag=False)
|
|
203
|
+
|
|
204
|
+
config = ringspy.Config(geoName="small_cube", r_max=2, box_size=1.0, seed=1) # parameters left out: defaults
|
|
205
|
+
result = ringspy.generate(config)
|
|
206
|
+
print(result.output_dir, result.nParticles, result.porosity)
|
|
183
207
|
```
|
|
184
|
-
|
|
208
|
+
Each example also has a short Python script next to it, e.g. `python wood_cube.py`.
|
|
209
|
+
|
|
210
|
+
*Note: template scripts of earlier versions (e.g. `tests/test_wood_cube.py` of v1.1), which call the `MeshGenTools` functions one by one, still work. Their placement functions take an optional `rng` argument (a seed or a `numpy.random.Generator`) to make the cell placement repeatable.*
|
|
211
|
+
|
|
212
|
+
${\textbf{(New feature in version v0.4.x)}}$
|
|
213
|
+
|
|
214
|
+
The Lloyd's relaxation (a.k.a. Lloyd's algorithm) has been integrated with the mesh generation, one may use this approach by changing the following line in the input file (see [`wood_cube_lloyd.toml`](https://github.com/kingyin3613/ringspy/tree/main/examples/wood_cube_lloyd.toml)):
|
|
215
|
+
```toml
|
|
216
|
+
radial_growth_rule = "binary_lloyd"
|
|
185
217
|
```
|
|
186
218
|
This allows a rapid radial generation of more regular centroidal Voronoi cells from the `generation_center` (see the difference between `wood_binary` and `wood_binary_lloyd` in the preview of 2D cross-sections in section 2.2). For more detail of the algorithm, see [Wiki - Lloyd's algorithm](https://en.wikipedia.org/wiki/Lloyd's_algorithm)).
|
|
187
219
|
|
|
@@ -203,8 +235,9 @@ The following files should be generated in the `.\meshes\geoName` directory with
|
|
|
203
235
|
- Paraview vtk file for initial grain solid configuration: `wood_cube_beams.vtu`
|
|
204
236
|
- Paraview vtk file of initial cell ridge configuration: `wood_cube_conns.vtu`
|
|
205
237
|
- Paraview vtk file of initial connector (volume) configuration: `wood_cube_conns_vol.vtu`
|
|
238
|
+
- The `.vtu` files are written as text. For large models, `rpgen.VisualizationFiles(..., vtk_format='binary')` writes them as binary files instead, which are faster to write and read and about 3 times smaller.
|
|
206
239
|
- (Optional) 3D model files
|
|
207
|
-
- STL file of initial cellular solid configuration: `wood_cube.stl`
|
|
240
|
+
- Binary STL file of initial cellular solid configuration: `wood_cube.stl`
|
|
208
241
|
- (Optional) Abaqus input files
|
|
209
242
|
- INP file of simulation input of initial cellular solid configuration in `Abaqus`: `wood_cube.inp`
|
|
210
243
|
|
|
@@ -254,7 +287,7 @@ A scientific visualization application `ParaView` can directly visualize the gen
|
|
|
254
287
|

|
|
255
288
|
|
|
256
289
|
### 4. (Optional) Numerical Simulation
|
|
257
|
-
The mesh generation tool can also prepare the input files for the numerical simulations of the cellular solid in other softwares. By now (version 1.
|
|
290
|
+
The mesh generation tool can also prepare the input files for the numerical simulations of the cellular solid in other softwares. By now (version 1.x), the input file format, `.inp`, that is used in a finite element method (FEM) software `Abaqus` is supported, if the INP flag is on. `Abaqus` is a commerical software suite for integrated computer-aided engineering (CAE) and finite element analysis, own by `Dassault Systèmes`. One may refer to its [Wiki](https://en.wikipedia.org/wiki/Abaqus) for more about `Abaqus`, and to [Introduction](https://bertoldi.seas.harvard.edu/files/bertoldi/files/abaqusinputfilemanualv1.pdf?m=1444417191) for the introduction of Abaqus input files.
|
|
258
291
|
|
|
259
292
|
All steps for the model setup can be accomplished through manually coding the Abaqus input file in a text editor. The method used in the example procedure shown below requires access to the Abaqus GUI.
|
|
260
293
|
|
|
@@ -279,14 +312,30 @@ All steps for the model setup can be accomplished through manually coding the Ab
|
|
|
279
312
|

|
|
280
313
|
|
|
281
314
|
## Contributing
|
|
315
|
+
[](https://doi.org/10.21105/joss.04945)
|
|
316
|
+
|
|
317
|
+
If you make use of this code, or find it is useful for your own research , please cite the JOSS paper:
|
|
318
|
+
```
|
|
319
|
+
@article{ringspy,
|
|
320
|
+
doi = {10.21105/joss.04945},
|
|
321
|
+
url = {https://doi.org/10.21105/joss.04945},
|
|
322
|
+
year = {2023},
|
|
323
|
+
publisher = {The Open Journal},
|
|
324
|
+
volume = {8},
|
|
325
|
+
number = {83},
|
|
326
|
+
pages = {4945},
|
|
327
|
+
author = {Hao Yin and Gianluca Cusatis},
|
|
328
|
+
title = {RingsPy: A Python package for Voronoi mesh generation of cellular solids with radial growth pattern},
|
|
329
|
+
journal = {Journal of Open Source Software}
|
|
330
|
+
}
|
|
331
|
+
```
|
|
282
332
|
|
|
283
333
|
Contributions are always welcome!
|
|
284
334
|
|
|
285
335
|
If you wish to contribute code/algorithms to this project, or to propose a collaboration study, please send an email to haoyin2022 [at] u.northwestern.edu .
|
|
286
|
-
|
|
287
336
|
## License
|
|
288
337
|

|
|
289
338
|
|
|
290
|
-
Distributed under the GPL v3 license.
|
|
339
|
+
Distributed under the GPL v3 license.
|
|
291
340
|
|
|
292
341
|
|