Now, I have extracted the required outputs and complete documentation for them is as follows:
Chapter 1
Stress Strain parameters from Solid Element (Source code:
https://github.com/Nolaraj/STKO_Opensee ... Element.py)
Initialization
1. Initialization of STKO system and its components
2. User input for data customization
• Database ID
db_id = 1
• Stress and strain component
component = 5 # from 0 to 6 (example 2 = Szz)
• Stage-id for mesh evaluation: Generally, first stage is occupied by gravity analysis and second stage is assigned for seismic analysis. The index here follows with start with 1.
stage_for_mesh = 2
• Reference CoOrdinates in X, Y and Z format: The values here provided are the reference from which nearby first scanned node (ie. Midpoint of solid element) inside the sphere defined by the tolerance is used for data extraction.
refcoOrd = [12.5,12.5,-7] # [X, Y , Z] Units of co ordinates are according to the model dimensions
• Tolerance: Values provided here iterates from start to end with specified increment (multiplying factor) until first node of solid element inside the sphere of influence specified by reference Co ordinate (as center) above is found. Here the tolerance value on each iterations acts to behave as radius for sphere of influence.
Tolerances = [1e-7, 1.5, 5] #Toleraces: Starting tolerance for check, tolerance increment, and maximum tolerance
Getting solid element of interest (based on reference CoOrdinates)
Elements = []
for ele_id, ele in mesh.elements.items():
if CheckValue(ele):
Elements.append(ele_id)
break
1. First all the elements from mesh are iterated.
2. The elements are checked whether they lie inside the boundary demarcated by reference coordinates and tolerance.
3. First scanned element is taken for further process.
Extracting all available volume-based stress and strains
strain = db.getElementalResult('strain (Volumes; 6', match=MpcOdb.Contains)
stress = db.getElementalResult('stress (Volumes; 6', match=MpcOdb.Contains)
• To get elements results for stress and strains as displayed above, custom recorders each with value “stress” and “strain” needs to be kept in analysis step of preprocessor.
• Strain and stress variable in the code above extracts all stress and strains values of index [3] and [4] of figure above.
Parsing all the available steps for particular stage and writing
# X-Y data for each element
XY_lists = [([], []) for i in range(len(elements))]
# parse all stages and all steps
for stage_id in db.getStageIDs():
all_steps = db.getStepIDs(stage_id)
for step_id in all_steps:
opt.stage = stage_id
opt.step = step_id
# evaluate the field
stress_field = stress.evaluate(opt)
strain_field = strain.evaluate(opt)
# process each element
for i in range(len(elements)):
ele_id = elements
x, y = XY_lists
row = MpcOdbResultField.gauss(ele_id, 0)
ix = strain_field[row, component]
iy = stress_field[row, component]
print(ele_id, ix, iy)
x.append(ix)
y.append(iy)
• XY_lists creates the space for accommodation of ([stressstep 1, stressstep 2 …], [strain step 1, strain step 2 ...]), ([], [])…. for each elements.
• Then stress and strains fields are found out through .evaluate(opt) command. After that for each steps, stress and strain are determined as ix and iy based upon row and component variable.
o row primarily defines for the index of element’s gauss point on MPCO Result field.
o component is as defined in initialization process.
• Note: Here in this case only one element is considered so i variable loop runs for single time. In case of multiple variable, the outputs will be as directed above.
By using of the data above chart is now developed using the code below
# make charts for each selected element
for i in range(len(elements)):
# element data
ele_id = elements
x, y = XY_lists
# create a new chart data
cdata = MpcChartData()
cdata.id = doc.genNextIdForChartData()
cdata.name = "Element {} - Compoenent {}".format(ele_id, component)
cdata.xLabel = strain.componentLabels()[component]
cdata.yLabel = stress.componentLabels()[component]
cdata.x = x
cdata.y = y
doc.addChartData(cdata)
# create a chart data item to put in the chart
cdata_item = MpcChartDataGraphicItem(cdata)
cdata_item.color = MpcQColor(255, 150, 0, 255)
cdata_item.thickness = 1.5
cdata_item.penStyle = MpcQPenStyle.SolidLine
# create a new chart
chart = MpcChart()
chart.id = doc.genNextIdForChart()
chart.name = "Element {} - Compoenent {}".format(ele_id, component)
chart.addItem(cdata_item)
doc.addChart(chart)
Sample of plot for single gauss point result
Chapter 2
Bulk processing of multiple model database (Source code: https://github.com/Nolaraj/STKO_Opensee ... _python.py)
Summary of complete process
1. First the user provides root directory from which data extraction needs to be proceed.
2. The system then extracts for all available .mpco files inside all the sub directory of root folder.
3. Each .mpco cluster is determined and separated for preventing mixing of multiple database from same cluster.
4. The system then extracts stress and strain as mentioned in previous heading.
Note: In this code stress strains are extracted from .mpco using h5py python module without involvement of STKO platform.
5. The stress and strain are then saved inside Excel workbook with worksheet for each cluster as shown in sample figure below. Strain are saved under column A and stress under column B.
6. Further data processing can be attained through custom python code.