Creating StructureGene from Custom Mesh Data#

This guide explains how to create a StructureGene object from your own mesh data when your format is not directly supported by sgio.

Note

If you just want to get started quickly, skip to Quick Start: Simple Triangle Mesh.

Overview#

When you have mesh data from custom software or proprietary formats that you want to analyze with VABS or SwiftComp, you need to:

  1. Create a StructureGene object with basic configuration (name, dimensions)

  2. Build the mesh with nodes, elements, and connectivity

  3. Define materials and their properties

  4. Assign materials to elements using property IDs and mocombos

  5. Write to VABS/SwiftComp format

What You Need#

Required Data:
  • Nodal coordinates (x, y, z for each node)

  • Element connectivity (which nodes form each element)

  • Element types (triangle, quad, tetrahedron, etc.)

  • Material properties (elastic moduli, density, etc.)

Optional Data:
  • Original node/element IDs (to preserve your numbering)

  • Material orientations (for composites)

  • Node/element sets (for boundary conditions)

Guide Contents#

Key Concepts#

StructureGene

The main container for your mesh and material data. Think of it as your complete finite element model ready for homogenization analysis.

Mesh (using meshio format)

Contains nodes (points), elements (cells), and associated data. Uses 0-based indexing for connectivity.

Materials

Stored by name in a dictionary. Can be isotropic, transversely isotropic, or orthotropic.

Mocombos (Material-Orientation Combinations)

Maps property IDs to (material_name, orientation_angle) pairs. This allows using the same material at different angles.

Property IDs

Integer IDs assigned to each element that reference a mocombo, which then references a material and orientation.

Workflow Diagram#

Your Mesh Data
     |
     v
Parse nodes, elements, materials
     |
     v
Create StructureGene
     |
     +-- Set dimensions (sgdim, smdim)
     +-- Add materials to sg.materials{}
     +-- Create mocombos mapping
     +-- Build mesh with 0-based connectivity
     |
     v
Write to VABS/SwiftComp
     |
     v
Run homogenization analysis

Next Steps#