OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
fracturemanager.h
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #ifndef fracturemanager_h
36 #define fracturemanager_h
37 
38 #include "datareader.h"
39 #include "inputrecord.h"
40 #include "contextioresulttype.h"
41 #include "contextmode.h"
42 #include "timestep.h"
43 #include "interface.h"
44 #include "enumitem.h"
45 #include "floatarray.h"
46 
47 namespace oofem {
48 class Domain;
49 class IntArray;
50 class Element;
51 class FractureManager;
52 class FailureCriteria;
53 class FailureCriteriaStatus;
54 
55 
57 
58 #define _IFT_FracManager_Name "fracmanager"
59 #define _IFT_FracManager_numcriterias "numcriterias"
60 #define _IFT_FracManager_verbose "verbose"
61 
62 // Failure criterias
63 #define _IFT_DamagedNeighborLayered_Name "damagedneighborlayered"
64 #define _IFT_DamagedNeighborLayered_DamageThreshold "damagethreshold"
65 
66 
67 // IPLocal - each integration point, ELLocal - one per element
68 #define FailureCriteria_DEF \
69  ENUM_ITEM_WITH_VALUE(FC_Undefined, 0) \
70  ENUM_ITEM_WITH_VALUE(IPLocal, 1) \
71  ENUM_ITEM_WITH_VALUE(ELLocal, 2) \
72  ENUM_ITEM_WITH_VALUE(Nonlocal, 3)
73 
76 };
77 
78 
79 #undef ENUM_ITEM
80 #undef ENUM_ITEM_WITH_VALUE
81 #undef enumitem_h
82 
83 
85 {
86  // abstract class from all the different failure criterias should be derived
87 private:
88 
89  //FractureManager *fMan;
90  FailureCriteria *failCrit; // pointer to the corresponding failure criteria
91 // FailureCriteriaType type; // local, nonlocal
92  //FailureCriteriaName name; // max strain, von Mises, effectivePlasticStrain, tsaiHill, J-integral, G, K etc.
93 // bool failedFlag; // is the criteria fulfilled?
94  int number;
95 
96 
97 
98 public:
99  FailureCriteriaStatus(int number, FailureCriteria * failCrit)
100  {
101  this->number = number;
102  this->failCrit = failCrit;
103  }
104 
106  {
107  this->el = el;
108  this->failCrit = failCrit;
109  }
110 
112  ~FailureCriteriaStatus() { } // must destroy object correctly
114 
115  std :: vector< std :: vector< FloatArray > >quantities;
117  std :: vector< bool >failedFlags;
118 
119 
120  //FailureCriteriaType giveType() { return this->giveFailureCriteria().giveType(); }
122 
123 
124  bool hasFailed(int i) { return failedFlags.at(i - 1); }
125 
127  virtual int instanciateYourself(DataReader &dr) { return 1; }
128  virtual const char *giveClassName() const { return "FailureCriteriaStatus"; }
129 };
130 
131 
132 
133 
134 
136 {
137 private:
138  FailureCriteriaType type; // local, nonlocal
139  FractureManager *fMan; // pointer to its corresponding manager
140  int number;
141 
142 public:
143  FailureCriteria(int number, FractureManager * fMan)
144  {
145  this->number = number;
146  this->fMan = fMan;
147  };
148  ~FailureCriteria() { } // must destroy object correctly
149 
150  std :: vector< FailureCriteriaStatus * >list;
151 
152  FailureCriteriaType giveType() { return this->type; }
153  FractureManager *giveFractureManager() { return this->fMan; }
154  void setType(FailureCriteriaType type) { this->type = type; }
155 
158  virtual const char *giveClassName() const { return "FailureCriteria"; }
159 
160 
161  virtual FailureCriteriaStatus *CreateStatus(Element *el, FailureCriteria *failCrit) const = 0;
162  virtual bool computeFailureCriteriaQuantities(FailureCriteriaStatus *fcStatus, TimeStep *tStep);
163  virtual bool evaluateFCQuantities(Element *el, TimeStep *tStep) { return false; } // defaults to no implementation
164  virtual bool evaluateFailureCriteria(FailureCriteriaStatus *fcStatus) = 0;
165 };
166 
167 
168 
169 
171 {
172 public:
174  FailureCriteriaStatus(el, failCrit) { }
175 
177 };
178 
179 
181 {
182 private:
184 
185 public:
187  FailureCriteria(number, fracMan) { }
188 
189  virtual bool evaluateFailureCriteria(FailureCriteriaStatus *fcStatus);
190  virtual const char *giveClassName() const { return "DamagedNeighborLayered"; }
191  virtual const char *giveInputRecordName() const { return _IFT_DamagedNeighborLayered_Name; }
193 
195  { return new DamagedNeighborLayeredStatus(el, failCrit); }
196 };
197 
198 
199 
201 {
202 public:
204  virtual const char *giveClassName() const { return "FailureModuleElementInterface"; }
206 };
207 
208 
209 
216 {
217 private:
220 
221 public:
223  FractureManager(Domain * domain);
225  ~FractureManager();
226 
227  void setUpdateFlag(bool flag) { this->updateFlag = flag; }
228  bool giveUpdateFlag() { return this->updateFlag; }
229 
230  void evaluateFailureCriterias(TimeStep *tStep); //Loop through all elements and evaluate criteria (if supported)
231 
232 
233  void evaluateYourself(TimeStep *tStep);
234  void updateXFEM(TimeStep *tStep);
235  void updateXFEM(FailureCriteriaStatus *fc, TimeStep *tStep);
236 
237 
238 
241  const char *giveClassName() const { return "FractureManager"; }
242  const char *giveInputRecordName() const { return "FractureManager"; }
243  void clear();
244  Domain *giveDomain() { return this->domain; }
245 
246 
247 
248  std :: vector< FailureCriteria * >criteriaList;
249  //std :: vector< CrackManager* > crackManagers; // Keep track of all cracks - each crack may have several fronts/tips
250  //std :: vector< PropagationLawManager* > propagationLawManagers;
251 };
252 } // end namespace oofem
253 #endif // fracturemanager_h
FailureCriteria * giveFailureCriteria()
#define _IFT_DamagedNeighborLayered_Name
Class and object Domain.
Definition: domain.h:115
FailureCriteriaType
FailureCriteriaType type
Abstract base class for all finite elements.
Definition: element.h:145
This class manages the fracture mechanics part.
std::vector< FailureCriteriaStatus * > list
Class representing the abstraction for input data source.
Definition: datareader.h:50
FractureManager * giveFractureManager()
virtual void computeFailureCriteriaQuantities(FailureCriteriaStatus *fc, TimeStep *tStep)
virtual const char * giveClassName() const
FractureManager * fMan
FailureCriteriaStatus(int number, FailureCriteria *failCrit)
virtual bool evaluateFCQuantities(Element *el, TimeStep *tStep)
virtual const char * giveClassName() const
DamagedNeighborLayeredStatus(Element *el, FailureCriteria *failCrit)
std::vector< FailureCriteria * > criteriaList
DamagedNeighborLayered(int number, FractureManager *fracMan)
void setType(FailureCriteriaType type)
virtual IRResultType initializeFrom(InputRecord *ir)
void setUpdateFlag(bool flag)
FailureCriteriaStatus(Element *el, FailureCriteria *failCrit)
Class representing vector of real numbers.
Definition: floatarray.h:82
const char * giveInputRecordName() const
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
FailureCriteria(int number, FractureManager *fMan)
Class representing the general Input Record.
Definition: inputrecord.h:101
FailureCriteriaType giveType()
virtual FailureCriteriaStatus * CreateStatus(Element *el, FailureCriteria *failCrit) const
virtual int instanciateYourself(DataReader &dr)
Class Interface.
Definition: interface.h:82
const char * giveClassName() const
virtual const char * giveClassName() const
virtual const char * giveClassName() const
virtual const char * giveInputRecordName() const
the oofem namespace is to define a context or scope in which all oofem names are defined.
std::vector< std::vector< FloatArray > > quantities
std::vector< bool > failedFlags
Class representing solution step.
Definition: timestep.h:80

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:28 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011