RE: volumetric weighted average of SDV1 using python
| Newsgroups | gmane.comp.mathematics.abaqus.user |
|---|---|
| Message-ID | <CY1PR03MB22971525CB9C0B62C43F517BE1900@CY1PR03MB2297.namprd03.prod.outlook.com> |
You need to get down to the values (and data) associated with the field output. For example: VR = frame.fieldOutputs[‘SDV1’].getSubset(region=myInstance) VR_values = [x.data for x in VR.values] To do the vector multiplication you’ll need to use Numpy: import numpy … VR = frame.fieldOutputs[‘SDV1’].getSubset(region=myInstance) VR_values = numpy.array([x.data for x in VR.values]) el_VOL= frame.fieldOutputs[‘EVOL’].getSubset(region=myInstance) el_VOL _values = numpy.array([x.data for x in el_VOL.values]) e_time_V = el_VOL*VR Regards, Dave Lindeman Staff Scientist Corporate Research Systems Laboratory 3M Center 235-3G-08 St. Paul, MN 55144 651-733-6383 From: [email protected] [mailto:[email protected]] Sent: Tuesday, May 15, 2018 2:46 PM To: [email protected] Subject: [EXTERNAL] [Abaqus] volumetric weighted average of SDV1 using python I've been trying to obtain volumetric weighted average of SDV1 in my model by using element volume EVOL. I wrote the following python code to do it for me, but it gives an error on multiplication part (el_VOL*VR) "incompatible data locations". I know SDV1 is stored at integration point and EVOL at whole element level and that is probably why the error. I probably should use IVOL; however, I already finished simulations and didn't store IVOL as I thought EVOL is enough, especially since the elements are C3D8R therefore EVOL and IVOL should be the same numbers. Does anyone know how to manipulate this code to perform the multiplications? odbPath = "C:\\Temp\\cap03.odb" odb = session.openOdb(name=odbPath,readOnly=FALSE) allSteps = session.odbData[odbPath].steps.keys() step = odb.steps[allSteps[1]] allFrames = session.odbData[odbPath].steps[allSteps[1]].frames.keys() myInstance = odb.rootAssembly.instances["PART-1-1"] for j in range(len(allFrames)): frame = step.frames[j] VR = frame.fieldOutputs['SDV1'].getSubset(region=myInstance) el_VOL = frame.fieldOutputs['EVOL'].getSubset(region=myInstance) e_times_V = el_VOL*VR newField = frame.FieldOutput(name='e_times_V', description='NA', field=e_times_V) print 'stepName = ', allSteps[1], ' frameNumber = ', allFrames[j] odb.save() odb.close() -- Sent from: http://abaqus-users.1086179.n5.nabble.com/ 3M Note: This message is from an [EXTERNAL] sender. If you suspect this message is malicious or spam, please click on the "Report Phishing - PhishMe" icon within the Outlook Ribbon to report it for evaluation, and do NOT open any attachments or click on any links. If you are using OWA, a handheld device, or do not see the icon, please follow the instructions below: Click here<https://spam.mmm.com/pem/pages/digestProcess/digestProcess.jsf?content=aedaaa864ecbae94e99f8ec623c17e2351023af7a749281eb3c12c72cced2c287f84f37f885629e2d9f11863505cd5960ac616536ee4e23285b2a4560df440260013180be7aa6b29f483d9656800ab8a0cef2d769bfa28fc3dd789610b0c2c2ab1612e40217e4b49e7e0466518f3f7b7a345650220f937b02c2652c0d9f1f960241719dcf5bbcade> to report this email as spam [Non-text portions of this message have been removed]