LifeV
WallTensionEstimator.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 a class which can be used to evaluate the wall tension in the arterial wall.
30  *
31  * @version 1.0
32  * @date 01-01-2010
33  * @author Paolo Tricerri
34  *
35  * @maintainer Paolo Tricerri <paolo.tricerri@epfl.ch>
36  */
37 
38 #ifndef WALLTENSION_H_
39 #define WALLTENSION_H_ 1
40 
41 // Tell the compiler to ignore specific kind of warnings:
42 #pragma GCC diagnostic ignored "-Wunused-variable"
43 #pragma GCC diagnostic ignored "-Wunused-parameter"
44 
45 // STL classes
46 #include <string>
47 #include <sstream>
48 #include <iostream>
49 #include <stdexcept>
50 
51 // Boost classes
52 #include <boost/scoped_ptr.hpp>
53 #include <boost/multi_array.hpp>
54 
55 // Trilinos classes
56 #include <Epetra_SerialDenseMatrix.h>
57 
58 // Tell the compiler to restore the warning previously silented
59 #pragma GCC diagnostic warning "-Wunused-variable"
60 #pragma GCC diagnostic warning "-Wunused-parameter"
61 
62 // LifeV core includes
63 #include <lifev/core/array/MatrixElemental.hpp>
64 #include <lifev/core/array/VectorElemental.hpp>
65 #include <lifev/core/array/MatrixEpetra.hpp>
66 #include <lifev/core/array/VectorEpetra.hpp>
67 
68 #include <lifev/core/fem/Assembly.hpp>
69 #include <lifev/core/fem/AssemblyElemental.hpp>
70 #include <lifev/core/fem/FESpace.hpp>
71 #include <lifev/core/LifeV.hpp>
72 #include <lifev/core/util/Displayer.hpp>
73 #include <lifev/core/array/MapEpetra.hpp>
74 
75 #include <lifev/core/filter/ExporterEnsight.hpp>
76 #ifdef HAVE_HDF5
77 #include <lifev/core/filter/ExporterHDF5.hpp>
78 #endif
79 #include <lifev/core/filter/ExporterEmpty.hpp>
80 
81 #include <lifev/eta/fem/ETFESpace.hpp>
82 
83 // Structure module include
84 #include <lifev/structure/fem/AssemblyElementalStructure.hpp>
85 #include <lifev/structure/solver/StructuralConstitutiveLawData.hpp>
86 #include <lifev/structure/solver/WallTensionEstimatorData.hpp>
87 #include <lifev/structure/solver/StructuralConstitutiveLaw.hpp>
88 
89 //Materials
90 #include <lifev/structure/solver/isotropic/VenantKirchhoffMaterialLinear.hpp>
91 #include <lifev/structure/solver/isotropic/VenantKirchhoffMaterialNonLinear.hpp>
92 #include <lifev/structure/solver/isotropic/ExponentialMaterialNonLinear.hpp>
93 #include <lifev/structure/solver/isotropic/NeoHookeanMaterialNonLinear.hpp>
94 
95 #include <lifev/eta/fem/ETFESpace.hpp>
96 
97 #include <lifev/structure/solver/isotropic/VenantKirchhoffMaterialNonLinearPenalized.hpp>
98 #include <lifev/structure/solver/isotropic/SecondOrderExponentialMaterialNonLinear.hpp>
99 
100 namespace LifeV
101 {
102 /*!
103  \class WallTensionEstimator
104  \brief
105  This class lets to compute the wall tensions inside the arterial wall. The tensorial operations
106  that are needed to compute the stress tensor are defined in AssemblyElementalStructure. When a new
107  type of analysis wants to be performed new methods can be added
108 */
109 
110 template <typename Mesh>
112 {
113 public:
114 
115  //!@name Type definitions
116  //@{
117 
118  // Communicator
119  typedef Displayer::comm_Type comm_Type;
120  typedef Displayer::commPtr_Type commPtr_Type;
121 
122  // FE space
123  typedef FESpace < Mesh, MapEpetra > feSpace_Type;
125 
128 
129  // Data classes
131  typedef typename std::shared_ptr<data_Type> dataPtr_Type;
134 
135  //Matrices 3x3 and std::vector for the invariants
138  typedef std::vector< Real > vector_Type;
140 
141  // These two are to handle the vector displacement read from hdf5
142  typedef VectorEpetra solutionVect_Type;
144 
145  // Displayer and Exporter classes
146  typedef typename std::shared_ptr<const Displayer> displayerPtr_Type;
147  typedef typename std::shared_ptr< Exporter<Mesh> > exporterPtr_Type;
148 
149  // Materials
150  typedef StructuralConstitutiveLaw<Mesh> material_Type;
152 
153  //@}
154 
155 
156  //! @name Constructor & Deconstructor
157  //@{
158 
160 
161  virtual ~WallTensionEstimator() {};
162 
163  //@}
164 
165 
166  //!@name Methods
167  //@{
168 
169  //! Setup the created object of the class WallTensionEstimator
170  /*!
171  \param dataMaterial: the class containing the VenantKirchhoffElasticData
172  \param tensionData: the class containing the WallTensionEstimatorData
173  \param dFESpace: the FiniteElement Space
174  \param displayer: the displayer object
175  \param marker volume marker
176  */
177  void setup ( const dataPtr_Type& dataMaterial,
178  const analysisDataPtr_Type& tensionData,
179  const feSpacePtr_Type& feSpace,
180  const feSpaceETPtr_Type& feSpaceET,
181  const commPtr_Type& comm,
182  UInt marker);
183 
184  //! Setup the created object of the class WallTensionEstimator
185  /*!
186  \param dataMaterial: the class containing the VenantKirchhoffElasticData
187  \param dFESpace: the FiniteElement Space
188  \param displayer: the displayer object
189  \param marker volume marker
190  */
191  void setup ( const dataPtr_Type& dataMaterial,
192  const feSpacePtr_Type& feSpace,
193  const feSpaceETPtr_Type& feSpaceET,
194  const commPtr_Type& comm,
195  UInt marker);
196 
197  //! This method computes the Cauchy stress tensor and its principal values. It uses the displacement vector that has to be set
198  virtual void analyzeTensions();
199 
200  //! This method computes the Cauchy stress tensor and its principal values. It uses the displacement vector that has to be set
202 
203  //! This method computes the Cauchy stress tensor and its principal values. It uses the displacement vector that has to be set
205 
206  //! This method computes the Cauchy stress tensor and its principal values. It uses the displacement vector that has to be set
208 
209  //! This method computes the Von Mises stress. It uses the displacement vector that has to be set
211 
212  //@}
213 
214 
215  //! @name Set Methods
216  //@{
217 
218  //! Set the displacement vector
219  void setDisplacement ( const solutionVect_Type& displacement )
220  {
221  *M_displacement = displacement;
222  }
223 
224  //@}
225 
226 
227  //! @name Get Methods
228  //@{
229 
230  //! Get the Epetramap
231  MapEpetra const& map() const
232  {
233  return *M_FESpace->mapPtr();
234  }
235 
236  //! Get the FESpace object
237  LIFEV_DEPRECATED ( const feSpace_Type& dFESpace() const
238  {
239  return feSpace();
240  }
241  )
242 
243  //! Get the pointer to the FESpace object
244  LIFEV_DEPRECATED ( const feSpacePtr_Type& dFESpacePtr() const
245  {
246  return feSpacePtr();
247  }
248  )
249 
250  //! Get the FESpace object
251  const feSpace_Type& feSpace() const
252  {
253  return *M_FESpace;
254  }
255 
256  //! Get the pointer to the FESpace object
258  {
259  return M_FESpace;
260  }
261 
262  //! Get the scalar FESpace object
264  {
265  return *M_FESpaceScalar;
266  }
267 
268  //! Get the pointer to the scalar FESpace object
270  {
271  return M_FESpaceScalar;
272  }
273 
274  //! Get the displacement solution
276  {
277  return *M_displacement;
278  }
279 
280  //! Get the displacement solution
282  {
283  return *M_gradientX;
284  }
285 
287  {
288  return *M_gradientY;
289  }
290 
292  {
293  return *M_gradientZ;
294  }
295 
297  {
298  return *M_sigmaX;
299  }
300 
302  {
303  return *M_sigmaY;
304  }
305 
307  {
308  return *M_sigmaZ;
309  }
310 
311  //! Export the XX component of the stress by copying it to an external vector
312  /*!
313  * @param stressXX vector to be filled with the XX component of the stress
314  */
316  {
317  stressXX.subset ( *M_sigmaX, static_cast<UInt> ( 0 ) );
318  }
319 
320  //! Export the XY component of the stress by copying it to an external vector
321  /*!
322  * @param stressXY vector to be filled with the XY component of the stress
323  */
325  {
326  stressXY.subset ( *M_sigmaX, static_cast<UInt> ( 1 * M_FESpace->dof().numTotalDof() ) );
327  }
328 
329  //! Export the XZ component of the stress by copying it to an external vector
330  /*!
331  * @param stressXZ vector to be filled with the XZ component of the stress
332  */
334  {
335  stressXZ.subset ( *M_sigmaX, static_cast<UInt> ( 2 * M_FESpace->dof().numTotalDof() ) );
336  }
337 
338  //! Export the YX component of the stress by copying it to an external vector
339  /*!
340  * @param stressYX vector to be filled with the YX component of the stress
341  */
343  {
344  stressYX.subset ( *M_sigmaY, static_cast<UInt> ( 0 ) );
345  }
346 
347  //! Export the YY component of the stress by copying it to an external vector
348  /*!
349  * @param stressYY vector to be filled with the YY component of the stress
350  */
352  {
353  stressYY.subset ( *M_sigmaY, static_cast<UInt> ( 1 * M_FESpace->dof().numTotalDof() ) );
354  }
355 
356  //! Export the YZ component of the stress by copying it to an external vector
357  /*!
358  * @param stressYZ vector to be filled with the YZ component of the stress
359  */
361  {
362  stressYZ.subset ( *M_sigmaY, static_cast<UInt> ( 2 * M_FESpace->dof().numTotalDof() ) );
363  }
364 
365  //! Export the ZX component of the stress by copying it to an external vector
366  /*!
367  * @param stressZX vector to be filled with the ZX component of the stress
368  */
370  {
371  stressZX.subset ( *M_sigmaZ, static_cast<UInt> ( 0 ) );
372  }
373 
374  //! Export the ZY component of the stress by copying it to an external vector
375  /*!
376  * @param stressZY vector to be filled with the ZY component of the stress
377  */
379  {
380  stressZY.subset ( *M_sigmaZ, static_cast<UInt> ( 1 * M_FESpace->dof().numTotalDof() ) );
381  }
382 
383  //! Export the ZZ component of the stress by copying it to an external vector
384  /*!
385  * @param stressZZ vector to be filled with the ZZ component of the stress
386  */
388  {
389  stressZZ.subset ( *M_sigmaZ, static_cast<UInt> ( 2 * M_FESpace->dof().numTotalDof() ) );
390  }
391 
392  //! Export the ZZ component of the stress by copying it to an external vector
393  /*!
394  * @param stressZZ vector to be filled with the ZZ component of the stress
395  */
396  void exportStressVonMises ( solutionVect_Type& stressVonMises )
397  {
398  stressVonMises = *M_sigmaVonMises;
399  }
400 
401  //! Get the global vector for the eigenvalues
403  {
404  return *M_globalEigenvalues;
405  }
406 
407  //@}
408 
409 
410 protected:
411 
412 
413  //! @name Protected methods
414  //@{
415 
416  //! computeDeformation: This method computes the tensor F given the displacement on the element.
417  /*!
418  \param NONE
419  */
421  solutionVectPtr_Type grDisplY,
422  solutionVectPtr_Type grDisplZ );
423 
424  //! constructGlobalStressVector: This method construct the vectors \sigma_{.,i} for i=x,y,z to have for each DOF the tensor \sigma
425  /*!
426  \param NONE
427  */
429 
430  //! constructPatchAreaVector: This method build the patch area vector used in the reconstruction process
431  /*!
432  \param NONE
433  */
434  void constructPatchAreaVector ( solutionVect_Type& patchArea );
435 
436  //! reconstructElementaryVector: This method applies a reconstruction procedure on the elvec that is passed
437  /*!
438  \param elvecTens VectorElemental over which the reconstruction is applied
439  */
440  void reconstructElementaryVector ( VectorElemental& elVecSigma, const solutionVect_Type& patchArea, const feSpace_Type& feSpace );
441 
442  //@}
443 
444 
445  //! @name Protected members
446  //@{
447 
448  //! Vectorial FE space
450 
451  //! Scalar FE space
453 
454  //! Elementary matrix for the tensor F
456 
457  //! Elementary matrix for the tensor F
459  //! Elementary matrix for the tensor P
461 
462  //! Elementary matrix for the tensor \sigma (Cauchy tensor on the current config)
464 
465  //! Vector of the invariants of C and detF (length = 4)
467 
468  //! Vector of the eigenvalues of \sigma on the DOF (length = 3)
471 
472  //! Vector for the displacement field
474 
475  //! Vector for the gradient along X of the displacement field
477 
478  //! Vector for the gradient along Y of the displacement field
480 
481  //! Vector for the gradient along Z of the displacement field
483 
484  //! Vector for the X component of the stress tensor
486 
487  //! Vector for the Y component of the stress tensor
489 
490  //! Vector for the Z component of the stress tensor
492 
493  //! Vector for the Von Mises stress
495 
496  //! Vector for the eigenvalues of the Cauchy stress tensor
498 
499  //! The Offset parameter
501 
502  //! The volume marker
504 
505  //Class for material parameter
507 
508  //Class for analysis parameter
510 
511  //Displayer
513 
514  //! Material class
516 
517  //@}
518 };
519 
520 //=====================================
521 // Constructor
522 //=====================================
523 template <typename Mesh>
525  M_FESpace ( ),
526  M_FESpaceScalar ( ),
527  M_deformationF ( ),
528  M_cofactorF ( ),
529  M_firstPiola ( ),
530  M_sigma ( ),
531  M_invariants ( ),
532  M_eigenvaluesR ( ),
533  M_eigenvaluesI ( ),
534  M_displacement ( ),
535  M_gradientX ( ),
536  M_gradientY ( ),
537  M_gradientZ ( ),
539  M_sigmaX ( ),
540  M_sigmaY ( ),
541  M_sigmaZ ( ),
542  M_sigmaVonMises ( ),
543  M_offset ( 0 ),
544  M_marker ( 1 ),
545  M_dataMaterial ( ),
546  M_analysisData ( ),
547  M_displayer ( ),
548  M_material ( )
549 {
550 }
551 
552 
553 
554 //====================================
555 // Public Methods
556 //===================================
557 template <typename Mesh>
558 void
559 WallTensionEstimator<Mesh >::setup ( const dataPtr_Type& dataMaterial,
560  const analysisDataPtr_Type& tensionData,
561  const feSpacePtr_Type& feSpace,
562  const feSpaceETPtr_Type& feSpaceET,
563  const commPtr_Type& comm,
564  UInt marker)
565 {
566  M_analysisData = tensionData;
567  setup ( dataMaterial, feSpace, feSpaceET, comm, marker );
568 }
569 
570 template <typename Mesh>
571 void
572 WallTensionEstimator<Mesh >::setup ( const dataPtr_Type& dataMaterial,
573  const feSpacePtr_Type& feSpace,
574  const feSpaceETPtr_Type& feSpaceET,
575  const commPtr_Type& comm,
576  UInt marker)
577 {
578  // Data classes & Volumes markers
579  M_dataMaterial = dataMaterial;
580  M_marker = marker;
581 
582  // FESpace
583  M_FESpace = feSpace;
584 
585  // Create a scalar FESpace
586  M_FESpaceScalar.reset ( new feSpace_Type ( M_FESpace->mesh(),
587  M_FESpace->refFE(),
588  M_FESpace->qr(),
589  M_FESpace->bdQr(),
590  1,
591  comm ) );
592 
593  // Displayer
594  M_displayer.reset ( new Displayer ( comm ) );
595 
596  // Vector and Tensors
597  M_sigma.reset ( new matrix_Type ( M_FESpace->fieldDim(), M_FESpace->fieldDim() ) );
598 
599  M_deformationF.reset ( new matrix_Type ( M_FESpace->fieldDim(), M_FESpace->fieldDim() ) );
600  M_cofactorF.reset ( new matrix_Type ( M_FESpace->fieldDim(), M_FESpace->fieldDim() ) );
601  M_firstPiola.reset ( new matrix_Type ( M_FESpace->fieldDim(), M_FESpace->fieldDim() ) );
602 
603  M_displacement.reset ( new solutionVect_Type (*M_FESpace->mapPtr() ) );
604 
605  M_gradientX.reset ( new solutionVect_Type (*M_FESpace->mapPtr() ) );
606  M_gradientY.reset ( new solutionVect_Type (*M_FESpace->mapPtr() ) );
607  M_gradientZ.reset ( new solutionVect_Type (*M_FESpace->mapPtr() ) );
608 
609  M_sigmaX.reset ( new solutionVect_Type (*M_FESpace->mapPtr() ) );
610  M_sigmaY.reset ( new solutionVect_Type (*M_FESpace->mapPtr() ) );
611  M_sigmaZ.reset ( new solutionVect_Type (*M_FESpace->mapPtr() ) );
612 
613  M_sigmaVonMises.reset ( new solutionVect_Type (*M_FESpaceScalar->mapPtr() ) );
614 
615  M_globalEigenvalues.reset ( new solutionVect_Type (*M_FESpace->mapPtr() ) );
616 
617  M_invariants.resize ( M_FESpace->fieldDim() + 1 );
618  M_eigenvaluesR.resize ( M_FESpace->fieldDim() );
619  M_eigenvaluesI.resize ( M_FESpace->fieldDim() );
620 
621  // Materials
622  M_material.reset( new material_Type() );
623  M_material->setup ( feSpace, feSpaceET, M_FESpace->mapPtr(), M_offset, M_dataMaterial, M_displayer );
624 
625 }
626 
627 template <typename Mesh>
628 void
630 {
631  //TODO: Maybe here a case for the VonMises should be added
632  *M_globalEigenvalues *= 0.0;
633  if ( !M_analysisData->recoveryVariable().compare ("displacement") )
634  {
636  }
637  else if ( !M_analysisData->recoveryVariable().compare ("eigenvalues") )
638  {
640  }
641  else
642  {
644  }
645 }
646 
647 template <typename Mesh>
648 void
650 {
651 
652  solutionVectPtr_Type grDisplX ( new solutionVect_Type (*M_FESpace->mapPtr() ) );
653  solutionVectPtr_Type grDisplY ( new solutionVect_Type (*M_FESpace->mapPtr() ) );
654  solutionVectPtr_Type grDisplZ ( new solutionVect_Type (*M_FESpace->mapPtr() ) );
655 
656  //Compute the deformation gradient tensor F of the displ field
657  computeDisplacementGradient ( grDisplX, grDisplY, grDisplZ );
658 
659  M_gradientX = grDisplX;
660  M_gradientY = grDisplY;
661  M_gradientZ = grDisplZ;
662 
663  //Initially used for debug
664  // M_displayer->leaderPrint(" \n*********************************\n ");
665  // M_displayer->leaderPrint(" Norm of the gradient with respect to x ", grDisplX->norm2() );
666  // M_displayer->leaderPrint(" \n*********************************\n ");
667  // M_displayer->leaderPrint(" Norm of the gradient with respect to y ", grDisplY->norm2() );
668  // M_displayer->leaderPrint(" \n*********************************\n ");
669  // M_displayer->leaderPrint(" Norm of the gradient with respect to z ", grDisplZ->norm2() );
670 
671  //For each of the DOF, the Cauchy tensor is computed.
672  //Therefore the tensor C,P, \sigma are computed for each DOF
673  UInt dim = M_FESpace->dim();
674 
675  LifeChrono chrono;
676 
677  this->M_displayer->leaderPrint (" \n*********************************\n ");
678  this->M_displayer->leaderPrint (" Performing the analysis recovering the displacement..., ");
679  this->M_displayer->leaderPrint (" \n*********************************\n ");
680 
681  chrono.start();
682 
683  for ( UInt iDOF = 0; iDOF < ( UInt ) M_FESpace->dof().numTotalDof(); ++iDOF )
684  {
685 
686  if ( M_displacement->blockMap().LID ( static_cast<EpetraInt_Type> (iDOF) ) != -1 ) // The Global ID is on the calling processors
687  {
688  std::vector<Real> dX (3, 0.0);
689  std::vector<Real> dY (3, 0.0);
690  std::vector<Real> dZ (3, 0.0);
691 
692  //Reinitialization of matrices and arrays
693  (*M_deformationF).Scale (0.0);
694  (*M_cofactorF).Scale (0.0);
695  (*M_firstPiola).Scale (0.0);
696  (*M_sigma).Scale (0.0);
697 
698  //Extracting the gradient of U on the current DOF
699  for ( UInt iComp = 0; iComp < M_FESpace->fieldDim(); ++iComp )
700  {
701  Int LIDid = M_displacement->blockMap().LID ( static_cast<EpetraInt_Type> ( ( iDOF + iComp * dim + M_offset ) ) );
702  Int GIDid = M_displacement->blockMap().GID ( static_cast<EpetraInt_Type> (LIDid) );
703  dX[iComp] = (*grDisplX) (GIDid); // (d_xX,d_yX,d_zX)
704  dY[iComp] = (*grDisplY) (GIDid); // (d_xY,d_yY,d_zY)
705  dZ[iComp] = (*grDisplZ) (GIDid); // (d_xZ,d_yZ,d_zZ)
706  }
707 
708  //Fill the matrix F
709  for ( UInt icoor (0); icoor < M_FESpace->fieldDim(); ++icoor )
710  {
711  (*M_deformationF) (icoor, 0) = dX[icoor];
712  (*M_deformationF) (icoor, 1) = dY[icoor];
713  (*M_deformationF) (icoor, 2) = dZ[icoor];
714 
715  (*M_deformationF) (icoor, icoor) += 1.0;
716  }
717 
718  //Compute the rightCauchyC tensor
719  AssemblyElementalStructure::computeInvariantsRightCauchyGreenTensor (M_invariants, *M_deformationF, *M_cofactorF);
720 
721  // Real sumI(0);
722  // for( UInt i(0); i < M_invariants.size(); i++ )
723  // sumI += M_invariants[i];
724 
725  //Compute the first Piola-Kirchhoff tensor
726  M_material->computeLocalFirstPiolaKirchhoffTensor (*M_firstPiola, *M_deformationF, *M_cofactorF, M_invariants, M_marker);
727 
728  //Compute the Cauchy tensor
729  AssemblyElementalStructure::computeCauchyStressTensor (*M_sigma, *M_firstPiola, M_invariants[3], *M_deformationF);
730 
731  //Compute the eigenvalue
732  AssemblyElementalStructure::computeEigenvalues (*M_sigma, M_eigenvaluesR, M_eigenvaluesI);
733 
734  //The Cauchy tensor is symmetric and therefore, the eigenvalues are real
735  //Check on the imaginary part of eigen values given by the Lapack method
736  Real sum (0);
737  for ( UInt i (0); i < M_eigenvaluesI.size(); ++i )
738  {
739  sum += std::abs (M_eigenvaluesI[i]);
740  }
741  ASSERT_PRE ( sum < 1e-6 , "The eigenvalues of the Cauchy stress tensors have to be real!" );
742 
743  std::sort ( M_eigenvaluesR.begin(), M_eigenvaluesR.end() );
744 
745  //Save the eigenvalues in the global vector
746  for ( UInt icoor (0); icoor < M_FESpace->fieldDim(); ++icoor )
747  {
748  Int LIDid = M_displacement->blockMap().LID ( static_cast<EpetraInt_Type> (iDOF + icoor * dim + M_offset) );
749  Int GIDid = M_displacement->blockMap().GID ( static_cast<EpetraInt_Type> (LIDid) );
750  (*M_globalEigenvalues) (GIDid) = M_eigenvaluesR[icoor];
751  }
752 
753  }
754  }
755 
756  chrono.stop();
757  M_displayer->leaderPrint ("Analysis done in: ", chrono.diff() );
758 }
759 
760 template <typename Mesh>
761 void
763 {
764  LifeChrono chrono;
765 
766  solutionVect_Type patchArea (*M_displacement, Unique, Add);
767  patchArea *= 0.0;
768 
769  constructPatchAreaVector ( patchArea );
770 
771  //Before assembling the reconstruction process is done
772  solutionVect_Type patchAreaR (patchArea, Repeated);
773 
774  QuadratureRule fakeQuadratureRule;
775 
776  Real refElemArea (0); //area of reference element
777  //compute the area of reference element
778  for ( UInt iq (0); iq < M_FESpace->qr().nbQuadPt(); ++iq )
779  {
780  refElemArea += M_FESpace->qr().weight (iq);
781  }
782 
783  Real wQuad (refElemArea / M_FESpace->refFE().nbDof() );
784 
785  //Setting the quadrature Points = DOFs of the element and weight = 1
786  std::vector<GeoVector> coords = M_FESpace->refFE().refCoor();
787  std::vector<Real> weights (M_FESpace->fe().nbFEDof(), wQuad);
788  fakeQuadratureRule.setDimensionShape ( shapeDimension (M_FESpace->refFE().shape() ), M_FESpace->refFE().shape() );
789  fakeQuadratureRule.setPoints (coords, weights);
790 
791  //Set the new quadrature rule
792  M_FESpace->setQuadRule (fakeQuadratureRule);
793 
794  this->M_displayer->leaderPrint (" \n*********************************\n ");
795  this->M_displayer->leaderPrint (" Performing the analysis recovering the tensions..., " );
796  this->M_displayer->leaderPrint (" \n*********************************\n ");
797 
798  UInt totalDof = M_FESpace->dof().numTotalDof();
799  VectorElemental dk_loc (M_FESpace->fe().nbFEDof(), M_FESpace->fieldDim() );
800 
801  //Vectors for the deformation tensor
802  std::vector<matrix_Type> vectorDeformationF (M_FESpace->fe().nbFEDof(), *M_deformationF);
803  //Copying the displacement field into a vector with repeated map for parallel computations
804  solutionVect_Type dRep (*M_displacement, Repeated);
805 
806  VectorElemental elVecTens (M_FESpace->fe().nbFEDof(), M_FESpace->fieldDim() );
807 
808  chrono.start();
809 
810  //Loop on each volume
811  for ( UInt i (0); i < M_FESpace->mesh()->numVolumes(); ++i )
812  {
813  M_FESpace->fe().updateFirstDerivQuadPt ( M_FESpace->mesh()->volumeList ( i ) );
814  elVecTens.zero();
815 
816  M_marker = M_FESpace->mesh()->volumeList ( i ).markerID();
817 
818  UInt eleID = M_FESpace->fe().currentLocalId();
819 
820  //Extracting the local displacement
821  for ( UInt iNode (0); iNode < ( UInt ) M_FESpace->fe().nbFEDof(); ++iNode )
822  {
823  UInt iloc = M_FESpace->fe().patternFirst ( iNode );
824 
825  for ( UInt iComp = 0; iComp < M_FESpace->fieldDim(); ++iComp )
826  {
827  UInt ig = M_FESpace->dof().localToGlobalMap ( eleID, iloc ) + iComp * M_FESpace->dim() + M_offset;
828  dk_loc[iloc + iComp * M_FESpace->fe().nbFEDof() ] = dRep[ig];
829  }
830  }
831 
832  //Compute the element tensor F
833  AssemblyElementalStructure::computeLocalDeformationGradient ( dk_loc, vectorDeformationF, M_FESpace->fe() );
834 
835  //Compute the local vector of the principal stresses
836  for ( UInt nDOF (0); nDOF < ( UInt ) M_FESpace->fe().nbFEDof(); ++nDOF )
837  {
838  UInt iloc = M_FESpace->fe().patternFirst ( nDOF );
839 
840  M_sigma->Scale (0.0);
841  M_firstPiola->Scale (0.0);
842  M_cofactorF->Scale (0.0);
843 
844  //Compute the rightCauchyC tensor
845  AssemblyElementalStructure::computeInvariantsRightCauchyGreenTensor (M_invariants, vectorDeformationF[nDOF], *M_cofactorF);
846 
847  //Compute the first Piola-Kirchhoff tensor
848  M_material->computeLocalFirstPiolaKirchhoffTensor (*M_firstPiola, vectorDeformationF[nDOF], *M_cofactorF, M_invariants, M_marker);
849 
850  //Compute the Cauchy tensor
851  AssemblyElementalStructure::computeCauchyStressTensor (*M_sigma, *M_firstPiola, M_invariants[3], vectorDeformationF[nDOF]);
852 
853  //Compute the eigenvalue
854  AssemblyElementalStructure::computeEigenvalues (*M_sigma, M_eigenvaluesR, M_eigenvaluesI);
855 
856  //The Cauchy tensor is symmetric and therefore, the eigenvalues are real
857  //Check on the imaginary part of eigen values given by the Lapack method
858  Real sum (0);
859  for ( UInt i (0); i < M_eigenvaluesI.size(); ++i )
860  {
861  sum += std::abs (M_eigenvaluesI[i]);
862  }
863  ASSERT_PRE ( sum < 1e-6 , "The eigenvalues of the Cauchy stress tensors have to be real!" );
864 
865  std::sort ( M_eigenvaluesR.begin(), M_eigenvaluesR.end() );
866 
867  //Assembling the local vector
868  for ( UInt coor (0); coor < M_eigenvaluesR.size(); ++coor )
869  {
870  elVecTens[iloc + coor * M_FESpace->fe().nbFEDof() ] = M_eigenvaluesR[coor];
871  }
872  }
873 
874  reconstructElementaryVector ( elVecTens, patchAreaR, *M_FESpace );
875 
876  //Assembling the local into global vector
877  for ( UInt ic (0); ic < M_FESpace->fieldDim(); ++ic )
878  {
879  assembleVector (*M_globalEigenvalues, elVecTens, M_FESpace->fe(), M_FESpace->dof(), ic, M_offset + ic * totalDof );
880  }
881  }
882 
883  M_globalEigenvalues->globalAssemble();
884 
885  chrono.stop();
886  M_displayer->leaderPrint ("Analysis done in: ", chrono.diff() );
887 }
888 
889 template <typename Mesh>
890 void
892 {
893  //Chrono
894  LifeChrono chrono;
895  chrono.start();
896 
897  //Construct stress tensor
899 
900  for ( UInt iDOF (0); iDOF < ( UInt ) M_FESpace->dof().numTotalDof(); ++iDOF )
901  {
902 
903  if ( M_displacement->blockMap().LID ( static_cast<EpetraInt_Type> (iDOF) ) != -1 ) // The Global ID is on the calling processors
904  {
905 
906  (*M_sigma).Scale (0.0);
907 
908  //Extracting the gradient of U on the current DOF
909  for ( UInt iComp = 0; iComp < M_FESpace->fieldDim(); ++iComp )
910  {
911  Int LIDid = M_displacement->blockMap().LID ( static_cast<EpetraInt_Type> (iDOF + iComp * M_FESpace->dim() + M_offset) );
912  Int GIDid = M_displacement->blockMap().GID (static_cast<EpetraInt_Type> (LIDid) );
913  (*M_sigma) (iComp, 0) = (*M_sigmaX) (GIDid); // (d_xX,d_yX,d_zX)
914  (*M_sigma) (iComp, 1) = (*M_sigmaY) (GIDid); // (d_xY,d_yY,d_zY)
915  (*M_sigma) (iComp, 2) = (*M_sigmaZ) (GIDid); // (d_xZ,d_yZ,d_zZ)
916  }
917 
918  //Compute the eigenvalue
919  AssemblyElementalStructure::computeEigenvalues (*M_sigma, M_eigenvaluesR, M_eigenvaluesI);
920 
921  //The Cauchy tensor is symmetric and therefore, the eigenvalues are real
922  //Check on the imaginary part of eigen values given by the Lapack method
923  Real sum (0);
924  for ( UInt i (0); i < M_eigenvaluesI.size(); ++i )
925  {
926  sum += std::abs (M_eigenvaluesI[i]);
927  }
928  ASSERT_PRE ( sum < 1e-6 , "The eigenvalues of the Cauchy stress tensors have to be real!" );
929 
930  std::sort ( M_eigenvaluesR.begin(), M_eigenvaluesR.end() );
931 
932  //Save the eigenvalues in the global vector
933  for ( UInt icoor = 0; icoor < M_FESpace->fieldDim(); ++icoor )
934  {
935  Int LIDid = M_displacement->blockMap().LID ( static_cast<EpetraInt_Type> (iDOF + icoor * M_FESpace->dim() + M_offset ) );
936  Int GIDid = M_displacement->blockMap().GID (static_cast<EpetraInt_Type> (LIDid) );
937  (*M_globalEigenvalues) (GIDid) = M_eigenvaluesR[icoor];
938  }
939  }
940  }
941 
942  chrono.stop();
943  M_displayer->leaderPrint ("Analysis done in: ", chrono.diff() );
944 
945 }
946 
947 template <typename Mesh>
948 void
950 {
951  //Chrono
952  LifeChrono chrono;
953  chrono.start();
954 
955  //Construct stress tensor
957 
958  //Compute Von Mises stress
959  *M_sigmaVonMises *= 0.;
960 
961  //Initialize vectors
962  solutionVect_Type stressComponent1 ( *M_FESpaceScalar->mapPtr() );
963  solutionVect_Type stressComponent2 ( *M_FESpaceScalar->mapPtr() );
964  solutionVect_Type stressComponent3 ( *M_FESpaceScalar->mapPtr() );
965 
966  //Off-diagonal elements
967  exportStressXY ( stressComponent1 );
968  exportStressXZ ( stressComponent2 );
969  exportStressYZ ( stressComponent3 );
970  *M_sigmaVonMises += stressComponent1 * stressComponent1
971  + stressComponent2 * stressComponent2
972  + stressComponent3 * stressComponent3;
973  *M_sigmaVonMises *= 6.;
974 
975  //Diagonal elements
976  exportStressXX ( stressComponent1 );
977  exportStressYY ( stressComponent2 );
978  exportStressZZ ( stressComponent3 );
979  *M_sigmaVonMises += ( stressComponent1 - stressComponent2 ) * ( stressComponent1 - stressComponent2 )
980  + ( stressComponent1 - stressComponent3 ) * ( stressComponent1 - stressComponent3 )
981  + ( stressComponent2 - stressComponent3 ) * ( stressComponent2 - stressComponent3 );
982 
983  //Final operations
984  *M_sigmaVonMises *= 0.5;
985  M_sigmaVonMises->sqrt();
986 
987  //Chrono
988  chrono.stop();
989  M_displayer->leaderPrint (" S- Von Mises stress computed in: ", chrono.globalDiff ( *M_displayer->comm() ), " s\n" );
990 }
991 
992 template <typename Mesh>
993 void
995  solutionVectPtr_Type grDisplY,
996  solutionVectPtr_Type grDisplZ )
997 {
998  //The map of the displacement field is not transformed in a Repeated map
999  //because it is done inside the gradientRecovery method
1000 
1001  //Compute the gradient along X of the displacement field
1002  *grDisplX = M_FESpace->gradientRecovery (*M_displacement, 0);
1003 
1004  //Compute the gradient along Y of the displacement field
1005  *grDisplY = M_FESpace->gradientRecovery (*M_displacement, 1);
1006 
1007  //Compute the gradient along Z of the displacement field
1008  *grDisplZ = M_FESpace->gradientRecovery (*M_displacement, 2);
1009 }
1010 
1011 template <typename Mesh>
1012 void
1014 {
1015  //Chrono
1016  LifeChrono chrono;
1017  chrono.start();
1018 
1019  // Reset stress components
1020  *M_sigmaX *= 0.;
1021  *M_sigmaY *= 0.;
1022  *M_sigmaZ *= 0.;
1023 
1024  //Constructing the patch area vector for reconstruction purposes
1025  solutionVect_Type patchArea (*M_displacement, Unique, Add);
1026  patchArea *= 0.0;
1027 
1028  constructPatchAreaVector ( patchArea );
1029 
1030  //Before assembling the reconstruction process is done
1031  solutionVect_Type patchAreaR (patchArea, Repeated);
1032 
1033  //Compute the area of reference element
1034  Real refElemArea (0);
1035  for (UInt iq (0); iq < M_FESpace->qr().nbQuadPt(); ++iq)
1036  {
1037  refElemArea += M_FESpace->qr().weight (iq);
1038  }
1039 
1040  //Setting the quadrature Points = DOFs of the element and weight = 1
1041  Real wQuad (refElemArea / M_FESpace->refFE().nbDof() );
1042  std::vector<Real> weights (M_FESpace->fe().nbFEDof(), wQuad);
1043  std::vector<GeoVector> coords = M_FESpace->refFE().refCoor();
1044 
1045  QuadratureRule fakeQuadratureRule;
1046  fakeQuadratureRule.setDimensionShape ( shapeDimension (M_FESpace->refFE().shape() ), M_FESpace->refFE().shape() );
1047  fakeQuadratureRule.setPoints (coords, weights);
1048 
1049  //Creating a copy of the FESpace
1050  feSpace_Type fakeFESpace ( M_FESpace->mesh(), M_FESpace->refFE(), M_FESpace->qr(), M_FESpace->bdQr(), 3, M_FESpace->map().commPtr() );
1051 
1052  this->M_displayer->leaderPrint (" \n*********************************\n ");
1053  this->M_displayer->leaderPrint (" Performing the analysis recovering the Cauchy stresses..., ");
1054  this->M_displayer->leaderPrint (" \n*********************************\n ");
1055 
1056  //Set the new quadrature rule
1057  fakeFESpace.setQuadRule (fakeQuadratureRule);
1058 
1059  //Preliminary variables
1060  UInt totalDof = fakeFESpace.dof().numTotalDof();
1061  VectorElemental dk_loc (fakeFESpace.fe().nbFEDof(), fakeFESpace.fieldDim() );
1062 
1063  //Vectors for the deformation tensor
1064  (*M_deformationF).Scale (0.0);
1065  std::vector<matrix_Type> vectorDeformationF (fakeFESpace.fe().nbFEDof(), *M_deformationF);
1066 
1067  //Copying the displacement field into a vector with repeated map for parallel computations
1068  solutionVect_Type dRep (*M_displacement, Repeated);
1069 
1070  //Creating the local stress tensors
1071  VectorElemental elVecSigmaX (fakeFESpace.fe().nbFEDof(), fakeFESpace.fieldDim() );
1072  VectorElemental elVecSigmaY (fakeFESpace.fe().nbFEDof(), fakeFESpace.fieldDim() );
1073  VectorElemental elVecSigmaZ (fakeFESpace.fe().nbFEDof(), fakeFESpace.fieldDim() );
1074 
1075  //Loop on each volume
1076  for ( UInt i (0); i < fakeFESpace.mesh()->numVolumes(); ++i )
1077  {
1078  //fakeFESpace.fe().update ( fakeFESpace.mesh()->volumeList ( i ), UPDATE_DPHI | UPDATE_WDET );
1079  fakeFESpace.fe().updateFirstDerivQuadPt ( fakeFESpace.mesh()->volumeList ( i ) );
1080 
1081  elVecSigmaX.zero();
1082  elVecSigmaY.zero();
1083  elVecSigmaZ.zero();
1084 
1085  M_marker = fakeFESpace.mesh()->volumeList ( i ).markerID();
1086 
1087  UInt eleID = fakeFESpace.fe().currentLocalId();
1088 
1089  //Extracting the local displacement
1090  for ( UInt iNode (0); iNode < ( UInt ) fakeFESpace.fe().nbFEDof(); ++iNode )
1091  {
1092  UInt iloc = fakeFESpace.fe().patternFirst ( iNode );
1093 
1094  for ( UInt iComp = 0; iComp < fakeFESpace.fieldDim(); ++iComp )
1095  {
1096  UInt ig = fakeFESpace.dof().localToGlobalMap ( eleID, iloc ) + iComp * fakeFESpace.dim() + M_offset;
1097  dk_loc[iloc + iComp * fakeFESpace.fe().nbFEDof() ] = dRep[ig];
1098  }
1099  }
1100 
1101  //Compute the element tensor F
1102  AssemblyElementalStructure::computeLocalDeformationGradient ( dk_loc, vectorDeformationF, fakeFESpace.fe() );
1103 
1104  //Compute the local vector of the principal stresses
1105  for ( UInt nDOF (0); nDOF < ( UInt ) fakeFESpace.fe().nbFEDof(); ++nDOF )
1106  {
1107  UInt iloc = fakeFESpace.fe().patternFirst ( nDOF );
1108 
1109  M_sigma->Scale (0.0);
1110  M_firstPiola->Scale (0.0);
1111  M_cofactorF->Scale (0.0);
1112 
1113  //Compute the rightCauchyC tensor
1114  AssemblyElementalStructure::computeInvariantsRightCauchyGreenTensor (M_invariants, vectorDeformationF[nDOF], *M_cofactorF);
1115 
1116  //Compute the first Piola-Kirchhoff tensor
1117  M_material->computeLocalFirstPiolaKirchhoffTensor (*M_firstPiola, vectorDeformationF[nDOF], *M_cofactorF, M_invariants, M_marker);
1118 
1119  //Compute the Cauchy tensor
1120  AssemblyElementalStructure::computeCauchyStressTensor (*M_sigma, *M_firstPiola, M_invariants[3], vectorDeformationF[nDOF]);
1121 
1122  //Assembling the local vectors for local tensions Component X, Y, Z
1123  for ( UInt coor (0); coor < fakeFESpace.fieldDim(); ++coor )
1124  {
1125  (elVecSigmaX) [iloc + coor * fakeFESpace.fe().nbFEDof() ] = (*M_sigma) (coor, 0);
1126  (elVecSigmaY) [iloc + coor * fakeFESpace.fe().nbFEDof() ] = (*M_sigma) (coor, 1);
1127  (elVecSigmaZ) [iloc + coor * fakeFESpace.fe().nbFEDof() ] = (*M_sigma) (coor, 2);
1128  }
1129  }
1130 
1131  reconstructElementaryVector ( elVecSigmaX, patchAreaR, fakeFESpace );
1132  reconstructElementaryVector ( elVecSigmaY, patchAreaR, fakeFESpace );
1133  reconstructElementaryVector ( elVecSigmaZ, patchAreaR, fakeFESpace );
1134 
1135  //Assembling the three elemental vector in the three global
1136  for ( UInt ic = 0; ic < fakeFESpace.fieldDim(); ++ic )
1137  {
1138  assembleVector (*M_sigmaX, elVecSigmaX, fakeFESpace.fe(), fakeFESpace.dof(), ic, M_offset + ic * totalDof );
1139  assembleVector (*M_sigmaY, elVecSigmaY, fakeFESpace.fe(), fakeFESpace.dof(), ic, M_offset + ic * totalDof );
1140  assembleVector (*M_sigmaZ, elVecSigmaZ, fakeFESpace.fe(), fakeFESpace.dof(), ic, M_offset + ic * totalDof );
1141  }
1142  }
1143 
1144  M_sigmaX->globalAssemble();
1145  M_sigmaY->globalAssemble();
1146  M_sigmaZ->globalAssemble();
1147 
1148  //Chrono
1149  chrono.stop();
1150  M_displayer->leaderPrint (" S- Cauchy stresses recovered in: ", chrono.globalDiff ( *M_displayer->comm() ), " s\n" );
1151 }
1152 
1153 template <typename Mesh>
1154 void
1156 {
1157  solutionVect_Type patchAreaR (*M_displacement, Repeated);
1158  patchAreaR *= 0.0;
1159 
1160  Real refElemArea (0); //area of reference element
1161  UInt totalDof = M_FESpace->dof().numTotalDof();
1162  //compute the area of reference element
1163  for (UInt iq (0); iq < M_FESpace->qr().nbQuadPt(); ++iq)
1164  {
1165  refElemArea += M_FESpace->qr().weight (iq);
1166  }
1167 
1168  // Define a special quadrature rule for the interpolation
1169  QuadratureRule interpQuad;
1170  interpQuad.setDimensionShape (shapeDimension (M_FESpace->refFE().shape() ), M_FESpace->refFE().shape() );
1171  Real wQuad (refElemArea / M_FESpace->refFE().nbDof() );
1172 
1173  for (UInt i (0); i < M_FESpace->refFE().nbDof(); ++i ) //nbRefCoor
1174  {
1175  interpQuad.addPoint (QuadraturePoint (M_FESpace->refFE().xi (i), M_FESpace->refFE().eta (i), M_FESpace->refFE().zeta (i), wQuad) );
1176  }
1177 
1178  UInt totalNumberVolumes (M_FESpace->mesh()->numVolumes() );
1179  UInt numberLocalDof (M_FESpace->dof().numLocalDof() );
1180 
1181  CurrentFE interpCFE (M_FESpace->refFE(), getGeometricMap (* (M_FESpace->mesh() ) ), interpQuad);
1182 
1183  // Loop over the cells
1184  for (UInt iterElement (0); iterElement < totalNumberVolumes; ++iterElement)
1185  {
1186  interpCFE.update (M_FESpace->mesh()->volumeList ( iterElement ), UPDATE_WDET );
1187 
1188  for (UInt iterDof (0); iterDof < numberLocalDof; ++iterDof)
1189  {
1190  for (UInt iDim (0); iDim < M_FESpace->fieldDim(); ++iDim)
1191  {
1192  ID globalDofID (M_FESpace->dof().localToGlobalMap (iterElement, iterDof) + iDim * totalDof);
1193  patchAreaR[globalDofID] += interpCFE.measure();
1194  }
1195  }
1196  }
1197 
1198  solutionVect_Type final (patchAreaR, Unique, Add);
1199 
1200  patchArea.add (final);
1201 }
1202 
1203 template <typename Mesh>
1204 void
1205 WallTensionEstimator<Mesh >::reconstructElementaryVector ( VectorElemental& elVecSigma,
1206  const solutionVect_Type& patchArea,
1207  const feSpace_Type& feSpace )
1208 {
1209  Real measure = feSpace.fe().measure();
1210  UInt eleID = feSpace.fe().currentLocalId();
1211 
1212  for (UInt iDof = 0; iDof < feSpace.fe().nbFEDof(); ++iDof)
1213  {
1214  UInt iloc = feSpace.fe().patternFirst ( iDof );
1215 
1216  for ( UInt icoor = 0; icoor < feSpace.fieldDim(); ++icoor )
1217  {
1218  ID globalDofID (feSpace.dof().localToGlobalMap (eleID, iDof) + icoor * feSpace.dof().numTotalDof() );
1219 
1220  elVecSigma[iloc + icoor * feSpace.fe().nbFEDof() ] *= ( measure / patchArea[globalDofID] );
1221  }
1222  }
1223 }
1224 
1225 }
1226 
1227 #endif /*WALLTENSION_H 1*/
void reconstructElementaryVector(VectorElemental &elVecSigma, const solutionVect_Type &patchArea, const feSpace_Type &feSpace)
reconstructElementaryVector: This method applies a reconstruction procedure on the elvec that is pass...
solutionVect_Type sigmaZ() const
void assignFunction(bcBase_Type &base)
Assign the function to the base of the BCHandler.
materialPtr_Type M_material
Material class.
void exportStressYY(solutionVect_Type &stressYY)
Export the YY component of the stress by copying it to an external vector.
solutionVectPtr_Type M_sigmaY
Vector for the Y component of the stress tensor.
StructuralConstitutiveLawData data_Type
std::shared_ptr< vector_Type > vectorPtr_Type
FESpace - Short description here please!
Definition: FESpace.hpp:78
void exportStressYZ(solutionVect_Type &stressYZ)
Export the YZ component of the stress by copying it to an external vector.
solutionVect_Type principalStresses() const
Get the global vector for the eigenvalues.
solutionVectPtr_Type M_gradientY
Vector for the gradient along Y of the displacement field.
void setDisplacement(const solutionVect_Type &displacement)
Set the displacement vector.
UInt M_marker
The volume marker.
solutionVectPtr_Type M_sigmaX
Vector for the X component of the stress tensor.
solutionVect_Type gradientX() const
Get the displacement solution.
virtual void analyzeTensions()
This method computes the Cauchy stress tensor and its principal values. It uses the displacement vect...
matrixPtr_Type M_firstPiola
Elementary matrix for the tensor P.
std::shared_ptr< matrix_Type > matrixPtr_Type
solutionVect_Type sigmaX() const
feSpacePtr_Type M_FESpace
Vectorial FE space.
void exportStressXY(solutionVect_Type &stressXY)
Export the XY component of the stress by copying it to an external vector.
Epetra_Import const & importer()
Getter for the Epetra_Import.
Definition: MapEpetra.cpp:394
feSpacePtr_Type M_FESpaceScalar
Scalar FE space.
#define ASSERT_PRE(X, A)
Definition: LifeAssert.hpp:96
uint32_type ID
IDs.
Definition: LifeV.hpp:194
std::shared_ptr< feSpaceET_Type > feSpaceETPtr_Type
void exportStressZX(solutionVect_Type &stressZX)
Export the ZX component of the stress by copying it to an external vector.
void constructPatchAreaVector(solutionVect_Type &patchArea)
constructPatchAreaVector: This method build the patch area vector used in the reconstruction process ...
WallTensionEstimatorData analysisData_Type
void exportStressYX(solutionVect_Type &stressYX)
Export the YX component of the stress by copying it to an external vector.
solutionVectPtr_Type M_gradientZ
Vector for the gradient along Z of the displacement field.
solutionVectPtr_Type M_globalEigenvalues
Vector for the eigenvalues of the Cauchy stress tensor.
void exportStressZY(solutionVect_Type &stressZY)
Export the ZY component of the stress by copying it to an external vector.
void exportStressXZ(solutionVect_Type &stressXZ)
Export the XZ component of the stress by copying it to an external vector.
const feSpacePtr_Type & feSpacePtr() const
Get the pointer to the FESpace object.
solutionVectPtr_Type M_sigmaVonMises
Vector for the Von Mises stress.
solutionVect_Type gradientZ() const
void analyzeTensionsRecoveryDisplacement()
This method computes the Cauchy stress tensor and its principal values. It uses the displacement vect...
std::shared_ptr< feSpace_Type > feSpacePtr_Type
void setup(const dataPtr_Type &dataMaterial, const analysisDataPtr_Type &tensionData, const feSpacePtr_Type &feSpace, const feSpaceETPtr_Type &feSpaceET, const commPtr_Type &comm, UInt marker)
Setup the created object of the class WallTensionEstimator.
std::string M_analysisType
Type of Analysis.
solutionVectPtr_Type M_sigmaZ
Vector for the Z component of the stress tensor.
Epetra_SerialDenseMatrix matrix_Type
double Real
Generic real data.
Definition: LifeV.hpp:175
const feSpace_Type & feSpace() const
Get the FESpace object.
CurrentFE - A primordial class for the assembly of the local matrices/vectors retaining the values on...
Definition: CurrentFE.hpp:243
std::shared_ptr< Exporter< Mesh > > exporterPtr_Type
void analyzeTensionsRecoveryEigenvalues()
This method computes the Cauchy stress tensor and its principal values. It uses the displacement vect...
void exportStressVonMises(solutionVect_Type &stressVonMises)
Export the ZZ component of the stress by copying it to an external vector.
solutionVect_Type gradientY() const
std::shared_ptr< VectorEpetra > solutionVectPtr_Type
solutionVectPtr_Type M_gradientX
Vector for the gradient along X of the displacement field.
matrixPtr_Type M_sigma
Elementary matrix for the tensor (Cauchy tensor on the current config)
void computeDisplacementGradient(solutionVectPtr_Type grDisplX, solutionVectPtr_Type grDisplY, solutionVectPtr_Type grDisplZ)
computeDeformation: This method computes the tensor F given the displacement on the element...
#define LIFEV_DEPRECATED(func)
Definition: LifeV.hpp:117
void exportStressZZ(solutionVect_Type &stressZZ)
Export the ZZ component of the stress by copying it to an external vector.
std::shared_ptr< material_Type > materialPtr_Type
MapEpetra const & map() const
Get the Epetramap.
solutionVectPtr_Type M_displacement
Vector for the displacement field.
matrixPtr_Type M_cofactorF
Elementary matrix for the tensor F.
UInt M_offset
The Offset parameter.
vector_Type M_invariants
Vector of the invariants of C and detF (length = 4)
matrixPtr_Type M_deformationF
Elementary matrix for the tensor F.
QuadratureRule - The basis class for storing and accessing quadrature rules.
void analyzeTensionsRecoveryVonMisesStress()
This method computes the Von Mises stress. It uses the displacement vector that has to be set...
FESpace< Mesh, MapEpetra > feSpace_Type
solutionVect_Type displacement() const
Get the displacement solution.
void setup(const dataPtr_Type &dataMaterial, const feSpacePtr_Type &feSpace, const feSpaceETPtr_Type &feSpaceET, const commPtr_Type &comm, UInt marker)
Setup the created object of the class WallTensionEstimator.
void constructGlobalStressVector()
constructGlobalStressVector: This method construct the vectors {.,i} for i=x,y,z to have for each DOF...
const feSpacePtr_Type & feSpaceScalarPtr() const
Get the pointer to the scalar FESpace object.
void analyzeTensionsRecoveryCauchyStresses()
This method computes the Cauchy stress tensor and its principal values. It uses the displacement vect...
DataElasticStructure - Data container for solid problems with elastic structure.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
void exportStressXX(solutionVect_Type &stressXX)
Export the XX component of the stress by copying it to an external vector.
ETFESpace< RegionMesh< LinearTetra >, MapEpetra, 3, 3 > feSpaceET_Type
solutionVect_Type sigmaY() const
const feSpace_Type & feSpaceScalar() const
Get the scalar FESpace object.
vector_Type M_eigenvaluesR
Vector of the eigenvalues of on the DOF (length = 3)
StructuralConstitutiveLaw< Mesh > material_Type