21 #include "libmesh/libmesh.h" 22 #include "libmesh/elem.h" 23 #include "libmesh/dof_map.h" 45 "[2D][structural][base]")
48 coords << -1.0, 1.0, 1.0, -1.0,
55 SECTION(
"Element returns proper number of strain components")
61 SECTION(
"Incompatible modes flag returns false for basic element")
66 SECTION(
"Isotropic flag returns true for basic element")
72 SECTION(
"Check setting/getting element local solution")
74 const libMesh::DofMap& dof_map = test_elem.
assembly.
system().get_dof_map();
75 std::vector<libMesh::dof_id_type> dof_indices;
77 uint n_dofs = uint(dof_indices.size());
79 RealVectorX elem_solution = 5.3*RealVectorX::Ones(n_dofs);
86 SECTION(
"Check setting/getting element local sensitivity solution")
88 const libMesh::DofMap& dof_map = test_elem.
assembly.
system().get_dof_map();;
89 std::vector<libMesh::dof_id_type> dof_indices;
91 uint n_dofs = uint(dof_indices.size());
93 RealVectorX elem_solution_sens = 3.1*RealVectorX::Ones(n_dofs);
102 SECTION(
"Element shape can be transformed")
139 TEST::transform_element(test_elem.
mesh, coords, 0.0, 0.0, 4.2, 1.0, 1.0, 0.0, 0.0, 0.0, 5.2, 0.0);
143 TEST::transform_element(test_elem.
mesh, coords, 0.0, 0.0, 4.2, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -6.4);
libMesh::LibMeshInit * p_global_init
const MAST::NonlinearSystem & system() const
virtual unsigned int n_direct_strain_components()
row dimension of the direct strain matrix, also used for the bending operator row dimension ...
libMesh::Elem * reference_elem
Pointer to the actual libMesh element object.
Real get_shoelace_area(RealMatrixX X)
Calcualtes the area of a 2D polygon using the shoelace formula.
virtual bool if_isotropic() const =0
return true if the property is isotropic
MAST::NonlinearImplicitAssembly assembly
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.
const MAST::ElementPropertyCardBase & elem_property()
returns a constant reference to the finite element object
Matrix< Real, Dynamic, Dynamic > RealMatrixX
virtual bool if_incompatible_modes() const
virtual void set_solution(const RealVectorX &vec, bool if_sens=false)
stores vec as solution for element level calculations, or its sensitivity if if_sens is true...
Matrix< Real, Dynamic, 1 > RealVectorX
const RealVectorX & local_solution(bool if_sens=false) const
MAST::StructuralElement2D * elem
TEST_CASE("structural_element_2d_base_tests", "[2D][structural][base]")
libMesh::ReplicatedMesh mesh
The actual libMesh mesh object.
virtual unsigned int n_von_karman_strain_components()
row dimension of the von Karman strain matrix