Analysis models#

loadtracer.analysis_models.analysis_model#

class loadtracer.analysis_models.analysis_model.AbstractAnalysisModel[source]#

Bases: ABC

An abstract base class (“abc”) to describe the interface required of any and all classes used as analysis models within loadtracer.

Parameters:
  • pm – A papermodels model (dict)

  • model – An attribute to store the analysis model while it is being used

pm: dict#
model: Any | None = None#
get_reactions(*args, **kwargs)[source]#
dump_model(fp=None)[source]#

If ‘fp’ is None, then a dict is returned

Parameters:

fp (StringIO | None)

Return type:

dict | None

load_model(fp=None, model_data=None)[source]#
Parameters:
classmethod from_papermodel(filepath=None, model_data=None)[source]#
Parameters:
  • filepath (str | Path | None)

  • model_data (dict | None)

loadtracer.analysis_models.frame_model#

class loadtracer.analysis_models.frame_model.PyniteFrame(pm: dict, model: Pynite.FEModel3D.FEModel3D | None = None)[source]#

Bases: AbstractAnalysisModel

Parameters:
  • pm (dict)

  • model (FEModel3D | None)

pm: dict#
get_reactions()[source]#

Returns the reactions keyed by support index (see get_support_reactions). A member with no loads has empty reactions at each support.

Return type:

dict[int, dict]

dump_model(fp=None, indent=2)[source]#

Dumps the model to ‘fp’. If ‘fp’ is None, then a Python dict is returned.

Parameters:
Return type:

dict | None

load_model(fp=None, model_data=None)[source]#

Loads the model from either ‘fp’ or ‘model_data’ and returns a dict

Parameters:
Return type:

dict

classmethod from_papermodel(model_data=None, filepath=None)[source]#

Loads the model from either ‘fp’ or ‘model_data’ and returns a dict

Parameters:
  • model_data (dict | None)

  • filepath (str | Path | None)

Return type:

dict

loadtracer.analysis_models.frame_model.build_pynite_frame_model(pm, material=None, section=None, load_combinations=None)[source]#

Returns a FEModel3D populated with the data from ‘pm’.

Parameters:
  • pm (dict)

  • material (dict | None)

  • section (dict | None)

  • load_combinations (dict | None)

loadtracer.analysis_models.frame_model.pynite_default_material()[source]#
loadtracer.analysis_models.frame_model.pynite_default_section()[source]#
loadtracer.analysis_models.frame_model.get_node_locations(pm)[source]#

Returns a list of (location, constraints) for the nodes of the member, sorted by location. The member ends are included as free nodes (constraints = None) when there is no support at the end.

The first support is a pin and the others are rollers unless a support has a “fixity” of its own. Coincident supports (see validate_papermodel) are not modelled.

Raises UnstableMemberError if the supports cannot make the member stable.

Parameters:

pm (dict)

Return type:

list[tuple[float, list[int] | None]]

loadtracer.analysis_models.frame_model.get_support_reactions(model, pm)[source]#

Returns the reactions of the solved ‘model’ keyed by support index, in the same order as the supports in ‘pm’ (which is the order that papermodels uses for ‘transfer_reaction_index’). Every support is included, even when its reactions are zero, so that the indexes always line up.

e.g. {0: {“FY”: {“D”: -5.0, “L”: -10.0}, …}, 1: {…}}

Parameters:
  • model (FEModel3D)

  • pm (dict)

Return type:

dict[int, dict]

loadtracer.analysis_models.wall_model#

class loadtracer.analysis_models.wall_model.LoadbearingWall(pm: dict, model: loadbearing_wall.wall_model.LinearWallModel | None = None, vertical_spread_angle: float = 0, minimum_point_spread: float = 0.5)[source]#

Bases: AbstractAnalysisModel

Parameters:
  • pm (dict)

  • model (LinearWallModel | None)

  • vertical_spread_angle (float)

  • minimum_point_spread (float)

pm: dict#
vertical_spread_angle: float = 0#
minimum_point_spread: float = 0.5#
get_reactions()[source]#

Returns the reactions of the wall on its (single, continuous) support as distributed loads: {0: {dir: {case: [dist_load, …]}}}.

The magnitudes are the forces on the support, which is the same sign convention as the frame and column models (the opposite sign of the applied loads).

Return type:

dict[int, dict]

dump_model(filepath=None, indent=2)[source]#

Dumps the model to ‘filepath’. If ‘filepath’ is None, then a Python dict is returned.

Parameters:
Return type:

dict | None

load_model(filepath=None, model_data=None)[source]#

Loads the model from either ‘filepath’ or ‘model_data’ and returns a dict

Parameters:
  • filepath (str | Path | None)

  • model_data (dict | None)

Return type:

dict

classmethod from_papermodel(model_data=None, filepath=None)[source]#

Loads the model from either ‘fp’ or ‘model_data’ and returns a dict

Parameters:
  • model_data (dict | None)

  • filepath (str | Path | None)

Return type:

dict

loadtracer.analysis_models.wall_model.get_wall_height(pm, vertical_spread_angle)[source]#

Returns the wall height to use in the LinearWallModel for ‘pm’.

The height is only needed when ‘vertical_spread_angle’ is not zero. It is then read from the “height” value that the designer annotated on the wall (element_attributes.user_defined.height).

Parameters:
Return type:

float

loadtracer.analysis_models.wall_model.build_linear_wall_model(pm, vertical_spread_angle, minimum_point_spread)[source]#

Returns a LinearWallModel based on the data within ‘pm’.

The loads in ‘pm’ must be on the wall (see validation.conform_loads_to_member).

Parameters:
  • pm (dict)

  • vertical_spread_angle (float)

  • minimum_point_spread (float)

Return type:

LinearWallModel

loadtracer.analysis_models.column_model#

class loadtracer.analysis_models.column_model.PointColumn(pm: dict, model: loadtracer.analysis_models.concentric_column.concentric_column.ConcentricColumn | None = None)[source]#

Bases: AbstractAnalysisModel

Parameters:
pm: dict#
get_reactions()[source]#
dump_model(filepath=None, indent=2)[source]#

Dumps the model to ‘fp’. If ‘fp’ is None, then a Python dict is returned.

Parameters:
Return type:

dict | None

load_model(filepath=None, model_data=None)[source]#

Loads the model from either ‘fp’ or ‘model_data’ and returns a dict

Parameters:
  • filepath (str | Path | None)

  • model_data (dict | None)

Return type:

dict

classmethod from_papermodel(model_data=None, filepath=None)[source]#

Loads the model from either ‘fp’ or ‘model_data’ and returns a dict

Parameters:
  • model_data (dict | None)

  • filepath (str | Path | None)

Return type:

dict

loadtracer.analysis_models.column_model.build_column_model(pm)[source]#

Returns a ConcentricColumn based on the data within ‘pm’.

A concentric column carries the sum of its loads, so distributed loads (e.g. from a wall above) are added as their resultants.

Parameters:

pm (dict)

Return type:

ConcentricColumn

loadtracer.analysis_models.concentric_column#

class loadtracer.analysis_models.concentric_column.concentric_column.ConcentricColumn(*, height=None, point_loads=None, gravity_dir='z', strong_axis_dir='y', weak_axis_dir='x', reverse_reaction_sign=True)[source]#

Bases: BaseModel

Parameters:
  • height (float | None)

  • point_loads (list[dict] | None)

  • gravity_dir (str)

  • strong_axis_dir (str)

  • weak_axis_dir (str)

  • reverse_reaction_sign (bool)

height: float | None#
point_loads: list[dict] | None#
gravity_dir: str#
strong_axis_dir: str#
weak_axis_dir: str#
reverse_reaction_sign: bool#
model_post_init(_ConcentricColumn__context)[source]#

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

Parameters:

_ConcentricColumn__context (Any)

classmethod from_json(filepath)[source]#
Parameters:

filepath (str | Path)

to_json(filepath, indent=2)[source]#
Parameters:

filepath (str | Path)

classmethod from_dict(data)[source]#
Parameters:

data (dict)

dump_dict()[source]#
add_point_load(magnitude, location, case, direction)[source]#

Adds a point load to the collection of point loads

Parameters:
get_reactions()[source]#

Returns a float representing the total sum of loads for the given ‘dir’ (direction) and ‘case’ (load case).

Return type:

float

classmethod from_point_loads(point_loads)[source]#
Parameters:

point_loads (dict[str, dict[str, str | float]])

model_config = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].