讲义课件文稿isrpt_第1页
讲义课件文稿isrpt_第2页
讲义课件文稿isrpt_第3页
讲义课件文稿isrpt_第4页
讲义课件文稿isrpt_第5页
免费预览已结束,剩余21页可下载查看

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Lesson content:The Odb ObjectWriting to the OdbExamplesWorkshop 9: Working with the ODB ObjectWorkshop 10: Linear SuperpositionLesson 7: Postprocessing with Abaqus Scripting 2 hoursThe Odb Object (1/18)Output Database Object ModelResults data in the ODB are categorized as Field Data or History Data.

2、Odb objects are persistent.The Odb object is normally available from inside or outside of Abaqus/Viewer or Abaqus/CAE.Field DataHistory DataThe Odb Object (2/18)Accessing ODB root objectsFrom within the interactive products:This method allows Abaqus/CAE to keep track of the open output databases:Ope

3、ns an existing output database (.odb) fileCreates a new Odb objectAdds the new Odb object to the session.odbs repository.import visualizationsession.openOdb() The Odb Object (3/18)Access to odb object from outside of the interactive products: This will not use Abaqus tokens but Abaqus/CAE Session fu

4、nctionality will be unavailable. Odb object model is same in either case.Useful for third party developers. Sometimes can be useful for batch mode on clusters.Note if both batch mode of execution and Abaqus/CAE functionality is desired use “abaqus cae noGUI scriptname”When you execute outside of Aba

5、qus/CAE typically only one output database is open at a time. Import odbAccesso = openOdb()The Odb Object (4/18)Examples: Accessing the odb root objectsExample from within the interactive productsimport visualizationodb1 = session.openOdb(/home/job1.odb)odb2 = session.openOdb(/home/job2.odb)odb3 = s

6、ession.openOdb(/home/job3.odb)for odb in session.odbs.values(): odb.close()Example from outside of the interactive productsfrom odbAcess import *odb1 = openOdb(/home/job1.odb)odb2 = openOdb(/home/job2.odb)odb3 = openOdb(/home/job3.odb)odb1.close()odb2.close()odb3.close()The session.openOdb() method

7、allows Abaqus/CAE to keep track of the open output databasesThe Odb Object (5/18)steps (type = Repository)Background: each step in the analysis is associated with an analysis procedure.The output data for an Abaqus analysis contains a repository of one or more step objects. The key to the repository

8、 is the name of the step (user defined when building the model).Examples: accessing two steps by name and by pseudo-indexcrushStep = odb.stepsCrushlastStep = odb.steps.values()-1Field DataThe Odb Object (6/18)frames (type = OdbFrameArray)Background: Each increment of the analysis that writes output

9、to the output database is called a frame.The index to the frame sequence is not the frame number.Examples: accessing two frames by indexfirstFrame = crushStep.frames0lastFrame = lastStep.frames-1Standard Python 0th-based indexingField DataHistory DataField DataThe Odb Object (7/18)fieldOutputs (type

10、 = Repository)Background: Different variables can be written to the output database at different frequencies. As a result, not all frames will contain all of the field output variables.Field output data objects are stored in the fieldOutputs repository under the Odb frames object. The key to the rep

11、ository is the name of the output variable. For example, here we are accessing the field output for stress:stress = crushFrame.fieldOutputsSField DataThe Odb Object (8/18)Example: One statement access to the resultstress = odb.stepsCrush.frames-1.fieldOutputsSThe field output named S in the last fra

12、me of the step named Crush in the output database object called odb is assigned to the identifier stress.This example does not use intermediate assignments. The code using intermediate assignments: odb = session.openOdb(/home/job1.odb) steps = odb.steps step = stepsCrush stress = step.frames-1.field

13、OutputsS Field output named SThe last FrameOutput database odbVariable stressStep named CrushThe Odb Object (9/18)FieldOuptut ObjectBy default the field output data is output for the full model. So the FieldOutput object stress in the previous case will include stress values at all the elements in t

14、he model for last frame of step Crush.It contains a “cloud or array of field value objects” (e.g., stress tensors at each integration point for all elements). Each field value has much information (members) associated with it, for example:elementLabel, nodeLabel, position, face, integrationPoint, se

15、ctionPoint, type, data, magnitude, mises, tresca, press, inv3, maxPrincipal, midPrincipal, etc.The Odb Object (10/18)Given a FieldOutput object (stress), it is easy to extract results for stressValue in stress.values: print stressValue.mises More specific results for a region of the model can be obt

16、ained using the getSubset method, which returns another FieldOutput object. # Restrict the stress output to a prticular elementset instance = odb.rootAssembly.instances“PART-1-1” elSet1 = instance.elementSet“elSet1” stress.getSubset(region=elSet1)Field DataThe Odb Object (11/18)getSubset() methodThe

17、 getSubset() method can be thought of as a filter to restrict the FieldOutput object to a certain section of the model.The method returns a fieldOutput object.Arguments to getSubset() can include position, sectionPoint, region (node,elements,elementsets etc), location, and localCoordSystem.Possible

18、values for the position argument to the getSubset command are INTEGRATION_POINT, NODAL, ELEMENT_NODAL, CENTROID.Field DataThe Odb Object (12/18)Performance considerations for the getSubset() methodThe use of the getSubset() method is optional.The getSubset() method is used to facilitate efficient ra

19、ndom access of the ODB.As a general rule, the efficiency of the getSubset() method will break down when trying to access more than half of the model.The performance of the getSubset() method should be evaluated on a case-by-case basis when accessing data for large regions of a database.See Knowledge

20、 Base Article QA for guidelines for improving performance when using the ODB APIField DataThe Odb Object (13/18)Mathematical operations are supported for FieldOutput objects.Performed on tensors and vectors.Examples: stress1 + stress2, 2.*stressInvariants are calculated after the operation.All opera

21、nds must be compatible, for example:This will not work: stress + disp; an exception will be thrown.INTEGRATION_POINT data cannot be combined with ELEMENT_NODAL data. Operations are performed in the coordinate system that was used to save the data.Operators include the following: +, -, *, /, abs(), a

22、cos(), asin(), atan(), cos(), degreeToRadian(), exp(), exp10(), log(), log10(), power(), radianToDegree(), sin(), sqrt(), tan()The Odb Object (14/18)historyRegions (type = Repository)All output values for a single point or for some larger region are collected in a historyRegions object.The historyRe

23、gions object is analogous to the frames object for field data.The key to the repository should describe the portion of the model that is associated with the data. For example: somePoint = crushStep.historyRegionsBeam TipField DataHistory DataHistory DataThe Odb Object (15/18)historyRegions (contd)Th

24、e history region will correspond to one of the following spatial associations:A nodeA regionAn integration pointA material pointConsistent with this, a default naming style for repository keys is used by Abaqus. For example, this name was created for nodal data:stepObject.historyRegionsNode Part-1-1

25、.415History DataThe Odb Object (16/18)historyRegions (contd)The type of output variable that is requested by the user (prior to submitting the job) will determine the spatial association. For example:*Output, history, freq=1*node output, nset=tip1u1,u2,*element output, elset=E1S11,S22,*energy output

26、, elset=E2ALLIE,Abaqus input file regions = odb.stepsstepName.historyRegions regionsElementSet E2.positionWHOLE_REGION regionsElement PART-1-1.1 Int Point 7.positionINTEGRATION_POINT regionsNode PART-1-1.64.positionNODALHistory DataThe Odb Object (17/18)historyOutputs (type = Repository)History data

27、 is stored in the historyOutputs repository, under the ODB historyRegions object.This repository contains all the output for a specific point or region for a given step.The key to the repository is the name of the output variable.Each item in the repository contains a sequence of sequences. For doma

28、in = TIME, the sequence is a tuple of (stepTime, value)For domain = FREQUENCY, the sequence is a tuple of (frequency, value)For domain = MODAL, the sequence is a tuple of (mode, value)Examples:u2Deflection = endPoint.historyOutputsU2History DataThe Odb Object (18/18)Mathematical operations are suppo

29、rted for HistoryOutput objects.Analogous to operations on FieldOutput objectsExample (calculate the magnitude of a vector quantity)mag = 0 componentLabels = (U1, U2, U3)for label in componentLabels: mag = mag + power(endPoint.historyOutputlabel, 2.)mag = sqrt(mag)Obviously, the operations apply to o

30、nly the values, not the time.Writing to the Odb (1/2)External data is data that is prepared outside Abaqus can be added to the ODB file. It is useful to add new fieldOutput variables to the ODB. It is also useful for 3rd-party developers to integrate results inside of Abaqus.Note: Data cannot be del

31、eted from the output database.Workaround: Create a new .odb file, and write data that is copied from an existing .odb file.We will walk over some of the ASI Python commands to add data to the ODBCreating an output databaseodb = Odb(name=myData, analysisTitle=derived data, description=test problem, p

32、ath=testWrite.odb)Writing to the Odb (2/2)Creating a stepmyStep = odb.Step(name=My Step, description=, domain=TIME, timePeriod=1.0)Creating a framemyFrame = myStep.Frame(frameId=1, frameValue=0.1, description=)Creating field outputuField = myFrame.FieldOutput(name=U, description=Displacements, type=

33、VECTOR)Adding result data to field outputnodeLabels = (1, 2, 3, 4, 5, 6)nodeDisplacements = ( (1.0,2.0,3.0), (4.0,5.0,6.0), (7.0,8.0,9.0), (10.0,11.0,12.0), (13.0,14.0,15.0), (16.0,17.0,18.0) )uField.addData(position=NODAL, instance=myInstance, labels=nodeLabels, data=nodeDisplacements)Examples (1/3

34、)Example 1: Reading some field dataodb = session.openOdb(indentfoam_std_visco_2.odb)# Create a variable that refers to the last frame of the first step.lastFrame = odb.stepsStep-1.frames-1# Create a variable that refers to the displacement U in the last frame of the first step.displacement = lastFrame.fieldOutputsU# Create a variable that refers to the node set PUNCH located at the center of the # hemispherical punch. The set is associated with the part instance PART-1-1.center = odb.rootAssembly.instan

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论