ResultProcessor¶
- class pyccx.results.ResultProcessor(jobName)¶
Bases:
objectResultProcessor takes the output (results) file from the Calculix simulation, specified in the working directory for the
Simulation. The class processes the ASCII .frd file to load the results into a structure.The typical usage is that the
Simulationwill be successfully run and provide a convenience handle to process the results:# Run the analysis object analysis = pyccx.analysis.Simulation() # ... analysis.run() # Open the results file ('input') is currently the file that is generated by PyCCX results = analysis.results() # The call to read must be done to load all loadcases and timesteps from the results file results.read()
Individual timesteps (increments) are seperated and may be accessed accordingly using the
incrementsproperty. The results are stored in a dictionary with the increment index and a corresponding dictionary of results. The results dictionary contains the nodal and elemental results that are specified previously in the analysis.Attributes Summary
Elements identified in the Calculix results file
Stored increments of the Calculix results file
Nodes identified in the Calculix results file
Convenience property for the number of increments available in the Calculix results file
Methods Summary
calculateVonMises(sigma)findIncrementByTime(incTime[, tol])Finds an increment at a stored time witin a specified tolerance (default: 1e-6)
getElementResult(increment, resultKey[, elIds])Returns a element result at step increment, for a correpsonding ResultsValue type.
getNodeResult(increment, resultKey[, nodeIds])Returns a nodal result at step increment, for a corresponding
ResultsValuetype.Returns the last or final increment stored in the Calculix results file
orderElements(elVals)orderNodes(nodeVals)read()Opens up the results files and parses the results files to load all data within each increment
readDat()Internal method that reads the Analysis' Calculix .dat file for the elemental quanties and parses the results.
readElFlux(line, rfstr, time)Saves element integration point stresses
readElResultBlock(infile, line)eturns an array of line, mode, rfstr, time
readElStress(line, rfstr, time)Saves element integration point stresses
readNodalResultsBlock(infile)Returns an array of line, mode, rfstr, time
readNodeDisp(line, rfstr)Reads the nodal displacement values from the .frd file
readNodeFlux(line, rfstr)Reads the nodal heat flux values from the .frd file
readNodeForce(line, rfstr)Reads the nodal force values from the .frd file
readNodeStrain(line, rfstr)Reads the nodal strain values from the .frd file
readNodeStress(line, rfstr)Reads the nodal stress values from the .frd file
readNodeTemp(line, rfstr)Reads the nodal temp values from the .frd file
Attributes Documentation
- elements¶
Elements identified in the Calculix results file
A tuple of element ids, element types and element connectivity are returned
- increments¶
Stored increments of the Calculix results file
- nodes¶
Nodes identified in the Calculix results file
- numIncrements¶
Convenience property for the number of increments available in the Calculix results file
Methods Documentation
- static calculateVonMises(sigma)¶
- clearResults()¶
- findIncrementByTime(incTime, tol=1e-06)¶
Finds an increment at a stored time witin a specified tolerance (default: 1e-6)
- Parameters:
incTime – The specified analysis time to locate the increment
tol (
Optional[float]) – The numerical tolerance to find the increment [default: 1e-6]
- Return type:
Tuple[int,Dict]- Returns:
The Increment data structure if found
- getElementResult(increment, resultKey, elIds=None)¶
Returns a element result at step increment, for a correpsonding ResultsValue type. The elIDs parameter is optional and will select those values stored at these elements. The return value is a tuple, consisting of the element ids, integration points and corresponding result values.
- Parameters:
increment (
int) – The selected increment index availableresultKey (
ResultsValue) – A Valid Nodal Quantity in ResultsValueelIds (
Optional[array]) – A list of element ids
- Return type:
Tuple[array,array,array]- Returns:
A tuple of element ids, integration points and corresponding result values
- getNodeResult(increment, resultKey, nodeIds=None)¶
Returns a nodal result at step increment, for a corresponding
ResultsValuetype. The nodeIds parameter is optional.- Parameters:
increment (
dict) – The selected increment index availableresultKey (
ResultsValue) – A Valid Nodal Quantity in ResultsValuenodeIds (
Optional[array]) – A list of node ids
- Return type:
Tuple[array,array]- Returns:
A tuple of node ids and corresponding result values
- Raises:
Exception if the increment or result key does not exist
- hasResults()¶
- Return type:
bool
- lastIncrement()¶
Returns the last or final increment stored in the Calculix results file
- static orderElements(elVals)¶
- static orderNodes(nodeVals)¶
- read()¶
Opens up the results files and parses the results files to load all data within each increment
- Return type:
None
- readDat()¶
Internal method that reads the Analysis’ Calculix .dat file for the elemental quanties and parses the results.
- Return type:
None
- readElFlux(line, rfstr, time)¶
Saves element integration point stresses
- readElResultBlock(infile, line)¶
eturns an array of line, mode, rfstr, time
- readElStress(line, rfstr, time)¶
Saves element integration point stresses
- readNodalResultsBlock(infile)¶
Returns an array of line, mode, rfstr, time
- readNodeDisp(line, rfstr)¶
Reads the nodal displacement values from the .frd file
- Return type:
tuple
- readNodeFlux(line, rfstr)¶
Reads the nodal heat flux values from the .frd file
- Return type:
tuple
- readNodeForce(line, rfstr)¶
Reads the nodal force values from the .frd file
- readNodeStrain(line, rfstr)¶
Reads the nodal strain values from the .frd file
- Return type:
tuple
- readNodeStress(line, rfstr)¶
Reads the nodal stress values from the .frd file
- Return type:
tuple
- readNodeTemp(line, rfstr)¶
Reads the nodal temp values from the .frd file
- Return type:
tuple