22 #include <boost/test/unit_test.hpp> 26 #include "examples/structural/beam_modal_analysis/beam_modal_analysis.h" 27 #include "tests/base/test_comparisons.h" 29 #include "elasticity/structural_discipline.h" 39 MAST::BeamModalAnalysis)
43 this->init(libMesh::EDGE2,
false);
51 this->solve(
false, &eig);
59 Izz = pow(th_z,1)*pow(th_y,3)/12.,
72 nconv = std::min(_sys->get_n_converged_eigenvalues(),
73 _sys->get_n_requested_eigenvalues());
75 for (
unsigned int i=0; i<nconv; i++) {
77 analytical = Eval*Izz/(rho*A) * pow((i+1)*
pi/_length, 4);
96 this->solve(
false, &eig_vec);
99 nconv = std::min(_sys->get_n_converged_eigenvalues(),
100 _sys->get_n_requested_eigenvalues());
105 eig = RealVectorX::Zero(nconv),
106 deig = RealVectorX::Zero(nconv),
107 deig_fd = RealVectorX::Zero(nconv);
109 for (
unsigned int i=0; i<nconv; i++) eig(i) = eig_vec[i];
123 for (
unsigned int i=0; i<this->_params_for_sensitivity.size(); i++ ) {
130 this->solve(
false, &eig_vec);
131 std::vector<Real> deig_vec(nconv);
132 this->sensitivity_solve(f, deig_vec);
133 for (
unsigned int i=0; i<nconv; i++) deig(i) = deig_vec[i];
139 (fabs(p0) > 0)? dp=delta*p0 : dp=delta;
143 this->solve(
false, &eig_vec);
144 for (
unsigned int i=0; i<nconv; i++) deig_fd(i) = eig_vec[i];
153 BOOST_TEST_MESSAGE(
" ** dlambda/dp (total) wrt : " << f.
name() <<
" **");
158 BOOST_AUTO_TEST_SUITE_END()
const std::string & name() const
returns the name of this function
BOOST_AUTO_TEST_CASE(BeamModalSolutionSensitivity)
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
BOOST_FIXTURE_TEST_SUITE(Structural1DBeamModalAnalysis, MAST::BeamModalAnalysis) BOOST_AUTO_TEST_CASE(BeamModalSolution)
bool compare_value(const Real v0, const Real v, const Real tol)