Code Documentation¶
ADA¶
The main library.
- class ada.Assembly(name='Ada', project='AdaProject', user: User = User(user_id='AdaUser', given_name=None, family_name=None, middle_names=None, prefix_titles=None, suffix_titles=None, org_id='ADA', org_name='Assembly For Design and Analysis', org_description=None, role='Engineer'), schema='IFC4X3_add2', metadata=None, units: Units | str = Units.M, enable_cache: bool = False, clear_cache: bool = False, cache_dir: str | Path = None, ifc_class: SpatialTypes = SpatialTypes.IfcSite)¶
- The Assembly object. A top level container of parts, beams, plates, shapes and FEM. - push(comment, bimserver_url, username, password, project, merge=False, sync=False)¶
- Push current assembly to BimServer with a comment tag that defines the revision name 
 - read_fem(fem_file: str | os.PathLike, fem_format: FEATypes | str = None, name: str = None, fem_converter: FemConverters | str = 'default', cache_model_now=False)¶
- Import a Finite Element model. Currently supported FEM formats: Abaqus, Sesam and Calculix 
 - read_ifc(ifc_file: str | os.PathLike | ifcopenshell.file, data_only=False, elements2part=None, create_cache=False)¶
- Import from IFC file. 
 - to_fem(name: str, fem_format: FEATypes | str, scratch_dir=None, metadata=None, execute=False, run_ext=False, cpus=1, gpus=None, overwrite=False, fem_converter='default', exit_on_complete=True, run_in_shell=False, make_zip_file=False, return_fea_results=True, model_data_only=False, write_input_files_only=False) FEAResult | None¶
- Create a FEM input file deck for executing fem analysis in a specified FEM format. Currently there is limited write support for the following FEM formats: - Open Source - Calculix 
- Code_Aster 
 - not open source - Abaqus 
- Usfos 
- Sesam 
 - Write support is added on a need-only-basis. Any contributions are welcomed! - Parameters:
- name – Name of FEM analysis input deck 
- fem_format – Desired fem format 
- scratch_dir – Output directory for analysis input deck 
- metadata – Parse additional commands to FEM solver not supported by the generalized classes 
- execute – Execute analysis on complete 
- run_ext – Run analysis externally or wait for complete 
- cpus – Number of cpus for running the analysis 
- gpus – Number of gpus for running the analysis (wherever relevant) 
- overwrite – Overwrite existing input file deck 
- fem_converter – Set desired fem converter. Use either ‘default’ or ‘meshio’. 
- exit_on_complete 
- run_in_shell 
- make_zip_file 
- return_fea_results – Automatically import the result mesh into 
- model_data_only – Only write the model data (nodes, elements, etc.) to the FEM file 
- write_input_files_only – - Only write the input files, do not execute the analysis - Note! Meshio implementation currently only supports reading & writing elements and nodes. 
 
 - Abaqus Metadata: - ‘ecc_to_mpc’: Runs the method - convert_ecc_to_mpc(). Default is True ‘hinges_to_coupling’: Runs the method- convert_hinges_2_couplings(). Default is True- Important Note! The ecc_to_mpc and hinges_to_coupling will make permanent modifications to the model. If this proves to create issues regarding performance this should be evaluated further. 
 
- class ada.Beam(name, n1: Node | Iterable, n2: Node | Iterable, sec: str | Section, mat: str | Material = None, up=None, angle=0.0, e1=None, e2=None, units=Units.M, hi1: BeamHinge = None, hi2: BeamHinge = None, **kwargs)¶
- The base Beam object - Parameters:
- n1 – Start position of beam. List or Node object 
- n2 – End position of beam. List or Node object 
- sec – Section definition. Str or Section Object 
- mat – Material. Str or Material object. String: [‘S355’ & ‘S420’] (default is ‘S355’ if None is parsed) 
- name – Name of beam 
 
 - static array_from_list_of_coords(list_of_coords: list[tuple | Point], sec: Section | str, mat: Material | str = None, name_gen: Iterable = None, make_closed=False) list[Beam]¶
- Create an array of beams from a list of coordinates 
 - bbox() BoundingBox¶
- Bounding Box of beam 
 - copy_to(name: str = None, p1=None, p2=None, rotation_axis: Iterable[float] = None, rotation_angle: float = None) Beam¶
- Copy beam to new position 
 - get_node_on_beam_by_fraction(fraction: float) Node¶
- Returns node as a fraction of the beam length from n1-node. 
 - property length: float¶
- Returns the length of the beam 
 - property ori¶
- Get the x-vector, y-vector and z-vector of a given beam 
 - property orientation: Placement¶
- This is the local orientation and position of the Beam within the local placement object 
 
- class ada.BeamHinge(name: 'str', dofs: 'list[BeamHingeDofType]')¶
- class ada.BeamHingeDofType(dof: 'DofType', constraint_type: 'BeamHingeConstraintType', spring_stiffness: 'float' = 0.0)¶
- class ada.BeamRevolve(name: str, curve: CurveRevolve, sec: str | Section, up=None, **kwargs)¶
- class ada.BeamSweep(name: str, curve: CurveOpen2d, sec: str | Section, **kwargs)¶
- class ada.BeamTapered(name, n1: Iterable, n2: Iterable, sec: str | Section, tap: str | Section = None, taper_type: TaperTypes | str = TaperTypes.CENTERED, **kwargs)¶
- class ada.Bolts(name, p1, p2, normal, members, parent=None)¶
- TODO: Create a bolt class based on the IfcMechanicalFastener concept. - Which in turn should likely be inside another element components class 
- class ada.BoolHalfSpace(origin: Point | Iterable[float], normal: Direction | Iterable[float], flip=False, name: str = None, plane_geo_width: float = 1.0, **kwargs)¶
- class ada.Boolean(primitive, bool_op: BoolOpEnum = BoolOpEnum.DIFFERENCE, metadata=None, parent=None, units=Units.M, guid=None)¶
- class ada.ConstraintConceptCurve(name: 'str', start_pos: 'Iterable | Point', end_pos: 'Iterable | Point', dof_constraints: 'list[ConstraintConceptDofType]')¶
- class ada.ConstraintConceptDofType(dof: 'DofType', constraint_type: 'ConstraintType', spring_stiffness: 'float' = 0.0)¶
- static encastre(dof_type: Literal['fixed', 'free', 'spring', 'prescribed', 'dependent', 'super'] = 'fixed') list[ConstraintConceptDofType]¶
- All 6 dofs are fixed 
 - static pinned() list[ConstraintConceptDofType]¶
- All 3 translational dofs are fixed, and all 3 rotational dofs are free. 
 
- class ada.ConstraintConceptPoint(name: 'str', position: 'Point | Iterable', dof_constraints: 'list[ConstraintConceptDofType]')¶
- class ada.ConstraintConceptRigidLink(name: 'str', master_point: 'Iterable | Point', influence_region: 'RigidLinkRegion', dof_constraints: 'list[ConstraintConceptDofType]', rotation_dependent: 'bool' = True, include_all_edges: 'bool' = True)¶
- class ada.CurvePoly2d(points2d, origin: Iterable | Point = None, normal: Iterable | Direction = None, xdir: Iterable | Direction = None, tol=0.001, parent=None, orientation: Placement = None)¶
- A closed curve defined by a list of 2d points represented by line and arc segments. 
- class ada.Direction(*coords: float | int | Iterable[float])¶
- class ada.Equipment(name: str, mass: float, cog: Iterable[float] | Point, origin: Iterable[float] | Point, lx: float, ly: float, lz: float, eq_repr: EquipRepr = EquipRepr.AS_IS, load_case_ref: str | LoadConceptCase = None, moment_equilibrium: bool = True, footprint: list[tuple[float, float]] = None)¶
- class ada.FEM(name: 'str', metadata: 'Dict' = <factory>, parent: 'Part' = None, nodes: 'Nodes' = <factory>, ref_points: 'Nodes' = <factory>, ref_sets: 'FemSets' = <factory>, elements: 'FemElements' = <factory>, sets: 'FemSets' = <factory>, sections: 'FemSections' = <factory>, initial_state: 'PredefinedField' = None, subroutine: 'str' = None)¶
- add_interface_nodes(interface_nodes: List[Node | InterfaceNode])¶
- Nodes used for interfacing between other parts. Pass a custom Constraint if specific coupling is needed 
 - add_set(fem_set: FemSet, p=None, vol_box=None, vol_cyl=None, single_member=False, tol=0.0001) FemSet¶
- Parameters:
- fem_set – A fem set object 
- p – Single point (x,y,z) 
- vol_box – Search by a box volume. Where p is (xmin, ymin, zmin) and vol_box is (xmax, ymax, zmax) 
- vol_cyl – Search by cylindrical volume. Used together with p to find nodes within cylinder inputted by [radius, height, thickness] 
- single_member – Set True if you wish to keep only a single member 
- tol – Point Tolerances. Default is 1e-4 
 
 
 - add_step(step: _step_types) _step_types¶
- Add an analysis step to the assembly 
 - create_fem_elem_from_obj(obj, el_type=None) Elem¶
- Converts structural object to FEM elements. Currently only BEAM is supported 
 - get_all_bcs() Iterable[Bc]¶
- Get all the boundary conditions in the entire assembly 
 - get_all_masses() Iterable[Mass]¶
- Get all the Masses in the entire assembly 
 
- class ada.Group(name: 'str', members: 'list[Part | Beam | Plate | Wall | Pipe | Shape]', parent: 'Part | Assembly', description: 'str' = '', guid: 'str' = <factory>, change_type: 'ChangeAction' = <ChangeAction.NOTDEFINED: 'NOTDEFINED'>)¶
- class ada.Instance(instance_ref: "Union['Part', 'BackendGeom']", placements: 'List[Placement]' = <factory>)¶
- class ada.LoadConceptAccelerationField(name: 'str', acceleration: 'tuple[float, float, float]', include_self_weight: 'bool' = True, rotational_field: 'RotationalAccelerationField' = None)¶
- class ada.LoadConceptCase(name: 'str', loads: 'list[LoadConceptLine | LoadConceptPoint | LoadConceptSurface | LoadConceptAccelerationField]' = <factory>, design_condition: 'DesignCondition' = <DesignCondition.OPERATING: 'operating'>, fem_loadcase_number: 'int' = 1, complex_type: "Literal['static']" = 'static', invalidated: 'bool' = True, include_self_weight: 'bool' = False, mesh_loads_as_mass: 'bool' = False)¶
- class ada.LoadConceptCaseCombination(name: 'str', load_cases: 'list[LoadConceptCaseFactored]', design_condition: "DesignCondition | Literal['operating']" = <DesignCondition.OPERATING: 'operating'>, complex_type: "Literal['static']" = 'static', invalidated: 'bool' = True, convert_load_to_mass: 'bool' = False, global_scale_factor: 'float' = 1.0, equipments_type: "Literal['line_load']" = 'line_load')¶
- class ada.LoadConceptCaseFactored(load_case: 'LoadConceptCase', factor: 'float', phase: 'int' = 0)¶
- class ada.LoadConceptLine(name: 'str', start_point: 'Point | Iterable', end_point: 'Point | Iterable', intensity_start: 'tuple[float, float, float]', intensity_end: 'tuple[float, float, float]', system: "Literal['local', 'global']" = 'local')¶
- class ada.LoadConceptPoint(name: 'str', position: 'Point | Iterable', force: 'tuple[float, float, float]', moment: 'tuple[float, float, float]', system: "Literal['local', 'global']" = 'local')¶
- class ada.LoadConceptSurface(name: 'str', plate_ref: 'Plate' = None, points: 'list[Iterable]' = None, pressure: 'float' = None, side: "Literal['front', 'back']" = 'front', system: "Literal['local', 'global']" = 'local')¶
- class ada.MassPoint(name: str, p: Point | Iterable[numeric, numeric, numeric], mass: float, radius=0.2, placement: Placement = None)¶
- Concept mass point object, added to handle export to genie xml without needing to use fem-object 
- class ada.Material(name, mat_model: CarbonSteel = None, mat_id=None, parent=None, metadata=None, units=Units.M, guid=None, ifc_store: IfcStore = None)¶
- The base material class. Currently only supports Metals. Default material model is S355 carbon steel 
- class ada.Node(p: Iterable[numeric, numeric, numeric] | Point, nid=None, r=None, parent=None, units=Units.M, refs=None)¶
- Base node object - Parameters:
- p – 3D coordinates of the node 
- nid – node id 
- bc – boundary condition of the node 
 
 - property has_refs: bool¶
- Returns if node is valid, i.e. has objects in refs 
 
- class ada.Part(name, color=None, placement=None, fem: FEM = None, metadata=None, parent=None, units: Units = Units.M, guid=None, ifc_store: IfcStore = None, ifc_class: SpatialTypes = SpatialTypes.IfcBuildingStorey)¶
- A Part superclass design to host all relevant information for cad and FEM modelling. - IFC_CLASSES¶
- alias of - SpatialTypes
 - add_joint(joint: JointBase) JointBase¶
- This method takes a Joint element containing two intersecting beams. It will check with the existing list of joints to see whether or not it is part of a larger more complex joint. It usese primarily two criteria. - Criteria 1: If both elements are in an existing joint already, it will u - Criteria 2: If the intersecting point coincides within a specified tolerance (currently 10mm) with an exisiting joint intersecting point. If so it will add the elements to this joint. If not it will create a new joint based on these two members. 
 - add_materials_in_batch(mats: Iterable[Material]) dict[Material, Material]¶
- Add each unique material exactly once. Returns a map original_material -> container_material. 
 - add_objects_in_batch(objects: Iterable[Beam | Plate], add_to_layer: str = None) list[Beam | Plate]¶
- Batch-add beams and plates. Returns the list of added (or existing) objects. Only supports Beam/BeamTapered and Plate for now. 
 - add_sections_in_batch(secs: Iterable[Section]) dict[Section, Section]¶
- Add each unique section exactly once. Returns a map original_section -> container_section. 
 - beam_clash_check(margins=5e-05)¶
- For all beams in a Assembly get all beams touching or within the beam. Essentially a clash check is performed and it returns a dictionary of all beam ids and the touching beams. A margin to the beam volume can be included. - Parameters:
- margins – Add margins to the volume box (equal in all directions). Input is in meters. Can be negative. 
- Returns:
- A map generator for the list of beams and resulting intersecting beams 
 
 - property concept_fem: ConceptFEM¶
- Returns the ConceptFEM object associated with this Part. 
 - consolidate_sections(include_self=True)¶
- Moves all sections from all sub-parts to this part 
 - copy_to(name: str = None, position: list[float] | Point = None, rotation_axis: Iterable[float] = None, rotation_angle: float = None, add_object_copy_suffix: bool = True) Part¶
- Copy the part and all its sub_parts to a new part. Optionally add translation and/or rotation to the new part 
 - create_objects_from_fem(skip_plates=False, skip_beams=False) None¶
- Build Beams and Plates from the contents of the local FEM object 
 - get_by_name(name) Part | Plate | Beam | Shape | Material | Pipe | None¶
- Get element of any type by its name. 
 - read_step_file(step_path, name=None, scale=None, transform=None, rotate=None, colour=None, opacity=1.0, source_units=Units.M, include_shells=False)¶
- Parameters:
- step_path – Can be path to stp file or path to directory of step files. 
- name – Desired name of destination Shape object 
- scale – Scale the step content upon import 
- transform – Transform the step content upon import 
- rotate – Rotate step content upon import 
- colour – Assign a specific colour upon import 
- opacity – Assign Opacity upon import 
- source_units – Unit of the imported STEP file. Default is ‘m’ 
 
 
 - to_trimesh_scene(render_override: dict[str, GeomRepr | str] = None, filter_by_guids=None, merge_meshes=True, stream_from_ifc=False, params: RenderParams = None, include_ada_ext: bool = False) trimesh.Scene¶
- Create a Trimesh.Scene from ada.Part. 
 
- class ada.Pipe(name, points, sec, mat='S355', content=None, metadata=None, color=None, units: Units = Units.M, guid=None, place: Placement = None)¶
- class ada.PipeSegElbow(name, start, midpoint, end, bend_radius, section, material=None, parent=None, guid=None, metadata=None, units=Units.M, color=None, arc_seg=None)¶
- class ada.PipeSegStraight(name, p1, p2, section, material, parent=None, guid=None, metadata=None, units=Units.M, color=None)¶
- class ada.Plate(name: str, points: CurvePoly2d | CoordinateSequence, t: float, mat: str | Material = 'S420', origin: Iterable | Point = None, xdir: Iterable | Direction = None, normal: Iterable | Direction = None, orientation: Placement = None, pl_id=None, tol=None, **kwargs)¶
- A plate object. The plate element covers all plate elements. - Contains a dictionary with each point of the plate described by an id (index) and a Node object. - Parameters:
- name – Name of plate 
- points – List of 2D point coordinates (or a PolyCurve) that make up the plate. Each point is (x, y, optional [radius]) 
- t – Thickness of plate 
- mat – Material. Can be either Material object or built-in materials (‘S420’ or ‘S355’) 
- origin – Explicitly define origin of plate. If not set 
- xdir – Explicitly define x direction of plate. If not set 
- normal – Explicitly define normal direction of plate. If not set 
 
 - bbox() BoundingBox¶
- Bounding Box of plate 
 - property t: float¶
- Plate thickness 
 
- class ada.Point(*coords: float | int | Iterable[float | int])¶
- class ada.PrimBox(name, p1, p2, origin=None, placement=None, material: Material | Literal['S355', 'S420'] = None, **kwargs)¶
- Primitive Box. Length, width & height are local x, y and z respectively 
- class ada.PrimCone(name, p1, p2, r, **kwargs)¶
- class ada.PrimCyl(name, p1, p2, r, **kwargs)¶
- class ada.PrimExtrude(name, curve2d: list[tuple], h, normal=None, origin=None, xdir=None, tol=0.001, **kwargs)¶
- class ada.PrimRevolve(name, points, rev_angle, origin=None, xdir=None, normal=None, tol=0.001, **kwargs)¶
- Revolved Primitive - property revolve_angle: float¶
- Revolve angle in degrees 
 
- class ada.PrimSweep(name, sweep_curve: Iterable[Iterable[float]] | CurveOpen3d, profile_curve_outer: Iterable[Iterable[float]] | CurvePoly2d, profile_xdir=None, profile_normal=None, profile_ydir=None, origin=None, derived_reference=False, tol=0.001, radiis: dict[int, float] = None, **kwargs)¶
- class ada.RigidLinkRegion(lower_corner: 'Iterable | Point', upper_corner: 'Iterable | Point')¶
- class ada.RotationalAccelerationField(rotational_point: 'tuple[float, float, float] | Point', rotational_axis: 'tuple[float, float, float] | Direction', angular_acceleration: 'float', angular_velocity: 'float')¶
- class ada.Shape(name, geom: Geometry | list[Geometry] | None = None, color=None, opacity=1.0, mass: float = None, cog: Iterable = None, material: Material | Literal['S355', 'S420'] = None, units=Units.M, metadata=None, guid=None, placement=None, ifc_store: IfcStore = None, ifc_class: ShapeTypes = ShapeTypes.IfcBuildingElementProxy, parent=None)¶
- IFC_CLASSES¶
- alias of - ShapeTypes
 
- class ada.Transform(translation: 'np.ndarray' = None, rotation: 'Rotation' = None)¶
- class ada.Units(*values)¶
- class ada.User(user_id: str = 'AdaUser', given_name: str = None, family_name: str = None, middle_names: str = None, prefix_titles: str = None, suffix_titles: str = None, org_id: str = 'ADA', org_name: str = 'Assembly For Design and Analysis', org_description: str = None, role: str = 'Engineer')¶
- class ada.Wall(name, points, height, thickness, placement=None, offset='CENTER', metadata=None, color=None, units=Units.M, guid=None, opacity=1.0)¶
- TYPES_JUSL¶
- alias of - WallJustification
 
- class ada.Weld(name, p1, p2, weld_type: WeldProfileEnum | str, members, profile: list[tuple], xdir: tuple, groove: list[tuple] = None, parent=None)¶
- ada.deprecated(reason: str)¶
- A decorator to mark functions or classes as deprecated. Emits a warning when the function or class is used, including the module path. - Parameters:
- reason – Explanation of why the function/class is deprecated. 
 
- ada.from_fem(fem_file: str | list | Path, fem_format: str | list = None, name: str | list = None, enable_cache=False, source_units=Units.M, fem_converter='default', create_concept_objects=False, convert_skip_plates=False, convert_skip_beams=False) Assembly¶
- Create an Assembly object from a FEM file. 
- ada.from_genie_xml(xml_path, ifc_schema='IFC4', name: str = None, extract_joints=False) Assembly¶
- Create an Assembly object from a Genie XML file.