MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
beam_bending_thermal_stress_evaluation.cpp
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2020 Manav Bhatia and MAST authors
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 
21 // BOOST includes
22 #include <boost/test/unit_test.hpp>
23 
24 
25 // MAST includes
26 #include "examples/structural/beam_bending_thermal_stress_with_offset/beam_bending_thermal_stress.h"
27 #include "tests/base/check_sensitivity.h"
28 
29 
30 
31 BOOST_FIXTURE_TEST_SUITE (Structural1DBeamBending,
32  MAST::BeamBendingThermalStress)
33 
34 //BOOST_AUTO_TEST_CASE (BeamBendingWithThermalStressSolution) {
35 //
36 // this->solve();
37 //
38 // // check the solution
39 // // iterate over each node, and compare the nodal solution with the
40 // // expected anlaytical value
41 // unsigned int
42 // dof_num = 0;
43 // libMesh::MeshBase::const_node_iterator
44 // it = _mesh->local_nodes_begin(),
45 // end = _mesh->local_nodes_end();
46 //
47 // Real
48 // temp = (*_temp)(),
49 // th_y = (*_thy)(),
51 // x = 0.,
52 // xi = 0.,
53 // eta = 0.,
54 // Eval = (*_E)(),
55 // alpha = (*_alpha)(),
56 // analytical = 0.,
57 // numerical = 0.;
58 //
59 // // analytical solution to the simply supported problem is
60 // // w(x) = -alpha*T*A*th_y/2/Izz*(x^2/2 - L*x/2);
61 // // dwdx(x) = -alpha*T*A*th_y/2/Izz*(x - L/2);
62 //
63 // BOOST_TEST_MESSAGE(" ** v-displacement and theta-z rotation **");
64 // for ( ; it!=end; it++) {
65 // const libMesh::Node* node = *it;
66 // x = (*node)(0);
67 //
68 // // v-displacement
69 // analytical = -alpha*temp/th_y*3./2.*(pow(x,2)/2. - _length*x/2.);
70 //
71 // dof_num = node->dof_number(_sys->number(),
72 // _structural_sys->vars()[1], // v-displ.
73 // 0);
74 // numerical = _sys->solution->el(dof_num);
75 // BOOST_CHECK(MAST::compare_value(analytical, numerical, tol));
76 //
77 // // theta-z rotation
78 // analytical = -alpha*temp/th_y*3./2.*(x - _length/2.);
79 //
80 // dof_num = node->dof_number(_sys->number(),
81 // _structural_sys->vars()[5], // tz-rotation
82 // 0);
83 // numerical = _sys->solution->el(dof_num);
84 // BOOST_CHECK(MAST::compare_value(analytical, numerical, tol));
85 //
86 // }
87 //
88 //
89 // // make sure that each stress object has a single stored value
90 // for (unsigned int i=0; i<_outputs.size(); i++) {
91 // BOOST_CHECK(_outputs[i]->n_elem_in_storage() == 1);
92 // }
93 //
94 // // now check the stress value in each element, which should be the same as
95 // // the pressure value specified for the problem
96 // BOOST_TEST_MESSAGE(" ** Stress **");
97 // for (unsigned int i=0; i<_outputs.size(); i++) {
98 //
99 // // get the element and the nodes to evaluate the stress
100 // const libMesh::Elem& e = **(_outputs[i]->get_elem_subset().begin());
101 //
102 // const std::vector<MAST::StressStrainOutputBase::Data*>&
103 // data = _outputs[i]->get_stress_strain_data_for_elem(&e);
104 //
105 // // find the location of quadrature point
106 // for (unsigned int j=0; j<data.size(); j++) {
107 //
108 // // logitudinal strain for this location
109 // numerical = data[j]->stress()(0);
110 //
111 // xi = data[j]->point_location_in_element_coordinate()(0);
112 // eta = data[j]->point_location_in_element_coordinate()(1);
113 //
114 // // assuming linear Lagrange interpolation for elements
115 // x = e.point(0)(0) * (1.-xi)/2. + e.point(1)(0) * (1.+xi)/2.;
116 // // stress is a combination of the bending and compressive stress.
117 // analytical = Eval*alpha*temp*(0.75*(eta+1.) - 1.);
118 //
119 //
120 // BOOST_CHECK(MAST::compare_value(analytical, numerical, tol));
121 // }
122 // }
123 //}
124 
125 
126 BOOST_AUTO_TEST_CASE (BeamBendingWithThermalStressSensitivity) {
127 
129 
130 }
131 
132 
133 BOOST_AUTO_TEST_SUITE_END()
134 
void check_sensitivity(ValType &v)
BOOST_FIXTURE_TEST_SUITE(Structural1DBeamBending, MAST::BeamBendingThermalStress) BOOST_AUTO_TEST_CASE(BeamBendingWithThermalStressSensitivity)
BOOST_AUTO_TEST_CASE(InternalForceJacobianZeroFreq)