22 #include <boost/test/unit_test.hpp> 26 #include "examples/structural/plate_thermally_stressed_modal_analysis/plate_thermally_stressed_modal_analysis.h" 27 #include "tests/base/test_comparisons.h" 29 #include "elasticity/structural_discipline.h" 39 MAST::PlateThermallyStressedModalAnalysis)
46 this->init(libMesh::QUAD4,
true);
56 this->solve(
false, &eig_vec);
59 nconv = std::min(_sys->get_n_converged_eigenvalues(),
60 _sys->get_n_requested_eigenvalues());
65 eig = RealVectorX::Zero(nconv),
66 deig = RealVectorX::Zero(nconv),
67 deig_fd = RealVectorX::Zero(nconv);
69 for (
unsigned int i=0; i<nconv; i++) eig(i) = eig_vec[i];
83 for (
unsigned int i=0; i<this->_params_for_sensitivity.size(); i++ ) {
90 this->solve(
false, &eig_vec);
91 std::vector<Real> deig_vec(nconv);
92 this->sensitivity_solve(f, deig_vec);
93 for (
unsigned int i=0; i<nconv; i++) deig(i) = deig_vec[i];
99 (fabs(p0) > 0)? dp=delta*p0 : dp=delta;
103 this->solve(
false, &eig_vec);
104 for (
unsigned int i=0; i<nconv; i++) deig_fd(i) = eig_vec[i];
113 BOOST_TEST_MESSAGE(
" ** dlambda/dp (total) wrt : " << f.
name() <<
" **");
114 for (
unsigned int i=0; i<deig.size(); i++)
115 std::cout << deig_fd(i) <<
" " << deig(i) << std::endl;
120 BOOST_AUTO_TEST_SUITE_END()
const std::string & name() const
returns the name of this function
bool compare_vector(const RealVectorX &v0, const RealVectorX &v, const Real tol)
This is a scalar function whose value can be changed and one that can be used as a design variable in...
BOOST_FIXTURE_TEST_SUITE(StructuralPlateThermallyStressedModalAnalysis, MAST::PlateThermallyStressedModalAnalysis) BOOST_AUTO_TEST_CASE(PlateThermallyStressedModalSolutionSensitivity)
BOOST_AUTO_TEST_CASE(InternalForceJacobianZeroFreq)
Matrix< Real, Dynamic, 1 > RealVectorX