diff --git a/test/test_model/test_solid_mechanics_model/CMakeLists.txt b/test/test_model/test_solid_mechanics_model/CMakeLists.txt index 335e778f8..421ad0e75 100644 --- a/test/test_model/test_solid_mechanics_model/CMakeLists.txt +++ b/test/test_model/test_solid_mechanics_model/CMakeLists.txt @@ -1,73 +1,81 @@ #=============================================================================== # @file CMakeLists.txt # # @author Guillaume Anciaux # # @date creation: Fri Sep 03 2010 # @date last modification: Tue Jan 30 2018 # # @brief configuratio for SolidMechanicsModel tests # # @section LICENSE # # Copyright (©) 2010-2018 EPFL (Ecole Polytechnique Fédérale de Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) # # Akantu is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. # # Akantu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License along with Akantu. If not, see . # # @section DESCRIPTION # #=============================================================================== add_akantu_test(test_materials "test_materials") add_akantu_test(test_cohesive "cohesive_test") add_akantu_test(test_embedded_interface "test_embedded_interface") add_akantu_test(test_energies "test energies") #=============================================================================== #=============================================================================== add_mesh(test_cube3d_two_mat_mesh cube_two_materials.geo 3 1) register_test(test_solid_mechanics_model_reassign_material SOURCES test_solid_mechanics_model_reassign_material.cc DEPENDS test_cube3d_two_mat_mesh FILES_TO_COPY two_materials.dat PACKAGE parallel implicit PARALLEL ) #=============================================================================== register_test(test_solid_mechanics_model_material_eigenstrain SOURCES test_solid_mechanics_model_material_eigenstrain.cc FILES_TO_COPY cube_3d_tet_4.msh; material_elastic_plane_strain.dat PACKAGE implicit ) #=============================================================================== +register_test(test_solid_mechanics_model_material_large_rotation + SOURCES test_solid_mechanics_model_material_large_rotation.cc + FILES_TO_COPY cube_3d_tet_4.msh; material_elastic.dat + PACKAGE implicit + ) + +#=============================================================================== + register_test(test_material_selector SOURCES test_material_selector.cc FILES_TO_COPY material_selector.dat material_selector.msh PACKAGE core ) #=============================================================================== # dynamics tests #=============================================================================== register_gtest_sources( SOURCES test_solid_mechanics_model_dynamics.cc FILES_TO_COPY test_solid_mechanics_model_dynamics_material.dat PACKAGE core ) register_gtest_test(test_solid_mechanics_model DEPENDS ${PATCH_TEST_BAR_MESHES} #bar_segment_2 bar_segment_3 #bar_triangle_3 bar_triangle_6 #bar_quadrangle_4 bar_quadrangle_8 #bar_tetrahedron_4 bar_tetrahedron_10 #bar_hexahedron_8 bar_hexahedron_20 #bar_pentahedron_6 bar_pentahedron_15 PARALLEL ) diff --git a/test/test_model/test_solid_mechanics_model/material_elastic.dat b/test/test_model/test_solid_mechanics_model/material_elastic.dat new file mode 100644 index 000000000..bbdfdd3a2 --- /dev/null +++ b/test/test_model/test_solid_mechanics_model/material_elastic.dat @@ -0,0 +1,9 @@ +permissive_parser = true + +material elastic [ + name = steel + rho = 7800 # density + E = 2e11 # young's modulus + nu = 0.3 # poisson's ratio + finite_deformation = 1 +] diff --git a/test/test_model/test_solid_mechanics_model/test_solid_mechanics_model_material_large_rotation.cc b/test/test_model/test_solid_mechanics_model/test_solid_mechanics_model_material_large_rotation.cc new file mode 100644 index 000000000..e0e731c92 --- /dev/null +++ b/test/test_model/test_solid_mechanics_model/test_solid_mechanics_model_material_large_rotation.cc @@ -0,0 +1,77 @@ +/** + * @file test_solid_mechanics_model_material_eigenstrain.cc + * + * @author Aurelia Isabel Cuba Ramos + * @author Nicolas Richart + * + * @date creation: Sat Apr 16 2011 + * @date last modification: Thu Feb 01 2018 + * + * @brief test the internal field prestrain + * + * @section LICENSE + * + * Copyright (©) 2010-2018 EPFL (Ecole Polytechnique Fédérale de Lausanne) + * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) + * + * Akantu is free software: you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Akantu. If not, see . + * + */ + +/* -------------------------------------------------------------------------- */ +#include "mesh_utils.hh" +#include "non_linear_solver.hh" +#include "solid_mechanics_model.hh" +/* -------------------------------------------------------------------------- */ + +using namespace akantu; + +int main(int argc, char * argv[]) { + initialize("material_elastic.dat", argc, argv); + + UInt dim = 3; + + /// load mesh + Mesh mesh(dim); + mesh.read("cube_3d_tet_4.msh"); + + /// declaration of model + SolidMechanicsModel model(mesh); + + /// model initialization + // model.initFull(_analysis_method=akantu._explicit_lumped_mass) + model.initFull(_analysis_method = _implicit_dynamic); + // model.initFull(_analysis_method = akantu._implicit_dynamic) + + auto & solver = model.getNonLinearSolver(); + solver.set("threshold", 1e-4); + solver.set("max_iterations", 100); + solver.set("convergence_type", SolveConvergenceCriteria::_residual); + + const Array & coordinates = mesh.getNodes(); + Array & displacement = model.getDisplacement(); + Array & boundary = model.getBlockedDOFs(); + MeshUtils::buildFacets(mesh); + + /* ------------------------------------------------------------------------ */ + /* Dynamic eolution */ + /* ------------------------------------------------------------------------ */ + model.solveStep(); + std::cout << "Converged in " << Int(solver.get("nb_iterations")) << " (" + << Real(solver.get("error")) << ")" << std::endl; + + finalize(); + + return EXIT_SUCCESS; +}