21 #define BOOST_TEST_DYN_LINK 22 #define BOOST_TEST_MODULE MAST_TESTS 23 #include <boost/test/unit_test.hpp> 24 #include <boost/version.hpp> 34 #include "libmesh/libmesh.h" 48 new libMesh::LibMeshInit(boost::unit_test::framework::master_test_suite().argc,
49 boost::unit_test::framework::master_test_suite().argv);
60 #if BOOST_VERSION > 106100 100 for (val.side=0; val.side<_fluid_elem->elem().get_reference_elem().n_sides(); val.side++)
101 BOOST_CHECK(check_jacobian(val));
123 val.jac_xdot =
false;
131 rho0 = this->_flight_cond->gas_property.rho;
134 sol = RealVectorX::Zero(this->_sys->n_dofs()),
135 res_sens = RealVectorX::Zero(this->_sys->n_dofs()),
136 res_up = RealVectorX::Zero(this->_sys->n_dofs()),
137 res_lo = RealVectorX::Zero(this->_sys->n_dofs());
144 this->init_solution_for_elem(sol);
145 this->_fluid_elem->set_solution(sol);
148 for (val.side=0; val.side<_fluid_elem->elem().get_reference_elem().n_sides(); val.side++) {
154 this->_flight_cond->gas_property.rho = rho0;
155 this->_flight_cond->init();
156 this->_fluid_elem->far_field_surface_residual_sensitivity(p,
false, res_sens, jac, val.side, *this->_far_field_bc);
160 this->_flight_cond->gas_property.rho = rho0 * (1. +
_frac);
161 this->_flight_cond->init();
162 this->_fluid_elem->far_field_surface_residual(
false, res_up, jac, val.side, *this->_far_field_bc);
164 this->_flight_cond->gas_property.rho = rho0 * (1. -
_frac);
165 this->_flight_cond->init();
166 this->_fluid_elem->far_field_surface_residual(
false, res_lo, jac, val.side, *this->_far_field_bc);
169 res_up /= (2.*
_frac*rho0);
192 val.jac_xdot =
false;
200 for (val.side=0; val.side<_fluid_elem->elem().get_reference_elem().n_sides(); val.side++)
201 BOOST_CHECK(check_jacobian(val));
223 val.jac_xdot =
false;
232 for (val.side=0; val.side<_fluid_elem->elem().get_reference_elem().n_sides(); val.side++)
233 BOOST_CHECK(check_jacobian(val));
252 val.jac_xdot =
false;
261 BOOST_CHECK(check_jacobian(val));
280 val.jac_xdot =
false;
290 BOOST_CHECK(check_jacobian(val));
310 val.jac_xdot =
false;
344 BOOST_CHECK(check_jacobian(val));
349 BOOST_AUTO_TEST_SUITE_END()
libMesh::LibMeshInit * _libmesh_init
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...
MAST::BoundaryConditionBase * _far_field_bc
BOOST_GLOBAL_FIXTURE(GlobalTestFixture)
virtual bool velocity_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac)
inertial force contribution to system residual
BOOST_FIXTURE_TEST_SUITE(PanelSmallDisturbanceFrequencyDomain2D, MAST::PanelInviscidSmallDisturbanceFrequencyDomain2DAnalysis) BOOST_AUTO_TEST_CASE(FreqDomainSensitivityWrtOmega)
virtual bool slip_wall_surface_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int s, MAST::BoundaryConditionBase &bc)
Matrix< Real, Dynamic, Dynamic > RealMatrixX
BOOST_AUTO_TEST_CASE(FarFieldJacobian)
MAST::ConservativeFluidElementBase * _fluid_elem
Matrix< Real, Dynamic, 1 > RealVectorX
virtual bool noslip_wall_surface_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int s, MAST::BoundaryConditionBase &bc)
virtual bool internal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
internal force contribution to system residual
MAST::BoundaryConditionBase * _noslip_wall_bc
virtual bool far_field_surface_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int s, MAST::BoundaryConditionBase &bc)
MAST::BoundaryConditionBase * _slip_wall_bc