GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
ApplyFracture.hpp
Go to the documentation of this file.
1 // This file is part of GranOO, a workbench for DEM simulation.
2 //
3 // Author(s) : - Damien Andre IRCER/UNILIM, Limoges France
4 // <damien.andre@unilim.fr>
5 // - Jean-luc Charles Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
6 // <jean-luc.charles@ensam.eu>
7 // - Jeremie Girardot Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
8 // <jeremie.girardot@ensam.eu>
9 // - Cedric Hubert LAMIH/UPHF, Valenciennes France
10 // <cedric.hubert@uphf.fr>
11 // - Ivan Iordanoff Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
12 // <ivan.iordanoff@ensam.eu>
13 //
14 // Copyright (C) 2008-2019 D. Andre, JL. Charles, J. Girardot, C. Hubert, I. Iordanoff
15 //
16 // This program is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 // This program is distributed in the hope that it will be useful,
22 // but WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 // GNU General Public License for more details.
25 //
26 // You should have received a copy of the GNU General Public License
27 // along with this program. If not, see <http://www.gnu.org/licenses/>.
28 
29 
30 #ifndef _GranOO_PlugIn_ApplyFracture_hpp_
31 #define _GranOO_PlugIn_ApplyFracture_hpp_
32 
33 #include <string>
34 #include <iostream>
35 #include <fstream>
36 
38 #include "GranOO3/DEM/Element.hpp"
39 #include "GranOO3/DEM/Bond.hpp"
41 #include "GranOO3/Core/PlugIn.hpp"
42 
43 #include "GranOO3/Math/Stat.hpp"
45 
46 
47 namespace GranOO3
48 {
49  namespace PlugIn
50  {
51 
52 
53 
54  class ApplyFracture : public Core::PlugInInterface<ApplyFracture>,
55  public Core::NeedSetOf< DEM::Element >
56  {
57 
58  DECLARE_STD_GRANOO_PLUGIN(APPLY-FRACTURE);
59 
60  public:
63 
64  public:
65  ApplyFracture();
66  void init();
67  void run();
68 
69  void parse_xml();
70  void write(std::ofstream&, const std::vector<double>&, const std::string&);
72 
73 
74  GRANOO_ACCESS(von_mises_criterion , double , _von_mises_criterion );
75  GRANOO_ACCESS(max_principal_criterion, double , _max_principal_stress_criterion );
76  GRANOO_ACCESS(mode , FailureMode , _failure_mode );
77  GRANOO_ACCESS(broken_bond_number , unsigned int, _broken_bond_number );
78 
79  private:
81 
85 
86  private:
87  const std::string _crack_set_ID;
97  double _s1, _s2, _s3; // store principal stress value for math::function
98  std::vector<Math::Variable*> _criterion_var;
99  std::vector<double*> _criterion_var_value;
100  std::vector<Math::Expression*> _criterion_var_expr;
101  std::vector<Math::Expression*> _criterion_law_expr;
102  unsigned int _broken_bond_number;
103  };
104  }
105 }
106 #endif
Definition: NeedSetOf.hpp:51
Definition: PlugIn.hpp:177
Definition: SetOf.hpp:153
a base class that represents an element
Definition: Element.hpp:55
Definition: Vector.hpp:75
Definition: ApplyFracture.hpp:56
void init()
Definition: ApplyFracture.cpp:224
double _s1
Definition: ApplyFracture.hpp:97
~ApplyFracture()
Definition: ApplyFracture.hpp:80
double _von_mises_criterion
Definition: ApplyFracture.hpp:94
ApplyCriterionOn
Definition: ApplyFracture.hpp:61
@ ALL
Definition: ApplyFracture.hpp:61
@ CLOSEST
Definition: ApplyFracture.hpp:61
@ HALF_PLANE
Definition: ApplyFracture.hpp:61
double _hydrostatic_criterion
Definition: ApplyFracture.hpp:93
std::vector< Math::Expression * > _criterion_law_expr
Definition: ApplyFracture.hpp:101
double _s3
Definition: ApplyFracture.hpp:97
void run()
Definition: ApplyFracture.cpp:254
std::vector< Math::Variable * > _criterion_var
Definition: ApplyFracture.hpp:98
double _tresca_criterion
Definition: ApplyFracture.hpp:95
bool _delete_broken_bond
Definition: ApplyFracture.hpp:91
DECLARE_STD_GRANOO_PLUGIN(APPLY-FRACTURE)
unsigned int _broken_bond_number
Definition: ApplyFracture.hpp:102
double _half_plane_coeff
Definition: ApplyFracture.hpp:92
double _s2
Definition: ApplyFracture.hpp:97
void parse_xml()
Definition: ApplyFracture.cpp:174
double _max_principal_stress_criterion
Definition: ApplyFracture.hpp:96
std::vector< Math::Expression * > _criterion_var_expr
Definition: ApplyFracture.hpp:100
const std::string _crack_set_ID
Definition: ApplyFracture.hpp:87
ApplyCriterionOn _apply_on
Definition: ApplyFracture.hpp:88
ApplyFracture()
Definition: ApplyFracture.cpp:142
FailureMode
Definition: ApplyFracture.hpp:62
@ BRITTLE
Definition: ApplyFracture.hpp:62
@ PLASTIC
Definition: ApplyFracture.hpp:62
bool _add_element_to_crack_set
Definition: ApplyFracture.hpp:90
void apply_failure_criterion()
Definition: ApplyFracture.cpp:259
std::vector< double * > _criterion_var_value
Definition: ApplyFracture.hpp:99
Geom::Vector compute_failure_direction(DEM::Element &de)
Definition: ApplyFracture.cpp:349
FailureMode _failure_mode
Definition: ApplyFracture.hpp:89
void write(std::ofstream &, const std::vector< double > &, const std::string &)
Definition: Common.hpp:198