API reference#

User interface functions - API#

ospgrillage comprised of user interface functions callable from the main module. Following section summarizes the functions callable from all modules within ospgrillage.

Top level interface functions#

ospgrillage.material.create_material(**kwargs)

User interface function to create Material object

ospgrillage.members.create_section(**kwargs)

User interface function to create Section object.

ospgrillage.members.create_member(**kwargs)

User interface function to create GrillageMember object.

ospgrillage.osp_grillage.create_grillage(...)

User interface to create OspGrillage object.

ospgrillage.load.create_load_vertex(**kwargs)

User interface function to create a load vertex.

ospgrillage.load.create_load(**kwargs)

User interface function to create load types.

ospgrillage.mesh.create_point(**kwargs)

User interface function to create a point named tuple - this is used in defining positions such as loads for example.

ospgrillage.load.create_load_case(**kwargs)

User interface function to create LoadCase objects.

ospgrillage.load.create_compound_load(**kwargs)

User interface function to create CompoundLoad object.

ospgrillage.load.create_moving_path(**kwargs)

User interface function to create Path object for moving load.

ospgrillage.load.create_moving_load(**kwargs)

User interface function to create Moving Load object.

ospgrillage.postprocessing.plot_force(...[, ...])

Plots a force diagram of the provided OspGrillage and xarray (result) objects for a specified component and LoadCase's.

ospgrillage.postprocessing.plot_defo(...[, ...])

Plots displacements of the provided OspGrillage and xarray (result) objects for a specified component and LoadCase's.

ospgrillage.postprocessing.create_envelope(...)

Interface for users to create an Envelope object.

Grillage model interface API#

The following methods can be called on the ospgrillage.osp_grillage.OspGrillage object.

ospgrillage.osp_grillage.OspGrillage.set_member(...)

Set GrillageMember instance object to elements of grillage members.

ospgrillage.osp_grillage.OspGrillage.analyze(...)

Function to analyze defined load

ospgrillage.osp_grillage.OspGrillage.get_results(...)

Function to get results from specific or all load cases.

ospgrillage.osp_grillage.OspGrillage.get_nodes([...])

Function to return all information for nodes in grillage model

ospgrillage.osp_grillage.OspGrillage.get_element(...)

Function to query properties of elements in grillage model.

ospgrillage.osp_grillage.OspGrillage.clear_load_cases(...)

Function to remove all/specific load cases from model.

Load module API#

The following methods can be called from the respective class objects of the Load module.

ospgrillage.load.CompoundLoad.set_global_coord(...)

Set global coordinate of the compound load with respect to global coordinate system of grillage model.

ospgrillage.load.CompoundLoad.add_load(load_obj)

Adds a Load to compound load group.

ospgrillage.load.LoadCase.add_load(load_obj, ...)

Add a Load or Compound load object to LoadCase

ospgrillage.load.MovingLoad.set_path(path_obj)

Function to assign/modify the common path variable with a new Path object.

ospgrillage.load.MovingLoad.add_load(load_obj)

Function to set a load type (Loads class object) with its path (Path class object).

ospgrillage.load.MovingLoad.query(...)

Function to query properties of moving load

OspGrillage class#

For information regarding the procedures in OpsGrillage class, see Package design.

class OspGrillage(bridge_name: str, long_dim: float, width: float, skew: list | float | int, num_long_grid: int, num_trans_grid: int, edge_beam_dist: list | float | int, mesh_type: str = 'Ortho', model: str = '3D', **kwargs)#

Bases: object

Base class of grillage model.

Init the OspGrillage class

Parameters:
  • bridge_name (str) – Name of bridge model and output .py file

  • long_dim (int or float) – Length of the model in the longitudinal direction (default: x axis)

  • width (int or float) – Width of the model in the transverse direction (default: z axis)

  • skew (int or float) – Skew angle of the start and end edges of model

  • num_long_grid (int) – Number of grid lines in longitudinal direction

  • num_trans_grid (int) – Number of grid lines in the transverse direction -

  • edge_beam_dist (int or float) – Distance of edge beam node lines to exterior main beam node lines

  • mesh_type (string) – Type of mesh either “Ortho” for orthogonal mesh or “Oblique” for oblique mesh

  • kwargs – See below

Keyword:

  • beam_z_spacing: (list of int or float) Custom distance of longitudinal members (global z - direction). Note this parameter supercedes num_long_grid.

  • beam_x_spacing: (list of int or float) Custom distance of transverse members (global x - direction). Note this parameter supercedes num_trans_grid.

  • ext_to_int_dist: (Int or Float, or a List of Int or Float) distance between internal beams and exterior main beams. If list is provided (usually size 2), apply each distinct distance to left and right side respectively.

  • multi_span_dist_list: (List of Int/Float) List of distance (x dir) correspond to span length of each multi span

  • multi_span_num_points: (List of Int) Num of transverse member correspond to spans of each element in multi_span_dist_list If not specified, takes int var for num_trans_beam and assigns to all spans of multi_span_dist_list

  • continuous: (Bool) To set continuity of spans. Default True. If False, separate spans by non_cont_spacing_x

  • stitch_slab_elements: (Bool) To set stictch elements between spans. Elements are set using set_member() with member= “stich_elements”

  • non_cont_spacing_x: (float) sets spacing or length of stitch elements.

Raises:

ValueError – If skew angle is greater than 90. If number of transverse grid line is less than 2.

create_osp_model(pyfile: bool = False)#

Create model in OpenSees model space.

Parameters:

pyfile (bool) – if True returns an executable py file instead of creating OpenSees instance of model.

set_boundary_condition(edge_group_counter: int | None = None, new_restraint_vector: list | None = None)#

Set or modify customized support conditions of the Mesh

Note

Advanced version to set multispan feature to be available for future release.

set_member(grillage_member_obj: GrillageMember, member: str | None = None, specific_group: int | None = None, specific_span: int | None = None)#

Set GrillageMember instance object to elements of grillage members.

Parameters:
  • grillage_member_obj (GrillageMember) – GrillageMember class object

  • member (str) – str of member category - see below table for the available name strings

  • specific_group (int) – Specific member group particularly for interior main beams.

  • specific_span – Specific span number to assign member

Raises:

ValueError If missing member

set_spring_support(rotational_spring_stiffness: float, edge_num: int = 0, spring_direction=6)#

Sets a spring support value of rotational_spring_stiffness to all nodes of edge number.

add_load_case(load_case_obj: LoadCase | MovingLoad, load_factor=1) None#

Function to add load cases to Ospllage grillage model. Function also adds moving load cases

Parameters:
  • load_factor – Optional load factor for the prescribed load case. Default = 1

  • load_case_obj (LoadCase,MovingLoad) – LoadCase or MovingLoad object

analyze(**kwargs) None#

Function to analyze defined load

Keyword:

  • all (bool): If True, runs all load cases. If not provided, default to True.

  • load_case (‘list’ or ‘str’): String or list of name strings for selected load case to be analyzed.

  • set_verbose(bool): If True, incremental load case report is not printed to terminal (default True)

Except:

raise ValueError if missing arguments for either load_case=, or all=

add_load_combination(load_combination_name: str, load_case_and_factor_dict: dict)#

Function to add load combination to analysis. Load combinations are defined through a dict with load case name str to be included in combination as keys, and load factor (type float/int) as value of dict.

Parameters:
  • load_combination_name (str) – Name string of load combination

  • load_case_and_factor_dict (str) – dict with name string of load cases within the combination as key, corresponding load factor as value.

Example format of input dict for add_load_combination:

load_comb = {"name_of_load_case_1":1.2, "name_of_load_case_2": 1.5}

Note

As of release 0.1.0, load combinations can be directly obtained (calculated on the fly) by specifying combination kwarg in get_results(). Hence, add_combination is here for adding and storing information of load combination to OspGrillage object.

get_results(**kwargs)#

Function to get results from specific or all load cases. Alternatively, function process and returns load combination if “combina+tions” argument is provided. Result format is xarray DataSet. If a “save_file_name” is provided, saves xarray DataSet to NetCDF format to current working directory.

Keyword:

  • combinations (bool): If provided, returns a modified DataSet according to combinations defined. Format of argument is dict()

    with keys of load case name string and values of load factors (int of float)

  • save_file_name (str): Name string of file name. Saves to NetCDF.

  • load_case (str): str or list of name string of specific load case to extract. Returned DataSet with the specified Load cases only

Returns:

Xarray DataSet of analysis results - extracted based on keyword option specified. If combination is True, returns a list of DataSet, with each element correspond to a load combination.

get_element(**kwargs) List[float]#

Function to query properties of elements in grillage model.

Keyword:

  • options (`str): string for element data option. Either “elements” or “nodes” (default)

  • z_group_num (int): group number [0 to N] for N is the number of groups within a specific grillage element group.

    this is needed for interior beams, where users which to query specific group (e.g. 2nd group) within this “interior_main_beam” element group.

  • x_group_num (int): ditto for z_group_num but for x_group

  • edge_group_num(int): ditto for z_group_num but for edge groups

Returns:

List of element data (tag)

get_nodes(number: int | None = None) list#

Function to return all information for nodes in grillage model

Returns:

dict contain node information

clear_load_cases(**kwargs)#

Function to remove all/specific load cases from model. This function also resets the results stored in the model - users are require to re- analyze().

OspGrillageBeam class#

class OspGrillageBeam(bridge_name, long_dim, width, skew: list | float | int = 0, num_long_grid: int = 0, num_trans_grid: int = 0, edge_beam_dist: list | float | int = 1, mesh_type='Ortho', model='3D', **kwargs)

Bases: OspGrillage

Concrete class for beam grillage model type.

Init the OspGrillage class

Parameters:
  • bridge_name (str) – Name of bridge model and output .py file

  • long_dim (int or float) – Length of the model in the longitudinal direction (default: x axis)

  • width (int or float) – Width of the model in the transverse direction (default: z axis)

  • skew (int or float) – Skew angle of the start and end edges of model

  • num_long_grid (int) – Number of grid lines in longitudinal direction

  • num_trans_grid (int) – Number of grid lines in the transverse direction -

  • edge_beam_dist (int or float) – Distance of edge beam node lines to exterior main beam node lines

  • mesh_type (string) – Type of mesh either “Ortho” for orthogonal mesh or “Oblique” for oblique mesh

  • kwargs – See below

Keyword:

  • beam_z_spacing: (list of int or float) Custom distance of longitudinal members (global z - direction). Note this parameter supercedes num_long_grid.

  • beam_x_spacing: (list of int or float) Custom distance of transverse members (global x - direction). Note this parameter supercedes num_trans_grid.

  • ext_to_int_dist: (Int or Float, or a List of Int or Float) distance between internal beams and exterior main beams. If list is provided (usually size 2), apply each distinct distance to left and right side respectively.

  • multi_span_dist_list: (List of Int/Float) List of distance (x dir) correspond to span length of each multi span

  • multi_span_num_points: (List of Int) Num of transverse member correspond to spans of each element in multi_span_dist_list If not specified, takes int var for num_trans_beam and assigns to all spans of multi_span_dist_list

  • continuous: (Bool) To set continuity of spans. Default True. If False, separate spans by non_cont_spacing_x

  • stitch_slab_elements: (Bool) To set stictch elements between spans. Elements are set using set_member() with member= “stich_elements”

  • non_cont_spacing_x: (float) sets spacing or length of stitch elements.

Raises:

ValueError – If skew angle is greater than 90. If number of transverse grid line is less than 2.

OspGrillageShell class#

class OspGrillageShell(bridge_name, long_dim, width, skew: list | float | int, num_long_grid: int, num_trans_grid: int, edge_beam_dist: list | float | int, mesh_type='Ortho', model='3D', **kwargs)

Bases: OspGrillage

Concrete class for shell model type

Init the OspGrillage class

Parameters:
  • bridge_name (str) – Name of bridge model and output .py file

  • long_dim (int or float) – Length of the model in the longitudinal direction (default: x axis)

  • width (int or float) – Width of the model in the transverse direction (default: z axis)

  • skew (int or float) – Skew angle of the start and end edges of model

  • num_long_grid (int) – Number of grid lines in longitudinal direction

  • num_trans_grid (int) – Number of grid lines in the transverse direction -

  • edge_beam_dist (int or float) – Distance of edge beam node lines to exterior main beam node lines

  • mesh_type (string) – Type of mesh either “Ortho” for orthogonal mesh or “Oblique” for oblique mesh

  • kwargs – See below

Keyword:

  • beam_z_spacing: (list of int or float) Custom distance of longitudinal members (global z - direction). Note this parameter supercedes num_long_grid.

  • beam_x_spacing: (list of int or float) Custom distance of transverse members (global x - direction). Note this parameter supercedes num_trans_grid.

  • ext_to_int_dist: (Int or Float, or a List of Int or Float) distance between internal beams and exterior main beams. If list is provided (usually size 2), apply each distinct distance to left and right side respectively.

  • multi_span_dist_list: (List of Int/Float) List of distance (x dir) correspond to span length of each multi span

  • multi_span_num_points: (List of Int) Num of transverse member correspond to spans of each element in multi_span_dist_list If not specified, takes int var for num_trans_beam and assigns to all spans of multi_span_dist_list

  • continuous: (Bool) To set continuity of spans. Default True. If False, separate spans by non_cont_spacing_x

  • stitch_slab_elements: (Bool) To set stictch elements between spans. Elements are set using set_member() with member= “stich_elements”

  • non_cont_spacing_x: (float) sets spacing or length of stitch elements.

Raises:

ValueError – If skew angle is greater than 90. If number of transverse grid line is less than 2.

Analysis class#

class Analysis(analysis_name: str, ops_grillage_name: str, pyfile: bool, node_counter, ele_counter, analysis_type='Static', time_series_counter=1, pattern_counter=1, load_case: LoadCase | None = None, step: int = 1, **kwargs)#

Bases: object

Main class to handle the run/execution of load case, including incremental load cases of a moving load analysis. Analysis class is created and handled by the OspGrillage class.

The following are the roles of Analysis object:

  • store information of ops commands for performing static (default) analysis of single/multiple load case(s).

  • execute the required ops commands to perform analysis using the OspGrillage model instance.

  • if flagged, writes an executable py file instead which performs the exact analysis as it would for an OspGrillage instance instead.

  • manages multiple load case’s ops.load() commands, applying the specified load factors to the load cases for load combinations

extract_grillage_responses()#

Function that wraps OpenSeesPy nodeDisp() and eleResponse(), gets results of current analysis - model instance in OpenSees.

Returns:

Stores results in global_ele_force and node_disp class variable

Result class#

class Results(mesh_obj: Mesh)#

Bases: object

Main class to store results of an Analysis class object, process into data array output for post processing/plotting. Class object is accessed within OspGrillage class object.

Material class#

class Material(**kwargs)#

Bases: object

This class stores information and provides methods to parse input material properties into OpenSeesPy Material objects.

Here are the information about OpenSees Material objects.

As ospgrillage is mainly intended for bridge decks , concrete and steel makes up the primary materials. In turn, ospgrillage wraps the UniAxialMaterial object of OpenSeesPy since it contains the primary options for Concrete and Steel.

The Material class also allow users to utilize codified material properties (e.g. AS5100, ASHTOO). These material properties are stored in a material library file (mat_lib.json). Users are required to pass in the appropriate keyword arguments (dict keys) to select the desirable codified materials. Users may access mat_lib.json. Additionally, this class is able create the mat_lib.json file and pass it through

Note

Current version of mat_lib.json is 0.1.0

The constructor of Material takes in three types of inputs:

  1. Keywords for looking up the ospgrillage material library i.e. mat_lib.json.

  2. General material properties - such as E, and G

  3. Specific material arguments of OpenSeesPy.

For (1), the following keywords are required:

Keyword:

  • code (str): name string of code according to mat_lib.json

  • type (str): Either “concrete” or “steel”

  • grade(str): Grade of material according to code

For (2), the minimum required material properties are:

Keyword:

  • E (float): Elastic modulus

  • G (float): Shear modulus

  • v (float): Poisson’s ratio

  • rho (float): Density

For (3), refer to OpenSeesPy.

get_material_args()#

Return the arguments for OpenSeesPy material. This function is handled by ospgrillage.osp_grillage.OspGrillage.

Returns:

Str of OpenSeesPy material type and list of material properties correspond to the inputs of OpenSeesPy commands

get_ops_material_command(material_tag)#

Parse material properties into OpenSeesPy Material commands.

Parameters:

material_tag (int) – tag of material defined in in OpenSeesPy space

Returns:

Str of OpenSees command to create material in OpenSeesPy

Section class#

class Section(op_ele_type: str = 'elasticBeamColumn', mass: float = 0, c_mass_flag: bool = False, unit_width: bool = False, op_section_type: str = 'Elastic', **kwargs)#

Bases: object

Class for structural sections of grillage model. Stores geometric properties of cross sections. This class also parses section inputs into relevant OpenSeesPy command for creating sections in OpenSees framework.

This class wraps `OpenSeesPy` Section() commands - methods for generating commands are handled by the higher hierarchy:class:~ospgrillage.member.GrillageMember class

The constructor takes in two types of keyword arguments.

  1. General section properties - such as A, I, J for example. These properties are parses into the appropriate OpenSees section arguments.

  2. OpenSeespy section arguments - i.e. specific keyword for a specific ops.section() type.

Section information of OpenSeesPy

Constructor takes following inputs to be parse into arguments for `OpenSeesPy` Sections.

Parameters:
  • op_ele_type (str) – OpenSees element type - default elasticBeamColumn

  • op_section_type (str) – OpenSees section type - default Elastic

  • mass (float) – Mass of member.

  • unit_width (bool) – Flag for if unit width properties are defined.

Constructor also takes the following keyword arguments for a section.

Keyword:

  • A (float): Cross sectional area

  • Iz (float): Moment of inertia about local z axis

  • Iy (float): Moment of inertia about local y axis

  • J (float): Torsional inertia - about local x axis

  • Az (float): Cross sectional area in the local z direction

  • Ay (float): Cross sectional area in the local y direction

Section properties are defined in local coordinate x y and z which are later transformed according to orientation of the defined GrillageMember object in the grillage model.

GrillageMember class#

class GrillageMember(section: Section, material, member_name: str = 'Undefined', quad_ele_flag: bool = False, tri_ele_flag: bool = False)#

Bases: object

Class for grillage model members. E.g., longitudinal beam members.

This class parses material and section properties of grillage members into corresponding OpenSeesPy Element() command.

Refer here for more information about

OpenSeesPy Element types and definition workflow.

For developers wishing to expand the library of elements wrapped by GrillageMember, introduce in this class:

  1. The argument input orders of new element in get_member_prop_arguments()

method.

  1. If the element requires the definition of Section in OpenSeesPy, add its Section’s list of input arguments

command generation to get_section_arguments() and get_ops_section_command().

Init the GrillageMember. Requires two input objects i.e. A Material, and Section.

Parameters:
  • section (Section) – Section class object

  • material (Material) – Material class object

  • member_name (str) – Name of the grillage member (Optional)

get_member_prop_arguments(width=1)#

Returns the element arguments based on the op_element_type of the GrillageMember.

Returns:

str containing member properties in accordance with convention of OpenSees element type

get_section_arguments(ele_width: float = 1)#

Returns the input arguments for OpenSeesPy Section command if the prescribe element type of the GrillageMember requires the definition of an OpenSeesPy Section object.

Returns:

str containing Section command properties in accordance with convention of OpenSees element type

get_ops_section_command(section_tag: int = 1, material_tag: int | None = None, ele_width: float = 1)#

Returns the OpenSeesPy Section command for the Section type

Returns:

str containing the OpenSeesPy Section command

get_element_command_str(ele_tag: int, node_tag_list: list, transf_tag: int | None = None, ele_width: float = 1, materialtag: int | None = None, sectiontag: int | None = None) str#

Return a list of OpenSeesPy element command for the member. This function is handled by OspGrillage class.

Mesh class#

class Mesh(long_dim: float, width: float, trans_dim: float, edge_dist_a: float, edge_dist_b: float, num_trans_beam: int, num_long_beam: int, skew_1: float, skew_2: float, pt1: Point = Point(x=0, y=0, z=0), pt2: Point = Point(x=0, y=0, z=0), pt3: Point | None = None, element_counter: int = 1, node_counter: int = 1, transform_counter: int = 0, global_x_grid_count: int = 0, global_edge_count: int = 0, mesh_origin: list | None = None, quad_ele: bool = False, **kwargs)#

Bases: object

Class for Mesh.

Positional arguments are handled by OspGrillage class.

Note

As of version 0.1.0, the default mesh is a straight mesh with either Orthogonal and Oblique grids. mesh module needs a new structure where the mesh class will have mesh types segregated into a base Mesh class and child class e.g. OrthogonalMesh(Mesh) class.

Load class#

For information regarding definition of Loads class, see Load.

NodalLoad#

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

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.

PointLoad#

class PointLoad(**kwargs)#

Bases: Loads

Class for Point loads.

Parameters:
  • name

  • kwargs

LineLoading#

class LineLoading(**kwargs)#

Bases: Loads

Class for line loading.

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

PatchLoading#

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:

CompoundLoad#

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

MovingLoad#

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.

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:

LoadCase#

For information regarding in LoadCase class, see Load.

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

Misc#

Path for moving loads#

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

Envelope#

class Envelope(ds, load_effect: str | None = None, **kwargs)#

Class for defining envelope of OspGrillage’s xarray of result.

A Envelope.get() method is provided that returns an enveloped xarray based on the specified input parameters of this class.

Parameters:
  • ds (Xarray) – Data set from get_results() . note Combination

  • load_effect (str) – Specific load effect to envelope.

  • kwargs – See below for keyword arguments.

Keyword:

  • array: either ‘displacement’ or ‘forces’

  • value_mode (Bool): Flag for envelope to return raw values - default True

  • query_mode (Bool): Flag for envelope to return loadcase coordinate for

    maxima - default False

  • extrema (str): either “min” or “max”

  • elements:

  • nodes

  • array

  • load_effect

get()#
Returns:

The enveloped xarray object.

Return type:

xarray

Shape functions#

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