22 #include <boost/test/unit_test.hpp> 26 #include "examples/structural/plate_modal_analysis/plate_modal_analysis.h" 27 #include "tests/base/test_comparisons.h" 29 #include "elasticity/structural_discipline.h" 39 MAST::PlateModalAnalysis)
44 this->init(libMesh::QUAD4,
false);
52 this->solve(
false, &eig);
62 D = pow(th,3)/12.*Eval/(1-nu*nu),
72 nconv = std::min(_sys->get_n_converged_eigenvalues(),
73 _sys->get_n_requested_eigenvalues());
75 std::set<Real> factors_set;
77 for (
unsigned int n=1; n<4; n++) {
78 for (
unsigned int m=1; m<4; m++) {
79 factors_set.insert((pow( n/_length,4) + pow( m/_width,4) +
80 2.* pow( n/_length,2) * pow( m/_width,2)));
85 std::vector<Real> factors;
86 std::set<Real>::const_iterator
87 it = factors_set.begin(),
88 end = factors_set.end();
90 for ( ; it != end; it++) {
91 factors.push_back(*it);
95 libmesh_assert_greater(factors.size(), nconv);
97 BOOST_TEST_MESSAGE(
" ** Plate Bending Eigenvalues **");
98 for (
unsigned int i=0; i<nconv; i++) {
100 analytical = D*pow(
pi,4)/rho/th * factors[i];
113 this->init(libMesh::QUAD4,
false);
123 this->solve(
false, &eig_vec);
126 nconv = std::min(_sys->get_n_converged_eigenvalues(),
127 _sys->get_n_requested_eigenvalues());
132 eig = RealVectorX::Zero(nconv),
133 deig = RealVectorX::Zero(nconv),
134 deig_fd = RealVectorX::Zero(nconv);
136 for (
unsigned int i=0; i<nconv; i++) eig(i) = eig_vec[i];
150 for (
unsigned int i=0; i<this->_params_for_sensitivity.size(); i++ ) {
157 this->solve(
false, &eig_vec);
158 std::vector<Real> deig_vec(nconv);
159 this->sensitivity_solve(f, deig_vec);
160 for (
unsigned int i=0; i<nconv; i++) deig(i) = deig_vec[i];
166 (fabs(p0) > 0)? dp=delta*p0 : dp=delta;
170 this->solve(
false, &eig_vec);
171 for (
unsigned int i=0; i<nconv; i++) deig_fd(i) = eig_vec[i];
180 BOOST_TEST_MESSAGE(
" ** dlambda/dp (total) wrt : " << f.
name() <<
" **");
185 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...
Matrix< Real, Dynamic, 1 > RealVectorX
bool compare_value(const Real v0, const Real v, const Real tol)
BOOST_AUTO_TEST_CASE(PlateModalSolutionSensitivity)
BOOST_FIXTURE_TEST_SUITE(StructuralPlateModalAnalysis, MAST::PlateModalAnalysis) BOOST_AUTO_TEST_CASE(PlateModalSolution)