Load#

Load module consist of class/methods which wraps `OpenSeesPy` to create and run load analysis. First part of the module comprise the user interface functions. Following are the classes of various load types, compound load, load case, moving load and moving load path.

create_load_vertex(**kwargs)#

User interface function to create a load vertex. Load vertices are used in defining loads. For example, a point load consist of a single load vertex while a patch load is defined using four load vertices for each of its corner.

Parameters:

kwargs – Keyword arg, see below.

Keyword:

  • x (float or int): Value of x coordinate

  • y (float or int): Value of y coordinate. Default is model plane y = 0

  • z (float or int): Value of z coordinate

  • p (float or int): Magnitude of vertical load in y direction.

Returns:

namedTuple LoadPoint(x,y,z,p)

Except:

ValueError if missing one or more keyword arguments.

create_point(**kwargs)#

User interface function to create a Point namedTuple. :param kwargs: See below :keyword:

  • x (float or int): Value of x coordinate

  • y (float or int): Value of y coordinate. Default is y = 0

  • z (float or int): Value of z coordinate

Returns:

Point(x,y,z) namedTuple

create_load_case(**kwargs)#

User interface function to create LoadCase objects. Following this function, users are required add loads to LoadCase object via add_load().

Keyword:

  • name(str): Name string of Load case object

Returns:

LoadCase object

create_compound_load(**kwargs)#

User interface function to create CompoundLoad object. Following this function users are required to add loads to object via add_load().

Returns:

CompoundLoad

create_load(**kwargs)#

User interface function to create load types.

Keyword:

  • type(str): type of load. Choose either [“point”,”line”,”patch”,”nodal”]

  • point# (LoadPoint namedTuple): LoadPoint for load type in global coordinate. Note different load type requires a

different minimum LoadPoint. * local_load_point_# (LoadPoint namedTuple): LoadPoint for load type in local coordinate. Note different load type requires a different minimum LoadPoint.

Returns:

PointLoad, LineLoading, PatchLoading, or NodalForces

create_moving_load(**kwargs)#

User interface function to create Moving Load object. Following this function, users are required to:

*. Set a common path to object via set_path() *. Add loads to object via add_load()

Returns:

MovingLoad object

Keyword:

  • **common_path**(Path): Path object for all load groups added to the Moving load object to traverse

  • **global_increment**(float or int): Number of increments to discretize Path object. This keyword is only used in advance usage where Moving Load contains multiple load groups each with unique path objects.

create_moving_path(**kwargs)#

User interface function to create Path object for moving load.

Keyword:

  • start_point (Point): Start point of path

  • end_point (Point): End point of path

  • increments (int): Increment of path steps. Default is 50

  • mid_point (Point): Default = None

Returns:

Path object

LoadPoint#

alias of Point

NodeForces#

alias of node_forces

Line#

alias of line

class Loads(**kwargs)#

Bases: object

Base class for Point, Line , and Patch loads

Parameters:
  • name – Name of load

  • Fx – Axis force in x axis

  • Fy – Axis force in y axis

  • Fz – Axis force in z axis

  • Mx – Moment about x axis

  • My – Moment about y axis

  • Mz – Moment about z axis

  • kwargs – see below

Keyword:

  • point1, point2, …, point8 : (LoadPoint namedTuple) coordinate points with force magnitude describing the load type

  • localpoint1, localpoint2, …, localpoint8: (LoadPoint namedTuple) local coordinate points with force magnitude describing the load type

load_point_1: Point#
load_point_2: Point#
load_point_3: Point#
load_point_4: Point#
load_point_5: Point#
load_point_6: Point#
load_point_7: Point#
load_point_8: Point#
move_load(ref_point: Point)#

Function to move each load point of load type by a reference coordinate. This function is handled by OpsGrillage :param ref_point: coordinate to be moved :type ref_point: namedTuple Point(x,y,z) :return: increment each load point by +x, +y, +z where (x,y,z) is the coordinate prescribed by ref_point

apply_load_factor(factor=1)#

Apply load factor to each load point’s p value (vertical P force)

get_magnitude()#

return the load points defined in the Load class

class NodalLoad(node_tag: int, node_force, name=None)#

Bases: Loads

Class for Nodal loads.

Inits the Nodal load class. NodalLoad requires a NodalForce(Fx,Fy,Fz,Mx,My,Mz) as input.

Parameters:
  • name (str) – Name of load

  • node_tag (int) – Node tag of grillage model for nodal load to be applied

  • node_force (NodalForces(Fx,Fy,Fz,Mx,My,Mz)) – Named tuple of node forces

get_nodal_load_str()#

Returns an ops.load() command for the NodalLoad.

load_point_1: Point#
load_point_2: Point#
load_point_3: Point#
load_point_4: Point#
load_point_5: Point#
load_point_6: Point#
load_point_7: Point#
load_point_8: Point#
class PointLoad(**kwargs)#

Bases: Loads

Class for Point loads.

Parameters:
  • name

  • kwargs

load_point_1: Point#
load_point_2: Point#
load_point_3: Point#
load_point_4: Point#
load_point_5: Point#
load_point_6: Point#
load_point_7: Point#
load_point_8: Point#
class LineLoading(**kwargs)#

Bases: Loads

Class for line loading.

Init the LineLoading class. :param name: :param kwargs:

interpolate_udl_magnitude(point_coordinate)#
get_point_given_distance(xbar, point_coordinate)#
get_line_segment_given_x(x)#
get_line_segment_given_z(z)#
load_point_1: Point#
load_point_2: Point#
load_point_3: Point#
load_point_4: Point#
load_point_5: Point#
load_point_6: Point#
load_point_7: Point#
load_point_8: Point#
class PatchLoading(**kwargs)#

Bases: Loads

Class for Patch loads.

By default requires at least 4 load point for patch (quadrilateral). Can take up to 8 load points.

Init the PatchLoad class. :param name: :param kwargs:

load_point_1: Point#
load_point_2: Point#
load_point_3: Point#
load_point_4: Point#
load_point_5: Point#
load_point_6: Point#
load_point_7: Point#
load_point_8: Point#
class CompoundLoad(name: str)#

Bases: object

Class for Compound load. Used to group different Load objects into a Compound load group.

When a Load object is pass as an input, CompoundLoad treats the initial positions (load_points) of the Load classes as local coordinates. Then CompoundLoad sets the loads “in-place” of the local coordinate. If class input local_coord is given, CompoundLoad replaces the coordinates of the initial load points (retaining the magnitude of load points)

When set_global_coord() function is called, CompoundLoad sets the input global coordinate as the new centroid of the compounded load groups. This is done by shifting each local coordinate load point in all load groups under CompoundLoad by x (global) and z (global).

Here are a few relationships between CompoundLoad and other classes

  • CompoundLoad object can have Loads class and its inheritances (Line, Point, Patch)

  • CompoundLoad handles functions of Load classes (e.g. move_load)

Init the CompoundLoad class

add_load(load_obj: Loads)#

Adds a Load to compound load group. If a local_coord parameter is given, this new local_coord overwrites the coordinates (either local or global) of the load object.

..note:

If load object is defined using local coordinate and local_coord is None, its default local coord precedes.

Parameters:
set_global_coord(global_coord: Point)#

Set global coordinate of the compound load with respect to global coordinate system of grillage model. The global coordinate is set to all local load points (i.e. it adds the global coord x y z to each local coord)

Parameters:

global_coord (Point namedTuple) – Value of x y z (global coord) to offset the basic coordinate system

class LoadCase(name: str)#

Bases: object

Main class for load cases. Each load case holds information about: #. Load object types (point line patch or combination i.e. compound load) #. load case ops load command line - this is generated by ops-grillage class method (add_load_case()) and updated to LoadCase class object. #. Load factor - all load objects within a Load case are link to one same load factor

Here are a few relationships between LoadCase and other classes

  • MovingLoad class creates a series of load case representing the movement of load objects in each load case.

  • Load combination takes in several LoadCase class instance with varied load factors into a single analysis

  • Analysis class handles the ops. commands required for

  • OpsGrillage class takes in load case and updates the variable ‘load_command_list’ after distributing loads within the LoadCase class to nodes/elements of the Mesh in OpsGrillage.

  • LoadCase class can have Load objects or CompoundLoad class object

Init the LoadCase Class

Parameters:

name – str of load case name

add_load(load_obj: Loads | CompoundLoad, **kwargs)#

Add a Load or Compound load object to LoadCase

Parameters:
  • load_objLoads or :class:`~ospgrillage.load.CompoundLoad`object

  • kwargs – keyword arguments

Keyword:

  • global_coord_of_load_obj (Point namedTuple): if load objects are defined in local coordinate, this parameter is required to set the origin of local coordinate of load groups onto the global coordinate of the grillage

move_load_group(ref_point: Point)#

Set the position of the load/Compound load’s local reference coordinate to the input ref_point

class MovingLoad(name, **kwargs)#

Bases: object

Main class of moving load case. MovingLoad class parses and creates multiple loadcase object corresponding to traversing the input load groups - be it compound or single. Moving load is able to set various path (defined by Path class object) to individual load groups.

Parameters:

name – Name string of moving load

Keyword:

  • common_path (Path): Path object specifying the common path for all loads defined in moving load to traverse

  • global_increment(int): Number of increments to discretize Path object.

Note

global_increment argument is used in advance moving load analysis, where a moving load object attributes each assigned load type with a corresponding unique Path object (which can differ between different paths).

set_path(path_obj)#

Function to assign/modify the common path variable with a new Path object. All loads added later to Moving load object will traverse the same common path object.

Parameters:

path_obj (Path) – Path object to specify common path variable.

add_load(load_obj: Loads | CompoundLoad, path_obj=None)#

Function to set a load type (Loads class object) with its path (Path class object). Function accepts compound load (Compound load class) as a load input, which in turn sets the path object to all loads within the compound load group.

Parameters:
  • load_obj – Loads class object , or Compound load object

  • path_obj – Path class object - this is for advance use, where users specify unique path object for each load within the moving load object.

parse_moving_load_cases()#
query(incremental_lc_name, **kwargs)#

Function to query properties of moving load

Parameters:
  • incremental_lc_name (str) – Name string of load case to query properties

  • kwargs

Returns:

class Path(start_point: Point, end_point: Point, increments: int = 50)#

Bases: object

Class for moving load path for MovingLoad.

Init the Path class

get_path_points() list#

Return a list of path points

get_custom_path_points(new_increment)#
create_load_model(**kwargs)#

Function to create a CompoundLoad object of a vehicle load model model :return: LoadModel object

class LoadModel(gap=0, **kwargs)#

Bases: object

Class to handle load model generator. This contains library of load models and creates load model using CompoundLoad class.

For users wishing to contribute/add load models, do so herein by adding the load model as a function to this class.

Init the class.

Parameters:
  • gap – Gap between axle (specific to M1600)

  • kwargs – See below

create()#
create_m1600_vehicle(gap)#

AS5100 Australian load model.

Parameters:

gap – Gap between axle group

Returns:

CompoundLoad object of a M1600 vehicle in local coordinate.

class ShapeFunction(option_three_node: str = 'triangle_linear', option_four_node='hermite')#

Bases: object

Class for shape functions.

To add more shape functions: * add the string options get_shape_function() * defining the shape function as a class function which takes eta and zeta as inputs

Init the ShapeFunction class. Each shape function can either be triangular or quadrilateral

get_shape_function(option: str, eta: float = 0, zeta: float = 0)#

Returns the shape function calculated outputs

static hermite_shape_function_1d(zeta: float, a: float)#

1D hermite shape function

Parameters:
  • zeta – absolute position in x direction

  • a – absolute position in x direction

Returns:

Four terms [N1, N2, N3, N4] of hermite shape function

static hermite_shape_function_2d(eta: float, zeta: float)#

2D Hermite shape function

static linear_shape_function(eta, zeta)#

2D linear beam shape function

Parameters:
  • zeta – absolute position in x direction

  • eta – absolute position in z direction

Returns:

Four terms [N1, N2, N3, N4] of Linear shape function

Note

Further validation needed - trial on different bridge models

static linear_triangular(x, z, x1, z1, x2, z2, x3, z3)#

2D linear triangular shape function