LifeV
StructuralConstitutiveLaw.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  * @file
29  * @brief This file contains an abstract class to implement different kinds of materials for structural dynamic problems (St. Venant-Kirchhoff, Neo-Hookean and Exponential materials right now )
30  *
31  * @version 1.0
32  * @date 01-01-2010
33  * @author Paolo Tricerri
34  * @author Gianmarco Mengaldo
35  *
36  * @version 2.0
37  * @date 12-03-2010
38  * @author Paolo Tricerri
39  *
40  * @maintainer Paolo Tricerri <paolo.tricerri@epfl.ch>
41  * @contributor Gianmarco Mengaldo <gianmarco.mengaldo@gmail.com>
42  */
43 
44 #ifndef _STRUCTURALCONSTITUTIVELAW_H_
45 #define _STRUCTURALCONSTITUTIVELAW_H_ 1
46 
47 #include <string>
48 //#include <sstream>
49 #include <iostream>
50 #include <stdexcept>
51 
52 
53 #include <Epetra_Vector.h>
54 #include <EpetraExt_MatrixMatrix.h>
55 #include <Epetra_SerialDenseMatrix.h>
56 
57 
58 #include <lifev/core/array/MatrixEpetra.hpp>
59 #include <lifev/core/array/VectorEpetra.hpp>
60 
61 #include <lifev/structure/fem/AssemblyElementalStructure.hpp>
62 #include <lifev/core/fem/FESpace.hpp>
63 
64 #include <lifev/core/LifeV.hpp>
65 #include <lifev/core/util/Displayer.hpp>
66 
67 #include <lifev/structure/solver/StructuralConstitutiveLawData.hpp>
68 
69 #include <lifev/structure/solver/isotropic/StructuralIsotropicConstitutiveLaw.hpp>
70 
71 #include <lifev/structure/solver/anisotropic/StructuralAnisotropicConstitutiveLaw.hpp>
72 
73 //ET include for assemblings
74 #include <lifev/eta/fem/ETFESpace.hpp>
75 #include <lifev/eta/expression/Integrate.hpp>
76 #include <lifev/eta/expression/Evaluate.hpp>
77 
78 namespace LifeV
79 {
80 /*!
81  \class StructuralConstitutiveLaw
82  \brief
83  This class is an abstract class to define different type of models for the arterial wall.
84  This class has just pure virtual methods. They are implemented in the specific class for one material
85 */
86 
87 template <typename MeshType>
88 class StructuralConstitutiveLaw
89 {
90 public:
91 
92  //!@name Type definitions
93  //@{
94  typedef StructuralConstitutiveLawData data_Type;
95 
96 
97  typedef StructuralIsotropicConstitutiveLaw<MeshType> isotropicLaw_Type;
98  typedef std::shared_ptr<isotropicLaw_Type> isotropicLawPtr_Type;
99 
100  typedef StructuralAnisotropicConstitutiveLaw<MeshType> anisotropicLaw_Type;
101  typedef std::shared_ptr<anisotropicLaw_Type> anisotropicLawPtr_Type;
102 
103  typedef MatrixEpetra<Real> matrix_Type;
104  typedef std::shared_ptr<matrix_Type> matrixPtr_Type;
105  typedef VectorEpetra vector_Type;
106  typedef std::shared_ptr<vector_Type> vectorPtr_Type;
107 
108  typedef typename std::shared_ptr<data_Type> dataPtr_Type;
109  typedef typename std::shared_ptr<const Displayer> displayerPtr_Type;
110 
111  typedef std::vector< typename MeshType::element_Type* > vectorVolumes_Type;
112 
113  typedef std::map< UInt, vectorVolumes_Type> mapMarkerVolumes_Type;
114  typedef std::shared_ptr<mapMarkerVolumes_Type> mapMarkerVolumesPtr_Type;
115 
116  typedef std::vector<UInt> vectorIndexes_Type;
117  typedef std::map< UInt, vectorIndexes_Type> mapMarkerIndexes_Type;
118  typedef std::shared_ptr<mapMarkerIndexes_Type> mapMarkerIndexesPtr_Type;
119 
120 
121  typedef ETFESpace<MeshType, MapEpetra, 3, 3 > ETFESpace_Type;
122  typedef std::shared_ptr<ETFESpace_Type> ETFESpacePtr_Type;
123 
124  typedef FESpace< MeshType, MapEpetra > FESpace_Type;
125  typedef std::shared_ptr<FESpace_Type> FESpacePtr_Type;
126 
127  //Vector for vector parameters
128  typedef std::vector<std::vector<Real> > vectorsParameters_Type;
129  typedef std::shared_ptr<vectorsParameters_Type> vectorsParametersPtr_Type;
130  //@}
131 
132 
133 
134  //! @name Constructor & Deconstructor
135  //@{
136 
137  StructuralConstitutiveLaw();
138 
139  virtual ~StructuralConstitutiveLaw() {}
140 
141  //@}
142 
143 
144 
145  //!@name Methods
146  //@{
147 
148  //! Setup the created object of the class StructuralConstitutiveLaw
149  /*!
150  \param dFespace: the FiniteElement Space
151  \param monolithicMap: the MapEpetra
152  \param offset: the offset parameter used assembling the matrices
153  */
154 
155  void setup ( const FESpacePtr_Type& dFESpace,
156  const ETFESpacePtr_Type& ETFESpace,
157  const std::shared_ptr<const MapEpetra>& monolithicMap,
158  const UInt offset, const dataPtr_Type& dataMaterial,
159  const displayerPtr_Type& displayer );
160 
161 
162  //! Computes the linear part of the stiffness matrix StructuralSolver::buildSystem
163  /*!
164  \param dataMaterial the class with Material properties data
165  */
166  void computeLinearStiff ( dataPtr_Type& dataMaterial,
167  const mapMarkerVolumesPtr_Type /*mapsMarkerVolumes*/,
168  const mapMarkerIndexesPtr_Type /*mapsMarkerIndexes*/ );
169 
170  //! Updates the Jacobian matrix in StructuralSolver::updateJacobian
171  /*!
172  \param disp: solution at the k-th iteration of NonLinearRichardson Method
173  \param dataMaterial: a pointer to the dataType member in StructuralSolver class to get the
174  material coefficients (e.g. Young modulus, Poisson ratio..)
175  \param displayer: a pointer to the Dysplaier member in the StructuralSolver class
176  */
177  void updateJacobianMatrix ( const vector_Type& disp, const dataPtr_Type& dataMaterial,
178  const mapMarkerVolumesPtr_Type mapsMarkerVolumes,
179  const mapMarkerIndexesPtr_Type mapsMarkerIndexes,
180  const displayerPtr_Type& displayer );
181 
182  //! Computes the new Stiffness matrix in StructuralSolver given a certain displacement field.
183  //! This function is used both in StructuralSolver::evalResidual and in
184  //! StructuralSolver::updateSystem since the matrix is the expression of the matrix is the same.
185  //!This is virtual and not pure virtual since in the linear St. Venant-Kirchhoff law it is not needed.
186  /*!
187  \param sol: the solution vector
188  \param factor: scaling factor used in FSI
189  \param dataMaterial: a pointer to the dataType member in StructuralSolver class to get the
190  material coefficients (e.g. Young modulus, Poisson ratio..)
191  \param displayer: a pointer to the Dysplaier member in the StructuralSolver class
192  */
193  void computeStiffness ( const vector_Type& sol, const UInt iter, Real factor, const dataPtr_Type& dataMaterial,
194  const mapMarkerVolumesPtr_Type mapsMarkerVolumes,
195  const mapMarkerIndexesPtr_Type mapsMarkerIndexes,
196  const displayerPtr_Type& displayer );
197 
198 
199  //! Output of the class
200  /*!
201  \param fileNamelinearStiff the filename where to apply the spy method for the linear part of the Stiffness matrix
202  \param fileNameStiff the filename where to apply the spy method for the Stiffness matrix
203  */
204  void showMe ( std::string const& fileNameStiff, std::string const& fileNameJacobian );
205 
206  //! Compute the First Piola Kirchhoff Tensor
207  /*!
208  \param firstPiola Epetra_SerialDenseMatrix that has to be filled
209  \param tensorF Epetra_SerialDenseMatrix the deformation gradient
210  \param cofactorF Epetra_SerialDenseMatrix cofactor of F
211  \param invariants std::vector with the invariants of C and the detF
212  \param material UInt number to get the material parameteres form the VenantElasticData class
213  */
214  void computeLocalFirstPiolaKirchhoffTensor ( Epetra_SerialDenseMatrix& firstPiola,
215  const Epetra_SerialDenseMatrix& tensorF,
216  const Epetra_SerialDenseMatrix& cofactorF,
217  const std::vector<Real>& invariants,
218  const UInt material);
219 
220  //! Compute the First Piola Kirchhoff Tensor
221  /*!
222  \param disp the displacement field from which we compute the fisrt piola-Kirchhoff tensor
223  \param sigma_1 the first column of the Cauchy stress tensor
224  \param sigma_2 the second column of the Cauchy stress tensor
225  \param sigma_3 the third column of the Cauchy stress tensor
226  */
227  void computeCauchyStressTensor ( const vectorPtr_Type disp,
228  const QuadratureRule& evalQuad,
229  vectorPtr_Type sigma_1,
230  vectorPtr_Type sigma_2,
231  vectorPtr_Type sigma_3);
232 
233 
234 
235  //! @name Set Methods
236  //@{
237 
238  //No set Methods
239 
240  //@}
241 
242 
243  //! @name Get Methods
244  //@{
245 
246  //! Getters
247  //! Get the Epetramap
248  MapEpetra const& map() const
249  {
250  return *M_localMap;
251  }
252 
253  //! Get the FESpace object
254  FESpace_Type& dFESpace()
255  {
256  return *M_dispFESpace;
257  }
258 
259  //! Get the FESpace object
260  ETFESpace_Type& dETFESpace()
261  {
262  return *M_dispETFESpace;
263  }
264 
265  //! Get the Stiffness matrix
266  matrixPtr_Type const jacobian() const
267  {
268  return M_jacobian;
269  }
270 
271  isotropicLawPtr_Type isotropicLaw( ) const
272  {
273  return M_isotropicLaw;
274  }
275 
276  anisotropicLawPtr_Type anisotropicLaw( ) const
277  {
278  return M_anisotropicLaw;
279  }
280 
281  //! Get the Stiffness matrix (linear case)
282  const matrixPtr_Type stiffMatrix();
283 
284  //! Get the Stiffness vector (nonlinear case)
285  const vectorPtr_Type stiffVector();
286 
287  void apply ( const vector_Type& sol, vector_Type& res,
288  const mapMarkerVolumesPtr_Type mapsMarkerVolumes,
289  const mapMarkerIndexesPtr_Type mapsMarkerIndexes);
290 
291  //@}
292 
293 protected:
294 
295  //!Protected Members
296 
297  FESpacePtr_Type M_dispFESpace;
298 
299  ETFESpacePtr_Type M_dispETFESpace;
300 
301  std::shared_ptr<const MapEpetra> M_localMap;
302 
303  //! Matrix jacobian
304  matrixPtr_Type M_jacobian;
305 
306  //! The Offset parameter
307  UInt M_offset;
308 
309  dataPtr_Type M_dataMaterial;
310 
311  isotropicLawPtr_Type M_isotropicLaw;
312 
313  anisotropicLawPtr_Type M_anisotropicLaw;
314 
315  displayerPtr_Type M_displayer;
316 
317  matrixPtr_Type M_matrixStiffness;
318 
319  vectorPtr_Type M_vectorStiffness;
320 };
321 
322 //=====================================
323 // Constructor
324 //=====================================
325 
326 template <typename MeshType>
327 StructuralConstitutiveLaw<MeshType>::StructuralConstitutiveLaw( ) :
328  M_dispFESpace ( ),
329  M_dispETFESpace ( ),
330  M_localMap ( ),
331  M_jacobian ( ),
332  M_offset ( 0 ),
333  M_dataMaterial ( ),
334  M_isotropicLaw ( ),
335  M_anisotropicLaw ( ),
336  M_displayer ( ),
337  M_matrixStiffness ( ),
338  M_vectorStiffness ( )
339 {
340  // std::cout << "I am in the constructor of StructuralConstitutiveLaw" << std::endl;
341 }
342 
343 template <typename MeshType>
344 void
345 StructuralConstitutiveLaw<MeshType>::setup (const FESpacePtr_Type& dFESpace,
346  const ETFESpacePtr_Type& dETFESpace,
347  const std::shared_ptr<const MapEpetra>& monolithicMap,
348  const UInt offset, const dataPtr_Type& dataMaterial, const displayerPtr_Type& displayer
349  )
350 {
351  M_dispFESpace = dFESpace;
352  M_dispETFESpace = dETFESpace;
353  M_localMap = monolithicMap;
354  M_jacobian.reset (new matrix_Type (*M_localMap) );
355  M_offset = offset;
356  M_dataMaterial = dataMaterial;
357 
358  // Creation of the abstract classes for the isotropic and anisotropic laws
359  M_isotropicLaw.reset ( isotropicLaw_Type::StructureIsotropicMaterialFactory::instance().createObject ( M_dataMaterial->solidTypeIsotropic() ) );
360 
361  if( !M_dataMaterial->constitutiveLaw().compare("anisotropic") )
362  {
363  M_anisotropicLaw.reset ( anisotropicLaw_Type::StructureAnisotropicMaterialFactory::instance().createObject ( M_dataMaterial->solidTypeAnisotropic() ) );
364  }
365 
366 
367  M_displayer = displayer;
368 
369  M_matrixStiffness.reset ( new matrix_Type(*M_localMap) );
370  M_vectorStiffness.reset ( new vector_Type(*M_localMap) );
371 
372  // Setting the isotropic and anisotropic part
373  M_isotropicLaw->setup( dFESpace, dETFESpace, monolithicMap, offset, M_dataMaterial );
374  if( !M_dataMaterial->constitutiveLaw().compare("anisotropic") )
375  {
376  M_anisotropicLaw->setup( dFESpace, dETFESpace, monolithicMap, offset, M_dataMaterial );
377  }
378 
379 }
380 
381 template <typename MeshType>
382 void StructuralConstitutiveLaw<MeshType>::computeLinearStiff (dataPtr_Type& dataMaterial,
383  const mapMarkerVolumesPtr_Type mapsMarkerVolumes,
384  const mapMarkerIndexesPtr_Type mapsMarkerIndexes)
385 {
386 
387  M_isotropicLaw->computeLinearStiff(dataMaterial, mapsMarkerVolumes, mapsMarkerIndexes);
388 
389  // The anisotropic part has no need for such a method since it is for sure nonlinear.
390 
391 }
392 
393 
394 template <typename MeshType>
395 void StructuralConstitutiveLaw<MeshType>::updateJacobianMatrix (const vector_Type& disp,
396  const dataPtr_Type& dataMaterial,
397  const mapMarkerVolumesPtr_Type mapsMarkerVolumes,
398  const mapMarkerIndexesPtr_Type mapsMarkerIndexes,
399  const displayerPtr_Type& displayer)
400 {
401  // Resetting and initializing the pointer to the Jacobian
402  M_jacobian.reset (new matrix_Type (*M_localMap) );
403  *M_jacobian *= 0.0;
404 
405  // Isotropic part
406  M_displayer->leaderPrint ("\n S- Updating the Jacobian Matrix ( isotropic part )\n");
407  M_isotropicLaw->updateJacobianMatrix ( disp, dataMaterial, mapsMarkerVolumes, mapsMarkerIndexes, displayer);
408 
409  *M_jacobian += *M_isotropicLaw->jacobian();
410 
411  if( !M_dataMaterial->constitutiveLaw().compare("anisotropic") )
412  {
413  // Anisotropic part
414  M_displayer->leaderPrint ("\n S- Updating the Jacobian Matrix ( anisotropic part )\n");
415 
416  M_anisotropicLaw->updateJacobianMatrix (disp, dataMaterial, mapsMarkerVolumes, mapsMarkerIndexes, displayer);
417 
418  *M_jacobian += *M_anisotropicLaw->jacobian();
419  }
420 
421  M_jacobian->globalAssemble();
422 }
423 
424 template <typename MeshType>
425 void StructuralConstitutiveLaw<MeshType>::computeStiffness ( const vector_Type& sol, const UInt iter, Real factor, const dataPtr_Type& dataMaterial,
426  const mapMarkerVolumesPtr_Type mapsMarkerVolumes,
427  const mapMarkerIndexesPtr_Type mapsMarkerIndexes,
428  const displayerPtr_Type& displayer )
429 {
430 
431  // For the linear elastic case the compute stiffness is an empty method.
432  // We use the general interface but then we get the vector using stiffVector
433 
434  // Resetting and initializing the pointer to the vector
435  M_vectorStiffness.reset (new vector_Type (*M_localMap) );
436  *M_vectorStiffness *= 0.0;
437 
438  // Isotropic part
439  M_displayer->leaderPrint ("\n S- Updating the VectorStiffness ( isotropic part )\n");
440  M_isotropicLaw->computeStiffness ( sol, factor, dataMaterial, mapsMarkerVolumes, mapsMarkerIndexes, displayer);
441 
442  *M_vectorStiffness += *M_isotropicLaw->stiffVector();
443 
444 
445  if( !M_dataMaterial->constitutiveLaw().compare("anisotropic") )
446  {
447  // Anisotropic part
448  displayer->leaderPrint ("\n S- Updating the VectorStiffness ( anisotropic part )\n");
449 
450  // if( !M_dataMaterial->solidTypeAnisotropic().compare("multimechanism") &&
451  // !M_dataMaterial->fiberActivation().compare("explicit") &&
452  // !iter)
453  // {
454  // M_anisotropicLaw->computeReferenceConfigurations( sol, dataMaterial, displayer );
455  // }
456 
457  M_anisotropicLaw->computeStiffness (sol, iter, factor, dataMaterial, mapsMarkerVolumes, mapsMarkerIndexes, displayer);
458 
459  *M_vectorStiffness += *M_anisotropicLaw->stiffVector();
460  }
461 
462  M_vectorStiffness->globalAssemble();
463 }
464 
465 template <typename MeshType>
466 void
467 StructuralConstitutiveLaw<MeshType>::showMe ( std::string const& fileNameStiff,
468  std::string const& fileNameJacobian
469  )
470 {
471  // Spying the isotropic part
472  M_isotropicLaw->showMe ( fileNameStiff, fileNameJacobian);
473 
474  if( !M_dataMaterial->constitutiveLaw().compare("anisotropic") )
475  {
476  // Spying the anisotropic part
477  M_anisotropicLaw->showMe ( fileNameStiff, fileNameJacobian);
478  }
479 
480 }
481 
482 template <typename MeshType>
483 void
484 StructuralConstitutiveLaw<MeshType>::computeLocalFirstPiolaKirchhoffTensor ( Epetra_SerialDenseMatrix& firstPiola,
485  const Epetra_SerialDenseMatrix& tensorF,
486  const Epetra_SerialDenseMatrix& cofactorF,
487  const std::vector<Real>& invariants,
488  const UInt marker)
489 {
490  firstPiola.Scale(0.0);
491 
492  Epetra_SerialDenseMatrix isotropicFirstPiola(firstPiola);
493 
494 
495  Epetra_SerialDenseMatrix anisotropicFirstPiola(firstPiola);
496 
497  // Computing the first part
498  M_isotropicLaw->computeLocalFirstPiolaKirchhoffTensor ( isotropicFirstPiola, tensorF, cofactorF, invariants, marker);
499 
500  firstPiola += isotropicFirstPiola;
501 
502  if( !M_dataMaterial->constitutiveLaw().compare("anisotropic") )
503  {
504  // Computing the first part
505  M_anisotropicLaw->computeLocalFirstPiolaKirchhoffTensor ( anisotropicFirstPiola, tensorF, cofactorF, invariants, marker);
506 
507  firstPiola += anisotropicFirstPiola;
508  }
509 
510 }
511 
512 template <typename MeshType>
513 const typename StructuralConstitutiveLaw<MeshType>::matrixPtr_Type StructuralConstitutiveLaw<MeshType>::stiffMatrix()
514 {
515  // Verify that the law that is being using is coherent with the formulation: linear <-> matrix, nonlinear <-> vector
516  ASSERT( !M_dataMaterial->solidTypeIsotropic().compare("linearVenantKirchhoff"), " No Stiffness Matrix defined for the nonlinear case! ");
517 
518  // Resetting and initializing the pointer to the vector
519  M_matrixStiffness.reset (new matrix_Type(*M_localMap) );
520  *M_matrixStiffness *= 0.0;
521 
522  // Isotropic part
523  *M_matrixStiffness += *M_isotropicLaw->stiffMatrix();
524 
525  M_matrixStiffness->globalAssemble();
526 
527  // Here we have just the return
528  return M_matrixStiffness;
529 }
530 
531 
532 template <typename MeshType>
533 const typename StructuralConstitutiveLaw<MeshType>::vectorPtr_Type StructuralConstitutiveLaw<MeshType>::stiffVector()
534 {
535  // Verify that the law that is being using is coherent with the formulation: linear <-> matrix, nonlinear <-> vector
536  ASSERT( M_dataMaterial->solidTypeIsotropic().compare("linearVenantKirchhoff"), " No Stiffness Vector defined for the linear case! ");
537 
538  // Resetting and initializing the pointer to the vector
539  M_vectorStiffness.reset (new vector_Type (*M_localMap) );
540  *M_vectorStiffness *= 0.0;
541 
542  // Isotropic part
543  *M_vectorStiffness += *M_isotropicLaw->stiffVector();
544 
545  if( !M_dataMaterial->constitutiveLaw().compare("anisotropic") )
546  {
547  // Anisotropic part
548  *M_vectorStiffness += *M_anisotropicLaw->stiffVector();
549  }
550 
551  M_vectorStiffness->globalAssemble();
552 
553  // Here we have just the return
554  return M_vectorStiffness;
555 }
556 
557 template <typename MeshType>
558 void StructuralConstitutiveLaw<MeshType>::apply ( const vector_Type& sol, vector_Type& res,
559  const mapMarkerVolumesPtr_Type mapsMarkerVolumes,
560  const mapMarkerIndexesPtr_Type mapsMarkerIndexes)
561 {
562  // Creating vectors for the isotropic and anisotropic vector which will be summed
563  vector_Type copyResIsotropic(res);
564 
565  // Computing isotropic and, eventually, anisotropic part of res
566  M_isotropicLaw->apply ( sol, copyResIsotropic, mapsMarkerVolumes, mapsMarkerIndexes, M_displayer);
567 
568  // Putting the new vectors in the res vector
569  res *= 0.0;
570 
571  res += copyResIsotropic;
572 
573  if( !M_dataMaterial->constitutiveLaw().compare("anisotropic") )
574  {
575  vector_Type copyResAnisotropic(res);
576  M_anisotropicLaw->apply ( sol, copyResAnisotropic, mapsMarkerVolumes, mapsMarkerIndexes, M_displayer);
577  res += copyResAnisotropic;
578  }
579 
580 }
581 
582 template <typename MeshType>
583 void
584 StructuralConstitutiveLaw<MeshType>::computeCauchyStressTensor ( const vectorPtr_Type disp,
585  const QuadratureRule& evalQuad,
586  vectorPtr_Type sigma_1,
587  vectorPtr_Type sigma_2, vectorPtr_Type sigma_3 )
588 {
589  /* Resetting pointers
590  In this method we use the same vector we pass to it. We could make copies of them and then
591  sum them in the right places.
592  */
593  vectorPtr_Type sigma1CopyIso;
594  vectorPtr_Type sigma2CopyIso;
595  vectorPtr_Type sigma3CopyIso;
596 
597  sigma1CopyIso.reset( new vector_Type(*M_localMap) );
598  sigma2CopyIso.reset( new vector_Type(*M_localMap) );
599  sigma3CopyIso.reset( new vector_Type(*M_localMap) );
600 
601  vectorPtr_Type sigma1CopyAniso;
602  vectorPtr_Type sigma2CopyAniso;
603  vectorPtr_Type sigma3CopyAniso;
604 
605  sigma1CopyAniso.reset( new vector_Type(*M_localMap) );
606  sigma2CopyAniso.reset( new vector_Type(*M_localMap) );
607  sigma3CopyAniso.reset( new vector_Type(*M_localMap) );
608 
609  M_isotropicLaw->computeCauchyStressTensor( disp, evalQuad, sigma1CopyIso, sigma2CopyIso, sigma3CopyIso );
610 
611  *sigma_1 += *sigma1CopyIso;
612  *sigma_2 += *sigma2CopyIso;
613  *sigma_3 += *sigma3CopyIso;
614 
615  if( !M_dataMaterial->constitutiveLaw().compare("anisotropic") )
616  {
617  M_anisotropicLaw->computeCauchyStressTensor( disp, evalQuad, sigma1CopyAniso, sigma2CopyAniso,sigma3CopyAniso );
618 
619  *sigma_1 += *sigma1CopyAniso;
620  *sigma_2 += *sigma2CopyAniso;
621  *sigma_3 += *sigma3CopyAniso;
622  }
623 
624  // Closing the vectors
625  sigma_1->globalAssemble();
626  sigma_2->globalAssemble();
627  sigma_3->globalAssemble();
628 }
629 
630 
631 }
632 #endif /*_STRUCTURALMATERIAL_H*/
FESpace - Short description here please!
Definition: FESpace.hpp:78
#define ASSERT(X, A)
Definition: LifeAssert.hpp:90
double Real
Generic real data.
Definition: LifeV.hpp:175
QuadratureRule - The basis class for storing and accessing quadrature rules.
class ETFESpace A light, templated version of the FESpace
Definition: ETFESpace.hpp:93
DataElasticStructure - Data container for solid problems with elastic structure.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191