MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
test_helpers.h
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 #ifndef __test__test_helpers__
21 #define __test__test_helpers__
22 
23 #include "base/mast_data_types.h"
26 #include "libmesh/point.h"
27 #include "libmesh/face_quad4.h"
28 
29 namespace TEST {
30 
35  std::vector<double> eigen_matrix_to_std_vector(RealMatrixX M);
36 
37 
42 
49  const RealVectorX& initial_elem_solution,
50  RealMatrixX& jacobian);
51 
52 
59  MAST::PhysicsDisciplineBase& discipline,
60  const RealVectorX& initial_elem_solution,
61  RealMatrixX& jacobian);
62 
69  MAST::PhysicsDisciplineBase& discipline,
70  const RealVectorX& initial_elem_solution,
71  RealMatrixX& jacobian);
72 
79  const RealVectorX& initial_elem_solution,
80  RealMatrixX& jacobian);
81 
82 
89  const RealVectorX& initial_elem_solution,
90  RealMatrixX& jacobian,
91  MAST::BoundaryConditionBase& thermal_bc);
92 
93 
99  void transform_element(libMesh::MeshBase& mesh, const RealMatrixX X0,
100  Real shift_x, Real shift_y, Real shift_z,
101  Real scale_x, Real scale_y,
102  Real rotation_x, Real rotation_y, Real rotation_z,
103  Real shear_x = 0, Real shear_y = 0);
104 }
105 #endif // __test__test_helpers__
void approximate_inertial_jacobian_with_finite_difference(MAST::StructuralElementBase &elem, const RealVectorX &initial_elem_solution, RealMatrixX &jacobian)
Approximates the inertial jacobian using a 6th order accurate central finite difference scheme...
Real get_shoelace_area(RealMatrixX X)
Calcualtes the area of a 2D polygon using the shoelace formula.
void approximate_volume_external_jacobian_with_finite_difference(MAST::StructuralElementBase &elem, MAST::PhysicsDisciplineBase &discipline, const RealVectorX &initial_elem_solution, RealMatrixX &jacobian)
Approximates the volume external jacobian using a 4th order accurate central finite difference scheme...
libMesh::Real Real
void transform_element(libMesh::MeshBase &mesh, const RealMatrixX X0, Real shift_x, Real shift_y, Real shift_z, Real scale_x, Real scale_y, Real rotation_x, Real rotation_y, Real rotation_z, Real shear_x=0, Real shear_y=0)
Transform an element by applying any combination of: shifts, scales, rotations, and shears...
std::vector< double > eigen_matrix_to_std_vector(RealMatrixX M)
Converts an Eigen Matrix object to a std::vector.
void approximate_internal_jacobian_with_finite_difference(MAST::StructuralElementBase &elem, const RealVectorX &initial_elem_solution, RealMatrixX &jacobian)
Approximates the internal Jacobian of an element using a 6th order accurate central finite difference...
Definition: mast_mesh.h:39
Matrix< Real, Dynamic, Dynamic > RealMatrixX
void approximate_side_external_jacobian_with_finite_difference(MAST::StructuralElementBase &elem, MAST::PhysicsDisciplineBase &discipline, const RealVectorX &initial_elem_solution, RealMatrixX &jacobian)
Approximates the side external jacobian using a 4th order accurate central finite difference scheme...
Matrix< Real, Dynamic, 1 > RealVectorX
void approximate_thermal_jacobian_with_finite_difference(MAST::StructuralElementBase &elem, const RealVectorX &initial_elem_solution, RealMatrixX &jacobian, MAST::BoundaryConditionBase &thermal_bc)
Approximates the thermal jacobian using a 6th order accurate central finite difference scheme...