5 #include "libmesh/point.h" 21 TEST_CASE(
"element_property_card_constant_heat_transfer_isotropic_3d",
22 "[heat_transfer],[3D],[isotropic],[constant],[property]")
44 REQUIRE( section.
dim() == dim);
47 SECTION(
"3D section thermal conductance matrix")
61 const libMesh::Point point(2.3, 3.1, 5.2);
62 const Real time = 2.34;
64 conduct_mat->operator()(point, time, D_sec_conduc);
67 RealMatrixX D_sec_conduc_true = RealMatrixX::Zero(3,3);
68 D_sec_conduc_true(0,0) = 237.0;
69 D_sec_conduc_true(1,1) = 237.0;
70 D_sec_conduc_true(2,2) = 237.0;
80 CHECK_THAT( test, Catch::Approx<double>(truth) );
85 TEST_CASE(
"element_property_card_constant_transient_heat_transfer_isotropic_3d",
86 "[heat_transfer],[3D],[isotropic],[constant],[property],[transient]")
111 REQUIRE( section.
dim() == dim);
115 SECTION(
"3D section thermal capacitance matrix")
129 const libMesh::Point point(2.3, 3.1, 5.2);
130 const Real time = 2.34;
132 capaci_mat->operator()(point, time, D_sec_capac);
135 RealMatrixX D_sec_capac_true = RealMatrixX::Zero(1,1);
136 D_sec_capac_true(0,0) = 908.0*1420.5;
146 CHECK_THAT( test, Catch::Approx<double>(truth) );
151 TEST_CASE(
"element_property_card_constant_thermoelastic_isotropic_3d",
152 "[thermoelastic],[3D],[isotropic],[constant],[property]")
172 material.
add(alpha_f);
180 REQUIRE( section.
dim() == dim);
183 SECTION(
"3D plane stress thermal expansion A matrix")
201 const libMesh::Point point(2.3, 3.1, 5.2);
202 const Real time = 2.34;
204 texp_A_mat->operator()(point, time, D_sec_texpA);
207 RealMatrixX D_sec_texpA_true = RealMatrixX::Zero(6,1);
208 D_sec_texpA_true(0,0) = 1.149882352941177e+07;
209 D_sec_texpA_true(1,0) = 1.149882352941177e+07;
210 D_sec_texpA_true(2,0) = 1.149882352941177e+07;
221 CHECK_THAT( test, Catch::Approx<double>(truth) );
225 SECTION(
"3D plane stress thermal expansion B matrix")
243 const libMesh::Point point(2.3, 3.1, 5.2);
244 const Real time = 2.34;
246 texp_B_mat->operator()(point, time, D_sec_texpB);
249 RealMatrixX D_sec_texpB_true = RealMatrixX::Zero(6,1);
250 D_sec_texpB_true(0,0) = 1.149882352941177e+07;
251 D_sec_texpB_true(1,0) = 1.149882352941177e+07;
252 D_sec_texpB_true(2,0) = 1.149882352941177e+07;
262 CHECK_THAT( test, Catch::Approx<double>(truth) );
267 TEST_CASE(
"element_property_card_constant_dynamic_isotropic_3d",
268 "[dynamic],[3D],[isotropic],[constant],[property]")
296 REQUIRE( section.
dim() == dim);
305 SECTION(
"3D section inertia matrix")
317 std::unique_ptr<MAST::FieldFunction<RealMatrixX>> inertia_mat = section.
inertia_matrix();
319 const libMesh::Point point(2.3, 3.1, 5.2);
320 const Real time = 2.34;
322 inertia_mat->operator()(point, time, D_sec_inertia);
325 RealMatrixX D_sec_inertia_true = RealMatrixX::Identity(3,3);
327 D_sec_inertia_true *= 1420.5;
337 CHECK_THAT( test, Catch::Approx<double>(truth) );
343 TEST_CASE(
"element_property_card_constant_structural_isotropic_3d",
344 "[structural],[3D],[isotropic],[constant],[property]")
370 REQUIRE( section.
dim() == dim);
374 SECTION(
"solid_2d_section is isotropic")
379 SECTION(
"set_get_strain_type")
402 SECTION(
"3D stiffness matrix")
414 std::unique_ptr<MAST::FieldFunction<RealMatrixX>> stiffness_mat = section.
stiffness_A_matrix();
416 const libMesh::Point point(2.3, 3.1, 5.2);
417 const Real time = 2.34;
419 stiffness_mat->operator()(point, time, D_stiff);
423 D_stiff_true(0,0) = 1.066784608580274e+11;
424 D_stiff_true(1,1) = 1.066784608580274e+11;
425 D_stiff_true(2,2) = 1.066784608580274e+11;
426 D_stiff_true(3,3) = 0.541353383458647e+11/2.0;
427 D_stiff_true(4,4) = 0.541353383458647e+11/2.0;
428 D_stiff_true(5,5) = 0.541353383458647e+11/2.0;
430 D_stiff_true(0,1) = D_stiff_true(1,0) = 0.525431225121628e+11;
431 D_stiff_true(0,2) = D_stiff_true(2,0) = 0.525431225121628e+11;
432 D_stiff_true(1,2) = D_stiff_true(2,1) = 0.525431225121628e+11;
443 CHECK_THAT( test, Catch::Approx<double>(truth) );
virtual bool if_isotropic() const
return true if the property is isotropic
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_expansion_A_matrix(const MAST::ElementBase &e) const
void set_diagonal_mass_matrix(bool m)
sets the mass matrix to be diagonal or consistent
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_expansion_B_matrix(const MAST::ElementBase &e) const
virtual bool depends_on(const MAST::FunctionBase &f) const
returns true if the property card depends on the function f
This is a scalar function whose value can be changed and one that can be used as a design variable in...
TEST_CASE("element_property_card_constant_heat_transfer_isotropic_3d", "[heat_transfer],[3D],[isotropic],[constant],[property]")
void set_strain(MAST::StrainType strain)
sets the type of strain to be used, which is LINEAR_STRAIN by default
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > inertia_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.
libMesh::LibMeshInit * p_global_init
Matrix< Real, Dynamic, Dynamic > RealMatrixX
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_conductance_matrix(const MAST::ElementBase &e) const
virtual unsigned int dim() const
dimension of the element for which this property is defined
const MAST::StrainType strain_type() const
returns the type of strain to be used for this element
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_capacitance_matrix(const MAST::ElementBase &e) const
virtual void set_material(MAST::MaterialPropertyCardBase &mat)
sets the material card
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_A_matrix(const MAST::ElementBase &e) const