This README.md describes features of the MATLAB program prepared for release at the AIAA SciCom 2019 Conference, San Diego 7-11 January 2019 [1]. The program reads mesh data and stresses from text files created by a finite element solution that is run independently by the user. It then defines the vector field and plots the load paths using the Runge-Kutta algorithm described in the paper.
- Matlab Load Path Plotting Algorithm
- Installation
- Example Run
- Program Features
- Format of Input Files
- References
- Example 1 Pin Loaded Hole
- Example 5 Simple Cube
- Example 8 Step – Static Solution
The repository can be cloned or downloaded from GitHub:
Once the files have been downloaded, change to the directory where the files are contained and run the "LoadPathGUI.m" file. You will see the GUI pop up:
To run the first data set in the Examples Directory.
Simulation Folder Path:
<MatLab run directory>\Examples\Example 1 Isotropic Plate With Loaded Hole\Simulation Files
Parallelisation tab – No
Seed Point File:
<MatLab run directory>\Examples\Example 1 Isotropic Plate With Loaded Hole\Y-Seeds (Primary)
Path Direction – Y
New pdf – Yes
Recompute – Yes
Save Directory
<MatLab run directory>\Examples\Example 1 Isotropic Plate With Loaded Hole
Step Size – 1
Path Length – 100
Minimum Vector Magnitude for Plot – 0.0
Then hit the "Plot Paths" button and the following results will be computed:
- The application only works for finite element mesh and stress files created using Hex8 elements (8-noded 3d bricks)
- The program reads node coordinates and element connectivity from a file (ds.dat) written to a fixed format.
- The program reads node stresses from a file (nodalSolution.txt) written to a fixed format.
- The contours are generated by a Runge-Kutta algorithm (see Reference [1]).
- Commencing points for the contours are defined.
- In a file xxxx.dat identified in the GUI created when the program is run.
- If the file is empty the Seeds are generated by the program. A seed is located at the centroid of element with the maximum magnitude of the Load Path Vector selected for the plot. Seeds are created on other elements with the same coordinate (in the Load Path Vector direction) to form a rake. This method facilitates the plot of the pulse.
- The program ensures the normal vectors for all element faces on the HEX8 elements point outwards
- Define centroid of element and store in an array
- Define centroid of face and vector V1 from centroid of element to centroid of face
- Define normal to face Vn as vector cross-product of two edges (store in array)
- If vector dot product V1.Vn is positive – ok
- If vector dot product V1.Vn is negative – reorder nodes on face and reverse direction of Vn.
- A simple code is used to determine which element point p0 is inside – may not work for highly distorted meshes.
- Loop over all elements
- Loop over all faces of the element
- Form vector V2 from centroid of the face to p0.
- Calculate the vector dot product of V2 and outward face normal.
- If all dot products are negative or zero p0 is in that element or on the surface of the element.
- If vector dot product is positive for any one face, p0 is outside element.
- For plot of transient propagation of pulse – see blocks of code ‘if pulse == 1’ in loadpath3D.m
- Plot only peak of pulse – In GUI set minimum below which path will not be plotted.
- In GUI set maximum for colorbar from review of finite element. Same maximum to be used across all time steps so plot will show change in maximum.
- To create movie
- Create a set of result files at different time steps
- Run load path program for each result file and store image as bmp file
- Run separate Movie.m program to create avi file.
Two files are required in addition to the data provided in the GUI. The format for these files defaults to ANSYS format. For other FEA packages the files might need to be edited
First 3 lines give a title comment, block information (3D and number of nodes) and read format Followed by list of node coordinates. The list ends with “-1” Title line for Elements, Element type (use et,1,185), block data including number of entries on line and number of elements and line giving format for read.
Followed by list of element node connectivity. Last 9 entries on each line give element number and node connectivity. Only 8-node brick elements are supported for this release. The node numbers need to be sequential (clockwise or anticlockwise) for a back face – then numbered on the front face in the same sequence – see figure below. The list ends with “-1”
The data for the "ds.dat" should be formatted as follows:
File containing stresses at nodes in global coordinates. Title line followed by one line for each node giving node number followed by 6 stress values.
The "nodalSolution.txt" file be in the following format:
Two lines giving number of nodes for stress file read.
The "nodalInfo.txt" file be in the following format:
[1] | D. Kelly, G. Pearce and K. Schroder-Turner. “Plotting Load Paths from Finite Element Stress Results for Aerospace Structures” Proceedings SciTech 2019, January 7-11, San Diego 2019.
Example 1 can be produced with the following settings:
This will yield the following plot:
Changing the path direction from "Y" to "X" and selecting the other seed file will yield:
Example 5 can be produced with the following settings:
This will yield the following plot:
Changing the path direction from "Y" to "X" file will yield (the values in dark blue are very near zero, hence this can be assumed to be a round off error):
Example 8 can be produced with the following settings:
This will yield the following plot: