sgio.write#
- sgio.write(sg: StructureGene, filename: str, file_format: str, format_version: str = '', analysis: str = 'h', sg_format: int = 1, prop_ref_y: str = 'x', macro_responses: list[StateCase] | None = None, model_type: str | None = None, load_type: int = 0, sfi: str = '8d', sff: str = '20.12e', mesh_only: bool = False, binary: bool = False, model_file: str | None = None, model_file_format: str | None = None, omega: float | None = None) str#
Write analysis input.
- Parameters:
sg (StructureGene) – Structure gene object.
filename (str) – Name of the input file.
file_format (str) – Format of the SG data file. Choose one from ‘vabs’, ‘sc’, ‘swiftcomp’, ‘gmsh’, ‘vtk’, ‘vtu’, or ‘sg_manifest’.
format_version (str, optional) – Version of the format; for ‘sg_manifest’, of the model file format. Default is
''(the writer’s default version).analysis (str, optional) –
Indicator of SG analysis. Default is
'h'. Choose one from’h’: Homogenization
’d’ or ‘l’: Dehomogenization
’fi’: Initial failure indices and strength ratios
sg_format ({0, 1}, optional) – Format for the VABS input. Default is 1.
prop_ref_y (str, optional) – Reference axis selector for material orientation. Default is
'x'.macro_responses (list[StateCase], optional) – Macroscopic responses. Default is
None(treated as empty).model_type (str, optional) – Type of the macro structural model. Defaults to the model type of
sg; for ‘sg_manifest’ it must agree with it.load_type (int, optional) – Type of the load. Default is 0.
sfi (str, optional) – String formatting for integers. Default is
'8d'.sff (str, optional) – String formatting for floats. Default is
'20.12e'.mesh_only (bool, optional) – If True, write meshing data only. Default is False.
binary (bool, optional) – For Gmsh output, write binary instead of ASCII. Default is False.
model_file (str, optional) – For ‘sg_manifest’: path of the model file relative to the manifest directory. The model file is written too.
model_file_format (str, optional) – For ‘sg_manifest’: format of the model file (‘vabs’ or ‘swiftcomp’).
omega (float, optional) – SG measure written to SwiftComp input; overrides
sg.omegafor this write without changingsg. Only valid for ‘swiftcomp’ output.
- Returns:
The output filename.
- Return type:
str