OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
mdm.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 mdm_h
36 #define mdm_h
37 
42 #define MDM_USE_MMAClosestIPTransfer
43 //#define MDM_USE_MMAShapeFunctProjection
44 //#define MDM_USE_MMALeastSquareProjection
45 
46 
47 // Allows to select different mapping algorithms
48 #define MDM_MAPPING_DEBUG 1
49 
50 #include "microplanematerial.h"
52 #include "matconst.h"
53 #include "../sm/Materials/structuralms.h"
55 #include "mmaclosestiptransfer.h"
56 
57 #ifdef MDM_MAPPING_DEBUG
58  #include "mmashapefunctprojection.h"
60 
61 #else
62 
63  #ifdef MDM_USE_MMAShapeFunctProjection
64  #include "mmashapefunctprojection.h"
65  #endif
66  #ifdef MDM_USE_MMALeastSquareProjection
68  #endif
69 #endif
70 
73 
75 
76 #define _IFT_MDM_Name "mdm"
77 #define _IFT_MDM_talpha "talpha"
78 #define _IFT_MDM_parmd "parmd"
79 #define _IFT_MDM_nonloc "nonloc"
80 #define _IFT_MDM_r "r"
81 #define _IFT_MDM_efp "efp"
82 #define _IFT_MDM_ep "ep"
83 #define _IFT_MDM_gf "gf"
84 #define _IFT_MDM_ft "ft"
85 #define _IFT_MDM_formulation "formulation"
86 #define _IFT_MDM_mode "mode"
87 #define _IFT_MDM_mapper "mapper"
88 #define _IFT_MDM_sourceRegionSet "sourceregset"
89 
90 
91 namespace oofem {
92 class Microplane;
93 
98 {
99 protected:
107 
108 public:
109  MDMStatus(int n, int nsd, int nmplanes, Domain * d, GaussPoint * g);
110  virtual ~MDMStatus();
111 
112  void setTempDamageTensorEigenVals(FloatArray src) { tempDamageTensorEigenValues = std :: move(src); }
113  void setTempDamageTensorEigenVec(FloatMatrix src) { tempDamageTensorEigenVectors = std :: move(src); }
118 
119  double giveMicroplaneTempDamage(int m) { return PsiTemp.at(m); }
120  double giveMicroplaneDamage(int m) { return Psi.at(m); }
121  void setMicroplaneTempDamage(int m, double val) { PsiTemp.at(m) = val; }
123  void setMicroplaneTempDamageValues(FloatArray src) { PsiTemp = std :: move(src); }
124 
127  void setTempDamageTensor(FloatMatrix src) { DamageTensorTemp = std :: move(src); }
128  void setLocalDamageTensorForAverage(FloatMatrix src) { localDamageTensor = std :: move(src); }
131 
132 
133  // definition
134  virtual const char *giveClassName() const { return "MDMStatus"; }
135 
136  virtual void printOutputAt(FILE *file, TimeStep *tStep);
137 
138  virtual void initTempStatus();
139  virtual void updateYourself(TimeStep *tStep);
140 
141  virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj = NULL);
142  virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj = NULL);
143 
155 };
156 
157 
162 {
163 public:
164  enum MDMFormulatrionType { COMPLIANCE_DAMAGE, STIFFNESS_DAMAGE };
165  enum MDMModeType { mdm_3d, mdm_2d };
166 
167 protected:
168  int ndc;
169  int nsd;
170  int type_dam;
172 
174  double mdm_Ep;
176  double mdm_Efp;
177  double ParMd;
179 
181  double Gf;
183  double Ft;
184 
187 
190 
192  int nonlocal;
194  double R;
195 
198 
199 #ifdef MDM_MAPPING_DEBUG
200  static MMAShapeFunctProjection mapperSFT;
203 
204  // determines the mapping algorithm to be used
205  enum MDMMapperType { mdm_cpt=0, mdm_sft=1, mdm_lst=2 };
207 #else
208 
209  #ifdef MDM_USE_MMAClosestIPTransfer
210  static MMAClosestIPTransfer mapper;
212  #endif
213  #ifdef MDM_USE_MMAShapeFunctProjection
214  static MMAShapeFunctProjection mapper;
216  #endif
217  #ifdef MDM_USE_MMALeastSquareProjection
218  static MMALeastSquareProjection mapper;
220  #endif
221 #endif
222 
225 
226 public:
233  {
234  linearElasticMaterial = NULL;
235  nonlocal = 0;
236  type_dam = 0;
237  type_soft = 0;
238  mdm_Ep = mdm_Efp = -1.0;
239  sourceElemSet = NULL;
240  }
242  virtual ~MDM() {
243  if ( linearElasticMaterial ) {
244  delete linearElasticMaterial;
245  }
246  if ( sourceElemSet ) {
247  delete sourceElemSet;
248  }
249  }
250 
251  virtual int hasMaterialModeCapability(MaterialMode mode);
252 
253  virtual void giveRealStressVector(FloatArray &answer, GaussPoint *gp,
254  const FloatArray &reducedStrain, TimeStep *tStep);
255 
256  virtual void giveRealStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
257  { this->giveRealStressVector(answer, gp, reducedE, tStep); }
258  virtual void giveRealStressVector_PlaneStrain(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
259  { this->giveRealStressVector(answer, gp, reducedE, tStep); }
260  virtual void giveRealStressVector_PlaneStress(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
261  { this->giveRealStressVector(answer, gp, reducedE, tStep); }
262 
263  virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer,
264  MatResponseMode mode,
265  GaussPoint *gp,
266  TimeStep *tStep);
267 
268 
269  virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep);
270 
271  virtual void giveThermalDilatationVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep);
272 
274  virtual void giveInputRecord(DynamicInputRecord &input);
275 
276  // identification and auxiliary functions
277  virtual const char *giveInputRecordName() const { return _IFT_MDM_Name; }
278  virtual const char *giveClassName() const { return "MDM"; }
279 
280  virtual void giveRealMicroplaneStressVector(FloatArray &answer, Microplane *mplane,
281  const FloatArray &strain, TimeStep *tStep) { }
282 
283  virtual void initializeData(int numberOfMicroplanes);
284 
285  virtual void updateBeforeNonlocAverage(const FloatArray &strainVector, GaussPoint *gp, TimeStep *tStep);
286 
287  virtual double computeWeightFunction(const FloatArray &src, const FloatArray &coord);
288 
289  virtual int hasBoundedSupport() { return 1; }
293  virtual void giveSupportRadius(double &radius) { radius = this->R; }
294 
296 
297  virtual int MMI_map(GaussPoint *gp, Domain *oldd, TimeStep *tStep);
298  virtual int MMI_update(GaussPoint *gp, TimeStep *tStep, FloatArray *estrain = NULL);
299  virtual int MMI_finish(TimeStep *tStep);
300 
301  virtual int packUnknowns(DataStream &buff, TimeStep *tStep, GaussPoint *ip);
302  virtual int unpackAndUpdateUnknowns(DataStream &buff, TimeStep *tStep, GaussPoint *ip);
303  virtual int estimatePackSize(DataStream &buff, GaussPoint *ip);
304  virtual double predictRelativeComputationalCost(GaussPoint *gp);
305  virtual double predictRelativeRedistributionCost(GaussPoint *gp) { return 1.0; }
306 
307  virtual MaterialStatus *CreateStatus(GaussPoint *gp) const;
308 
309 protected:
311  StructuralMaterial *giveLinearElasticMaterial() { return linearElasticMaterial; }
312 
314  { return NULL; }
315  void computeDamageTensor(FloatMatrix &tempDamageTensor, const FloatArray &totalStrain,
316  GaussPoint *gp, TimeStep *tStep);
317  void computeLocalDamageTensor(FloatMatrix &tempDamageTensor, const FloatArray &totalStrain,
318  GaussPoint *gp, TimeStep *tStep);
319  double computeDamageOnPlane(GaussPoint *gp, Microplane *mplane, const FloatArray &strain);
320  void computePDC(FloatMatrix &tempDamageTensor, FloatArray &tempDamageTensorEigenVals,
321  FloatMatrix &tempDamageTensorEigenVec);
322  void transformStrainToPDC(FloatArray &answer, FloatArray &strain,
323  FloatMatrix &t, GaussPoint *gp);
324  void applyDamageTranformation(FloatArray &strainPDC, const FloatArray &tempDamageTensorEigenVals);
325  void transformStressFromPDC(FloatArray &answer, const FloatArray &stressPDC, const FloatMatrix &t, GaussPoint *gp);
326  void computeEffectiveStress(FloatArray &stressPDC, const FloatArray &strainPDC,
327  GaussPoint *gp, TimeStep *tStep);
328  void giveMaterialStiffnessMatrix(FloatMatrix &answer,
329  MatResponseMode mode, GaussPoint *gp,
330  TimeStep *tStep);
331  void applyDamageToStiffness(FloatMatrix &d, GaussPoint *gp);
332  void transformStiffnessfromPDC(FloatMatrix &de, const FloatMatrix &t);
333 
334  virtual void givePlaneStressStiffMtrx(FloatMatrix &answer, MatResponseMode mmode,
335  GaussPoint *gp,
336  TimeStep *tStep);
337 
338  virtual void givePlaneStrainStiffMtrx(FloatMatrix &answer,
339  MatResponseMode mmode, GaussPoint *gp,
340  TimeStep *tStep);
341 
342  void rotateTensor4(FloatMatrix &Dlocal, const FloatMatrix &t);
343  void formTransformationMatrix(FloatMatrix &answer, const FloatMatrix &t, int n);
344 
345  //double giveParameterEfp(const FloatArray &reducedStrain, GaussPoint *gp);
346  void giveRawMDMParameters(double &Efp, double &Ep, const FloatArray &reducedStrain, GaussPoint *gp);
347 };
348 } // end namespace oofem
349 #endif // mdm_h
double giveMicroplaneTempDamage(int m)
Definition: mdm.h:119
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
Abstract base class for all nonlocal structural materials.
The class implements the transfer of state variables based on Least square fit over old mesh integrat...
virtual double predictRelativeRedistributionCost(GaussPoint *gp)
Returns the relative redistribution cost of the receiver.
Definition: mdm.h:305
Implementation of microplane damage material (According to M.Jirasek).
Definition: mdm.h:161
int ndc
Number of damage components.
Definition: mdm.h:168
virtual const char * giveClassName() const
Definition: mdm.h:134
MDMMapperType mapperType
Definition: mdm.h:206
double mdm_Ep
Parameter controlling the elastic limit.
Definition: mdm.h:174
GaussPoint * gp
Associated integration point.
Class and object Domain.
Definition: domain.h:115
The class implements the closest integration point transfer of state variables.
MDMFormulatrionType
Definition: mdm.h:164
virtual void giveRealMicroplaneStressVector(FloatArray &answer, Microplane *mplane, const FloatArray &strain, TimeStep *tStep)
Computes real stress vector on given microplane (the meaning of values depends on particular implemen...
Definition: mdm.h:280
MDMMapperType
Definition: mdm.h:205
double ParMd
(m/E*Ep)
Definition: mdm.h:177
virtual const char * giveClassName() const
Definition: mdm.h:278
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
Defines several material constant (respective their representative number).
virtual void giveRealStressVector_PlaneStrain(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector_3d.
Definition: mdm.h:258
double Gf
Fracture energy (necessary to determine Ep and Efp if not given).
Definition: mdm.h:181
virtual ~MDMStatus()
Definition: mdm.C:1395
FloatMatrix damageTensorEigenVectors
Definition: mdm.h:106
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
The class representing the general material model adaptive mapping interface.
This class implements a structural material status information.
Definition: structuralms.h:65
const FloatMatrix & giveTempDamageTensorEigenVec()
Definition: mdm.h:116
void setTempDamageTensor(FloatMatrix src)
Definition: mdm.h:127
MDM(int n, Domain *d)
Constructor.
Definition: mdm.h:232
void setMicroplaneTempDamageValues(FloatArray src)
Definition: mdm.h:123
int type_dam
Definition: mdm.h:170
Material status class MDMStatus associated to MDM matarial.
Definition: mdm.h:97
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: mdm.C:1468
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: femcmpnn.C:77
MatResponseMode
Describes the character of characteristic material matrix.
void setLocalDamageTensorForAverage(FloatMatrix src)
Definition: mdm.h:128
FloatMatrix tempDamageTensorEigenVectors
Definition: mdm.h:106
FloatArray tempDamageTensorEigenValues
Principal damage directions.
Definition: mdm.h:105
const FloatArray & giveDamageTensorEigenVals()
Definition: mdm.h:115
StructuralMaterial * giveLinearElasticMaterial()
Returns reference to undamaged (bulk) material.
Definition: mdm.h:311
virtual void giveRealStressVector_PlaneStress(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector_StressControl.
Definition: mdm.h:260
StructuralMaterial * linearElasticMaterial
Reference to bulk (undamaged) material.
Definition: mdm.h:189
double giveMicroplaneDamage(int m)
Definition: mdm.h:120
Abstract base class for all microplane models.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: mdm.C:1457
MDMModeType mdmMode
Definition: mdm.h:186
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: matstatus.h:140
FloatMatrix DamageTensor
Macroscopic damage tensor.
Definition: mdm.h:103
#define _IFT_MDM_Name
Definition: mdm.h:76
const FloatMatrix & giveDamageTensor()
Definition: mdm.h:126
double mdm_Efp
Prescribed value of ef-ep.
Definition: mdm.h:176
virtual void giveRealStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector for second Piola-Kirchoff stress.
Definition: mdm.h:256
Class representing microplane integration point in finite element program.
Definition: microplane.h:74
double R
Interaction radius, related to the nonlocal characteristic length of material.
Definition: mdm.h:194
virtual Interface * giveInterface(InterfaceType it)
Interface requesting service.
Definition: mdm.C:1510
virtual int hasBoundedSupport()
Determines, whether receiver has bounded weighting function (limited support).
Definition: mdm.h:289
Set of elements, boundaries, edges and/or nodes.
Definition: set.h:66
int nsd
Number of spatial dimensions.
Definition: mdm.h:169
MDMModeType
Definition: mdm.h:165
FloatArray Psi
Damage values on individual microplanes.
Definition: mdm.h:101
virtual void giveSupportRadius(double &radius)
Determines the width (radius) of limited support of weighting function.
Definition: mdm.h:293
double Ft
Macroscopic tensile strength (necessary to determine Ep and Efp if not given).
Definition: mdm.h:183
virtual const char * giveInputRecordName() const
Definition: mdm.h:277
Abstract base class representing a material status information.
Definition: matstatus.h:84
const FloatMatrix & giveTempDamageTensor()
Definition: mdm.h:125
Class representing vector of real numbers.
Definition: floatarray.h:82
FloatArray strainVector
Equilibrated strain vector in reduced form.
Definition: structuralms.h:69
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual ~MDM()
Destructor.
Definition: mdm.h:242
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: mdm.C:1428
The class implements the transfer of state variables based on projection using shape functions...
FloatArray PsiTemp
Definition: mdm.h:101
int type_soft
Definition: mdm.h:171
double tempDillatCoeff
Temperature dilatation coeff.
Definition: mdm.h:178
MDMStatus(int n, int nsd, int nmplanes, Domain *d, GaussPoint *g)
Definition: mdm.C:1386
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual MaterialStatus * CreateMicroplaneStatus(GaussPoint *gp)
Definition: mdm.h:313
FloatMatrix DamageTensorTemp
Definition: mdm.h:103
Base class for all nonlocal structural material statuses.
Class Interface.
Definition: interface.h:82
MDMFormulatrionType formulation
Definition: mdm.h:185
const FloatArray & giveTempDamageTensorEigenVals()
Definition: mdm.h:114
Class representing the a dynamic Input Record.
void setTempDamageTensorEigenVals(FloatArray src)
Definition: mdm.h:112
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
Abstract base class for all "structural" constitutive models.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
Definition: mdm.C:1479
InterfaceType
Enumerative type, used to identify interface type.
Definition: interfacetype.h:43
void setTempDamageTensorEigenVec(FloatMatrix src)
Definition: mdm.h:113
FloatMatrix localDamageTensor
Definition: mdm.h:103
Set * sourceElemSet
cached source element set used to map internal variables (adaptivity), created on demand ...
Definition: mdm.h:197
FloatArray damageTensorEigenValues
Definition: mdm.h:105
const FloatArray & giveMicroplaneDamageValues()
Definition: mdm.h:122
const FloatMatrix * giveLocalDamageTensorForAveragePtr()
Definition: mdm.h:130
the oofem namespace is to define a context or scope in which all oofem names are defined.
void setMicroplaneTempDamage(int m, double val)
Definition: mdm.h:121
int nonlocal
Flag indicating local or nonlocal mode.
Definition: mdm.h:192
const FloatMatrix & giveLocalDamageTensorForAverage()
Definition: mdm.h:129
const FloatMatrix & giveDamageTensorEigenVec()
Definition: mdm.h:117
Class representing integration point in finite element program.
Definition: gausspoint.h:93
static MMAClosestIPTransfer mapper2
Mapper used to map stresses in adaptivity.
Definition: mdm.h:224
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: mdm.C:1398
Class representing solution step.
Definition: timestep.h:80
static MMALeastSquareProjection mapperLST
Definition: mdm.h:202

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:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011