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 = EI_x * cos_theta_p * cos_theta_p + EI_y * sin_theta_p * sin_theta_p;
52 const double bending_yy = EI_x * sin_theta_p * sin_theta_p + EI_y * cos_theta_p * cos_theta_p;
53 const double bending_xy = (EI_y - EI_x) * sin_theta_p * cos_theta_p;
56 const double shear_xx = GA * (kxs * cos_theta_s * cos_theta_s + kys * sin_theta_s * sin_theta_s);
57 const double shear_yy = GA * (kxs * sin_theta_s * sin_theta_s + kys * cos_theta_s * cos_theta_s);
58 const double shear_xy = GA * (kys - kxs) * sin_theta_s * cos_theta_s;
63 std::array<std::array<double, 6>, 6> stiffness_matrix = {};
66 stiffness_matrix[0][0] = shear_xx;
67 stiffness_matrix[0][1] = -shear_xy;
68 stiffness_matrix[1][0] = -shear_xy;
69 stiffness_matrix[1][1] = shear_yy;
72 stiffness_matrix[2][2] = EA;
75 stiffness_matrix[2][3] = EA * y_C;
76 stiffness_matrix[2][4] = -EA * x_C;
79 stiffness_matrix[3][2] = EA * y_C;
80 stiffness_matrix[4][2] = -EA * x_C;
83 stiffness_matrix[3][3] = bending_xx + EA * y_C * y_C;
84 stiffness_matrix[3][4] = -bending_xy - EA * x_C * y_C;
85 stiffness_matrix[4][3] = -bending_xy - EA * x_C * y_C;
86 stiffness_matrix[4][4] = bending_yy + EA * x_C * x_C;
89 stiffness_matrix[0][5] = -shear_xx * y_S - shear_xy * x_S;
90 stiffness_matrix[1][5] = shear_xy * y_S + shear_yy * x_S;
93 stiffness_matrix[5][0] = -shear_xx * y_S - shear_xy * x_S;
94 stiffness_matrix[5][1] = shear_xy * y_S + shear_yy * x_S;
97 stiffness_matrix[5][5] =
98 GKt + shear_xx * y_S * y_S + 2. * shear_xy * x_S * y_S + shear_yy * x_S * x_S;
100 return stiffness_matrix;
127 double m,
double I_x,
double I_y,
double I_p,
double x_G = 0.,
double y_G = 0.,
130 const double cos_theta_i = std::cos(theta_i);
131 const double sin_theta_i = std::sin(theta_i);
134 const double inertia_xx = I_x * cos_theta_i * cos_theta_i + I_y * sin_theta_i * sin_theta_i;
135 const double inertia_yy = I_x * sin_theta_i * sin_theta_i + I_y * cos_theta_i * cos_theta_i;
136 const double inertia_xy = (I_y - I_x) * sin_theta_i * cos_theta_i;
141 std::array<std::array<double, 6>, 6> mass_matrix = {};
144 mass_matrix[0][0] = m;
145 mass_matrix[1][1] = m;
146 mass_matrix[2][2] = m;
149 mass_matrix[0][5] = -m * y_G;
150 mass_matrix[1][5] = m * x_G;
151 mass_matrix[2][3] = m * y_G;
152 mass_matrix[2][4] = -m * x_G;
155 mass_matrix[3][2] = m * y_G;
156 mass_matrix[4][2] = -m * x_G;
157 mass_matrix[5][0] = -m * y_G;
158 mass_matrix[5][1] = m * x_G;
161 mass_matrix[3][3] = inertia_xx + m * y_G * y_G;
162 mass_matrix[3][4] = -inertia_xy - m * x_G * y_G;
163 mass_matrix[4][3] = -inertia_xy - m * x_G * y_G;
164 mass_matrix[4][4] = inertia_yy + m * x_G * x_G;
167 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:126
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