MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
thermal_residual_sensitivity.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 "tests/structural/build_structural_elem_1D.h"
27 #include "tests/structural/build_structural_elem_2D.h"
30 #include "tests/base/test_comparisons.h"
32 #include "elasticity/structural_discipline.h"
34 #include "base/parameter.h"
38 #include "base/nonlinear_system.h"
39 
40 
41 // libMesh includes
42 #include "libmesh/dof_map.h"
43 
44 
45 extern void
46 set_deformation(const unsigned int dim,
47  const unsigned int case_num,
48  const libMesh::ElemType e_type,
49  RealVectorX& vec);
50 
51 
52 
53 template <typename ValType>
54 void
56  const RealVectorX& sol) {
57 
58  const Real
59  delta = 1.e-5,
60  tol = 1.e-2;
61 
62  // tell the discipline about the section property and the piston theory
63  // boundary condition
64  v._discipline->add_volume_load(0, *v._thermal_load);
65 
66 
67  // get reference to the element in this mesh
68  const libMesh::Elem& elem = **(v._mesh->local_elements_begin());
69 
70  // now create the structural element
71  std::unique_ptr<MAST::StructuralElementBase>
72  e(MAST::build_structural_element(*v._structural_sys,
73  elem,
74  *v._p_card).release());
75 
76 
77  // number of dofs in this element
78  const libMesh::DofMap& dofmap = v._sys->get_dof_map();
79  std::vector<unsigned int> dof_ids;
80  dofmap.dof_indices(&elem, dof_ids);
81 
82  const unsigned int ndofs = (unsigned int)dof_ids.size();
83 
84  // make sure that the solution vector has been appropriately dimensioned
85  libmesh_assert_equal_to(sol.size(), ndofs);
86 
87  // now get the residual and Jacobian evaluations
89  x0 = RealVectorX::Zero(ndofs),
90  xdot0 = RealVectorX::Zero(ndofs),
91  x = RealVectorX::Zero(ndofs),
92  xdot = RealVectorX::Zero(ndofs),
93  res0 = RealVectorX::Zero(ndofs),
94  res = RealVectorX::Zero(ndofs);
95 
97  jac_x = RealMatrixX::Zero(ndofs, ndofs),
98  jac_xdot = RealMatrixX::Zero(ndofs, ndofs),
99  jac_x_fd = RealMatrixX::Zero(ndofs, ndofs),
100  jac_xdot_fd = RealMatrixX::Zero(ndofs, ndofs),
101  dummy;
102 
103 
104  // set the solution
105  x0 = sol;
106  x = sol;
107 
108 
109  // tell the element about the solution and velocity
110  e->set_solution(x);
111  e->set_velocity(xdot);
112 
113  // get the base residual vector and the Jacobians for numerical comparisons
114  // later.
115  e->volume_external_residual(true,
116  res0,
117  jac_xdot,
118  jac_x,
119  v._discipline->volume_loads());
120 
121  for (unsigned int i=0; i<ndofs; i++) {
122 
123  // first the Jacobian due to x
124  x = x0;
125  xdot = xdot0;
126  // perturb the i^th element of the solution
127  x(i) += delta;
128  e->set_solution(x);
129  e->set_velocity(xdot);
130 
131  // get the new residual
132  res.setZero();
133  e->volume_external_residual(false,
134  res,
135  dummy,
136  dummy,
137  v._discipline->volume_loads());
138 
139  // set the i^th column of the finite-differenced Jacobian
140  jac_x_fd.col(i) = (res-res0)/delta;
141 
142 
143 
144  // do the same for the Jacobian due to x_dot
145  x = x0;
146  xdot = xdot0;
147  // perturb the i^th element of the velocity
148  xdot(i) += delta;
149  e->set_solution(x);
150  e->set_velocity(xdot);
151 
152  // get the new residual
153  res.setZero();
154  e->volume_external_residual(false,
155  res,
156  dummy,
157  dummy,
158  v._discipline->volume_loads());
159 
160  // set the i^th column of the finite-differenced Jacobian
161  jac_xdot_fd.col(i) = (res-res0)/delta;
162  }
163 
164 
165  // now compare the matrices
166  BOOST_CHECK(MAST::compare_matrix( jac_x_fd, jac_x, tol));
167  BOOST_CHECK(MAST::compare_matrix(jac_xdot_fd, jac_xdot, tol));
168 
169  // now clear the laod
170  v._discipline->clear_volume_load(0, *v._thermal_load);
171 }
172 
173 
174 
175 
176 template <typename ValType>
178  const RealVectorX& x) {
179 
180  const Real
181  delta = 1.e-5,
182  tol = 1.e-2;
183 
184  // tell the discipline about the section property and the piston theory
185  // boundary condition
186  v._discipline->add_volume_load(0, *v._thermal_load);
187 
188  // get reference to the element in this mesh
189  const libMesh::Elem& elem = **(v._mesh->local_elements_begin());
190 
191  // now create the structural element
192  std::unique_ptr<MAST::StructuralElementBase>
193  e(MAST::build_structural_element(*v._structural_sys,
194  elem,
195  *v._p_card).release());
196 
197 
198  // number of dofs in this element
199  const libMesh::DofMap& dofmap = v._sys->get_dof_map();
200  std::vector<unsigned int> dof_ids;
201  dofmap.dof_indices(&elem, dof_ids);
202 
203  const unsigned int ndofs = (unsigned int)dof_ids.size();
204 
205  // make sure that the input dof vector is properly sized
206  libmesh_assert_equal_to(x.size(), ndofs);
207 
208  // now get the residual and Jacobian evaluations
210  res0 = RealVectorX::Zero(ndofs),
211  dresdp = RealVectorX::Zero(ndofs),
212  dresdp_fd = RealVectorX::Zero(ndofs);
213 
215  jac0 = RealMatrixX::Zero(ndofs, ndofs),
216  djacdp = RealMatrixX::Zero(ndofs, ndofs),
217  djacdp_fd = RealMatrixX::Zero(ndofs, ndofs),
218  dummy;
219 
220  Real
221  p0 = 0.,
222  dp = 0.;
223 
224 
225  // tell the element about the solution
226  e->set_solution(x);
227  // get the base residual vector and the Jacobians for numerical comparisons
228  // later.
229  e->volume_external_residual(true,
230  res0,
231  dummy,
232  jac0,
233  v._discipline->volume_loads());
234 
235 
236  for (unsigned int i=0; i<v._params_for_sensitivity.size(); i++) {
237 
238  MAST::Parameter& f = *v._params_for_sensitivity[i];
239 
240  // set the sensitivity of solution to be zero
241  e->sensitivity_param = &f;
242 
243  // get the base residual vector and the Jacobians for numerical comparisons
244  // later.
245  dresdp.setZero();
246  djacdp.setZero();
247  e->volume_external_residual_sensitivity(true,
248  dresdp,
249  dummy,
250  djacdp,
251  v._discipline->volume_loads());
252 
253  // reset the sensitivity parameter
254  e->sensitivity_param = nullptr;
255 
256  // now calculate the finite difference sensitivity
257 
258  // identify the perturbation in the parameter
259  p0 = f();
260  (fabs(p0) > 0)? dp=delta*p0 : dp=delta;
261  f() += dp;
262 
263  dresdp_fd.setZero();
264  djacdp_fd.setZero();
265  e->volume_external_residual(true,
266  dresdp_fd,
267  dummy,
268  djacdp_fd,
269  v._discipline->volume_loads());
270  // reset the parameter value
271  f() = p0;
272 
273  // calculate the finite-difference quantities
274  dresdp_fd -= res0;
275  dresdp_fd /= dp;
276  djacdp_fd -= jac0;
277  djacdp_fd /= dp;
278 
279  // now compare the matrices
280  BOOST_TEST_MESSAGE(" ** dres/dp (partial) wrt : " << f.name() << " **");
281  BOOST_CHECK(MAST::compare_vector( dresdp_fd, dresdp, tol));
282  BOOST_TEST_MESSAGE(" ** djac/dp (partial) wrt : " << f.name() << " **");
283  BOOST_CHECK(MAST::compare_matrix( djacdp_fd, djacdp, tol));
284  }
285 
286  // now clear the laod
287  v._discipline->clear_volume_load(0, *v._thermal_load);
288 }
289 
290 
291 
292 
293 BOOST_FIXTURE_TEST_SUITE (Structural1DJacobianEvaluation,
295 
296 BOOST_AUTO_TEST_CASE (ThermalResidualLinear1DIndependentOffset) {
297 
298  RealVectorX v;
299 
300  this->init(false, false);
301  set_deformation(1, 3, libMesh::INVALID_ELEM, v);
302  check_thermal_residual_force_jacobian<MAST::BuildStructural1DElem>(*this, v);
303 }
304 
305 
306 
307 BOOST_AUTO_TEST_CASE (ThermalResidualNonlinear1DIndependentOffset) {
308 
309  RealVectorX v;
310 
311  this->init(false, true);
312  set_deformation(1, 3, libMesh::INVALID_ELEM, v);
313  check_thermal_residual_force_jacobian<MAST::BuildStructural1DElem>(*this, v);
314 }
315 
316 
317 
318 BOOST_AUTO_TEST_CASE (ThermalResidualLinear1DDependentOffset) {
319 
320  RealVectorX v;
321 
322  this->init(true, false);
323  set_deformation(1, 3, libMesh::INVALID_ELEM, v);
324  check_thermal_residual_force_jacobian<MAST::BuildStructural1DElem>(*this, v);
325 }
326 
327 
328 
329 BOOST_AUTO_TEST_CASE (ThermalResidualNonlinear1DDependentOffset) {
330 
331  RealVectorX v;
332 
333  this->init(true, true);
334  set_deformation(1, 3, libMesh::INVALID_ELEM, v);
335  check_thermal_residual_force_jacobian<MAST::BuildStructural1DElem>(*this, v);
336 }
337 
338 
339 BOOST_AUTO_TEST_SUITE_END()
340 
341 
342 
343 BOOST_FIXTURE_TEST_SUITE (Structural1DThermalForceSensitivity,
344  MAST::BuildStructural1DElem)
345 
346 BOOST_AUTO_TEST_CASE (ThermalForceLinearSensitivity1DIndependentOffset) {
347 
348  this->init(false, false);
349 
350  RealVectorX v;
351 
352  // pure axial deformation
353  BOOST_TEST_MESSAGE("**** Pure Extension Deformation **");
354  set_deformation(1, 0, libMesh::INVALID_ELEM, v);
355  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural1DElem>
356  (*this, v);
357 
358  // pure bending deformation
359  BOOST_TEST_MESSAGE("**** Pure Bending Deformation **");
360  set_deformation(1, 1, libMesh::INVALID_ELEM, v);
361  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural1DElem>
362  (*this, v);
363 
364  // combination of axial and bending deformation
365  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Deformation **");
366  set_deformation(1, 2, libMesh::INVALID_ELEM, v);
367  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural1DElem>
368  (*this, v);
369 
370 }
371 
372 
373 
374 BOOST_AUTO_TEST_CASE (ThermalForceNonlinearSensitivity1DIndependentOffset) {
375 
376  this->init(false, true);
377 
378  RealVectorX v;
379 
380  // combination of axial and bending deformation
381  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Large Deformation **");
382  set_deformation(1, 3, libMesh::INVALID_ELEM, v);
383  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural1DElem>
384  (*this, v);
385 }
386 
387 
388 
389 BOOST_AUTO_TEST_CASE (ThermalForceLinearSensitivity1DDependentOffset) {
390 
391  this->init(true, false);
392 
393  RealVectorX v;
394 
395  // pure axial deformation
396  BOOST_TEST_MESSAGE("**** Pure Extension Deformation **");
397  set_deformation(1, 0, libMesh::INVALID_ELEM, v);
398  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural1DElem>
399  (*this, v);
400 
401  // pure bending deformation
402  BOOST_TEST_MESSAGE("**** Pure Bending Deformation **");
403  set_deformation(1, 1, libMesh::INVALID_ELEM, v);
404  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural1DElem>
405  (*this, v);
406 
407  // combination of axial and bending deformation
408  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Deformation **");
409  set_deformation(1, 2, libMesh::INVALID_ELEM, v);
410  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural1DElem>
411  (*this, v);
412 
413 }
414 
415 
416 
417 
418 BOOST_AUTO_TEST_CASE (ThermalForceNonlinearSensitivity1DDependentOffset) {
419 
420  this->init(true, true);
421 
422  RealVectorX v;
423 
424  // combination of axial and bending deformation
425  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Large Deformation **");
426  set_deformation(1, 3, libMesh::INVALID_ELEM, v);
427  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural1DElem>
428  (*this, v);
429 
430 }
431 
432 
433 
434 BOOST_AUTO_TEST_SUITE_END()
435 
436 
437 
438 BOOST_FIXTURE_TEST_SUITE (Structural2DJacobianEvaluation,
439  MAST::BuildStructural2DElem)
440 
441 
442 BOOST_AUTO_TEST_CASE (ThermalResidualLinearQUAD42DIndependentOffset) {
443 
444  RealVectorX v;
445 
446  this->init(false, false, libMesh::QUAD4);
447  set_deformation(2, 3, libMesh::QUAD4, v);
448  check_thermal_residual_force_jacobian<MAST::BuildStructural2DElem>(*this, v);
449 }
450 
451 
452 
453 BOOST_AUTO_TEST_CASE (ThermalResidualLinearTRI32DIndependentOffset) {
454 
455  RealVectorX v;
456 
457  this->init(false, false, libMesh::TRI3);
458  set_deformation(2, 3, libMesh::TRI3, v);
459  check_thermal_residual_force_jacobian<MAST::BuildStructural2DElem>(*this, v);
460 }
461 
462 
463 
464 BOOST_AUTO_TEST_CASE (ThermalResidualNonlinearQUAD42DIndependentOffset) {
465 
466  RealVectorX v;
467 
468  this->init(false, true, libMesh::QUAD4);
469  set_deformation(2, 3, libMesh::QUAD4, v);
470  check_thermal_residual_force_jacobian<MAST::BuildStructural2DElem>(*this, v);
471 }
472 
473 
474 
475 BOOST_AUTO_TEST_CASE (ThermalResidualNonlinearTRI32DIndependentOffset) {
476 
477  RealVectorX v;
478 
479  this->init(false, true, libMesh::TRI3);
480  set_deformation(2, 3, libMesh::TRI3, v);
481  check_thermal_residual_force_jacobian<MAST::BuildStructural2DElem>(*this, v);
482 }
483 
484 
485 
486 BOOST_AUTO_TEST_CASE (ThermalResidualLinearQUAD42DDependentOffset) {
487 
488  RealVectorX v;
489 
490  this->init(true, false, libMesh::QUAD4);
491  set_deformation(2, 3, libMesh::QUAD4, v);
492  check_thermal_residual_force_jacobian<MAST::BuildStructural2DElem>(*this, v);
493 }
494 
495 
496 
497 BOOST_AUTO_TEST_CASE (ThermalResidualLinearTRI32DDependentOffset) {
498 
499  RealVectorX v;
500 
501  this->init(true, false, libMesh::TRI3);
502  set_deformation(2, 3, libMesh::TRI3, v);
503  check_thermal_residual_force_jacobian<MAST::BuildStructural2DElem>(*this, v);
504 }
505 
506 
507 
508 BOOST_AUTO_TEST_CASE (ThermalResidualNonlinearQUAD42DDependentOffset) {
509 
510  RealVectorX v;
511 
512  this->init(true, true, libMesh::QUAD4);
513  set_deformation(2, 3, libMesh::QUAD4, v);
514  check_thermal_residual_force_jacobian<MAST::BuildStructural2DElem>(*this, v);
515 }
516 
517 
518 
519 BOOST_AUTO_TEST_CASE (ThermalResidualNonlinearTRI32DDependentOffset) {
520 
521  RealVectorX v;
522 
523  this->init(true, true, libMesh::TRI3);
524  set_deformation(2, 3, libMesh::TRI3, v);
525  check_thermal_residual_force_jacobian<MAST::BuildStructural2DElem>(*this, v);
526 }
527 
528 
529 BOOST_AUTO_TEST_SUITE_END()
530 
531 
532 
533 
534 BOOST_FIXTURE_TEST_SUITE (Structural2DThermalForceSensitivity,
535  MAST::BuildStructural2DElem)
536 
537 BOOST_AUTO_TEST_CASE (ThermalForceLinearSensitivityQUAD42DIndependentOffset) {
538 
539  this->init(false, false, libMesh::QUAD4);
540 
541  RealVectorX v;
542 
543  // pure axial deformation
544  BOOST_TEST_MESSAGE("**** Pure Extension Deformation **");
545  set_deformation(2, 0, libMesh::QUAD4, v);
546  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
547  (*this, v);
548 
549  // pure bending deformation
550  BOOST_TEST_MESSAGE("**** Pure Bending Deformation **");
551  set_deformation(2, 1, libMesh::QUAD4, v);
552  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
553  (*this, v);
554 
555  // combination of axial and bending deformation
556  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Deformation **");
557  set_deformation(2, 2, libMesh::QUAD4, v);
558  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
559  (*this, v);
560 
561 }
562 
563 
564 
565 BOOST_AUTO_TEST_CASE (ThermalForceLinearSensitivityTRI32DIndependentOffset) {
566 
567  this->init(false, false, libMesh::TRI3);
568 
569  RealVectorX v;
570 
571  // pure axial deformation
572  BOOST_TEST_MESSAGE("**** Pure Extension Deformation **");
573  set_deformation(2, 0, libMesh::TRI3, v);
574  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
575  (*this, v);
576 
577  // pure bending deformation
578  BOOST_TEST_MESSAGE("**** Pure Bending Deformation **");
579  set_deformation(2, 1, libMesh::TRI3, v);
580  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
581  (*this, v);
582 
583  // combination of axial and bending deformation
584  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Deformation **");
585  set_deformation(2, 2, libMesh::TRI3, v);
586  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
587  (*this, v);
588 
589 }
590 
591 
592 
593 
594 BOOST_AUTO_TEST_CASE (ThermalForceNonlinearSensitivityQUAD42DIndependentOffset) {
595 
596  this->init(false, true, libMesh::QUAD4);
597 
598  RealVectorX v;
599 
600  // combination of axial and bending deformation
601  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Large Deformation **");
602  set_deformation(2, 3, libMesh::QUAD4, v);
603  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
604  (*this, v);
605 
606 }
607 
608 
609 
610 BOOST_AUTO_TEST_CASE (ThermalForceNonlinearSensitivityTRI32DIndependentOffset) {
611 
612  this->init(false, true, libMesh::TRI3);
613 
614  RealVectorX v;
615 
616  // combination of axial and bending deformation
617  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Large Deformation **");
618  set_deformation(2, 3, libMesh::TRI3, v);
619  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
620  (*this, v);
621 
622 }
623 
624 
625 
626 
627 BOOST_AUTO_TEST_CASE (ThermalForceLinearSensitivityQUAD42DDependentOffset) {
628 
629  this->init(true, false, libMesh::QUAD4);
630 
631  RealVectorX v;
632 
633  // pure axial deformation
634  BOOST_TEST_MESSAGE("**** Pure Extension Deformation **");
635  set_deformation(2, 0, libMesh::QUAD4, v);
636  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
637  (*this, v);
638 
639  // pure bending deformation
640  BOOST_TEST_MESSAGE("**** Pure Bending Deformation **");
641  set_deformation(2, 1, libMesh::QUAD4, v);
642  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
643  (*this, v);
644 
645  // combination of axial and bending deformation
646  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Deformation **");
647  set_deformation(2, 2, libMesh::QUAD4, v);
648  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
649  (*this, v);
650 
651 }
652 
653 
654 
655 BOOST_AUTO_TEST_CASE (ThermalForceLinearSensitivityTRI32DDependentOffset) {
656 
657  this->init(true, false, libMesh::TRI3);
658 
659  RealVectorX v;
660 
661  // pure axial deformation
662  BOOST_TEST_MESSAGE("**** Pure Extension Deformation **");
663  set_deformation(2, 0, libMesh::TRI3, v);
664  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
665  (*this, v);
666 
667  // pure bending deformation
668  BOOST_TEST_MESSAGE("**** Pure Bending Deformation **");
669  set_deformation(2, 1, libMesh::TRI3, v);
670  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
671  (*this, v);
672 
673  // combination of axial and bending deformation
674  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Deformation **");
675  set_deformation(2, 2, libMesh::TRI3, v);
676  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
677  (*this, v);
678 
679 }
680 
681 
682 
683 
684 BOOST_AUTO_TEST_CASE (ThermalForceNonlinearSensitivityQUAD42DDependentOffset) {
685 
686  this->init(true, true, libMesh::QUAD4);
687 
688  RealVectorX v;
689 
690  // combination of axial and bending deformation
691  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Large Deformation **");
692  set_deformation(2, 3, libMesh::QUAD4, v);
693  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
694  (*this, v);
695 
696 }
697 
698 
699 
700 BOOST_AUTO_TEST_CASE (ThermalForceNonlinearSensitivityTRI32DDependentOffset) {
701 
702  this->init(true, true, libMesh::TRI3);
703 
704  RealVectorX v;
705 
706  // combination of axial and bending deformation
707  BOOST_TEST_MESSAGE("**** Combined Extension-Bending Large Deformation **");
708  set_deformation(2, 3, libMesh::TRI3, v);
709  check_thermal_force_and_jacobian_sensitivity<MAST::BuildStructural2DElem>
710  (*this, v);
711 
712 }
713 
714 
715 
716 BOOST_AUTO_TEST_SUITE_END()
void set_deformation(const unsigned int dim, const unsigned int case_num, const libMesh::ElemType e_type, RealVectorX &vec)
const std::string & name() const
returns the name of this function
Definition: function_base.h:60
void check_thermal_residual_force_jacobian(ValType &v, const RealVectorX &sol)
BOOST_AUTO_TEST_CASE(ThermalResidualNonlinear1DIndependentOffset)
BOOST_FIXTURE_TEST_SUITE(Structural1DJacobianEvaluation, MAST::BuildStructural1DElem) BOOST_AUTO_TEST_CASE(ThermalResidualLinear1DIndependentOffset)
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...
Definition: parameter.h:35
bool compare_matrix(const RealMatrixX &m0, const RealMatrixX &m, const Real tol)
libMesh::Real Real
Matrix< Real, Dynamic, Dynamic > RealMatrixX
Matrix< Real, Dynamic, 1 > RealVectorX
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
void check_thermal_force_and_jacobian_sensitivity(ValType &v, const RealVectorX &x)