SteveDoyle2 / pyNastran

A Python-based interface tool for Nastran's file formats
Other
395 stars 154 forks source link

NASA Nastran: element_code = 83? #583

Closed ajrio closed 4 years ago

ajrio commented 4 years ago

Wrote an output2 from the OS'd Nastran-95 on a SOL 1 static routine in hopes of importing it into pyNastran. I have CRODS and CTRIA3 in the model but only the CRODS seem to be imported so perhaps the CTRIA3 are being interpreted as HACAB (element code 83)?

DEBUG:   op2.py:620                   combine=True
DEBUG:   op2.py:621                   -------- reading op2 with read_mode=1 (array sizing) --------
INFO:    op2_scalar.py:1469           op2_filename = 'none.op2'
DEBUG:   op2_reader.py:255            mode = u'msc'
DEBUG:   op2_scalar.py:1620             table_name='OUGV1'
DEBUG:   op2_scalar.py:1620             table_name='OEF1'
DEBUG:   op2_scalar.py:1620             table_name='OES1'
DEBUG:   op2.py:640                   -------- reading op2 with read_mode=2 (array filling) --------
DEBUG:   op2_reader.py:255            mode = u'msc'
DEBUG:   op2_scalar.py:1620             table_name='OUGV1'
DEBUG:   op2_scalar.py:1620             table_name='OEF1'
WARNING: op2_common.py:1470           --Table3Data--

  device_code   = 1   Print
  analysis_code = 1   Statics
  table_code    = 4   OEF1-OEF - Element Force
  format_code   = 1   Real
  sort_method   = 1
  sort_code     = 0
    sort_bits   = (0, 0, 0)
    data_format = 0   Real
    sort_type   = 0   Sort1
    is_random   = 0   Sorted Responses
  random_code   = 0  
  element_type  = 83  HACAB
  s_code        = None ???
  thermal       = 0   isHeatTransfer = False
  thermal_bits  = [0, 0, 0, 0, 0]
  num_wide      = 9  
  isubcase      = 1  
  MSC Nastran

DEBUG:   op2_scalar.py:1620             table_name='OES1'
WARNING: op2_common.py:1470           sort1 Type=HACAB num=83
DEBUG:   op2.py:922                   combine_results
DEBUG:   op2.py:653                   finished reading op2
>>> print(model.get_op2_stats())
displacements[1]
  isubcase = 1
  type=RealDisplacementArray nnodes=110, table_name=OUGV1
  data: [t1, t2, t3, r1, r2, r3] shape=[1, 110, 6] dtype=float32
  node_gridtype.shape = (110, 2)
  sort1
  lsdvmns = [1]

crod_stress[1]
  type=RealRodStressArray nelements=119
  eType
  data: [1, nelements, 4] where 4=[axial, SMa, torsion, SMt]
  element.shape = (119,)
  data.shape = (1, 119, 4)
  element type: CROD
  sort1
  lsdvmns = [1]

crod_force[1]
  type=RealRodForceArray nelements=119; table_name=u'OEF1'
  data: [1, nnodes, 2] where 2=[axial, torsion]
  data.shape = (1, 119, 2)
  element.shape = (119,)
  element name: CROD
  sort1
  loadIDs = [1]
SteveDoyle2 commented 4 years ago

Nastran 95 is not supported. I use Windows and as far as I know, nobody has built it for Windows. Some people have done it for Linux, but have not put the code online. Unless I have a working executable, I can't support it.

ajrio commented 4 years ago

I can understand. Apparently the Ubuntu terminal can be run on Windows 10 (https://www.microsoft.com/en-us/p/ubuntu/) but I don't have Win10 to test. On my ubuntu box I just installed the package from the debian repository (sudo apt-get install nastran). Maybe it would work on Win 10 this way...

SteveDoyle2 commented 4 years ago

Oh, that does work. I didn't even think of trying that. Do you know who put that up (e.g., which github repository)?

Do you have an example? The d01011a.inp file I tried does not make an op2. There is an nptp file that is binary, but it doesn't strangely follow the standard nastran format.

ajrio commented 4 years ago

Glad it works!

https://github.com/nasa/NASTRAN-95/issues/5#issuecomment-400307240

^Extent of possible build ownership and my awareness of the debian package.

Here is my work in progress hobby, for example.

aBalsaWingbox.bdf.zip

You can see my DMAP Alters with the MSC flag. That generates a readable ("none") binary for your OP2 reader if I force model.post = -4, despite the -9 parameter flag.

As far as I can tell from inspection, this is the following Nastran 95 element codes:

1 CROD
2 C.....
3 CTUBE
4 CSHEAR
5 CTWIST
6 CTRIA1
7 CTRBSC
8 CTRPLT
9 CTRMEM
10 CONROD
11 ELAS1
12 ELAS2
13 ELAS3
14 ELAS4
15 CQDPLT
16 CQDMEM
17 CTRIA2
18 CQUAD2
19 CQUAD1
20 CDAMP1
21 CDAMP2
22 CDAMP3
23 CDAMP4
24 CVISC
25 CMASS1
26 CMASS2
27 CMASS3
28 CMASS4
29 CONM1
30 CONM2
31 PLOTEL
32 C.....
33 C.....
34 CBAR
35 CCONE
36 CTRIARG
37 CTRAPRG
38 CTORDRG
39 CTETRA
40 CWEDGE
41 CHEXA1
42 CHEXA2
43 CFLUID2
44 CFLUID3
45 CFLUID4
46 CFLMASS
47 CAXIF2
48 CAXIF3
49 CAXIF4
50 CSLOT3
51 CSLOT4
52 CHBDY
53 CDUM1
54 CDUM2
55 CDUM3
56 CDUM4
57 CDUM5
58 CDUM6
59 CDUM7
60 CDUM8
61 CDUM9
62 CQDMEM1
63 CQDMEM2
64 CQUAD4
65 CIHEX1
66 CIHEX2
67 CIHEX3
68 CQUADTS
69 CTRIATS
70 CTRIAAX
71 CTRAPAX
72 CAERO1
73 CTRIM6
74 CTRPLT1
75 CTRSHL
76 CFHEX1
77 CFHEX2
78 CFTETRA
79 CFWEDGE
80 CIS2D8
81 CELBOW
82 CFTUBE
83 CTRIA3
SteveDoyle2 commented 4 years ago

That’s not the build. That one is setup for VAX. I wonder if it’s Harry’s build. It’d be nice to find it and at least fix the required DMAP alter.

I got the reader working. It supports rods, springs, dampers, CSHEAR, CBAR, and CTRIA3 at the moment. Some tests are broken and I’m out of town now, so it’ll be a few days.

ajrio commented 4 years ago

Great! The way I understand the optimal DMAP logic sequence is that the Alter for output2 should be applied at the SDR2 card for each unique SOL. (https://www.princeton.edu/~dynaflow/femgv/manuals/postnas/node24.htm)

As to the source of the build, I found this: https://tracker.debian.org/pkg/nastran

Cheers and happy holidays!

SteveDoyle2 commented 4 years ago

Thanks!

It's finally done! You can use:

model = OP2()
model..set_as_nasa95()
model.read_op2(op2_filename)

or:

model = read_op2(op2_filename, mode='nasa95')