22 #include <boost/test/unit_test.hpp> 26 #include "tests/structural/build_structural_elem_1D.h" 27 #include "tests/structural/build_structural_elem_2D.h" 28 #include "tests/base/test_comparisons.h" 29 #include "tests/structural/build_structural_elem_1D.h" 31 #include "elasticity/structural_discipline.h" 43 #include "libmesh/dof_map.h" 47 template <
typename ValType>
57 const libMesh::Elem& elem = **(v._mesh->local_elements_begin());
60 std::unique_ptr<MAST::StructuralElementBase>
63 *v._p_card).release());
80 for (
unsigned int jj=0; jj<3; jj++) {
83 std::unique_ptr<MAST::FieldFunction<RealMatrixX > > mat_stiff;
87 BOOST_TEST_MESSAGE(
"**** Sensitivity for A matrix **");
88 mat_stiff = v._p_card->stiffness_A_matrix(*e);
93 BOOST_TEST_MESSAGE(
"**** Sensitivity for B matrix **");
94 mat_stiff = v._p_card->stiffness_B_matrix(*e);
99 BOOST_TEST_MESSAGE(
"**** Sensitivity for D matrix **");
100 mat_stiff = v._p_card->stiffness_D_matrix(*e);
115 (*mat_stiff)(pt, 0., mat0);
118 for (
unsigned int i=0; i<v._params_for_sensitivity.size(); i++) {
123 mat_stiff->derivative( f,
130 (fabs(p0) > 0)? dp=std::max(delta*p0, delta) : dp=delta;
133 (*mat_stiff)(pt, 0., dmat);
142 BOOST_TEST_MESSAGE(
" ** dprop/dp wrt : " << f.
name() <<
" **");
155 this->init(
false,
false);
156 check_material_property<MAST::BuildStructural1DElem>(*this);
162 this->init(
true,
false);
163 check_material_property<MAST::BuildStructural1DElem>(*this);
167 BOOST_AUTO_TEST_SUITE_END()
171 MAST::BuildStructural2DElem)
176 this->init(
false,
false, libMesh::QUAD4);
177 check_material_property<MAST::BuildStructural2DElem>(*this);
183 this->init(
true,
false, libMesh::QUAD4);
184 check_material_property<MAST::BuildStructural2DElem>(*this);
190 this->init(
false,
false, libMesh::TRI3);
191 check_material_property<MAST::BuildStructural2DElem>(*this);
197 this->init(
true,
false, libMesh::TRI3);
198 check_material_property<MAST::BuildStructural2DElem>(*this);
203 BOOST_AUTO_TEST_SUITE_END()
const std::string & name() const
returns the name of this function
This is a scalar function whose value can be changed and one that can be used as a design variable in...
bool compare_matrix(const RealMatrixX &m0, const RealMatrixX &m, const Real tol)
void check_material_property(ValType &v)
Matrix< Real, Dynamic, Dynamic > RealMatrixX
std::unique_ptr< MAST::StructuralElementBase > build_structural_element(MAST::SystemInitialization &sys, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
builds the structural element for the specified element type
BOOST_AUTO_TEST_CASE(Property1DSensitivityDependentOffset)
BOOST_FIXTURE_TEST_SUITE(Structural1DSectionPropertyEvaluation, MAST::BuildStructural1DElem) BOOST_AUTO_TEST_CASE(Property1DSensitivityIndependentOffset)