42 double EA,
double EI_x,
double EI_y,
double GKt,
double GA,
double kxs,
double kys,
double x_C,
43 double y_C,
double theta_p,
double x_S,
double y_S,
double theta_s
45 const double cos_theta_p = std::cos(theta_p);
46 const double sin_theta_p = std::sin(theta_p);
47 const double cos_theta_s = std::cos(theta_s);
48 const double sin_theta_s = std::sin(theta_s);
51 const double bending_xx =
52 (EI_x * cos_theta_p * cos_theta_p) + (EI_y * sin_theta_p * sin_theta_p);
53 const double bending_yy =
54 (EI_x * sin_theta_p * sin_theta_p) + (EI_y * cos_theta_p * cos_theta_p);
55 const double bending_xy = (EI_y - EI_x) * sin_theta_p * cos_theta_p;
58 const double shear_xx = GA * (kxs * cos_theta_s * cos_theta_s + kys * sin_theta_s * sin_theta_s);
59 const double shear_yy = GA * (kxs * sin_theta_s * sin_theta_s + kys * cos_theta_s * cos_theta_s);
60 const double shear_xy = GA * (kys - kxs) * sin_theta_s * cos_theta_s;
65 std::array<std::array<double, 6>, 6> stiffness_matrix = {};
68 stiffness_matrix[0][0] = shear_xx;
69 stiffness_matrix[0][1] = -shear_xy;
70 stiffness_matrix[1][0] = -shear_xy;
71 stiffness_matrix[1][1] = shear_yy;
74 stiffness_matrix[2][2] = EA;
77 stiffness_matrix[2][3] = EA * y_C;
78 stiffness_matrix[2][4] = -EA * x_C;
81 stiffness_matrix[3][2] = EA * y_C;
82 stiffness_matrix[4][2] = -EA * x_C;
85 stiffness_matrix[3][3] = bending_xx + EA * y_C * y_C;
86 stiffness_matrix[3][4] = -bending_xy - EA * x_C * y_C;
87 stiffness_matrix[4][3] = -bending_xy - EA * x_C * y_C;
88 stiffness_matrix[4][4] = bending_yy + EA * x_C * x_C;
91 stiffness_matrix[0][5] = -shear_xx * y_S - shear_xy * x_S;
92 stiffness_matrix[1][5] = shear_xy * y_S + shear_yy * x_S;
95 stiffness_matrix[5][0] = -shear_xx * y_S - shear_xy * x_S;
96 stiffness_matrix[5][1] = shear_xy * y_S + shear_yy * x_S;
99 stiffness_matrix[5][5] =
100 GKt + shear_xx * y_S * y_S + 2. * shear_xy * x_S * y_S + shear_yy * x_S * x_S;
102 return stiffness_matrix;
129 double m,
double I_x,
double I_y,
double I_p,
double x_G = 0.,
double y_G = 0.,
132 const double cos_theta_i = std::cos(theta_i);
133 const double sin_theta_i = std::sin(theta_i);
136 const double inertia_xx = (I_x * cos_theta_i * cos_theta_i) + (I_y * sin_theta_i * sin_theta_i);
137 const double inertia_yy = (I_x * sin_theta_i * sin_theta_i) + (I_y * cos_theta_i * cos_theta_i);
138 const double inertia_xy = (I_y - I_x) * sin_theta_i * cos_theta_i;
143 std::array<std::array<double, 6>, 6> mass_matrix = {};
146 mass_matrix[0][0] = m;
147 mass_matrix[1][1] = m;
148 mass_matrix[2][2] = m;
151 mass_matrix[0][5] = -m * y_G;
152 mass_matrix[1][5] = m * x_G;
153 mass_matrix[2][3] = m * y_G;
154 mass_matrix[2][4] = -m * x_G;
157 mass_matrix[3][2] = m * y_G;
158 mass_matrix[4][2] = -m * x_G;
159 mass_matrix[5][0] = -m * y_G;
160 mass_matrix[5][1] = m * x_G;
163 mass_matrix[3][3] = inertia_xx + m * y_G * y_G;
164 mass_matrix[3][4] = -inertia_xy - m * x_G * y_G;
165 mass_matrix[4][3] = -inertia_xy - m * x_G * y_G;
166 mass_matrix[4][4] = inertia_yy + m * x_G * x_G;
169 mass_matrix[5][5] = I_p + m * (x_G * x_G + y_G * y_G);
static std::array< std::array< double, 6 >, 6 > GenerateMassMatrix(double m, double I_x, double I_y, double I_p, double x_G=0., double y_G=0., double theta_i=0.)
Generates a 6x6 cross-sectional mass matrix for use in beam elements.
Definition generate_sectional_properties.hpp:128
static std::array< std::array< double, 6 >, 6 > GenerateStiffnessMatrix(double EA, double EI_x, double EI_y, double GKt, double GA, double kxs, double kys, double x_C, double y_C, double theta_p, double x_S, double y_S, double theta_s)
Generates a 6x6 cross-sectional stiffness matrix for use in beam elements.
Definition generate_sectional_properties.hpp:41