Generate#
- class modularbuildingpy.core._generate.Generate(name, directory, logger, material, **kwargs)#
Bases:
objectThis class is used to generate the model.
Caution
This class is not meant to be used directly. Please use the
get_generate()method ofModelclass to call methods and attributes.- calculate_tributary_area(**kwargs) None#
- connection(**kwargs) None#
Creates the connection dataframes.
- diaphragm(**kwargs) None#
- element(**kwargs) None#
- geo_transf(**kwargs) None#
- height(height=None, **kwargs) None#
This method is used to define the height of the building. The height is defined by the height dictionary. The height dictionary is a nested dictionary with the following structure:
Here’s an example of a dictionary:
height = { "ground_level": 0.0, "1": { "module": 3.5 + 0.6, "vert_con": 0.6, }, "2-3": {"module": 3.5 + 0.45, "vert_con": 0.45}, }
The key of the first level of the dictionary is the story number. In this case this height is defined for stories 1 to 3 (inclusive). You can also define the ground level by using the key
ground_level(Default: 0.0).The value of the first level of the dictionary is a dictionary with the following keys:
module: The height of the module.vert_con: The height of the vertical connector.
- Parameters:
height (dict) – The height dictionary. Defaults to None.
- Keyword Arguments:
kwargs_plot (dict, optional) – The kwargs_plot dictionary. Defaults to {}.
- Raises:
ValueError – If height is not provided.
- Returns:
None
Examples
generate.height( height=input_height, )
Note
This method must be called after the layout method. Otherwise, it will raise a ValueError.
- layout(layout=None, horizontal_spacing=None, **kwargs)#
This method is used to define the layout of the model. The layout is defined by the modules dictionary. The modules dictionary is a nested dictionary with the following structure:
Here’s an example of a dictionary:
layouts = { "1-3": { 1: { "we-dir": 3.5, "sn-dir": 12, "location": "south-west", "brace": [ {"side": "west", "range": "entire", "type": "Chevron"}, ], "sw-coord": [0.0, 0.0], }, 2: { "we-dir": 3.5, "sn-dir": 10.4, "location": "north-1", "brace": [ {"side": "west", "range": "entire", "type": "Chevron"}, ], "sw-coord": [0.0, 12 + 0.35], }, }
The key of the first level of the dictionary is the story number. In this case this layout is defined for stories 1 to 3 (inclusive).
The key of the second level of the dictionary is the module number. Make sure you number the modules in the order you want them to be generated.
The value of the second level of the dictionary is a dictionary with the following keys:
we-dir: The width of the module in the west-east direction.sn-dir: The width of the module in the south-north direction.location: The location of the module in the story. The location can be one of the following:south-west,north-1,north-2,north-3,north-4,east-1,east-2,east-3,east-4.brace: The bracing configuration of the module. The bracing configuration is a list of dictionaries. Each dictionary in the list represents a bracing configuration. The dictionary has the following keys:side: The side of the module that is braced. The side can be one of the following:south,north,east,west.range: The range of the bracing. The range can be one of the following:entire,all,full,start-end. If the range isstart-end, then the bracing is applied from the start of the module to the end of the module. If the range isentire,all, orfull, then the bracing is applied from the start of the module to the end of the module.type: The type of the bracing. The type can be one of the following:Chevron,X.
sw-coord: The south-west coordinate of the module. The south-west coordinate is a list with two elements. The first element is the x-coordinate and the second element is the y-coordinate.
- Parameters:
layout (dict) – The layout dictionary. Defaults to None.
horizontal_spacing (float) – The horizontal spacing between the modules. Defaults to None.
- Keyword Arguments:
kwargs_plot (dict, optional) – The kwargs_plot dictionary. Defaults to {}.
- Raises:
ValueError – If layout or horizontal_spacing is not provided.
- Returns:
None
Examples
generate.layout( layout=input_layout, horizontal_spacing=0.5, )
- load(**kwargs) None#
Loads the input files and parses the data.
- node(**kwargs) None#
- partition(niter=100, ufactor=3, ncuts=10, **kwargs) None#
Partitions the modules.
- plot_module_3D(kwargs_plot={}, **kwargs) None#
- plot_neighbor(kwargs_plot={}, **kwargs) None#
- print_module_load(**kwargs) None#
Prints the self-weight of the modules.
- print_module_section(**kwargs) None#
- section_material(**kwargs) None#
- show_diaphragm_master(**kwargs) None#
Shows the diaphragm master nodes.