GeometryMaker¶
- class geometry_maker.GeometryMaker¶
Access Hypnos functionality
- parameter_filler¶
Handles processing of json files
- Type
- design_tree¶
Parameters for constructing geometry
- Type
dict
- constructed_geometry¶
Python classes corresponding to constructed geometry
- Type
dict
- key_route_delimiter¶
delimiter for parameter paths
- Type
str
- change_delimiter(delimiter: str)¶
Change the delimiter to use in key paths for the change_params and get_param methods. By default the delimiter is ‘/’.
- Parameters
delimiter (str) – New delimiter
- change_params(updated_params: dict)¶
Change parameters in stored design tree. A parameter is referenced using it’s path. This path is a string of the keys that are used to access that parameter in the json file.
For example to change the value of the parameter ‘pin spacing’ to 135 here: { “class”: “hcpb_blanket”, “geometry”: {“pin spacing”: 100} }
The argument provided here would have to be {“geometry/pin spacing”: 135} with ‘/’ being the default delimiter.
- Parameters
updated_params (dict) – dictionary of the form {path to parameter : updated value}
- exp_scale(scaling: int)¶
Scale size of the geometry by 10^(scaling) to change what units cubit reports in. The default parameters assume 1 cubit unit = 1mm. So, for example, to get 1 cubit unit = 1cm you would use scaling = -1.
- Parameters
scaling (int) – Exponent to scale by
- export(format: str = 'cubit', rootname: str = 'geometry')¶
Export mesh/ geometry in specfied format
- Parameters
format (str, optional) – file format, by default “cubit”
rootname (str, optional) – filename, including path if in a different directory, by default “geometry”
- export_exodus(rootname: str = 'geometry', large_exodus=False, HDF5=False)¶
Export as exodus II file.
- Parameters
rootname (str, optional) – Name to give output file including path, by default “geometry”
large_exodus (bool, optional) – Create a large model that can store individual datasets > 2GB, by default False
HDF5 (bool, optional) – Create a model that can store even larger files, by default False
- file_to_tracked_geometry(filename: str)¶
Parse json file, make geometry, imprint + merge it, track boundaries.
- Parameters
filename (str) – name of json file
- fill_design_tree()¶
Process design_tree manually
- Returns
processed design tree
- Return type
dict
- get_param(param_path: str)¶
Get parameter in stored design tree. A parameter is referenced using it’s path.
For example to get the value of the parameter ‘pin spacing’ here: { “class”: “hcpb_blanket”, “geometry”: {“pin spacing”: 100} }
The argument provided here would have to be “geometry/pin spacing” with ‘/’ being the default delimiter.
- Parameters
param_path (str) – Path to parameter
- Returns
value of parameter
- Return type
any
- imprint_and_merge()¶
Imprint and merge geometry in cubit.
- make_geometry()¶
Build geometry corresponding to design tree in cubit
- Returns
- Return type
Class corresponding to the constructed cubit geometry
- make_merged_geometry()¶
Make geometry, imprint and merge
- make_tracked_geometry()¶
Make geometry, imprint + merge it, track boundaries.
- parse_json(filename: str)¶
Parse a json file and add corresponding design tree to design_tree attribute
- Parameters
filename (str) – name of json file
- Returns
processed design tree
- Return type
dict
- reset_cubit()¶
Reset cubit and corresponding internal states.
- set_mesh_size(size: int)¶
Set approximate mesh size in cubit
- Parameters
size (int) – Mesh size in cubit units
- tetmesh()¶
Mesh geometry in cubit
- track_components_and_materials()¶
Add components to blocks and component-component interfaces to sidesets Add materials and material-material interfaces to groups.