Chaste  Release::3.4
CompressibleExponentialLaw.cpp
1 /*
2 
3 Copyright (c) 2005-2016, University of Oxford.
4 All rights reserved.
5 
6 University of Oxford means the Chancellor, Masters and Scholars of the
7 University of Oxford, having an administrative office at Wellington
8 Square, Oxford OX1 2JD, UK.
9 
10 This file is part of Chaste.
11 
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright notice,
15  this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright notice,
17  this list of conditions and the following disclaimer in the documentation
18  and/or other materials provided with the distribution.
19  * Neither the name of the University of Oxford nor the names of its
20  contributors may be used to endorse or promote products derived from this
21  software without specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 */
35 
36 #include "CompressibleExponentialLaw.hpp"
37 
38 template<unsigned DIM>
40 {
41  mA = 0.88; // kPa
42 
43  double bff = 18.5; // dimensionless
44  double bss = 3.58; // dimensionless
45  double bnn = 3.58; // dimensionless
46  double bfn = 2.8; // etc
47  double bfs = 2.8;
48  double bsn = 2.8;
49 
50  mCompressibilityParam = 100.0;
51 
52  mB.resize(DIM);
53  for (unsigned i=0; i<DIM; i++)
54  {
55  mB[i].resize(DIM);
56  }
57 
58  mB[0][0] = bff;
59  mB[0][1] = mB[1][0] = bfs;
60  mB[1][1] = bss;
61 
62  if (DIM > 2)
63  {
64  mB[2][2] = bnn;
65  mB[0][2] = mB[2][0] = bfn;
66  mB[2][1] = mB[1][2] = bsn;
67  }
68 
69  for (unsigned M=0; M<DIM; M++)
70  {
71  for (unsigned N=0; N<DIM; N++)
72  {
73  mIdentity(M,N) = M==N ? 1.0 : 0.0;
74  }
75  }
76 }
77 
78 template<unsigned DIM>
80  c_matrix<double,DIM,DIM>& rInvC,
81  double pressure /* not used */,
82  c_matrix<double,DIM,DIM>& rT,
84  bool computeDTdE)
85 {
86  static c_matrix<double,DIM,DIM> C_transformed;
87  static c_matrix<double,DIM,DIM> invC_transformed;
88 
89  // The material law parameters are set up assuming the fibre direction is (1,0,0)
90  // and sheet direction is (0,1,0), so we have to transform C,inv(C),and T.
91  // Let P be the change-of-basis matrix P = (\mathbf{m}_f, \mathbf{m}_s, \mathbf{m}_n).
92  // The transformed C for the fibre/sheet basis is C* = P^T C P.
93  // We then compute T* = T*(C*), and then compute T = P T* P^T.
94 
95  this->ComputeTransformedDeformationTensor(rC, rInvC, C_transformed, invC_transformed);
96 
97  // Compute T*
98 
99  c_matrix<double,DIM,DIM> E = 0.5*(C_transformed - mIdentity);
100 
101  double QQ = 0;
102  for (unsigned M=0; M<DIM; M++)
103  {
104  for (unsigned N=0; N<DIM; N++)
105  {
106  QQ += mB[M][N]*E(M,N)*E(M,N);
107  }
108  }
109  assert(QQ < 10.0);
110  double multiplier = mA*exp(QQ);
111  rDTdE.Zero();
112 
113  double J = sqrt(Determinant(rC));
114 
115  for (unsigned M=0; M<DIM; M++)
116  {
117  for (unsigned N=0; N<DIM; N++)
118  {
119  rT(M,N) = multiplier*mB[M][N]*E(M,N) + mCompressibilityParam * J*log(J)*invC_transformed(M,N);
120 
121  if (computeDTdE)
122  {
123  for (unsigned P=0; P<DIM; P++)
124  {
125  for (unsigned Q=0; Q<DIM; Q++)
126  {
127  rDTdE(M,N,P,Q) = multiplier * mB[M][N] * (M==P)*(N==Q)
128  + 2*multiplier*mB[M][N]*mB[P][Q]*E(M,N)*E(P,Q)
129  + mCompressibilityParam * (J*log(J) + J) * invC_transformed(M,N) * invC_transformed(P,Q)
130  - mCompressibilityParam * 2*J*log(J) * invC_transformed(M,P) * invC_transformed(Q,N);
131  }
132  }
133  }
134  }
135  }
136 
137  // Now do: T = P T* P^T and dTdE_{MNPQ} = P_{Mm}P_{Nn}P_{Pp}P_{Qq} dT*dE*_{mnpq}
138  this->TransformStressAndStressDerivative(rT, rDTdE, computeDTdE);
139 }
140 
142 // Explicit instantiation
144 
145 template class CompressibleExponentialLaw<2>;
146 template class CompressibleExponentialLaw<3>;
void ComputeStressAndStressDerivative(c_matrix< double, DIM, DIM > &rC, c_matrix< double, DIM, DIM > &rInvC, double pressure, c_matrix< double, DIM, DIM > &rT, FourthOrderTensor< DIM, DIM, DIM, DIM > &rDTdE, bool computeDTdE)
T Determinant(const boost::numeric::ublas::c_matrix< T, 1, 1 > &rM)