-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Currently there is a function that is named _readShellStressData , which is a prior step to plot stresses. It is sort of uncomplete if intentions were to read actual Shell Stress Data.
vfo/vfo/internal_database_functions.py
Lines 552 to 612 in 0a8b94a
| def _readShellStressData(ModelName,LoadCaseName): | |
| """ | |
| """ | |
| ODBdir = ModelName+"_ODB" # ODB Dir name | |
| LoadCaseDir = os.path.join(ODBdir, LoadCaseName) | |
| # Get number of nodes in the model to set a node displacement array | |
| nodes,elements, eleClassTags = _readNodesandElements(ModelName) | |
| Nnodes = len(nodes) | |
| ndm = len(nodes[0,1:]) | |
| # Read shell element tags saved in ODB | |
| Elements_shell_4N4GP = os.path.join(ODBdir, "Elements_shell_4N4GP.out") | |
| if len(Elements_shell_4N4GP)>0: | |
| """ | |
| Read 4Node 4GP shell data if exists | |
| extrapolate stress from GP to nodes | |
| Calculate average stress at each node from elements | |
| Save node stress data for plotting | |
| """ | |
| EleStressFile_shell_4N4GP = os.path.join(LoadCaseDir,"EleStress_shell_4N4GP.out") | |
| GPstress_shell_4N4GP = np.transpose(np.loadtxt(EleStressFile_shell_4N4GP, dtype=float, delimiter=None, converters=None, unpack=True)) | |
| t_row = 0 # get this dynamically from tstep input | |
| ii=0 | |
| for ii, ele in enumerate(Elements_shell_4N4GP): | |
| ##### initialize a 2D array to store GP stress data for matrix calcs | |
| _thisGPstress = np.zeros([4,32]) | |
| _thisGPstress = np.array([[GPstress_shell_4N4GP[t_row, 1:9+ii]], | |
| [GPstress_shell_4N4GP[t_row, 10+ii:18+ii]], | |
| [GPstress_shell_4N4GP[t_row, 19+ii:27+ii]], | |
| [GPstress_shell_4N4GP[t_row, 28+ii:36+ii]]]) | |
| # each element has 3 stress vectors | |
| # create a [Nnodes x Nele] array to store node stress from each element | |
| # Each row is for a node. Store stress from element j at node i in the array location ij | |
| nodeStressArray = np.zeros([Nnodes,Nele]) | |
| timeSteps = Disp[:,0] | |
| Ntime = len(Disp[:,0]) | |
| tempDisp = np.zeros([Ntime,Nnodes,ndm]) | |
| tempDisp[:,:,0] = Disp[:,1::ndm] | |
| tempDisp[:,:,1] = Disp[:,2::ndm] | |
| if ndm == 3: | |
| tempDisp[:,:,2] = Disp[:,3::ndm] | |
| nodes_displacement = tempDisp | |
| return timeSteps, nodes_displacement |
I wish there were something to plot stress
Metadata
Metadata
Assignees
Labels
No labels