SG Manifest#
Normative specification of the SG manifest (*.sg.json), the primary on-disk
form of a structure gene in sgio.
No single file format fully describes an SG: an Abaqus .inp or Gmsh .msh
carries no sgdim, model type or model space, a .msh carries no materials,
and a SwiftComp input does not state its own smdim. A manifest holds these
SG-level parameters and references exactly one model file that holds the
rest.
import sgio
sg = sgio.read('section.sg.json', 'sg_manifest')
sgio.convert('section.sg.json', 'section.sg', 'sg_manifest', 'vabs')
# Writes section.msh and section.sg.json
sgio.write(
sg, 'section.sg.json', 'sg_manifest',
model_file='section.msh', model_file_format='gmsh',
)
Schema (version 1)#
{
"sg_manifest_version": 1,
"model_file": {"path": "section.msh", "format": "gmsh"},
"sgdim": 2,
"model_type": "BM2",
"model_space": "xy",
"initial_twist": 0.0,
"initial_curvature": [0.0, 0.0],
"oblique": [1.0, 0.0],
"config": {"analysis": 0, "physics": 0},
"materials": [
{"name": "carbon", "model": "sd1", "isotropy": 1, "elastic": {"e1": 1.4e11}}
],
"sections": [
{"name": "ply_0", "id": 1, "material": "carbon", "orientation": 0.0},
{"name": "ply_45", "id": 2, "material": "carbon", "orientation": 45.0}
]
}
Field |
Rule |
|---|---|
|
required; unknown versions are rejected |
|
required; relative to the manifest directory |
|
required; |
|
required for |
|
required; never inferred from element dimension |
|
required; the same string the API takes ( |
|
mesh axes of a 1D/2D SG ( |
|
optional beam/shell geometry |
|
optional |
|
grouped material records, each with a unique |
|
records with |
Unknown fields are rejected.
Sections and Mesh Elements#
For a Gmsh model file, sections bind mesh physical groups to materials:
element -> entity -> physical tag -> physical name -> section -> material
A section record matches a physical group by name, falling back to id (the
physical tag) when the name is absent or unmatched. Elements whose physical
group matches no section — an auxiliary boundary group, for example — are not
SG elements. The mesh-level field layout is in SG-on-Gmsh Serialization.
Writing#
sgio.write(..., 'sg_manifest', model_file=..., model_file_format=...) writes
the model file first, then the manifest without the owned fields. Model files
can be written as gmsh, swiftcomp or vabs; sgio has no Abaqus writer.
The manifest records the swiftcomp/vabs format version actually written.