Difference between revisions of "Using Octree Refinement and Mesh Smoothing"
(4 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
The octree refinement and smoothing can be called via the Python console in TexGen (or from a script). Once a textile is created then the following sequence of commands should be used: | The octree refinement and smoothing can be called via the Python console in TexGen (or from a script). Once a textile is created then the following sequence of commands should be used: | ||
− | t=GetTextile() | + | t=GetTextile() |
− | oc=COctreeVoxelMesh() | + | oc=COctreeVoxelMesh() |
− | # Generate an octree mesh (see details about the arguments below) | + | # Generate an octree mesh (see details about the arguments below) |
− | oc.SaveVoxelMesh(t, "my_octree_mesh", 3, 5, False, 50, 0.3, 0.3, False, False) | + | oc.SaveVoxelMesh(t, "my_octree_mesh", 10, 10, 2, 3, 5, False, 50, 0.3, 0.3, False, False) |
− | # Delete the object to free memory | + | # Delete the object to free memory |
− | del oc | + | del oc |
− | The function SaveVoxelMesh in COctreeVoxelMesh class takes 10 | + | The function <code>SaveVoxelMesh</code> in the <code>COctreeVoxelMesh</code> class takes 13 arguments: |
+ | |||
+ | SaveVoxelMesh(Textile, Filename, XVoxNum, YVoxNum, ZVoxNum, Min Refinement, Max Refinement, Smoothing, Smoothing Iterations, Smoothing Parameter 1, | ||
+ | Smoothing Parameter 2, Create surfaces, Create cohesive contact) | ||
+ | |||
+ | The arguments are: | ||
+ | * Textile – textile geometry to mesh | ||
+ | * Filename – filename for the resulting mesh (TexGen will create inp, ori and eld files) | ||
+ | * XXVoxNum, YVoxNum, ZVoxNum - starting number of voxels in x, y and z directions. For best results select values which give the same voxel dimension in all three axes. | ||
+ | * Min Refinement – minimum level of refinement. All elements will be refined at least to this level. Each level of refinement reduces the size of element by the factor of 2. This means that the maximum element size in a mesh with minimum level of refinement M will be L/2M, where L is the size of textile | ||
+ | * Max Refinement – maximum level of refinement. Only elements on the interface between two materials or close to it will be refined to this level of refinement. | ||
+ | * Smoothing – enabling the smoothing algorithm. The smoothing algorithm will move the yarn surface nodes according to the [http://www.cs.jhu.edu/~misha/Fall07/Papers/Taubin00.pdf Laplacian smoothing algorithm] | ||
+ | **False - no smoothing | ||
+ | **True - smoothing enabled | ||
+ | |||
+ | * Smoothing iterations – number of smoothing iterations | ||
+ | * Smoothing Parameter 1 – [https://diglib.eg.org/handle/10.2312/egst20001029 smoothing coefficient 1] | ||
+ | * Smoothing Parameter 2 – [https://diglib.eg.org/handle/10.2312/egst20001029 smoothing coefficient 2] | ||
+ | * Create surfaces - generate sets of nodes for surfaces between yarns and matrix | ||
+ | **False - no surface sets will be generated | ||
+ | **True - surfaces will be generated | ||
+ | * Create cohesive contact – define cohesive contact between yarns and matrix | ||
+ | **False - no contact generated | ||
+ | **True - nodes on the surfaces between yarns and matrix will be duplicated to "decouple" the yarns and matrix, cohesive contacts will be created |
Latest revision as of 16:51, 10 February 2021
Voxel meshing presents an easy way of meshing textile composites of arbitrary complexity. However, the voxel discretisation of curved surfaces creates artificial stress concentrations which can affect results of finite element analysis. In addition, since a voxel mesh has a uniform size of elements, it might require a large number of elements to achieve a good resolution to capture yarns etc.
Octree mesh refinement allows the creation of meshes with voxels of variable size. This is achieved by selective refinement of voxels which are close to yarns surfaces. These voxels are split into 8 smaller voxels which can be also be split in smaller voxels until a desired element size is achieved. This allows creation of an octree-refined voxel mesh which can give more precise results than a regular voxel mesh with the same number of elements.
In addition to the octree refinement, a smoothing algorithm can be applied to the generated octree-refined mesh. The smoothing algorithm moves the nodes on the yarns surface in order to generate a smoother surface which would not create stress concentrations. Details of the algorithm and description of its parameters can be found here
Details of the method will be published soon.
Python Functions for Octree Refinement and Smoothing
The octree refinement and smoothing can be called via the Python console in TexGen (or from a script). Once a textile is created then the following sequence of commands should be used:
t=GetTextile() oc=COctreeVoxelMesh() # Generate an octree mesh (see details about the arguments below) oc.SaveVoxelMesh(t, "my_octree_mesh", 10, 10, 2, 3, 5, False, 50, 0.3, 0.3, False, False) # Delete the object to free memory del oc
The function SaveVoxelMesh
in the COctreeVoxelMesh
class takes 13 arguments:
SaveVoxelMesh(Textile, Filename, XVoxNum, YVoxNum, ZVoxNum, Min Refinement, Max Refinement, Smoothing, Smoothing Iterations, Smoothing Parameter 1, Smoothing Parameter 2, Create surfaces, Create cohesive contact)
The arguments are:
- Textile – textile geometry to mesh
- Filename – filename for the resulting mesh (TexGen will create inp, ori and eld files)
- XXVoxNum, YVoxNum, ZVoxNum - starting number of voxels in x, y and z directions. For best results select values which give the same voxel dimension in all three axes.
- Min Refinement – minimum level of refinement. All elements will be refined at least to this level. Each level of refinement reduces the size of element by the factor of 2. This means that the maximum element size in a mesh with minimum level of refinement M will be L/2M, where L is the size of textile
- Max Refinement – maximum level of refinement. Only elements on the interface between two materials or close to it will be refined to this level of refinement.
- Smoothing – enabling the smoothing algorithm. The smoothing algorithm will move the yarn surface nodes according to the Laplacian smoothing algorithm
- False - no smoothing
- True - smoothing enabled
- Smoothing iterations – number of smoothing iterations
- Smoothing Parameter 1 – smoothing coefficient 1
- Smoothing Parameter 2 – smoothing coefficient 2
- Create surfaces - generate sets of nodes for surfaces between yarns and matrix
- False - no surface sets will be generated
- True - surfaces will be generated
- Create cohesive contact – define cohesive contact between yarns and matrix
- False - no contact generated
- True - nodes on the surfaces between yarns and matrix will be duplicated to "decouple" the yarns and matrix, cohesive contacts will be created