Coverage for cards/axis.py: 90%

20 statements  

« prev     ^ index     » next       coverage.py v7.7.0, created at 2025-03-20 20:51 +0100

1""" 

2NASTRAN Axis Cards Collection 

3""" 

4import logging 

5import re 

6from collections import defaultdict 

7 

8from nastranio.cardslib import SimpleCard 

9from nastranio.decorators import axis 

10 

11 

12# ============================================================================ 

13# axis 

14# ============================================================================ 

15@axis 

16class CORD2R(SimpleCard): 

17 """ 

18 Rectangular Coordinate System Definition, Form 2 

19 Defines a rectangular coordinate system using the coordinates of three points. 

20 

21 

22 ref: NX Nastran 12 Quick Reference Guide 12-24 (p.1508) 

23 """ 

24 

25 TABLE = """ 

26| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 

27|--------+-----+-----+----+----+----+----+----+----+----| 

28| CORD2R | CID | RID | A1 | A2 | A3 | B1 | B2 | B3 | | 

29| | C1 | C2 | C3 | | | | | | | 

30 """ 

31 DEFAULT = {"RID": 0} 

32 

33 

34@axis 

35class CORD2S(SimpleCard): 

36 """ 

37 Spherical Coordinate System Definition, Form 2 

38 Defines a spherical coordinate system using the coordinates of three points. 

39 

40 

41 ref: NX Nastran 12 Quick Reference Guide 12-26 (p.1510) 

42 """ 

43 

44 TABLE = """ 

45| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 

46|--------+-----+-----+----+----+----+----+----+----+----| 

47| CORD2S | CID | RID | A1 | A2 | A3 | B1 | B2 | B3 | | 

48| | C1 | C2 | C3 | | | | | | | 

49 """ 

50 DEFAULT = {"RID": 0} 

51 

52 

53@axis 

54class CORD2C(SimpleCard): 

55 """ 

56 Cylindrical Coordinate System Definition, Form 2 

57 Defines a cylindrical coordinate system using the coordinates of three points. 

58 

59 

60 ref: NX Nastran 12 Quick Reference Guide 12-21 (p.1505) 

61 """ 

62 

63 TABLE = """ 

64| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 

65|--------+-----+-----+----+----+----+----+----+----+----| 

66| CORD2C | CID | RID | A1 | A2 | A3 | B1 | B2 | B3 | | 

67| | C1 | C2 | C3 | | | | | | | 

68 """ 

69 DEFAULT = {"RID": 0} 

70 

71 

72if __name__ == "__main__": 

73 import doctest 

74 

75 doctest.testmod(optionflags=doctest.ELLIPSIS)