OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
hyperelasticmaterial.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 "hyperelasticmaterial.h"
36 #include "floatmatrix.h"
37 #include "floatarray.h"
38 #include "classfactory.h"
39 
40 namespace oofem {
41 REGISTER_Material(HyperElasticMaterial);
42 
44 { }
45 
46 
47 void
49 {
50  double J2, c11, c22, c33, c12, c13, c23, A, B;
51  FloatMatrix C(3, 3);
52  FloatMatrix invC;
53 
54  StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
55 
56  C.at(1, 1) = 1. + 2. * status->giveTempStrainVector().at(1);
57  C.at(2, 2) = 1. + 2. * status->giveTempStrainVector().at(2);
58  C.at(3, 3) = 1. + 2. * status->giveTempStrainVector().at(3);
59  C.at(2, 3) = C.at(3, 2) = status->giveTempStrainVector().at(4);
60  C.at(1, 3) = C.at(3, 1) = status->giveTempStrainVector().at(5);
61  C.at(1, 2) = C.at(2, 1) = status->giveTempStrainVector().at(6);
62 
63  invC.beInverseOf(C);
64  J2 = C.giveDeterminant();
65 
66  c11 = invC.at(1, 1);
67  c22 = invC.at(2, 2);
68  c33 = invC.at(3, 3);
69  c12 = invC.at(1, 2);
70  c13 = invC.at(1, 3);
71  c23 = invC.at(2, 3);
72 
73  A = ( K - 2. / 3. * G ) * J2;
74  B = -( K - 2. / 3. * G ) * ( J2 - 1. ) + 2. * G;
75 
76  answer.resize(6, 6);
77 
78  answer.at(1, 1) = ( A + B ) * c11 * c11;
79  answer.at(2, 2) = ( A + B ) * c22 * c22;
80  answer.at(3, 3) = ( A + B ) * c33 * c33;
81  answer.at(4, 4) = A * c23 * c23 + B / 2. * ( c22 * c33 + c23 * c23 );
82  answer.at(5, 5) = A * c13 * c13 + B / 2. * ( c11 * c33 + c13 * c13 );
83  answer.at(6, 6) = A * c12 * c12 + B / 2. * ( c11 * c22 + c12 * c12 );
84  answer.at(1, 2) = answer.at(2, 1) = A * c11 * c22 + B * c12 * c12;
85  answer.at(1, 3) = answer.at(3, 1) = A * c11 * c33 + B * c13 * c13;
86  answer.at(1, 4) = answer.at(4, 1) = A * c11 * c23 + B * c12 * c13;
87  answer.at(1, 5) = answer.at(5, 1) = A * c11 * c13 + B * c11 * c13;
88  answer.at(1, 6) = answer.at(6, 1) = A * c11 * c12 + B * c11 * c12;
89  answer.at(2, 3) = answer.at(3, 2) = A * c22 * c33 + B * c23 * c23;
90  answer.at(2, 4) = answer.at(4, 2) = A * c22 * c23 + B * c22 * c23;
91  answer.at(2, 5) = answer.at(5, 2) = A * c22 * c13 + B * c12 * c23;
92  answer.at(2, 6) = answer.at(6, 2) = A * c22 * c12 + B * c22 * c12;
93  answer.at(3, 4) = answer.at(4, 3) = A * c33 * c23 + B * c33 * c23;
94  answer.at(3, 5) = answer.at(5, 3) = A * c33 * c13 + B * c33 * c13;
95  answer.at(3, 6) = answer.at(6, 3) = A * c33 * c12 + B * c13 * c23;
96  answer.at(4, 5) = answer.at(5, 4) = A * c23 * c13 + B / 2. * ( c12 * c33 + c13 * c23 );
97  answer.at(4, 6) = answer.at(6, 4) = A * c23 * c12 + B / 2. * ( c12 * c23 + c22 * c13 );
98  answer.at(5, 6) = answer.at(6, 5) = A * c13 * c12 + B / 2. * ( c11 * c23 + c12 * c13 );
99 }
100 
101 
102 void
104 {
105  double J2;
106  FloatMatrix C(3, 3);
107  FloatMatrix invC;
108  FloatArray strainVector;
109 
110  StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
111  this->giveStressDependentPartOfStrainVector_3d(strainVector, gp,
112  totalStrain,
113  tStep, VM_Total);
114 
115  C.at(1, 1) = 1. + 2. * strainVector.at(1);
116  C.at(2, 2) = 1. + 2. * strainVector.at(2);
117  C.at(3, 3) = 1. + 2. * strainVector.at(3);
118  C.at(1, 2) = C.at(2, 1) = strainVector.at(6);
119  C.at(1, 3) = C.at(3, 1) = strainVector.at(5);
120  C.at(2, 3) = C.at(3, 2) = strainVector.at(4);
121  invC.beInverseOf(C);
122  J2 = C.giveDeterminant();
123 
124  answer.resize(6);
125  double aux = ( K - 2. / 3. * G ) * ( J2 - 1. ) / 2. - G;
126  answer.at(1) = aux * invC.at(1, 1) + G;
127  answer.at(2) = aux * invC.at(2, 2) + G;
128  answer.at(3) = aux * invC.at(3, 3) + G;
129  answer.at(4) = aux * invC.at(2, 3);
130  answer.at(5) = aux * invC.at(1, 3);
131  answer.at(6) = aux * invC.at(1, 2);
132 
133  // update gp
134  status->letTempStrainVectorBe(totalStrain);
135  status->letTempStressVectorBe(answer);
136 }
137 
138 
141 {
142  return new StructuralMaterialStatus(1, this->giveDomain(), gp);
143 }
144 
145 
148 {
149  IRResultType result; // Required by IR_GIVE_FIELD macro
150 
153 
155 }
156 
157 } // end namespace oofem
double giveDeterminant() const
Returns the trace (sum of diagonal components) of the receiver.
Definition: floatmatrix.C:1408
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
Definition: structuralms.h:137
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
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
This class implements a structural material status information.
Definition: structuralms.h:65
#define _IFT_HyperElasticMaterial_k
MatResponseMode
Describes the character of characteristic material matrix.
virtual void giveRealStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Default implementation relies on giveRealStressVector for second Piola-Kirchoff stress.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
HyperElasticMaterial(int n, Domain *d)
void giveStressDependentPartOfStrainVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode)
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver&#39;s temporary strain vector.
Definition: structuralms.h:115
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
Abstract base class representing a material status information.
Definition: matstatus.h:84
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
#define _IFT_HyperElasticMaterial_g
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
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 ...
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
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
Abstract base class for all "structural" constitutive models.
Domain * giveDomain() const
Definition: femcmpnn.h:100
REGISTER_Material(DummyMaterial)
the oofem namespace is to define a context or scope in which all oofem names are defined.
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
Definition: floatmatrix.C:835
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.

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