5 #include "libmesh/point.h" 23 TEST_CASE(
"solid_element_property_card_constant_base_1d",
24 "[1D],[isotropic],[constant],[property]")
74 section.
add(thickness_y_f);
75 section.
add(thickness_z_f);
76 section.
add(offsety_f);
77 section.
add(offsetz_f);
92 REQUIRE( section.
dim() == dim);
103 const Real area_true = 2.2500000000000004e+00;
104 const Real torsion_constant_true = 3.5540414988249380e-01;
105 const Real first_area_moment_z_true = 6.4574999999999994e-01;
106 const Real first_area_moment_y_true = 3.7214999999999945e+00;
107 const Real second_area_moment_zz_true = 2.9079899999999986e-01;
108 const Real second_area_moment_yy_true = 7.8428609999999814e+00;
109 const Real second_area_moment_zy_true = 1.0680705000000006e+00;
110 const Real second_area_moment_polar_true = 8.1336599999999812e+00;
111 const Real Izzc_true = 1.0546874999999994e-01;
112 const Real Iyyc_true = 1.6875000000000009e+00;
113 const Real Izyc_true = 2.4424906541753444e-15;
114 const Real warping_constant_true = 6.1030611538894504e-02;
115 const Real kappa_z_true = 8.3330248143102326e-01;
116 const Real kappa_y_true = 5.5763491072129889e-01;
117 const Real xs_true = 1.6540000458463804e+00;
118 const Real ys_true = 2.8700000023051281e-01;
119 const Real xst_true = 1.6540000458463804e+00;
120 const Real yst_true = 2.8700000023051281e-01;
121 const libMesh::Point shear_center_true(xs_true, ys_true, 0.);
122 const libMesh::Point centroid_true(1.654, 0.287, 0.);
125 const libMesh::Point point(4.3, -3.5, -6.7);
126 const Real time = 8.22;
130 Area(point, time, area);
131 REQUIRE( area == Approx(area_true) );
133 Real first_area_moment_y;
135 Ay(point, time, first_area_moment_y);
136 CHECK( first_area_moment_y == Approx(first_area_moment_y_true) );
138 Real first_area_moment_z;
140 Az(point, time, first_area_moment_z);
141 CHECK( first_area_moment_z == Approx(first_area_moment_z_true) );
145 Inertias(point, time, I);
146 REQUIRE( I(0,1) == I(1,0) );
150 REQUIRE( Izz == Approx(second_area_moment_zz_true) );
151 REQUIRE( Iyy == Approx(second_area_moment_yy_true) );
152 REQUIRE( Izy == Approx(second_area_moment_zy_true) );
156 PolarInertia(point, time, Ip);
157 REQUIRE( Ip == Approx(second_area_moment_polar_true) );
159 Real torsion_constant;
161 TorsionConstant(point, time, torsion_constant);
162 REQUIRE( torsion_constant == Approx(torsion_constant_true).epsilon(0.005) );
171 ShearCoefficientMatrix(point, time, shear_coefficients);
172 REQUIRE( shear_coefficients(0,0) == Approx(kappa_z_true) );
173 REQUIRE( shear_coefficients(1,1) == Approx(kappa_y_true) );
194 TEST_CASE(
"solid_element_property_card_constant_base_sensitivity_1d",
195 "[1D],[isotropic],[constant],[property],[sensitivity]")
216 std::vector<MAST::Parameter*> sens_params = {&thickness_y, &thickness_z};
217 uint n_s = sens_params.size();
249 section.
add(thickness_y_f);
250 section.
add(thickness_z_f);
251 section.
add(offsety_f);
252 section.
add(offsetz_f);
261 orientation(1) = 1.0;
267 REQUIRE( section.
dim() == dim);
278 const Real area_true = 2.2500000000000004e+00;
279 const Real torsion_constant_true = 3.5540414988249380e-01;
280 const Real first_area_moment_z_true = 6.4574999999999994e-01;
281 const Real first_area_moment_y_true = 3.7214999999999945e+00;
282 const Real second_area_moment_zz_true = 2.9079899999999986e-01;
283 const Real second_area_moment_yy_true = 7.8428609999999814e+00;
284 const Real second_area_moment_zy_true = 1.0680705000000006e+00;
285 const Real second_area_moment_polar_true = 8.1336599999999812e+00;
286 const Real Izzc_true = 1.0546874999999994e-01;
287 const Real Iyyc_true = 1.6875000000000009e+00;
288 const Real Izyc_true = 2.4424906541753444e-15;
289 const Real warping_constant_true = 6.1030611538894504e-02;
290 const Real kappa_z_true = 8.3330248143102326e-01;
291 const Real kappa_y_true = 5.5763491072129889e-01;
292 const Real xs_true = 1.6540000458463804e+00;
293 const Real ys_true = 2.8700000023051281e-01;
294 const Real xst_true = 1.6540000458463804e+00;
295 const Real yst_true = 2.8700000023051281e-01;
296 const libMesh::Point shear_center_true(xs_true, ys_true, 0.);
298 const libMesh::Point centroid_true(1.654, 0.287);
299 Real stress_C_x, stress_C_y, stress_D_x, stress_D_y;
300 Real stress_E_x, stress_E_y, stress_F_x, stress_F_y;
302 const libMesh::Point point(4.3, -3.5, -6.7);
303 const Real time = 8.22;
305 Real dA_dthickness_y, dA_dthickness_z;
306 Real dCz_dthickness_y, dCz_dthickness_z;
307 Real dCy_dthickness_y, dCy_dthickness_z;
308 Real dQz_dthickness_y, dQz_dthickness_z;
309 Real dQy_dthickness_y, dQy_dthickness_z;
310 Real dIzz_dthickness_y, dIzz_dthickness_z;
311 Real dIyy_dthickness_y, dIyy_dthickness_z;
312 Real dIzy_dthickness_y, dIzy_dthickness_z;
313 Real dIp_dthickness_y, dIp_dthickness_z;
314 Real dIzzc_dthickness_y, dIzzc_dthickness_z;
315 Real dIyyc_dthickness_y, dIyyc_dthickness_z;
316 Real dIzyc_dthickness_y, dIzyc_dthickness_z;
317 Real dIpc_dthickness_y, dIpc_dthickness_z;
318 Real dJ_dthickness_y, dJ_dthickness_z;
319 Real dxs_dthickness_y, dxs_dthickness_z;
320 Real dys_dthickness_y, dys_dthickness_z;
321 Real dW_dthickness_y, dW_dthickness_z;
323 Real f_h, f_2h, f_n, f_2n;
327 const Real delta = 1.220703125e-04;
331 std::vector<Real> dA(n_s);
332 for (uint i=0; i<n_s; i++)
334 Area.
derivative(*sens_params[i], point, time, dA[i]);
337 std::vector<Real> dA_cd(n_s);
338 for (uint i=0; i<n_s; i++)
340 (*sens_params[i])() += delta;
341 Area(point, time, f_h);
343 (*sens_params[i])() += delta;
344 Area(point, time, f_2h);
346 (*sens_params[i])() -= 3.0*delta;
347 Area(point, time, f_n);
349 (*sens_params[i])() -= delta;
350 Area(point, time, f_2n);
352 (*sens_params[i])() += 2.0*delta;
354 dA_cd[i] = (f_2n - 8.*f_n + 8*f_h - f_2h)/(12.*delta);
356 libMesh::out <<
"dA_d" << sens_params[i]->name() <<
" = " << dA[i] <<
"\tdA_cd = " << dA_cd[i] << std::endl;
357 REQUIRE(dA[i] == Approx(dA_cd[i]));
395 std::vector<Real> dAy(n_s);
396 for (uint i=0; i<n_s; i++)
398 Area_y.
derivative(*sens_params[i], point, time, dAy[i]);
401 std::vector<Real> dAy_cd(n_s);
402 for (uint i=0; i<n_s; i++)
404 (*sens_params[i])() += delta;
405 Area_y(point, time, f_h);
407 (*sens_params[i])() += delta;
408 Area_y(point, time, f_2h);
410 (*sens_params[i])() -= 3.0*delta;
411 Area_y(point, time, f_n);
413 (*sens_params[i])() -= delta;
414 Area_y(point, time, f_2n);
416 (*sens_params[i])() += 2.0*delta;
418 dAy_cd[i] = (f_2n - 8.*f_n + 8*f_h - f_2h)/(12.*delta);
420 libMesh::out <<
"dAy_d" << sens_params[i]->name() <<
" = " << dAy[i] <<
"\tdAy_cd = " << dAy_cd[i] << std::endl;
421 REQUIRE(dAy[i] == Approx(dAy_cd[i]));
426 std::vector<Real> dAz(n_s);
427 for (uint i=0; i<n_s; i++)
429 Area_z.
derivative(*sens_params[i], point, time, dAz[i]);
432 std::vector<Real> dAz_cd(n_s);
433 for (uint i=0; i<n_s; i++)
435 (*sens_params[i])() += delta;
436 Area_z(point, time, f_h);
438 (*sens_params[i])() += delta;
439 Area_z(point, time, f_2h);
441 (*sens_params[i])() -= 3.0*delta;
442 Area_z(point, time, f_n);
444 (*sens_params[i])() -= delta;
445 Area_z(point, time, f_2n);
447 (*sens_params[i])() += 2.0*delta;
449 dAz_cd[i] = (f_2n - 8.*f_n + 8*f_h - f_2h)/(12.*delta);
451 libMesh::out <<
"dAz_d" << sens_params[i]->name() <<
" = " << dAz[i] <<
"\tdAz_cd = " << dAz_cd[i] << std::endl;
452 REQUIRE(dAz[i] == Approx(dAz_cd[i]));
458 std::vector<RealMatrixX> dI(n_s);
459 for (uint i=0; i<n_s; i++)
461 Inertia.
derivative(*sens_params[i], point, time, dI[i]);
464 std::vector<RealMatrixX> dI_cd(n_s);
465 for (uint i=0; i<n_s; i++)
467 (*sens_params[i])() += delta;
468 Inertia(point, time, fm_h);
470 (*sens_params[i])() += delta;
471 Inertia(point, time, fm_2h);
473 (*sens_params[i])() -= 3.0*delta;
474 Inertia(point, time, fm_n);
476 (*sens_params[i])() -= delta;
477 Inertia(point, time, fm_2n);
479 (*sens_params[i])() += 2.0*delta;
481 dI_cd[i] = (fm_2n - 8.*fm_n + 8*fm_h - fm_2h)/(12.*delta);
483 libMesh::out <<
"dI_d" << sens_params[i]->name() <<
" =\n" << dI[i] <<
"\ndI_cd = \n" << dI_cd[i] << std::endl;
485 Real dIzz = dI[i](0,0);
486 Real dIyy = dI[i](1,1);
487 Real dIyz = dI[i](1,0);
488 Real dIzy = dI[i](0,1);
490 Real dIzz_cd = dI_cd[i](0,0);
491 Real dIyy_cd = dI_cd[i](1,1);
492 Real dIyz_cd = dI_cd[i](1,0);
493 Real dIzy_cd = dI_cd[i](0,1);
495 REQUIRE(dIzz == Approx(dIzz_cd));
496 REQUIRE(dIyy == Approx(dIyy_cd));
497 REQUIRE(dIyz == Approx(dIyz_cd));
498 REQUIRE(dIzy == Approx(dIzy_cd));
499 REQUIRE(dIyz == dIzy);
505 std::vector<Real> dIp(n_s);
506 for (uint i=0; i<n_s; i++)
508 PolarInertia.
derivative(*sens_params[i], point, time, dIp[i]);
511 std::vector<Real> dIp_cd(n_s);
512 for (uint i=0; i<n_s; i++)
514 (*sens_params[i])() += delta;
515 PolarInertia(point, time, f_h);
517 (*sens_params[i])() += delta;
518 PolarInertia(point, time, f_2h);
520 (*sens_params[i])() -= 3.0*delta;
521 PolarInertia(point, time, f_n);
523 (*sens_params[i])() -= delta;
524 PolarInertia(point, time, f_2n);
526 (*sens_params[i])() += 2.0*delta;
528 dIp_cd[i] = (f_2n - 8.*f_n + 8.*f_h - f_2h)/(12.*delta);
530 libMesh::out <<
"dIp_d" << sens_params[i]->name() <<
" = " << dIp[i] <<
"\tdIp_cd = " << dIp_cd[i] << std::endl;
531 REQUIRE(dIp[i] == Approx(dIp_cd[i]));
570 std::vector<Real> dJ(n_s);
571 for (uint i=0; i<n_s; i++)
573 TorsionConstant.
derivative(*sens_params[i], point, time, dJ[i]);
576 std::vector<Real> dJ_cd(n_s);
577 for (uint i=0; i<n_s; i++)
579 (*sens_params[i])() += delta;
580 TorsionConstant(point, time, f_h);
582 (*sens_params[i])() += delta;
583 TorsionConstant(point, time, f_2h);
585 (*sens_params[i])() -= 3.0*delta;
586 TorsionConstant(point, time, f_n);
588 (*sens_params[i])() -= delta;
589 TorsionConstant(point, time, f_2n);
591 (*sens_params[i])() += 2.0*delta;
593 dJ_cd[i] = (f_2n - 8.*f_n + 8*f_h - f_2h)/(12.*delta);
595 libMesh::out <<
"dJ_d" << sens_params[i]->name() <<
" = " << dJ[i] <<
"\tdJ_cd = " << dJ_cd[i] << std::endl;
596 REQUIRE(dJ[i] == Approx(dJ_cd[i]).epsilon(0.1) );
653 std::vector<Real> dW(n_s);
654 for (uint i=0; i<n_s; i++)
656 WarpingConstant.
derivative(*sens_params[i], point, time, dW[i]);
659 std::vector<Real> dW_cd(n_s);
660 for (uint i=0; i<n_s; i++)
662 (*sens_params[i])() += delta;
663 WarpingConstant(point, time, f_h);
665 (*sens_params[i])() += delta;
666 WarpingConstant(point, time, f_2h);
668 (*sens_params[i])() -= 3.0*delta;
669 WarpingConstant(point, time, f_n);
671 (*sens_params[i])() -= delta;
672 WarpingConstant(point, time, f_2n);
674 (*sens_params[i])() += 2.0*delta;
676 dW_cd[i] = (f_2n - 8.*f_n + 8*f_h - f_2h)/(12.*delta);
678 libMesh::out <<
"dW_d" << sens_params[i]->name() <<
" = " << dW[i] <<
"\tdW_cd = " << dW_cd[i] << std::endl;
679 REQUIRE(dW[i] == Approx(dW_cd[i]).epsilon(0.1) );
685 TEST_CASE(
"solid_element_property_card_constant_heat_transfer_1d",
686 "[heat_transfer],[1D],[isotropic],[constant],[property]")
736 section.
add(thickness_y_f);
737 section.
add(thickness_z_f);
738 section.
add(offsety_f);
739 section.
add(offsetz_f);
754 REQUIRE( section.
dim() == dim);
765 const Real area_true = 2.2500000000000004e+00;
768 const libMesh::Point point(4.3, -3.5, -6.7);
769 const Real time = 8.22;
773 Area(point, time, area);
774 REQUIRE( area == Approx(area_true) );
777 SECTION(
"1D section thermal conductance matrix")
791 const libMesh::Point point(2.3, 3.1, 5.2);
792 const Real time = 2.34;
794 conduct_mat->operator()(point, time, D_sec_conduc);
797 RealMatrixX D_sec_conduc_true = RealMatrixX::Zero(1,1);
798 D_sec_conduc_true(0,0) = k() * area_true;
808 CHECK_THAT( test, Catch::Approx<double>(truth) );
811 SECTION(
"1D section thermal capacitance matrix")
825 const libMesh::Point point(2.3, 3.1, 5.2);
826 const Real time = 2.34;
828 capaci_mat->operator()(point, time, D_sec_capac);
831 RealMatrixX D_sec_capac_true = RealMatrixX::Zero(1,1);
832 D_sec_capac_true(0,0) = cp() * rho() * area_true;
842 CHECK_THAT( test, Catch::Approx<double>(truth) );
847 TEST_CASE(
"solid_element_property_card_constant_thermoelastic_1d",
848 "[thermoelastic],[1D],[isotropic],[constant],[property]")
897 material.
add(alpha_f);
903 section.
add(thickness_y_f);
904 section.
add(thickness_z_f);
905 section.
add(offsety_f);
906 section.
add(offsetz_f);
915 orientation(1) = 1.0;
921 REQUIRE( section.
dim() == dim);
933 const libMesh::Point point(4.3, -3.5, -6.7);
934 const Real time = 8.22;
937 const Real area_true = 2.2500000000000004e+00;
938 const Real first_area_moment_z_true = 6.4574999999999994e-01;
939 const Real first_area_moment_y_true = 3.7214999999999945e+00;
941 SECTION(
"1D thermal expansion A matrix")
956 Area(point, time, area);
957 CHECK( area == Approx(area_true) );
961 const libMesh::Point point(2.3, 3.1, 5.2);
962 const Real time = 2.34;
964 texp_A_mat->operator()(point, time, D_sec_texpA);
967 RealMatrixX D_sec_texpA_true = RealMatrixX::Zero(2,1);
968 D_sec_texpA_true(0,0) = E() * alpha() * area_true;
979 CHECK_THAT( test, Catch::Approx<double>(truth) );
982 SECTION(
"1D thermal expansion B matrix")
995 Real first_area_moment_y;
997 Ay(point, time, first_area_moment_y);
998 CHECK( first_area_moment_y == Approx(first_area_moment_y_true) );
1000 Real first_area_moment_z;
1002 Az(point, time, first_area_moment_z);
1003 CHECK( first_area_moment_z == Approx(first_area_moment_z_true) );
1007 const libMesh::Point point(2.3, 3.1, 5.2);
1008 const Real time = 2.34;
1010 texp_B_mat->operator()(point, time, D_sec_texpB);
1012 libMesh::out <<
"texp_B_mat =\n" << D_sec_texpB << std::endl;
1015 RealMatrixX D_sec_texpB_true = RealMatrixX::Zero(2,1);
1016 D_sec_texpB_true(0,0) = E() * alpha() * area_true * offset_y();
1017 D_sec_texpB_true(1,0) = E() * alpha() * area_true * offset_z();
1028 CHECK_THAT( test, Catch::Approx<double>(truth) );
1033 TEST_CASE(
"solid_element_property_card_constant_dynamic_1d",
1034 "[dynamic],[1D],[isotropic],[constant],[property]")
1078 material.
add(rho_f);
1083 material.
add(alpha_f);
1089 section.
add(thickness_y_f);
1090 section.
add(thickness_z_f);
1091 section.
add(offsety_f);
1092 section.
add(offsetz_f);
1101 orientation(1) = 1.0;
1107 REQUIRE( section.
dim() == dim);
1118 const Real area_true = 2.2500000000000004e+00;
1119 const Real torsion_constant_true = 3.5540414988249380e-01;
1120 const Real first_area_moment_z_true = 6.4574999999999994e-01;
1121 const Real first_area_moment_y_true = 3.7214999999999945e+00;
1122 const Real second_area_moment_zz_true = 2.9079899999999986e-01;
1123 const Real second_area_moment_yy_true = 7.8428609999999814e+00;
1124 const Real second_area_moment_zy_true = 1.0680705000000006e+00;
1125 const Real second_area_moment_polar_true = 8.1336599999999812e+00;
1126 const Real Izzc_true = 1.0546874999999994e-01;
1127 const Real Iyyc_true = 1.6875000000000009e+00;
1128 const Real Izyc_true = 2.4424906541753444e-15;
1129 const Real warping_constant_true = 6.1030611538894504e-02;
1130 const Real kappa_z_true = 8.3330248143102326e-01;
1131 const Real kappa_y_true = 5.5763491072129889e-01;
1132 const Real xs_true = 1.6540000458463804e+00;
1133 const Real ys_true = 2.8700000023051281e-01;
1134 const Real xst_true = 1.6540000458463804e+00;
1135 const Real yst_true = 2.8700000023051281e-01;
1136 const libMesh::Point shear_center_true(xs_true, ys_true, 0.);
1137 const libMesh::Point centroid_true(1.654, 0.287, 0.);
1140 const libMesh::Point point(4.3, -3.5, -6.7);
1141 const Real time = 8.22;
1143 SECTION(
"1D section inertia matrix")
1155 std::unique_ptr<MAST::FieldFunction<RealMatrixX>> inertia_mat = section.
inertia_matrix();
1157 const libMesh::Point point(2.3, 3.1, 5.2);
1158 const Real time = 2.34;
1160 inertia_mat->operator()(point, time, D_sec_iner);
1163 RealMatrixX D_sec_iner_true = RealMatrixX::Zero(6,6);
1168 Area(point, time, area);
1169 REQUIRE( area == Approx(area_true) );
1170 D_sec_iner_true(0,0) = D_sec_iner_true(1,1) = D_sec_iner_true(2,2) = area_true;
1174 PolarInertia(point, time, Ip);
1175 CHECK( Ip == Approx(second_area_moment_polar_true) );
1176 D_sec_iner_true(3,3) = second_area_moment_polar_true;
1179 Real first_area_moment_y;
1181 Ay(point, time, first_area_moment_y);
1182 CHECK( first_area_moment_y == Approx(first_area_moment_y_true) );
1183 D_sec_iner_true(0,4) = D_sec_iner_true(4,0) = first_area_moment_y_true;
1185 Real first_area_moment_z;
1187 Az(point, time, first_area_moment_z);
1188 CHECK( first_area_moment_z == Approx(first_area_moment_z_true) );
1189 D_sec_iner_true(0,5) = D_sec_iner_true(5,0) = first_area_moment_z_true;
1194 Inertias(point, time, I);
1195 REQUIRE( I(0,1) == I(1,0) );
1199 REQUIRE( Izz == Approx(second_area_moment_zz_true) );
1200 REQUIRE( Iyy == Approx(second_area_moment_yy_true) );
1201 REQUIRE( Izy == Approx(second_area_moment_zy_true) );
1202 D_sec_iner_true(4,4) = Iyy;
1203 D_sec_iner_true(4,5) = Izy;
1204 D_sec_iner_true(5,4) = Izy;
1205 D_sec_iner_true(5,5) = Izz;
1207 D_sec_iner_true *= rho();
1217 CHECK_THAT( test, Catch::Approx<double>(truth) );
1222 TEST_CASE(
"solid_element_property_card_constant_structural_1d",
1223 "[structural],[1D],[isotropic],[constant],[property]")
1267 material.
add(rho_f);
1272 material.
add(alpha_f);
1278 section.
add(thickness_y_f);
1279 section.
add(thickness_z_f);
1280 section.
add(offsety_f);
1281 section.
add(offsetz_f);
1290 orientation(1) = 1.0;
1296 REQUIRE( section.
dim() == dim);
1309 const Real area_true = 2.2500000000000004e+00;
1310 const Real torsion_constant_true = 3.5540414988249380e-01;
1311 const Real first_area_moment_z_true = 6.4574999999999994e-01;
1312 const Real first_area_moment_y_true = 3.7214999999999945e+00;
1313 const Real second_area_moment_zz_true = 2.9079899999999986e-01;
1314 const Real second_area_moment_yy_true = 7.8428609999999814e+00;
1315 const Real second_area_moment_zy_true = 1.0680705000000006e+00;
1316 const Real second_area_moment_polar_true = 8.1336599999999812e+00;
1317 const Real Izzc_true = 1.0546874999999994e-01;
1318 const Real Iyyc_true = 1.6875000000000009e+00;
1319 const Real Izyc_true = 2.4424906541753444e-15;
1320 const Real warping_constant_true = 6.1030611538894504e-02;
1321 const Real kappa_z_true = 8.3330248143102326e-01;
1322 const Real kappa_y_true = 5.5763491072129889e-01;
1323 const Real xs_true = 1.6540000458463804e+00;
1324 const Real ys_true = 2.8700000023051281e-01;
1325 const Real xst_true = 1.6540000458463804e+00;
1326 const Real yst_true = 2.8700000023051281e-01;
1327 const libMesh::Point shear_center_true(xs_true, ys_true, 0.);
1328 const libMesh::Point centroid_true(1.654, 0.287, 0.);
1331 const libMesh::Point point(4.3, -3.5, -6.7);
1332 const Real time = 8.22;
1334 SECTION(
"set_get_bending_model")
1355 SECTION(
"1D extension stiffness matrix")
1369 Area(point, time, area);
1370 REQUIRE( area == Approx(area_true) );
1372 Real torsion_constant;
1374 TorsionConstant(point, time, torsion_constant);
1375 REQUIRE( torsion_constant == Approx(torsion_constant_true).epsilon(0.05) );
1377 std::unique_ptr<MAST::FieldFunction<RealMatrixX>> extension_stiffness_mat = section.
stiffness_A_matrix();
1379 const libMesh::Point point(2.3, 3.1, 5.2);
1380 const Real time = 2.34;
1382 extension_stiffness_mat->operator()(point, time, D_sec_ext);
1384 libMesh::out <<
"D_sec_ext\n" << D_sec_ext << std::endl;
1387 Real G = E() / (2. * (1.+nu()));
1388 RealMatrixX D_sec_ext_true = RealMatrixX::Zero(2,2);
1389 D_sec_ext_true(0,0) = E() * area_true;
1390 D_sec_ext_true(1,1) = G * torsion_constant_true;
1401 CHECK_THAT( test, Catch::Approx<double>(truth).epsilon(0.05) );
1405 SECTION(
"1D bending section stiffness matrix")
1419 Inertias(point, time, I);
1420 REQUIRE( I(0,1) == I(1,0) );
1424 REQUIRE( Izz == Approx(second_area_moment_zz_true) );
1425 REQUIRE( Iyy == Approx(second_area_moment_yy_true) );
1426 REQUIRE( Izy == Approx(second_area_moment_zy_true) );
1428 std::unique_ptr<MAST::FieldFunction<RealMatrixX>> bending_stiffness_mat = section.
stiffness_D_matrix();
1430 const libMesh::Point point(2.3, 3.1, 5.2);
1431 const Real time = 2.34;
1433 bending_stiffness_mat->operator()(point, time, D_sec_bnd);
1436 RealMatrixX D_sec_bnd_true = RealMatrixX::Zero(2,2);
1437 D_sec_bnd_true(0,0) = E() * second_area_moment_zz_true;
1438 D_sec_bnd_true(1,1) = E() * second_area_moment_yy_true;
1439 D_sec_bnd_true(0,1) = E() * second_area_moment_zy_true;
1440 D_sec_bnd_true(1,0) = E() * second_area_moment_zy_true;
1450 CHECK_THAT( test, Catch::Approx<double>(truth) );
1453 SECTION(
"1D extension-bending section stiffness matrix")
1465 Real first_area_moment_y;
1467 Ay(point, time, first_area_moment_y);
1468 CHECK( first_area_moment_y == Approx(first_area_moment_y_true) );
1470 Real first_area_moment_z;
1472 Az(point, time, first_area_moment_z);
1473 CHECK( first_area_moment_z == Approx(first_area_moment_z_true) );
1475 std::unique_ptr<MAST::FieldFunction<RealMatrixX>> bndext_stiffness_mat = section.
stiffness_B_matrix();
1477 const libMesh::Point point(2.3, 3.1, 5.2);
1478 const Real time = 2.34;
1480 bndext_stiffness_mat->operator()(point, time, D_sec_bndext);
1483 RealMatrixX D_sec_bndext_true = RealMatrixX::Zero(2,2);
1484 D_sec_bndext_true(0,0) = E() * first_area_moment_z_true;
1485 D_sec_bndext_true(0,1) = E() * first_area_moment_y_true;
1496 CHECK_THAT( test, Catch::Approx<double>(truth) );
1499 SECTION(
"1D transverse shear section stiffness matrix")
1513 Area(point, time, area);
1514 REQUIRE( area == Approx(area_true) );
1518 const libMesh::Point point(2.3, 3.1, 5.2);
1519 const Real time = 2.34;
1521 trans_shear_stiffness_mat->operator()(point, time, D_sec_shr);
1524 Real G = E() / (2. * (1.+nu()));
1525 RealMatrixX D_sec_shr_true = RealMatrixX::Zero(2,2);
1526 D_sec_shr_true(0,0) = G*area_true*kappa_z_true;
1527 D_sec_shr_true(1,1) = G*area_true*kappa_y_true;
1537 CHECK_THAT( test, Catch::Approx<double>(truth) );
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_B_matrix(const MAST::ElementBase &e) const
virtual void init()
Only used by 1D sections.
virtual const MAST::FieldFunction< Real > & Ip() const
virtual void set_material(MAST::MaterialPropertyCardBase &mat)
sets the material card
void set_diagonal_mass_matrix(bool m)
sets the mass matrix to be diagonal or consistent
RealVectorX & y_vector()
returns value of the property val.
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_conductance_matrix(const MAST::ElementBase &e) const
This is a scalar function whose value can be changed and one that can be used as a design variable in...
libMesh::LibMeshInit * p_global_init
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > transverse_shear_stiffness_matrix(const MAST::ElementBase &e) const
virtual void derivative(const MAST::FunctionBase &f, ValType &v) const
calculates the value of the function derivative and returns it in v.
virtual const MAST::FieldFunction< RealMatrixX > & I() const
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_capacitance_matrix(const MAST::ElementBase &e) const
void add(MAST::FunctionBase &f)
adds the function to this card and returns a reference to it.
std::vector< double > eigen_matrix_to_std_vector(RealMatrixX M)
Converts an Eigen Matrix object to a std::vector.
virtual bool depends_on(const MAST::FunctionBase &f) const
returns true if the property card depends on the function f
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_D_matrix(const MAST::ElementBase &e) const
Matrix< Real, Dynamic, Dynamic > RealMatrixX
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_expansion_B_matrix(const MAST::ElementBase &e) const
virtual const MAST::FieldFunction< Real > & Az() const
virtual const MAST::FieldFunction< Real > & Gam() const
TEST_CASE("solid_element_property_card_constant_base_1d", "[1D],[isotropic],[constant],[property]")
The default 1D solid section is defined as a solid rectangular cross section defined by two parameter...
virtual bool if_isotropic() const
return true if the property is isotropic
virtual unsigned int dim() const
dimension of the element for which this property is defined
virtual const MAST::FieldFunction< Real > & A() const
Matrix< Real, Dynamic, 1 > RealVectorX
virtual const MAST::FieldFunction< Real > & Ay() const
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_A_matrix(const MAST::ElementBase &e) const
bool if_diagonal_mass_matrix() const
returns the type of strain to be used for this element
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_expansion_A_matrix(const MAST::ElementBase &e) const
void set_bending_model(MAST::BendingOperatorType b)
returns the bending model to be used for the 2D element
virtual const MAST::FieldFunction< RealMatrixX > & Kap() const
virtual const MAST::FieldFunction< Real > & J() const
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > inertia_matrix(const MAST::ElementBase &e) const