1. C++ / Говнокод #16797

    +57

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    for (j=0;j<3;j++) {
    			tmp += member[i].V[2][j] * member[i].V[0][j];}
    		if (tmp > LENGTH_EPS) {
    			if ( node[member[i].n0].u_fix.y == 0 ) { //if node #1 is not fixed
    				if ( node[member[i].n0].teta_fix.x == 0 ) { //if node #3 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+1,	FreeDeg*n_number[member[i].n0] +3,	6*EJz/member[i].L*tmp				);} //k(1,3)
    				if ( node[member[i].n1].teta_fix.x == 0 ) {	//if node #9 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+1,	FreeDeg*n_number[member[i].n1] +3,	6*EJz/member[i].L*tmp				);} //k(1,9)
    			}
    			if ( node[member[i].n0].u_fix.z == 0 ) { //if node #2 is not fixed
    				if ( node[member[i].n0].u_fix.x == 0 ) { //if node #0 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+2,  FreeDeg*n_number[member[i].n0],		12*EJy/pow(member[i].L,2)*tmp 	);} //k(2,0)
    				if ( node[member[i].n1].u_fix.x == 0 ) { //if node #6 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+2,  FreeDeg*n_number[member[i].n1],		-12*EJy/pow(member[i].L,2)*tmp 	);} //k(2,6)
    			}
    			if ( node[member[i].n0].teta_fix.y == 0 ) { //if node #4 is not fixed
    				if ( node[member[i].n0].u_fix.x == 0 ) { //if node #0 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+4,	FreeDeg*n_number[member[i].n0],		-6*EJy/member[i].L*tmp 			);} //k(4,0)
    				if ( node[member[i].n1].u_fix.x == 0 ) { //if node #6 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+4,	FreeDeg*n_number[member[i].n1],		6*EJy/member[i].L*tmp 			);} //k(4,6)
    			}
    			if ( node[member[i].n0].teta_fix.z == 0 ) { //if node #5 is not fixed
    				if ( node[member[i].n0].teta_fix.x == 0 ) { //if node #3 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+5,  FreeDeg*n_number[member[i].n0] +3,	4*EJz*tmp				);} //k(5,3)
    				if ( node[member[i].n1].teta_fix.x == 0 ) {	//if node #9 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+5,  FreeDeg*n_number[member[i].n1] +3,  2*EJz/member[i].L*tmp 	);} //k(5,9)
    			}
    			if ( node[member[i].n1].u_fix.y == 0) { //if node #7 is not fixed
    				if ( node[member[i].n0].teta_fix.x == 0 ) { //if node #3 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+1,	FreeDeg*n_number[member[i].n0] +3,	-6*EJz/member[i].L*tmp 			);} //k(7,3)
    				if ( node[member[i].n1].teta_fix.x == 0 ) {	//if node #9 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+1,	FreeDeg*n_number[member[i].n1] +3,	-6*EJz/member[i].L*tmp 			);} //k(7,9)
    			}
    			if ( node[member[i].n1].u_fix.z == 0 ) { //if node #8 is not fixed
    				if ( node[member[i].n0].u_fix.x == 0 ) { //if node #0 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+2,  FreeDeg*n_number[member[i].n0],		-12*EJy/pow(member[i].L,2)*tmp 	);} //k(8,0)
    				if ( node[member[i].n1].u_fix.x == 0 ) { //if node #6 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+2,  FreeDeg*n_number[member[i].n1],		12*EJy/pow(member[i].L,2)*tmp 	);} //k(8,6)
    			}
    			if ( node[member[i].n1].teta_fix.y == 0 ) { //if node #10 is not fixed
    				if ( node[member[i].n0].u_fix.x == 0 ) { //if node #0 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+4,	FreeDeg*n_number[member[i].n0],		-6*EJy/member[i].L*tmp			);} //k(10,0)
    				if ( node[member[i].n1].u_fix.x == 0 ) { //if node #6 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+4,	FreeDeg*n_number[member[i].n1],		6*EJy/member[i].L*tmp 			);} //k(10,6)
    			}
    			if ( node[member[i].n1].teta_fix.z == 0 ) {	//if node #11 is not fixed
    				if ( node[member[i].n0].teta_fix.x == 0 ) { //if node #3 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+5,  FreeDeg*n_number[member[i].n0] +3,	2*EJz*tmp 				);} //k(11,3)
    				if ( node[member[i].n1].teta_fix.x == 0 ) {	//if node #9 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+5,  FreeDeg*n_number[member[i].n1] +3,	4*EJz*tmp 				);} //k(11,9)
    			}
    		}		
    		
    		//SUM(Lzi * Lyi),   i=x0,y0,z0
    		tmp = 0;
    		for (j=0;j<3;j++) {
    			tmp += member[i].V[2][j] * member[i].V[1][j];}
    		if (tmp > LENGTH_EPS) {
    			if ( node[member[i].n0].u_fix.y == 0 ) { //if node #1 is not fixed
    				if ( node[member[i].n0].teta_fix.y == 0 ) { //if node #4 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+1,	FreeDeg*n_number[member[i].n0] +4,	6*EJz/member[i].L*tmp			); //k(1,4)
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+4,	FreeDeg*n_number[member[i].n0] +1,	-6*EJy/member[i].L*tmp 			); //k(4,1)
    				}
    				if ( node[member[i].n1].teta_fix.y == 0 ) { //if node #10 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+1,	FreeDeg*n_number[member[i].n1] +4,	6*EJz/member[i].L*tmp			); //k(1,10)
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+4,	FreeDeg*n_number[member[i].n0] +1,	-6*EJy/member[i].L*tmp			); //k(10,1)
    				}
    			}
    			if ( node[member[i].n1].u_fix.y == 0) { //if node #7 is not fixed
    				if ( node[member[i].n0].teta_fix.y == 0 ) { //if node #4 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n0]+4,	FreeDeg*n_number[member[i].n1] +1,	6*EJy/member[i].L*tmp 			); //k(4,7)
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+1,	FreeDeg*n_number[member[i].n0] +4,	-6*EJz/member[i].L*tmp 			); //k(7,4)
    				}
    				if ( node[member[i].n1].teta_fix.y == 0 ) { //if node #10 is not fixed
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+1,	FreeDeg*n_number[member[i].n1] +4,	-6*EJz/member[i].L*tmp 			); //k(7,10)
    					k_var.AddNewElement( FreeDeg*n_number[member[i].n1]+4,	FreeDeg*n_number[member[i].n1] +1,	6*EJy/member[i].L*tmp 			); //k(10,7)
    				}
    			}
    
    ..............................еще 10 страниц

    математики... бессмысленные и беспощадные.

    Запостил: FadeToBlack, 04 Октября 2014

    Комментарии (7) RSS

    Добавить комментарий