OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
lsmastermatgrad.C
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 #include "lsmastermatgrad.h"
37 #include "gausspoint.h"
38 #include "floatmatrix.h"
39 #include "floatarray.h"
40 #include "intarray.h"
41 #include "stressvector.h"
42 #include "strainvector.h"
43 #include "mathfem.h"
44 #include "contextioerr.h"
45 #include "datastream.h"
46 #include "classfactory.h"
47 
48 namespace oofem {
49 REGISTER_Material(LargeStrainMasterMaterial);
50 
51 // constructor
53 {
54  slaveMat = 0;
55 }
56 
57 // destructor
59 { }
60 
61 // specifies whether a given material mode is supported by this model
62 int
64 {
65  return mode == _3dMat;
66 }
67 
68 // creates a new material status corresponding to this class
71 {
72  return new LargeStrainMasterMaterialStatus(1, this->giveDomain(), gp, slaveMat);
73 }
74 
75 
76 void
78 //
79 // Returns characteristic material stiffness matrix of the receiver
80 //
81 {
82  OOFEM_ERROR("shouldn't be called");
83 }
84 
85 
86 void
88 {
89  MaterialMode mMode = gp->giveMaterialMode();
90  switch ( mMode ) {
91  case _3dMat:
93  break;
94  default:
95  OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
96  }
97 }
98 
99 void
101 {
102  MaterialMode mMode = gp->giveMaterialMode();
103  switch ( mMode ) {
104  case _3dMat:
105  give3dKappaMatrix(answer, mode, gp, tStep);
106  break;
107  default:
108  OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
109  }
110 }
111 
112 void
114 {
115  MaterialMode mMode = gp->giveMaterialMode();
116  switch ( mMode ) {
117  case _3dMat:
118  give3dGprime(answer, mode, gp, tStep);
119  break;
120  default:
121  OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
122  }
123 }
124 
125 void
127 {
128  MaterialMode mMode = gp->giveMaterialMode();
129  switch ( mMode ) {
130  case _3dMat:
131  giveInternalLength(answer, mode, gp, tStep);
132  break;
133  default:
134  OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
135  }
136 }
137 
138 void
140 {
141  MaterialMode mMode = gp->giveMaterialMode();
142  OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
143 }
144 
145 
146 void
148 {
149  this->initTempStatus(gp);
151  if ( graddpmat == NULL ) {
152  OOFEM_WARNING("material %d has no Structural support", slaveMat);
153  return;
154  }
155 
156  graddpmat->givePDGradMatrix_kk(answer, mode, gp, tStep);
157 }
158 
159 void
161 {
162  LargeStrainMasterMaterialStatus *status = static_cast< LargeStrainMasterMaterialStatus * >( this->giveStatus(gp) );
163  this->initTempStatus(gp);
164  FloatMatrix gPrime;
166  if ( graddpmat == NULL ) {
167  OOFEM_WARNING("material %d has no Structural support", slaveMat);
168  return;
169  }
170 
171  graddpmat->givePDGradMatrix_uk(gPrime, mode, gp, tStep);
172  gPrime.at(4, 1) = 2. * gPrime.at(4, 1);
173  gPrime.at(5, 1) = 2. * gPrime.at(5, 1);
174  gPrime.at(6, 1) = 2. * gPrime.at(6, 1);
175  answer.beProductOf(status->givePmatrix(), gPrime);
176 }
177 
178 
179 void
181 {
182  LargeStrainMasterMaterialStatus *status = static_cast< LargeStrainMasterMaterialStatus * >( this->giveStatus(gp) );
183  this->initTempStatus(gp);
184  FloatMatrix kappaMatrix;
186  if ( graddpmat == NULL ) {
187  OOFEM_WARNING("material %d has no Structural support", slaveMat);
188  return;
189  }
190 
191  graddpmat->givePDGradMatrix_ku(kappaMatrix, mode, gp, tStep);
192  kappaMatrix.at(1, 4) = 2. * kappaMatrix.at(1, 4);
193  kappaMatrix.at(1, 5) = 2. * kappaMatrix.at(1, 5);
194  kappaMatrix.at(1, 6) = 2. * kappaMatrix.at(1, 6);
195  answer.beProductTOf( kappaMatrix, status->givePmatrix() );
196 }
197 
198 
199 
200 void
201 LargeStrainMasterMaterialGrad :: giveFirstPKStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &vF, double nonlocalCumulatedStrain, TimeStep *tStep)
202 {
203  LargeStrainMasterMaterialStatus *status = static_cast< LargeStrainMasterMaterialStatus * >( this->giveStatus(gp) );
204  this->initTempStatus(gp);
205  MaterialMode mode = gp->giveMaterialMode();
206  if ( mode == _3dMat ) {
207  Material *mat;
208  StructuralMaterial *sMat;
209  mat = domain->giveMaterial(slaveMat);
210  sMat = dynamic_cast< StructuralMaterial * >(mat);
211  if ( sMat == NULL ) {
212  OOFEM_WARNING("material %d has no Structural support", slaveMat);
213  return;
214  }
215 
217  if ( !dpmat ) {
218  OOFEM_ERROR("Material doesn't implement the required DpGrad interface!");
219  }
220 
221 
222  double lambda1, lambda2, lambda3, E1, E2, E3;
223  FloatArray eVals, SethHillStrainVector, stressVector, stressM;
224  FloatMatrix F, C, eVecs, SethHillStrain;
225  FloatMatrix L1, L2, T;
226  //store of deformation gradient into 3x3 matrix
227  F.beMatrixForm(vF);
228  //compute right Cauchy-Green tensor(C), its eigenvalues and eigenvectors
229  C.beTProductOf(F, F);
230  // compute eigen values and eigen vectors of C
231  C.jaco_(eVals, eVecs, 40);
232  // compute Seth - Hill's strain measure, it depends on mParameter
233  lambda1 = eVals.at(1);
234  lambda2 = eVals.at(2);
235  lambda3 = eVals.at(3);
236  if ( m == 0 ) {
237  E1 = 1. / 2. * log(lambda1);
238  E2 = 1. / 2. * log(lambda2);
239  E3 = 1. / 2. * log(lambda3);
240  } else {
241  E1 = 1. / ( 2. * m ) * ( pow(lambda1, m) - 1. );
242  E2 = 1. / ( 2. * m ) * ( pow(lambda2, m) - 1. );
243  E3 = 1. / ( 2. * m ) * ( pow(lambda3, m) - 1. );
244  }
245 
246  SethHillStrain.resize(3, 3);
247  for ( int i = 1; i < 4; i++ ) {
248  for ( int j = 1; j < 4; j++ ) {
249  SethHillStrain.at(i, j) = E1 * eVecs.at(i, 1) * eVecs.at(j, 1) + E2 *eVecs.at(i, 2) * eVecs.at(j, 2) + E3 *eVecs.at(i, 3) * eVecs.at(j, 3);
250  }
251  }
252 
253 
254 
255  SethHillStrainVector.beSymVectorFormOfStrain(SethHillStrain);
256  dpmat->giveRealStressVectorGrad(stressVector, answer2, gp, SethHillStrainVector, nonlocalCumulatedStrain, tStep);
257  this->constructTransformationMatrix(T, eVecs);
258 
259  stressVector.at(4) = 2 * stressVector.at(4);
260  stressVector.at(5) = 2 * stressVector.at(5);
261  stressVector.at(6) = 2 * stressVector.at(6);
262 
263 
264  stressM.beProductOf(T, stressVector);
265  stressM.at(4) = 1. / 2. * stressM.at(4);
266  stressM.at(5) = 1. / 2. * stressM.at(5);
267  stressM.at(6) = 1. / 2. * stressM.at(6);
268 
269  this->constructL1L2TransformationMatrices(L1, L2, eVals, stressM, E1, E2, E3);
270 
271  FloatMatrix junk, P, TL;
272  FloatArray secondPK;
273  junk.beProductOf(L1, T);
274  P.beTProductOf(T, junk);
275  //transformation of the stress to the 2PK stress and then to 1PK
276  stressVector.at(4) = 0.5 * stressVector.at(4);
277  stressVector.at(5) = 0.5 * stressVector.at(5);
278  stressVector.at(6) = 0.5 * stressVector.at(6);
279  secondPK.beProductOf(P, stressVector);
280  answer1.beProductOf(F, secondPK); // P = F*S
281  junk.zero();
282  junk.beProductOf(L2, T);
283  TL.beTProductOf(T, junk);
284 
285  status->setPmatrix(P);
286  status->setTLmatrix(TL);
287  status->letTempStressVectorBe(answer1);
288  } else {
289  OOFEM_ERROR("Unknown material mode.");
290  }
291 }
292 
293 
296 {
298 }
299 } // end namespace oofem
virtual void givePDGradMatrix_ku(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Left lower block.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
virtual void giveFirstPKStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalDamageDrivningVariable, TimeStep *tStep)
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
Class and object Domain.
Definition: domain.h:115
LargeStrainMasterMaterialGrad(int n, Domain *d)
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
virtual void givePDGradMatrix_LD(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Stress-based averaging.
double m
Specifies the strain tensor.
Definition: lsmastermat.h:72
Total Lagrange.
Definition: fmode.h:44
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
void give3dGprime(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: lsmastermat.C:63
virtual void givePDGradMatrix_ku(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Left lower block.
void giveInternalLength(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
MatResponseMode
Describes the character of characteristic material matrix.
virtual void givePDGradMatrix_uk(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Right upper block.
void beMatrixForm(const FloatArray &aArray)
Definition: floatmatrix.C:1657
bool jaco_(FloatArray &eval, FloatMatrix &v, int nf)
Computes eigenvalues and eigenvectors of receiver (must be symmetric) The receiver is preserved...
Definition: floatmatrix.C:1912
const char * __MaterialModeToString(MaterialMode _value)
Definition: cltypes.C:314
void setTLmatrix(const FloatMatrix &values)
Definition: lsmastermat.h:126
virtual int hasMaterialModeCapability(MaterialMode mode)
Tests if material supports material mode.
Material * giveMaterial(int n)
Service for accessing particular domain material model.
Definition: domain.C:281
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual void givePDGradMatrix_uk(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Right upper block.
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
Material interface for gradient material models.
virtual void givePDGradMatrix_kk(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Right lower block.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
Abstract base class for all material models.
Definition: material.h:95
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
virtual void giveRealStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalDamageDrivningVariable, TimeStep *tStep)
gradient - based giveRealStressVector
Abstract base class representing a material status information.
Definition: matstatus.h:84
void setPmatrix(const FloatMatrix &values)
Definition: lsmastermat.h:125
virtual void givePDGradMatrix_kk(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Right lower block.
Class representing vector of real numbers.
Definition: floatarray.h:82
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
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
Definition: structuralms.h:135
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
Class representing the general Input Record.
Definition: inputrecord.h:101
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:367
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
Definition: femcmpnn.h:179
Abstract base class for all "structural" constitutive models.
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
Computes the stiffness matrix for giveRealStressVector of receiver in given integration point...
void beProductTOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:397
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
Domain * giveDomain() const
Definition: femcmpnn.h:100
MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
void give3dKappaMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
REGISTER_Material(DummyMaterial)
void beSymVectorFormOfStrain(const FloatMatrix &aMatrix)
Definition: floatarray.C:1014
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:337
the oofem namespace is to define a context or scope in which all oofem names are defined.
void constructTransformationMatrix(FloatMatrix &answer, const FloatMatrix &eigenVectors)
transformation matrices
Definition: lsmastermat.C:156
void constructL1L2TransformationMatrices(FloatMatrix &answer1, FloatMatrix &answer2, const FloatArray &eigenValues, FloatArray &stress, double E1, double E2, double E3)
Definition: lsmastermat.C:204
virtual void initTempStatus(GaussPoint *gp)
Initializes temporary variables stored in integration point status at the beginning of new time step...
Definition: material.C:267
virtual void givePDGradMatrix_uu(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Left upper block.
virtual IRResultType initializeFrom(InputRecord *ir)
Class representing integration point in finite element program.
Definition: gausspoint.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
int slaveMat
&#39;slave&#39; material model number.
Definition: lsmastermat.h:70
Class representing solution step.
Definition: timestep.h:80
Large strain master material.
Definition: lsmastermat.h:63

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