Coverage for mpcforces_extractor\test_ressources\simple_model.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-11-01 11:08 +0100

1from typing import List 

2 

3 

4def get_simple_model_fem() -> List: 

5 """ 

6 This method returns a simple model with MPC and CQUAD4 elements 

7 """ 

8 

9 lines = [ 

10 "$$\n", 

11 "GRID 4 43.8828813.6511210.0 \n", 

12 "GRID 5 43.8828813.6511226.5871 \n", 

13 "GRID 6 51.5091413.6511217.62625\n", 

14 "GRID 6091 243.882913.6511210.0 \n", 

15 "GRID 6092 243.883413.65107-10.0 \n", 

16 "GRID 6093 0.0 -10.0 -10.0 \n", 

17 "GRID 6094 0.0 -10.0 0.0 \n", 

18 "GRID 6095 0.0 -10.0 10.0 \n", 

19 "GRID 6096 0.0 0.0 10.0 \n", 

20 "GRID 6097 0.0 10.0 10.0 \n", 

21 "GRID 6098 0.0 10.0 0.0 \n", 

22 "GRID 6099 0.0 10.0 -10.0 \n", 

23 "GRID 6100 0.0 0.0 -10.0 \n", 

24 "GRID 6101 0.0 0.0 0.0 \n", 

25 "GRID 6102 8.871956-10.0 -10.0 \n", 

26 "GRID 6103 8.871956-10.0 0.0 \n", 

27 "GRID 6104 8.871956-10.0 10.0 \n", 

28 "GRID 6105 8.8719560.0 10.0 \n", 

29 "GRID 6106 8.87195610.0 10.0 \n", 

30 "GRID 6107 8.87195610.0 0.0 \n", 

31 "GRID 6108 8.87195610.0 -10.0 \n", 

32 "GRID 6109 8.8719560.0 -10.0 \n", 

33 "GRID 6110 8.8719560.0 0.0 \n", 

34 "GRID 6111 4.435978-5.0 -6.66667\n", 

35 "$$\n", 

36 "$$ RBE2 Elements - Multiple dependent nodes\n", 

37 "$$\n", 

38 "$HMCOMP ID 1 1 4\n", 

39 "RBE2 9 6111 123456 6093 6094 6100 6102 6109\n", 

40 "+ 6110 0.0\n", 

41 "$\n", 

42 "$$\n", 

43 "$$ CQUAD4 Elements\n", 

44 "$$\n", 

45 "$HMCOMP ID 1 1 4\n", 

46 "CQUAD4 1 1 6097 6098 6101 6096\n", 

47 "CQUAD4 2 1 6096 6101 6094 6095\n", 

48 "CQUAD4 3 1 6098 6099 6100 6101\n", 

49 "CQUAD4 4 1 6101 6100 6093 6094\n", 

50 "CQUAD4 5 1 6106 6107 6110 6105\n", 

51 "CQUAD4 6 1 6105 6110 6103 6104\n", 

52 "CQUAD4 7 1 6107 6108 6109 6110\n", 

53 "CQUAD4 8 1 6110 6109 6102 6103\n", 

54 "$\n", 

55 "$$\n", 

56 "$$ SPC Data\n", 

57 "$$\n", 

58 "SPC 1 6106 123456 0.0\n", 

59 "$$\n", 

60 "$$ FORCE Data\n", 

61 "$$\n", 

62 "FORCE 2 6097 01.0 0.0 0.0 1\n", 

63 ] 

64 return lines 

65 

66 

67def get_simple_model_mpc() -> List: 

68 """ 

69 This method returns a simple model with MPC forces which is the output of Optistruct 

70 for the simple model fem above 

71 """ 

72 lines = [ 

73 "OPTISTRUCT RESULT 2023.1\n", 

74 " \n", 

75 "$ITERATION 0\n", 

76 " \n", 

77 "$SUBCASE 1 \n", 

78 "$TIME 0.10000000E+01\n", 

79 " \n", 

80 "$MPC FORCE [REAL]\n", 

81 "--------+-----------------------------------------------------------------------------\n", 

82 " GRID # X-FORCE Y-FORCE Z-FORCE X-MOMENT Y-MOMENT Z-MOMENT\n", 

83 "--------+-----------------------------------------------------------------------------\n", 

84 " 6093 -2.65537E-02 -2.44183E-01 4.36841E-02\n", 

85 " 6094 7.00173E-01 4.53330E-01 -6.34804E-01\n", 

86 " 6100 -6.73619E-01 -1.20915E+00 -3.15689E-01\n", 

87 " 6102 -1.93745E-01 7.63245E-02 -2.52271E-01 -1.96810E-02 -8.38505E-01 1.92525E-01\n", 

88 " 6109 -1.09135E-01 5.39527E-01 3.23144E-01 1.70904E-01 -3.49756E-01 1.11075E+00\n", 

89 " 6110 3.02880E-01 -6.15851E-01 9.29127E-01 1.16756E+00 7.03142E+00 6.34173E-01\n", 

90 " 6111 0.00000E-00 0.00000E-00 0.00000E-00 0.00000E-00 0.00000E-00 0.00000E-00\n", 

91 "--------+-----------------------------------------------------------------------------\n", 

92 ] 

93 return lines