### Full Model Setup and Analysis Example Source: https://pynite.readthedocs.io/en/latest/_sources/node.rst.txt Demonstrates creating a model, adding nodes, defining supports and enforced displacements, applying loads, performing analysis, and retrieving results. ```python from Pynite import FEModel3D model = FEModel3D() n1 = model.add_node('N1', 0, 0, 0) n2 = model.add_node('N2', 0, 10, 0) # Pinned base and vertical settlement at the top model.def_support('N1', support_DX=True, support_DY=True, support_DZ=True) model.def_node_disp('N2', 'DY', -0.25) # Add a small horizontal force model.add_node_load('N2', 'FX', 2.0, case='S') model.add_load_combo('S', {'S': 1.0}) model.analyze_linear() print(model.nodes['N2'].DX['S']) # horizontal drift print(model.nodes['N1'].RxnFY['S']) # base vertical reaction ``` -------------------------------- ### Worked Example: Model Setup and Analysis Source: https://pynite.readthedocs.io/en/latest/node.html Demonstrates creating a model, adding nodes, defining a pinned support, applying an enforced displacement (settlement), adding a load, defining a load combination, performing linear analysis, and printing results. ```python from Pynite import FEModel3D model = FEModel3D() n1 = model.add_node('N1', 0, 0, 0) n2 = model.add_node('N2', 0, 10, 0) # Pinned base and vertical settlement at the top model.def_support('N1', support_DX=True, support_DY=True, support_DZ=True) model.def_node_disp('N2', 'DY', -0.25) # Add a small horizontal force model.add_node_load('N2', 'FX', 2.0, case='S') model.add_load_combo('S', {'S': 1.0}) model.analyze_linear() print(model.nodes['N2'].DX['S']) # horizontal drift print(model.nodes['N1'].RxnFY['S']) # base vertical reaction ``` -------------------------------- ### Worked Example: Cantilever Beam Analysis Source: https://pynite.readthedocs.io/en/latest/member.html A complete example demonstrating the setup of a cantilever beam, application of a tip load, linear analysis, querying results (max shear, max moment, tip deflection), and plotting diagrams. Requires matplotlib for plotting. ```python from Pynite import FEModel3D # Simple cantilever beam example model = FEModel3D() model.add_material('Steel', E=29_000_000.0, G=11_200_000.0, nu=0.3, rho=0.283) model.add_section('W12x26', A=7.65, Iy=17.3, Iz=204.0, J=0.300) n1 = model.add_node('N1', 0, 0, 0) n2 = model.add_node('N2', 10, 0, 0) # 10 units long m1 = model.add_member('M1', n1, n2, 'Steel', 'W12x26') # Fix the base model.def_support('N1', support_DX=True, support_DY=True, support_DZ=True, support_RX=True, support_RY=True, support_RZ=True) # Apply a downward tip load at the free end model.add_node_load('N2', 'FZ', -5.0, case='D') model.add_load_combo('D', {'D': 1.0}) model.analyze_linear() # Query common results Vmax = model.members['M1'].max_shear('Fz', 'D') Mmax = model.members['M1'].max_moment('Mz', 'D') dtip = model.members['M1'].deflection('dz', x=model.members['M1'].L(), combo_name='D') # Plot diagrams (requires matplotlib) # model.members['M1'].plot_shear('Fz', 'D', n_points=50) # model.members['M1'].plot_moment('Mz', 'D', n_points=50) # model.members['M1'].plot_deflection('dz', 'D', n_points=50) ``` -------------------------------- ### Install PyniteFEA with all features Source: https://pynite.readthedocs.io/en/latest/_sources/installation.rst.txt Installs PyniteFEA along with all optional features, including visualization and reporting tools. This is recommended for full functionality. ```console $ pip install PyniteFEA[all] ``` -------------------------------- ### Install additional dependencies for PyniteFEA Source: https://pynite.readthedocs.io/en/latest/_sources/installation.rst.txt Installs individual optional dependencies that are included when using the '[all]' flag. Install these separately if you omit '[all]' during the main installation. ```console $ pip install matplotlib ``` ```console $ pip install scipy ``` ```console $ pip install pdfkit ``` ```console $ pip install jinja2 ``` ```console $ pip install vtk ``` ```console $ pip install pyvista[all,trame] ``` ```console $ pip install ipywidgets ``` ```console $ pip install trame_jupyter_extension ``` -------------------------------- ### Interactive Workflow Example Source: https://pynite.readthedocs.io/en/latest/rendering.html An example demonstrating an interactive workflow involving rendering, updating, and saving the model visualization. ```APIDOC ### Interactive Workflow Example ```python from Pynite.Rendering import Renderer # or Pynite.Visualization # Create renderer my_rndr = Renderer(my_model) # View undeformed shape my_rndr.render_model() # Add deformation and quickly refresh my_rndr.deformed_shape = True my_rndr.deformed_scale = 20 my_rndr.update() # Switch diagram type my_rndr.member_diagrams = 'Mz' my_rndr.update() # Save result my_rndr.screenshot('mz_diagram.png') ``` ``` -------------------------------- ### Install PyniteFEA base version Source: https://pynite.readthedocs.io/en/latest/_sources/installation.rst.txt Installs PyniteFEA without optional features. Use this for a lighter-weight installation if visualization and reporting are not needed. ```console $ pip install PyniteFEA ``` -------------------------------- ### Install Sympy for derivation viewing Source: https://pynite.readthedocs.io/en/latest/_sources/installation.rst.txt Installs the Sympy library, which is only needed if you wish to view the mathematical derivations used in Pynite's development. ```console $ pip install sympy ``` -------------------------------- ### Display Axial Force Diagrams with Custom Scale Source: https://pynite.readthedocs.io/en/latest/rendering.html Example demonstrating how to display axial force diagrams and customize their size for better visibility. ```python # Example: Display axial force diagrams with custom scale my_rndr.member_diagrams = 'Fx' my_rndr.diagram_scale = 50 # Larger diagrams with larger labels my_rndr.render_model() ``` -------------------------------- ### Quick Start: Building and Analyzing a Structural Model Source: https://pynite.readthedocs.io/en/latest/FEModel3D.html This snippet demonstrates the basic workflow for creating a structural model, defining geometry, materials, sections, supports, loads, and performing a linear analysis. It also shows how to access results. ```python # Import the modeling class from Pynite import FEModel3D # Create a new model model = FEModel3D() # Geometry model.add_node('N1', 0.0, 0.0, 0.0) model.add_node('N2', 3.0, 0.0, 0.0) model.add_material('A36', E=29_000_000.0, G=11_200_000.0, nu=0.3, rho=0.283) model.add_section('Wsect', A=10.0, Iy=100.0, Iz=200.0, J=5.0) m1 = model.add_member('M1', i_node='N1', j_node='N2', material_name='A36', section_name='Wsect') # Supports and loads model.def_support('N1', support_DX=True, support_DY=True, support_DZ=True, support_RY=True, support_RZ=True) model.add_node_load('N2', direction='FZ', P=-5.0, case='D') # Load combinations and analysis model.add_load_combo('1.0D', {'D': 1.0}) model.analyze_linear(log=False) # Results uz = model.nodes['N2'].DZ['1.0D'] rxn = model.nodes['N1'].RxnFZ['1.0D'] ``` -------------------------------- ### Analyze a 3D Frame with Loads and Combinations (Python) Source: https://pynite.readthedocs.io/en/latest/_sources/quickstart.rst.txt Build and analyze a simple 3D portal frame with gravity and lateral loads. This example demonstrates load combinations and extracting member forces. ```python from Pynite import FEModel3D # Create the model frame = FEModel3D() # Nodes: two column bases and two column tops (units: inches, kips) # N1 ---M3--- N2 (beam at top, 20 ft span) # | | # M1 M2 (columns, 12 ft tall) # | | # N3 N4 (fixed bases) frame.add_node('N1', 0, 12*12, 0) frame.add_node('N2', 20*12, 12*12, 0) frame.add_node('N3', 0, 0, 0) frame.add_node('N4', 20*12, 0, 0) # Material: structural steel frame.add_material('Steel', 29000, 11200, 0.3, 2.836e-4) # Section: W10x33 (approximate properties) # A=9.71 in^2, Iy=36.6 in^4, Iz=171 in^4, J=0.583 in^4 frame.add_section('W10x33', 9.71, 36.6, 171, 0.583) # Members: two columns and one beam frame.add_member('M1', 'N3', 'N1', 'Steel', 'W10x33') frame.add_member('M2', 'N4', 'N2', 'Steel', 'W10x33') frame.add_member('M3', 'N1', 'N2', 'Steel', 'W10x33') # Fixed supports at column bases frame.def_support('N3', True, True, True, True, True, True) frame.def_support('N4', True, True, True, True, True, True) # Loads # Dead load: uniform gravity on beam (500 plf = 0.0417 kip/in) frame.add_member_dist_load('M3', 'Fy', -0.5/12, -0.5/12, case='D') # Wind load: lateral point load at top-left node frame.add_node_load('N1', 'FX', 10, case='W') # Load combinations (ASCE 7 LRFD) frame.add_load_combo('1.4D', {'D': 1.4}) frame.add_load_combo('1.2D+1.0W', {'D': 1.2, 'W': 1.0}) # Run analysis frame.analyze(check_statics=True) # Print base reactions for the wind combination print('--- Base reactions (1.2D+1.0W) ---') for node_name in ['N3', 'N4']: node = frame.nodes[node_name] Rx = node.RxnFX['1.2D+1.0W'] Ry = node.RxnFY['1.2D+1.0W'] Mz = node.RxnMZ['1.2D+1.0W'] print(f'{node_name}: Rx={Rx:.2f} k, Ry={Ry:.2f} k, Mz={Mz:.1f} k-in') # Print peak beam forces beam = frame.members['M3'] print(f'\nBeam max moment: {beam.max_moment("Mz", "1.2D+1.0W")/12:.1f} k-ft') ``` -------------------------------- ### Worked Example: Cantilever Beam Analysis Source: https://pynite.readthedocs.io/en/latest/_sources/member.rst.txt Demonstrates setting up a simple cantilever beam model, applying loads, performing linear analysis, and querying common results like maximum shear, moment, and tip deflection. Includes commented-out plotting calls. ```python from Pynite import FEModel3D # Simple cantilever beam example model = FEModel3D() model.add_material('Steel', E=29_000_000.0, G=11_200_000.0, nu=0.3, rho=0.283) model.add_section('W12x26', A=7.65, Iy=17.3, Iz=204.0, J=0.300) n1 = model.add_node('N1', 0, 0, 0) n2 = model.add_node('N2', 10, 0, 0) # 10 units long m1 = model.add_member('M1', n1, n2, 'Steel', 'W12x26') # Fix the base model.def_support('N1', support_DX=True, support_DY=True, support_DZ=True, support_RX=True, support_RY=True, support_RZ=True) # Apply a downward tip load at the free end model.add_node_load('N2', 'FZ', -5.0, case='D') model.add_load_combo('D', {'D': 1.0}) model.analyze_linear() # Query common results Vmax = model.members['M1'].max_shear('Fz', 'D') Mmax = model.members['M1'].max_moment('Mz', 'D') dtip = model.members['M1'].deflection('dz', x=model.members['M1'].L(), combo_name='D') # Plot diagrams (requires matplotlib) # model.members['M1'].plot_shear('Fz', 'D', n_points=50) # model.members['M1'].plot_moment('Mz', 'D', n_points=50) # model.members['M1'].plot_deflection('dz', 'D', n_points=50) ``` -------------------------------- ### Generate a PDF Report with Pynite Source: https://pynite.readthedocs.io/en/latest/_sources/reporting.rst.txt Example of how to import the Reporting module and call the create_report method to generate a PDF report. Specify the output file path and format. ```python # Import the reporting module from Pynite import Reporting # Create the report Reporting.create_report(my_model, output_filepath='./My Report.pdf', format='pdf') ``` -------------------------------- ### Display Moment Diagram in Z-direction Source: https://pynite.readthedocs.io/en/latest/rendering.html Visualize internal forces and moments on members. This example displays a moment diagram in the z-direction and adjusts the diagram size. ```python # Display a moment diagram in the z-direction my_rndr.member_diagrams = 'Mz' my_rndr.diagram_scale = 30 # Adjust diagram size (default: 30) my_rndr.render_model() ``` -------------------------------- ### Analyze a 3D Frame with Pynite Source: https://pynite.readthedocs.io/en/latest/quickstart.html Model a simple 3D portal frame including columns and a beam. This example demonstrates defining nodes, materials, sections, members, fixed supports, applying dead and wind loads, defining load combinations (ASCE 7 LRFD), running the analysis, and extracting/printing member forces and reactions. It also includes rendering the deformed shape for a specific load combination. ```python from Pynite import FEModel3D # Create the model frame = FEModel3D() # Nodes: two column bases and two column tops (units: inches, kips) # N1 ---M3--- N2 (beam at top, 20 ft span) # | | # M1 M2 (columns, 12 ft tall) # | | # N3 N4 (fixed bases) frame.add_node('N1', 0, 12*12, 0) frame.add_node('N2', 20*12, 12*12, 0) frame.add_node('N3', 0, 0, 0) frame.add_node('N4', 20*12, 0, 0) # Material: structural steel frame.add_material('Steel', 29000, 11200, 0.3, 2.836e-4) # Section: W10x33 (approximate properties) # A=9.71 in^2, Iy=36.6 in^4, Iz=171 in^4, J=0.583 in^4 frame.add_section('W10x33', 9.71, 36.6, 171, 0.583) # Members: two columns and one beam frame.add_member('M1', 'N3', 'N1', 'Steel', 'W10x33') frame.add_member('M2', 'N4', 'N2', 'Steel', 'W10x33') frame.add_member('M3', 'N1', 'N2', 'Steel', 'W10x33') # Fixed supports at column bases frame.def_support('N3', True, True, True, True, True, True) frame.def_support('N4', True, True, True, True, True, True) # Loads # Dead load: uniform gravity on beam (500 plf = 0.0417 kip/in) frame.add_member_dist_load('M3', 'Fy', -0.5/12, -0.5/12, case='D') # Wind load: lateral point load at top-left node frame.add_node_load('N1', 'FX', 10, case='W') # Load combinations (ASCE 7 LRFD) frame.add_load_combo('1.4D', {'D': 1.4}) frame.add_load_combo('1.2D+1.0W', {'D': 1.2, 'W': 1.0}) # Run analysis frame.analyze(check_statics=True) # Print base reactions for the wind combination print('--- Base reactions (1.2D+1.0W) ---') for node_name in ['N3', 'N4']: node = frame.nodes[node_name] Rx = node.RxnFX['1.2D+1.0W'] Ry = node.RxnFY['1.2D+1.0W'] Mz = node.RxnMZ['1.2D+1.0W'] print(f'{node_name}: Rx={Rx:.2f} k, Ry={Ry:.2f} k, Mz={Mz:.1f} k-in') # Print peak beam forces beam = frame.members['M3'] print(f'\nBeam max moment: {beam.max_moment("Mz", "1.2D+1.0W")/12:.1f} k-ft') print(f'Beam max shear: {beam.max_shear("Fy", "1.2D+1.0W"):.2f} k') print(f'Beam max defl: {beam.min_deflection("dy", "1.2D+1.0W"):.4f} in') # Render the deformed shape from Pynite.Visualization import Renderer rndr = Renderer(frame) rndr.deformed_shape = True rndr.deformed_scale = 50 rndr.render_loads = True rndr.combo_name = '1.2D+1.0W' rndr.render_model() ``` -------------------------------- ### Analyze a Simply Supported Beam with Distributed Load (Python) Source: https://pynite.readthedocs.io/en/latest/_sources/quickstart.rst.txt Analyze a simply supported beam with a uniform distributed load. This example demonstrates basic model creation, load application, analysis, and result plotting. ```python # Example of a simply supported beam with a uniform distributed load. # Units used in this example are inches and kips # This example does not use load combinations. The program will create a # default load combindation called 'Combo 1' # Import `FEModel3D` from `Pynite` from Pynite import FEModel3D # Create a new finite element model beam = FEModel3D() # Add nodes (14 ft = 168 inches apart) beam.add_node('N1', 0, 0, 0) beam.add_node('N2', 168, 0, 0) # Define a material E = 29000 # Modulus of elasticity (ksi) G = 11200 # Shear modulus of elasticity (ksi) nu = 0.3 # Poisson's ratio rho = 2.836e-4 # Density (kci) beam.add_material('Steel', E, G, nu, rho) # Add a section with the following properties: # Iy = 100 in^4, Iz = 150 in^4, J = 250 in^4, A = 20 in^2 beam.add_section('MySection', 20, 100, 150, 250) #Add a member beam.add_member('M1', 'N1', 'N2', 'Steel', 'MySection') # Provide simple supports beam.def_support('N1', True, True, True, False, False, False) beam.def_support('N2', True, True, True, True, False, False) # Add a uniform load of 200 lbs/ft to the beam (from 0 in to 168 in) beam.add_member_dist_load('M1', 'Fy', -200/1000/12, -200/1000/12, 0, 168) # Alternatively the following line would do apply the load to the full # length of the member as well # beam.add_member_dist_load('M1', 'Fy', -200/1000/12, -200/1000/12) # Analyze the beam beam.analyze() # Print the shear, moment, and deflection diagrams beam.members['M1'].plot_shear('Fy') beam.members['M1'].plot_moment('Mz') beam.members['M1'].plot_deflection('dy') # Print reactions at each end of the beam print(f"Left Support Reaction: { {k: float(v) for k, v in beam.nodes['N1'].RxnFY.items()} }") print(f"Right Support Reaction: { {k: float(v) for k, v in beam.nodes['N2'].RxnFY.items()} }") # Render the deformed shape of the beam magnified 100 times, with a text # height of 5 inches from Pynite.Visualization import Renderer renderer = Renderer(beam) renderer.annotation_size = 6 renderer.deformed_shape = True renderer.deformed_scale = 100 renderer.render_loads = True renderer.render_model() ``` -------------------------------- ### Add Members to Model Source: https://pynite.readthedocs.io/en/latest/member.html Create new members by specifying their name, start and end nodes, material, and section properties. Assumes nodes, materials, and sections are already defined. ```python # Add a member name 'M1' starting at node 'N1' and ending at node 'N2' # made from a previously defined material named 'Steel' my_model.add_member('M1', 'N1', 'N2', 'Steel', 'W12x26') # Add another member 'M2' my_model.add_member('M2', 'N2', 'N3', 'Steel', 'W12x26') ``` -------------------------------- ### Define End Releases for Pinned Connections Source: https://pynite.readthedocs.io/en/latest/member.html Simulate pinned connections or other end conditions by defining end releases using `def_releases()`. This example shows how to create a pin-ended member by releasing rotational degrees of freedom. ```python # The following line turns member M1 into a pin-ended member my_model.def_releases('M1', Dxi=False, Dyi=False, Dzi=False, Rxi=False, Ryi=True, Rzi=True, Dxj=False, Dyj=False, Dzj=False, Rxj=False, Ryj=True, Rzj=True) # This next line does the same thing as the previous line - just simplified my_model.def_releases('M1', False, False, False, False, True, True, False, False, False, False, True, True) # This next line is yet another simple way to do the same thing my_model.def_releases('M1', 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1) ``` -------------------------------- ### Add Member with Material and Section Source: https://pynite.readthedocs.io/en/latest/member.html Defines a new member in the FE model, specifying its name, start and end nodes, material, and section properties. Ensure material and section are defined prior to adding the member. ```python model.add_member('M1', n1, n2, 'Steel', 'W12x26') ``` -------------------------------- ### Get Deflection at a Specific Point on Member Source: https://pynite.readthedocs.io/en/latest/member.html Calculates the deflection at a specific distance from the start of a member for a given load combination. The distance is specified in the member's local units. ```python my_model.members['M2'].deflection('dy', 5, 'D+S') ``` -------------------------------- ### Renderer Initialization Source: https://pynite.readthedocs.io/en/latest/rendering.html Demonstrates how to initialize the Renderer object using either the PyVista or VTK backend. ```APIDOC ## Renderer Initialization ### Description Initialize the Renderer object, choosing between the recommended PyVista backend or the alternative VTK backend. ### Code Examples **PyVista renderer (recommended)** ```python from Pynite.Rendering import Renderer my_rndr = Renderer(my_model) ``` **VTK renderer (alternative)** ```python from Pynite.Visualization import Renderer my_rndr = Renderer(my_model) ``` ``` -------------------------------- ### Get Moment at a Specific Point on Member Source: https://pynite.readthedocs.io/en/latest/member.html Calculates the bending moment at a specific distance from the start of a member for a given load combination. The distance is specified in the member's local units. ```python my_model.members['M2'].moment('Mz', 5, '1.2D+1.6S') ``` -------------------------------- ### Get Shear at a Specific Point on Member Source: https://pynite.readthedocs.io/en/latest/member.html Calculates the shear force at a specific distance from the start of a member for a given load combination. The distance is specified in the member's local units. ```python my_model.members['M2'].shear('Fy', 5, '1.2D+1.6S') ``` -------------------------------- ### Initialize VTK Renderer Source: https://pynite.readthedocs.io/en/latest/_sources/rendering.rst.txt Use this snippet to initialize the alternative VTK renderer for lightweight environments or specific VTK customization needs. ```python from Pynite.Visualization import Renderer my_renderer = Renderer(my_model) my_renderer.render_model() ``` -------------------------------- ### Add Distributed Loads to Members Source: https://pynite.readthedocs.io/en/latest/_sources/member.rst.txt Applies linearly varying distributed loads to members. Define the member, load direction, start and end magnitudes, start and end distances, and load classification. ```python my_model.add_member_dist_load('M1', 'Fy', -0.100, -0.200, 2, 5, 'DL') ``` -------------------------------- ### End Releases Source: https://pynite.readthedocs.io/en/latest/member.html Defines the end releases (or restraints) for a member at its start and end nodes. ```APIDOC ## def_releases ### Description Defines the end releases for a member at its start (i) and end (j) nodes. ### Signature `FEModel3D.def_releases(member_name, Dxi=False, Dyi=False, Dzi=False, Rxi=False, Ryi=False, Rzi=False, Dxj=False, Dyj=False, Dzj=False, Rxj=False, Ryj=False, Rzj=False)` ### Parameters - **member_name** (str) - The name of the member to define releases for. - **Dxi, Dyi, Dzi** (bool, optional) - Translational releases at the start node (i) along X, Y, Z axes. Defaults to False (restrained). - **Rxi, Ryi, Rzi** (bool, optional) - Rotational releases at the start node (i) around X, Y, Z axes. Defaults to False (restrained). - **Dxj, Dyj, Dzj** (bool, optional) - Translational releases at the end node (j) along X, Y, Z axes. Defaults to False (restrained). - **Rxj, Ryj, Rzj** (bool, optional) - Rotational releases at the end node (j) around X, Y, Z axes. Defaults to False (restrained). ### Notes Setting a parameter to `True` indicates a release (no restraint). Setting it to `False` indicates a restraint. ``` -------------------------------- ### Create Rectangular Quad Mesh and Add Openings Source: https://pynite.readthedocs.io/en/latest/meshes.html Demonstrates creating a rectangular mesh on the XZ plane, adding a rectangular opening, generating the mesh, defining supports on the perimeter, and solving the model. Supports are defined for all degrees of freedom. Results can be queried using helper functions for max/min moments and shears. ```python from Pynite.FEModel3D import FEModel3D from Pynite.Mesh import RectangleMesh model = FEModel3D() model.add_material('Conc', E=3600*144, nu=0.2, rho=0.0) # example units # Add a rectangular mesh to the model model.add_rectangle_mesh( name='Slab', mesh_size = 2.0, width = 20.0, height = 25.0, thickness = 0.5, material_name = 'Conc', kx_mod = 1.0, ky_mod = 1.0, origin = [0, 0, 0], plane = 'XZ' ) # Rectangular meshes are unique, in that you can add openings to them model.meshes['Slab'].add_rect_opening( name = 'Opening 1', x_left = 5.0, # The mesh's local x-y coordinate system y_bott = 6.0, width = 5.0, height = 7.0 ) # Once all openings are defined the mesh can be generated model.meshes['Slab'].generate() # builds nodes/elements and adds them to the model # Now that the nodes and elements in the mesh have been generated, we can add supports. # Let's add fixed supports to the perimeter for node in model.meshes['Slab'].nodes.values(): # Check if the node lies on the perimeter if node.X == 0.0 or node.X == 20.0 or node.Z == 0.0 or node.Z == 25.0: # The mesh was generated in the XZ plane model.def_support(node.name, True, True, True, True, True, True) # Fix all degrees of freedom at the node # Solve the model model.analyze() # Solve the model, then query peak values by combo/tag slab = model.meshes['Slab']; mx_max = slab.max_moment('Mx', combo_tags=['service', 'strength']) # Check tagged combinations qy_min = slab.min_shear('Qy', combo_tags='Combo 1') # Check just one combination ``` -------------------------------- ### Access Member Nodes Source: https://pynite.readthedocs.io/en/latest/member.html Retrieves the start (i_node) and end (j_node) node objects associated with a member. ```python model.members['M'].i_node ``` ```python model.members['M'].j_node ``` -------------------------------- ### Add Member Point Load Source: https://pynite.readthedocs.io/en/latest/_sources/FEModel3D.rst.txt Applies a concentrated point load to a member at a specified distance from the start node. ```python model.add_member_pt_load(member_name, direction, P, x, case='Case 1') ``` -------------------------------- ### Initialize PyVista Renderer Source: https://pynite.readthedocs.io/en/latest/_sources/rendering.rst.txt Use this snippet to initialize the recommended PyVista renderer for interactive 3D visualization and Jupyter notebook integration. ```python from Pynite.Rendering import Renderer my_renderer = Renderer(my_model) my_renderer.render_model() ``` -------------------------------- ### Access Member Length Source: https://pynite.readthedocs.io/en/latest/member.html Retrieves the length of a specific member. The length is calculated based on the coordinates of its start and end nodes. ```python model.members['M'].L() ``` -------------------------------- ### Getting Node Results Source: https://pynite.readthedocs.io/en/latest/_sources/node.rst.txt Accesses results for a node after an analysis has been performed. Results are stored in dictionaries keyed by load combination name. ```APIDOC ## Getting Node Results ### Description Accesses results for a node after an analysis has been performed. Results are stored in dictionaries keyed by load combination name. ### Access Method `model.nodes['NodeName']` ### Available Nodal Results (per load combination) - **Displacements (global)** - `DX['Combo']`, `DY['Combo']`, `DZ['Combo']` - **Rotations (global)** - `RX['Combo']`, `RY['Combo']`, `RZ['Combo']` - **Reactions (global forces)** - `RxnFX['Combo']`, `RxnFY['Combo']`, `RxnFZ['Combo']` - **Reactions (global moments)** - `RxnMX['Combo']`, `RxnMY['Combo']`, `RxnMZ['Combo']` ### Notes - Results are populated only after a successful call to `analyze_linear()`, `analyze()`, or `analyze_PDelta()`. - Each combination analyzed will appear as a key in the respective result dictionaries. ``` -------------------------------- ### Set Visual Theme Source: https://pynite.readthedocs.io/en/latest/_sources/rendering.rst.txt Switch between 'default' (dark background) and 'print' (white background) themes for rendering. ```python my_rndr.theme = 'default' my_rndr.theme = 'print' ``` -------------------------------- ### Get Maximum Deflection from Member Source: https://pynite.readthedocs.io/en/latest/member.html Retrieves the maximum deflection for a specified axis and load combination from a member. This helps in assessing the serviceability of the structure. ```python my_model.members['M1'].max_deflection('dy', 'D') ``` -------------------------------- ### Initialize and Render Model Source: https://pynite.readthedocs.io/en/latest/_sources/rendering.rst.txt Basic initialization of the Renderer and rendering the undeformed shape. Supports switching to deformed shape visualization with scaling. ```python from Pynite.Rendering import Renderer # or Pynite.Visualization # Create renderer my_rndr = Renderer(my_model) # View undeformed shape my_rndr.render_model() # Add deformation and quickly refresh my_rndr.deformed_shape = True my_rndr.deformed_scale = 20 my_rndr.update() # Switch diagram type my_rndr.member_diagrams = 'Mz' my_rndr.update() # Save result my_rndr.screenshot('mz_diagram.png') ``` -------------------------------- ### Get Max Torque for a Tag Source: https://pynite.readthedocs.io/en/latest/member.html Retrieves the maximum torque across all load combinations tagged 'Strength'. Returns the maximum value and the governing combination. ```python Tmax, combo = my_model.members['M1'].max_torque(['Strength']) ``` -------------------------------- ### Get Maximum Torque in Member Source: https://pynite.readthedocs.io/en/latest/member.html Retrieves the maximum torque experienced by a member under a specified load combination. This is useful for members subjected to torsional loads. ```python Tmax = my_model.members['M1'].max_torque('D+L') ``` -------------------------------- ### Creating a Load Combination Source: https://pynite.readthedocs.io/en/latest/_sources/load_combo.rst.txt Demonstrates how to create a new load combination using the `add_load_combo` method, specifying load cases and their respective factors. ```APIDOC ## FEModel3D.add_load_combo() ### Description Creates a load combination by combining multiple load cases with specified load factors. ### Method ```python FEModel3D.add_load_combo(name: str, load_cases: dict, combo_tags: list = None) ``` ### Parameters * **name** (str) - The name for the new load combination. * **load_cases** (dict) - A dictionary where keys are load case names (str) and values are their corresponding load factors (float). * **combo_tags** (list, optional) - A list of tags to categorize the load combination. Defaults to None. ### Request Example ```python # Assume 'D' and 'L' are names previously specified for load cases my_model.add_load_combo('Vertical Loads', {'D':1.2, 'L':1.6}) ``` ### Response This method does not return a value but modifies the model by adding the load combination. ``` -------------------------------- ### Get Minimum Deflection from Member Source: https://pynite.readthedocs.io/en/latest/member.html Retrieves the minimum deflection for a specified axis and load combination from a member. Use this to find the most negative deflection value. ```python my_model.members['M3'].min_deflection('dz', 'D+L') ``` -------------------------------- ### Creating a New Member Source: https://pynite.readthedocs.io/en/latest/_sources/member.rst.txt Demonstrates how to define material and section properties, and then add a new member to the model. ```APIDOC ## Creating a New Member To create a new member use the ``FEModel3D.add_member()`` method. For the example below, we'll assume 3 nodes have already been defined ('N1', 'N2', and 'N3'). The next step is to set up some material and section properties for the members we'll be creating: ### Method ```python my_model.add_section('W12x26', Iy, Iz, J, A) my_model.add_material('Steel', E, G, nu, rho) my_model.add_member('M1', 'N1', 'N2', 'Steel', 'W12x26') my_model.add_member('M2', 'N2', 'N3', 'Steel', 'W12x26') ``` ### Parameters for add_section - **section_name** (str) - The name of the section property. - **A** (float) - Cross-sectional area. - **Iy** (float) - Weak axis moment of inertia. - **Iz** (float) - Strong axis moment of inertia. - **J** (float) - Torsional constant. ### Parameters for add_material - **material_name** (str) - The name of the material. - **E** (float) - Modulus of elasticity. - **G** (float) - Shear modulus. - **nu** (float) - Poisson's ratio. - **rho** (float) - Density. ### Parameters for add_member - **member_name** (str) - The name of the member. - **i_node** (str) - The name of the starting node. - **j_node** (str) - The name of the ending node. - **material_name** (str) - The name of the material to use. - **section_name** (str) - The name of the section property to use. ``` -------------------------------- ### Create Model and Rectangular Plate Source: https://pynite.readthedocs.io/en/latest/_sources/plate.rst.txt Initializes a FEModel3D, defines a material, adds nodes, creates a rectangular plate with specified thickness and material, sets edge supports, applies surface pressure, and performs linear analysis. Use this for basic plate modeling scenarios. ```python from Pynite import FEModel3D model = FEModel3D() model.add_material('Conc', E=3_600_000.0, G=1_500_000.0, nu=0.2, rho=0.150) # Define rectangle corners in the XY plane n1 = model.add_node('N1', 0, 0, 0) n2 = model.add_node('N2', 10, 0, 0) n3 = model.add_node('N3', 10, 8, 0) n4 = model.add_node('N4', 0, 8, 0) # Add a rectangular plate (thickness = 0.5) p1 = model.add_plate('P1', n1, n2, n3, n4, t=0.5, material_name='Conc', kx_mod=1.0, ky_mod=1.0) # Edge supports along the west edge model.def_support('N1', support_DZ=True) model.def_support('N4', support_DZ=True) # Uniform surface pressure (downward) model.add_plate_surface_pressure('P1', pressure=-0.05, case='D') model.add_load_combo('D', {'D': 1.0}) model.analyze_linear() # Sample results at plate center (local coordinates x=width/2, y=height/2) mx, my, mxy = model.plates['P1'].moment(x=5.0, y=4.0, local=True, combo_name='D').flatten() qx, qy = model.plates['P1'].shear(x=5.0, y=4.0, local=True, combo_name='D').flatten() sx, sy, txy = model.plates['P1'].membrane(x=5.0, y=4.0, local=True, combo_name='D').flatten() ``` -------------------------------- ### Getting Node Results Source: https://pynite.readthedocs.io/en/latest/node.html Explains how to access nodal results after an analysis, including displacements, rotations, and reactions, by querying the node's result dictionaries. ```APIDOC ## Getting Node Results After running an analysis, each node stores its results in dictionaries keyed by load combination name. Access a node via `model.nodes['Name']` and then query the result you need by combination. ### Available nodal results * Displacements (global) - `DX['Combo']`, `DY['Combo']`, `DZ['Combo']` * Rotations (global) - `RX['Combo']`, `RY['Combo']`, `RZ['Combo']` * Reactions (global forces) - `RxnFX['Combo']`, `RxnFY['Combo']`, `RxnFZ['Combo']` * Reactions (global moments) - `RxnMX['Combo']`, `RxnMY['Combo']`, `RxnMZ['Combo']` ``` -------------------------------- ### Compare Multiple Load Cases Source: https://pynite.readthedocs.io/en/latest/_sources/rendering.rst.txt Iterates through a list of load cases, setting each as the active case and rendering/saving an image of the 'Fx' diagram for each. ```python load_cases = ['Dead Load', 'Live Load', 'Wind Load'] for case_name in load_cases: my_rndr.case = case_name my_rndr.member_diagrams = 'Fx' my_rndr.render_model() my_rndr.screenshot(f'{case_name}.png') ``` -------------------------------- ### Get Maximum Torque Source: https://pynite.readthedocs.io/en/latest/member.html Retrieves the maximum torque across all load combinations matching the provided tags. Returns the governing value and the name of the load combination. ```APIDOC ## Get Maximum Torque ### Description Retrieves the maximum torque across all load combinations matching the provided tags. Returns the governing value and the name of the load combination. ### Method ```python my_model.members['M1'].max_torque(combo_tags) ``` ### Parameters #### Path Parameters - **combo_tags** (list[str] or str) - A list of tags or a single tag to filter load combinations. ### Response - **float** or **tuple[float, str]**: The maximum torque value, or a tuple containing the value and the governing load combination name. ``` -------------------------------- ### Get Axial Force at Midspan Source: https://pynite.readthedocs.io/en/latest/member.html Calculates the axial force in a member at its midspan for a given load combination. This requires knowing the member's total length. ```python N_mid = my_model.members['M1'].axial(x=0.5*my_model.members['M1'].L(), combo_name='D') ``` -------------------------------- ### Access Node Displacements and Reactions Source: https://pynite.readthedocs.io/en/latest/_sources/node.rst.txt Retrieve global displacements and support reactions for a specific node under given load combinations. Also shows how to iterate through node loads. ```python n = my_model.nodes['N2'] # Global displacements/rotations for combo 'D+L' ux = n.DX['D+L'] uy = n.DY['D+L'] rz = n.RZ['D+L'] # Support reactions for combo '1.2D+1.0W' vy = n.RxnFY['1.2D+1.0W'] mz = n.RxnMZ['1.2D+1.0W'] # Inspect loads assigned to the node (list of tuples: (Direction, value, case)) for (dirn, val, case) in n.NodeLoads: print(dirn, val, case) ``` -------------------------------- ### Get Minimum Moment from Member Source: https://pynite.readthedocs.io/en/latest/member.html Retrieves the minimum bending moment for a specified axis and load combination from a member. Use this to find the most negative moment value. ```python my_model.members['M3'].min_moment('My', '1.2D+1.6L') ``` -------------------------------- ### Compare Multiple Load Cases Source: https://pynite.readthedocs.io/en/latest/_sources/rendering.rst.txt This snippet illustrates how to iterate through different load cases, set the active case, display shear force diagrams (Fx), and save an image for each load case. ```APIDOC ## Compare Multiple Load Cases ### Description This snippet illustrates how to iterate through different load cases, set the active case, display shear force diagrams (Fx), and save an image for each load case. ### Method ```python load_cases = ['Dead Load', 'Live Load', 'Wind Load'] for case_name in load_cases: my_rndr.case = case_name my_rndr.member_diagrams = 'Fx' my_rndr.render_model() my_rndr.screenshot(f'{case_name}.png') ``` ``` -------------------------------- ### Get Minimum Shear from Member Source: https://pynite.readthedocs.io/en/latest/member.html Retrieves the minimum shear force for a specified axis and load combination from a member. Use this to find the most negative shear value. ```python my_model.members['M3'].min_shear('Fz', '1.2D+1.6L') ``` -------------------------------- ### Switch Visual Theme Source: https://pynite.readthedocs.io/en/latest/rendering.html Change the rendering theme between 'default' (dark background) and 'print' (white background, suitable for publications). ```python my_rndr.theme = 'default' # Dark background (default) my_rndr.theme = 'print' # White background (better for publications) ```