N2PCreateFasteners Module#
- class NaxToPy.Modules.static.fasteners.N2PCreateFasteners.N2PFastenerMethod(*values)[source]#
Bases:
EnumWays in which a fastener can be modelled.
Every method is the combination of a connector, which ties the 1D element to the meshes of the pieces, and the 1D element itself. The COINCIDENT_NODE method uses no connector at all: the node of each mesh closest to the axis of the fastener is physically moved onto it, and the 1D element is attached directly to those nodes.
- CFAST = 'CFAST'#
- COINCIDENT_NODE = 'COINCIDENT-NODE'#
- property Connector: str#
Type of connector used by the method, or
Nonewhen it uses none.
- property IsDoubleRBE3: bool#
a first one from the grid of the fastener to four new grids placed on the circumference of the fastener, and a second one from each of those four grids to the element of the mesh it falls on.
- Type:
Shows whether the method spreads the load through two levels of RBE3
- property IsHyperWorks: bool#
Shows whether the method reproduces the way HyperWorks builds a fastener, that is, a pair of RBE3 per piece, one for the translations and another for the rotations, weighted with the shape functions of the pierced element.
- property OneDimElement: str#
Type of 1D element used by the method.
- RBE2_CBAR = 'RBE2+CBAR'#
- RBE2_CBUSH = 'RBE2+CBUSH'#
- RBE2_CROD = 'RBE2+CROD'#
- RBE3_CBAR = 'RBE3+CBAR'#
- RBE3_CBUSH = 'RBE3+CBUSH'#
- RBE3_CBUSH_HW = 'RBE3+CBUSH_HW'#
- RBE3_CROD = 'RBE3+CROD'#
- RBE3_RBE3_CBUSH = 'RBE3+RBE3+CBUSH'#
- class NaxToPy.Modules.static.fasteners.N2PCreateFasteners.N2PCreateFasteners[source]#
Bases:
objectThe N2PCreateFasteners class creates the cards that model a set of fasteners joining several meshes of 2D elements. It works both for NASTRAN and for OptiStruct models, as the cards involved are common to both solvers.
- Properties:
Model: N2PModelContent -> model the fasteners will be created in. PieceList: list[list[N2PElement]] -> one list of 2D elements per part to be joined. Only CQUAD4 and CTRIA3 elements are supported. Positions: np.ndarray -> array of shape (n, 4) as [x, y, z, D] or (n, 7) as [x, y, z, dx, dy, dz, D], with one row per fastener. The diameter is compulsory. When the direction is given, it goes from the head to the nut. Method: N2PFastenerMethod -> way in which every fastener of this run will be modelled. Tolerance: float -> factor that multiplies the diameter to obtain the maximum distance allowed between the point given and the pieces it joins. DiameterFactor: float -> factor that multiplies the diameter to obtain the radius of the influence area. Only used when WeightMethod is “DISTANCE”. WeightMethod: str -> “SHAPE_FUNCTIONS” or “DISTANCE”, how the nodes a connector ties are chosen and weighted. StiffnessMethod: str -> formulation used for the shear stiffness of the fasteners. ConnectionType: str -> “bolt” or “rivet”. ShearType: str -> “AUTO”, “simple” or “double”. FastenerModulus: float -> elastic modulus of the fasteners. FastenerPoisson: float -> Poisson ratio of the fasteners. HeadHeight: float -> height of the head of the fasteners. NutHeight: float -> height of the nut of the fasteners. K4: float -> torsional stiffness of the CBUSH around the axis of the fastener. K5: float -> bending stiffness of the CBUSH around the Y axis of the fastener. K6: float -> bending stiffness of the CBUSH around the Z axis of the fastener. OffsetIDsNodes: int -> first ID of the new grids, or -1 to start after the highest one in the model. OffsetIDsElements: int -> first ID of the new elements, or -1 to start after the highest one in the model. OffsetIDsProperties: int -> first ID of the new properties, or -1 to start after the highest one in the model. OffsetIDsCoords: int -> first ID of the new coordinate systems, or -1 to start after the highest one. IncludeName: str -> compulsory name of the include file the new cards will be written in. AllowExistingInclude: bool -> if True, the cards are appended to the include file when it already exists. CreateCoordinateSystemPerFastener: bool -> if False, a CORD2R is only written for the fasteners that need one because their CBUSH has no length, and the rest are oriented by vector. If True, every fastener gets one. ElementTolerance: float -> numerical tolerance of the inside-the-element test. MaxNodeMovementFactor: float -> only for COINCIDENT-NODE, largest fraction of the characteristic size of an element that one of its nodes is allowed to be moved. LayoutList: list[N2PFastenerLayout] -> geometry of the fasteners that could be resolved. DiscardedList: list[tuple[int, str]] -> row and reason of the fasteners that could not be resolved.
- calculate() None[source]#
Method used to resolve the geometry of the fasteners and create all the cards that model them.
- Calling example:
>>> creator.calculate()
- load_positions_from_csv(path: str, delimiter: str = ',') ndarray[source]#
Method used to fill the Positions property from a csv file, so the user does not need to build the array by hand.
The file must have four or seven columns, as described in the Positions property. Empty lines and lines starting with # are skipped, which allows the file to be commented and to carry a header.
- Parameters:
path – str -> route of the csv file.
delimiter – str -> character that separates the columns.
- Returns:
the array that has been assigned to the Positions property.
- Return type:
np.ndarray
- Calling example:
>>> creator.load_positions_from_csv(r"C:\fasteners\positions.csv")
- resolve_geometry() None[source]#
Method used to work out the geometry of every fastener: its axis, the pieces it actually joins, where it pierces each of them and which nodes of each mesh fall inside its influence area. No card is created here.
This is the first half of calculate(), and it is exposed on its own so the geometry can be reviewed before anything is written into the model.
- Calling example:
>>> creator.resolve_geometry()
- write_bdf(folder: str = None) None[source]#
Method used to write the model, and with it the include file holding the new fasteners, to disk. The calculate() method must be used before this one.
- Parameters:
folder – str -> folder the whole model is rebuilt in, keeping its original file structure. When it is None the model is updated in place, so only the files that hold modified cards are rewritten.
- Calling example:
>>> creator.write_bdf(r"C:\output") >>> creator.write_bdf() # The model is updated in place
- ALLOWED_CONNECTION_TYPES = ('bolt', 'rivet')#
- ALLOWED_SHEAR_TYPES = ('AUTO', 'simple', 'double')#
- ALLOWED_STIFFNESS_METHODS = ('HUTH', 'TATE_ROSENFELD', 'BOEING', 'GRUMMAN', 'SWIFT', 'NELSON')#
- ALLOWED_WEIGHT_METHODS = ('SHAPE_FUNCTIONS', 'DISTANCE')#
- property AllowExistingInclude: bool#
Property that returns the allow_existing_include attribute, that is, whether the new cards may be appended to an include file that already exists.
- COINCIDENT_TOLERANCE_FACTOR = 0.0001#
- property ConnectionType: str#
Property that returns the connection_type attribute, that is, whether the fasteners are bolts or rivets.
- property CreateCoordinateSystemPerFastener: bool#
Property that returns the create_coordinate_system_per_fastener attribute. When it is False, only the fasteners that need it, that is, the ones whose CBUSH has no length because two pieces are in contact, get a CORD2R, and the rest of the CBUSH are oriented by vector. When it is True, every fastener gets its own CORD2R and all its CBUSH are oriented by CID.
- property DiameterFactor: float#
Property that returns the diameter_factor attribute, that is, the factor that multiplies the diameter to obtain the radius of the influence area.
- property DiscardedList: list[tuple[int, str]]#
Property that returns the row and the reason of every fastener that could not be resolved.
- property ElementTolerance: float#
Property that returns the element_tolerance attribute, that is, the numerical tolerance of the inside-the-element test.
- property FastenerModulus: float#
Property that returns the fastener_modulus attribute, that is, the elastic modulus of the fasteners.
- property FastenerPoisson: float#
Property that returns the fastener_poisson attribute, that is, the Poisson ratio of the fasteners.
- property HeadHeight: float#
Property that returns the head_height attribute, that is, the height of the head of the fasteners.
- property IncludeName: str#
Property that returns the include_name attribute, that is, the name of the include file the new cards will be written in.
- property K4: float#
Property that returns the k4 attribute, that is, the torsional stiffness of the CBUSH around the axis of the fastener. Only used by the methods based on CBUSH.
- property K5: float#
Property that returns the k5 attribute, that is, the bending stiffness of the CBUSH around the Y axis of the fastener. Only used by the methods based on CBUSH.
- property K6: float#
Property that returns the k6 attribute, that is, the bending stiffness of the CBUSH around the Z axis of the fastener. Only used by the methods based on CBUSH.
- property LayoutList: list[N2PFastenerLayout]#
Property that returns the geometry of the fasteners that could be resolved.
- property MaxNodeMovementFactor: float#
Property that returns the max_node_movement_factor attribute, that is, the largest fraction of the characteristic size of an element that one of its nodes may be moved by the COINCIDENT-NODE method.
- property Method: N2PFastenerMethod#
Property that returns the method attribute, that is, the way every fastener will be modelled.
- property Model: N2PModelContent#
Property that returns the model attribute, that is, the model the fasteners will be created in.
- property NutHeight: float#
Property that returns the nut_height attribute, that is, the height of the nut of the fasteners.
- property OffsetIDsCoords: int#
Property that returns the offset_ids_coords attribute, that is, the first ID of the new coordinate systems.
- property OffsetIDsElements: int#
Property that returns the offset_ids_elements attribute, that is, the first ID of the new elements.
- property OffsetIDsNodes: int#
Property that returns the offset_ids_nodes attribute, that is, the first ID of the new grids.
- property OffsetIDsProperties: int#
Property that returns the offset_ids_properties attribute, that is, the first ID of the new properties.
- property PieceList: list[list[N2PElement]]#
Property that returns the piece_list attribute, that is, the list of element lists to be joined.
- property Positions: ndarray#
Property that returns the positions attribute, that is, the table of fasteners to be created.
- RING_ANGLES = (0.0, 90.0, 180.0, 270.0)#
- ROTATION_COMPONENTS = 456#
- property ShearType: str#
Property that returns the shear_type attribute. When it is “AUTO”, every fastener is taken as simple shear when it joins two pieces and as double shear when it joins three or more.
- property StiffnessMethod: str#
Property that returns the stiffness_method attribute, that is, the formulation used for the shear stiffness.
- TRANSLATION_COMPONENTS = 123#
- property Tolerance: float#
Property that returns the tolerance attribute, that is, the factor that multiplies the diameter to obtain the maximum distance allowed between the point given and the pieces it joins.
- property WeightMethod: str#
Property that returns the weight_method attribute, that is, how the nodes a connector ties are chosen and weighted. With “SHAPE_FUNCTIONS” only the nodes of the pierced element take part, weighted with the shape functions of that element at the crossing, which is how the load would really be shared out and what HyperWorks does. With “DISTANCE” the nodes inside the influence radius are taken as well, weighted by how far they are from the crossing.