diff --git a/examples/new_material/barre_trou.geo b/examples/new_material/barre_trou.geo index 8df890782..fd284e89f 100644 --- a/examples/new_material/barre_trou.geo +++ b/examples/new_material/barre_trou.geo @@ -1,31 +1,31 @@ -lz = 0.1; +lz = 0.3; Point (1) = {0.00, 0, 0, lz}; Point (2) = {10, 0, 0, lz}; Point (3) = {10, 4, 0,lz}; Point (4) = {0.0 , 4,0, lz}; Line (1) = {1, 2}; Line (2) = {2, 3}; Line (3) = {3, 4}; Line (4) = {4, 1}; Line Loop (6) = {1,2, 3, 4}; Point(5) = {5, 2, 0,lz}; Point(6) = {3.5, 2, 0,lz}; Point(8) = {6.5, 2, 0,lz}; Point(9) = {5, 0.5, 0,lz}; Point(11) = {5, 3.5, 0,lz}; Point(12) = {5, 3.5, 0,lz}; Circle(7) = {6, 5, 11}; Circle(8) = {11, 5, 8}; Circle(9) = {8, 5, 9}; Circle(10) = {9, 5, 6}; Line Loop(11) = {10, 9, 8, 7}; Plane Surface(11)={6,11}; Physical Surface("Interior") = {11}; Physical Line("Traction") = {2}; Physical Line("Fixed_x") = {4}; Physical Line("Fixed_y") = {1, 3}; Physical Line("Free") = {7, 8, 9, 10}; diff --git a/examples/new_material/material.dat b/examples/new_material/material.dat index 662bae263..1ec3939b9 100644 --- a/examples/new_material/material.dat +++ b/examples/new_material/material.dat @@ -1,6 +1,8 @@ material local_damage [ name = concrete rho = 3000 # density E = 40e9 # young's modulus nu = 0.2 # poisson's ratio + Yd = 500 + Sd = 5000 ] diff --git a/examples/new_material/new_local_material.cc b/examples/new_material/new_local_material.cc index 9c8559f0f..6230a7c7d 100644 --- a/examples/new_material/new_local_material.cc +++ b/examples/new_material/new_local_material.cc @@ -1,103 +1,103 @@ /** * @file new_local_material.cc * * @author Guillaume Anciaux * @author Marion Estelle Chambart * @author Nicolas Richart * * @date creation: Thu Aug 06 2015 * @date last modification: Mon Jan 18 2016 * * @brief test of the class SolidMechanicsModel * * @section LICENSE * * Copyright (©) 2015 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 "local_material_damage.hh" #include "solid_mechanics_model.hh" /* -------------------------------------------------------------------------- */ #include /* -------------------------------------------------------------------------- */ using namespace akantu; #define bar_length 10. #define bar_height 4. akantu::Real eps = 1e-10; int main(int argc, char * argv[]) { akantu::initialize("material.dat", argc, argv); UInt max_steps = 10000; Real epot, ekin; const UInt spatial_dimension = 2; Mesh mesh(spatial_dimension); mesh.read("barre_trou.msh"); /// model creation SolidMechanicsModel model(mesh); /// model initialization model.initFull(_analysis_method = _explicit_lumped_mass); std::cout << model.getMaterial(0) << std::endl; Real time_step = model.getStableTimeStep(); model.setTimeStep(time_step / 10.); /// Dirichlet boundary conditions model.applyBC(BC::Dirichlet::FixedValue(0.0, _x), "Fixed_x"); model.applyBC(BC::Dirichlet::FixedValue(0.0, _y), "Fixed_y"); // Neumann boundary condition Matrix stress(2, 2); stress.eye(3e2); model.applyBC(BC::Neumann::FromStress(stress), "Traction"); model.setBaseName("local_material"); model.addDumpField("displacement"); model.addDumpField("velocity"); model.addDumpField("acceleration"); model.addDumpField("external_force"); model.addDumpField("internal_force"); model.addDumpField("grad_u"); model.addDumpField("stress"); model.addDumpField("damage"); model.dump(); for (UInt s = 0; s < max_steps; ++s) { model.solveStep(); epot = model.getEnergy("potential"); ekin = model.getEnergy("kinetic"); if (s % 100 == 0) std::cout << s << " " << epot << " " << ekin << " " << epot + ekin << std::endl; - if (s % 100 == 0) + if (s % 1000 == 0) model.dump(); } akantu::finalize(); return EXIT_SUCCESS; }