LifeV
StructuralConstitutiveLawData.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 DataElasticStructure - File containing a data container for solid problems with elastic structure
30  *
31  * @version 1.0
32  * @date 01-10-2003
33  * @author M.A. Fernandez
34  *
35  * @date 10-06-2010
36  * @author Cristiano Malossi
37  *
38  * @contributor Paolo Tricerri <paolo.tricerri@epfl.ch>
39  * @maintainer Paolo Tricerri <paolo.tricerri@epfl.ch>
40  */
41 
42 #ifndef StructuralConstitutiveLawData_H
43 #define StructuralConstitutiveLawData_H
44 
45 #include <string>
46 #include <iostream>
47 #include <map>
48 
49 #include <boost/shared_ptr.hpp>
50 
51 #include <lifev/core/LifeV.hpp>
52 #include <lifev/core/util/StringUtility.hpp>
53 #include <lifev/core/filter/GetPot.hpp>
54 #include <lifev/core/fem/TimeData.hpp>
55 #include <lifev/core/fem/TimeAdvanceData.hpp>
56 
57 namespace LifeV
58 {
59 
60 //! DataElasticStructure - Data container for solid problems with elastic structure
62 {
63 public:
64 
65  //! @name Type definitions
66  //@{
67 
68  typedef TimeData time_Type;
70 
71  typedef TimeAdvanceData timeAdvance_Type;
73 
78 
79  //@}
80 
81 
82  //! @name Constructors & Destructor
83  //@{
84 
85  //! Empty Constructor
87 
88  //! Copy constructor
89  /*!
90  * @param StructuralConstitutiveLawData - StructuralConstitutiveLawData
91  */
92  StructuralConstitutiveLawData ( const StructuralConstitutiveLawData& structuralConstitutiveLawData );
93 
94  //@}
95 
96 
97  //! @name Operators
98  //@{
99 
100  //! Operator=
101  /*!
102  * @param StructuralConstitutiveLawData - StructuralConstitutiveLawData
103  */
104  StructuralConstitutiveLawData& operator= ( const StructuralConstitutiveLawData& structuralConstitutiveLawData );
105 
106  //@}
107 
108 
109  //! @name Methods
110  //@{
111 
112  //! Read the dataFile and set all the quantities
113  /*!
114  * @param dataFile data file
115  * @param section section of the file
116  */
117  void setup ( const GetPot& dataFile, const std::string& section = "solid" );
118 
119  //! Display the values
120  void showMe ( std::ostream& output = std::cout ) const;
121 
122  //@}
123 
124 
125  //! @name Set methods
126  //@{
127 
128  //! Set data time container
129  /*!
130  * @param TimeData shared_ptr to TimeData container
131  */
132  void setTimeData ( const timePtr_Type timeData )
133  {
134  M_time = timeData;
135  }
136 
137  //! Set data time advance container
138  /*!
139  * @param timeAdvanceData shared_ptr to TimeAdvanceData container
140  */
141  void setTimeAdvanceData ( const timeAdvancePtr_Type timeAdvanceData )
142  {
143  M_timeAdvance = timeAdvanceData;
144  }
145 
146  //! Set data external pressure for the external surface of the solid
147  /*!
148  * @param externalPressure external pressure value
149  */
150  void setExternalPressure ( const Real& externalPressure )
151  {
152  M_externalPressure = externalPressure;
153  }
154 
155  //! Set density
156  /*!
157  * @param density solid density value
158  */
159  void setDensity ( const Real& density )
160  {
161  M_density = density;
162  }
163 
164  //! Set thickness
165  /*!
166  * @param thickness solid thickness value
167  */
168  void setThickness ( const Real& thickness )
169  {
170  M_thickness = thickness;
171  }
172 
173  //! Set poisson
174  /*!
175  * @param poisson solid poisson value
176  * @param material material ID (1 by default)
177  */
178  void setPoisson ( const Real& poisson, const UInt& material )
179  {
180  M_materialsFlagSet = true;
181  M_poisson[material] = poisson;
182  }
183 
184  //! Set Young modulus
185  /*!
186  * @param Solid Young modulus value
187  * @param material material ID (1 by default)
188  */
189  void setYoung ( const Real& young, const UInt& material )
190  {
191  M_materialsFlagSet = true;
192  M_young[material] = young;
193  }
194 
195  //! Set bulk modulus (nearly incompressible materials)
196  /*!
197  * @param bulk modulus value
198  * @param material material ID (1 by default)
199  */
200  void setBulk ( const Real& bulk, const UInt& material )
201  {
202  M_materialsFlagSet = true;
203  M_bulk[material] = bulk;
204  }
205 
206  //! Set Alfa modulus (nearly incompressible materials)
207  /*!
208  * @param Alfa modulus value
209  * @param material material ID (1 by default)
210  */
211  void setAlpha ( const Real& alpha, const UInt& material )
212  {
213  M_materialsFlagSet = true;
214  M_alpha[material] = alpha;
215  }
216 
217  //! Set Gamma (nearly imcompressible materials)
218  /*!
219  * @param Gamma modulus value
220  * @param material material ID (1 by default)
221  */
222  void setGamma ( const Real& gamma, const UInt& material )
223  {
224  M_materialsFlagSet = true;
225  M_gamma[material] = gamma;
226  }
227 
228  //@}
229 
230 
231  //! @name Get methods
232  //@{
233 
234  //! Get data time container
235  /*!
236  * @return shared_ptr to TimeData container
237  */
239  {
240  return M_time;
241  }
242 
243  //! Get data time advance container
244  /*!
245  * @return shared_ptr to TimeAdvanceData container
246  */
248  {
249  return M_timeAdvance;
250  }
251 
252  //! Get the external pressure to be applied to the external surface of the solid
253  /*!
254  * @return the value of the external pressure
255  */
256  const Real& externalPressure() const
257  {
258  return M_externalPressure;
259  }
260 
261  //! Get solid density
262  /*!
263  * @return Solid density
264  */
265  const Real& rho() const
266  {
267  return M_density;
268  }
269 
270  //! Get solid thickness
271  /*!
272  * @return Solid thickness
273  */
274  const Real& thickness() const
275  {
276  return M_thickness;
277  }
278 
279  //! Get solid thickness
280  /*!
281  * @return Solid thickness
282  */
284  {
286  }
287  //! Get solid thickness
288  /*!
289  * @return Solid thickness
290  */
291  const Real absoluteTolerance() const
292  {
293  return M_absoluteTolerance;
294  }
295  //! Get solid reltol newton
296  /*!
297  * @return Solid reltol newton
298  */
299  const Real relativeTolerance() const
300  {
301  return M_relativeTolerance;
302  }
303  //! Get solid etamax
304  /*!
305  * @return Solid etamax
306  */
307  const Real errorTolerance() const
308  {
309  return M_errorTolerance;
310  }
311  //! Get solid nonLinear Line Search ofr Newton
312  /*!
313  * @return nonLinearLineSearch
314  */
315  const UInt NonLinearLineSearch() const
316  {
317  return M_NonLinearLineSearch;
318  }
319 
320 
321  //! Get solid poisson coefficient
322  /*!
323  * @param material material ID (1 by default)
324  * @return Solid poisson coefficient
325  */
326  Real poisson ( const UInt& material ) const;
327 
328  //! Get solid young modulus
329  /*!
330  * @param material material ID (1 by default)
331  * @return Solid young modulus
332  */
333  Real young ( const UInt& material ) const;
334 
335  //! Get solid first lame coefficient
336  /*!
337  * @param material material ID (1 by default)
338  * @return Solid first Lame coefficient
339  */
340  Real lambda ( const UInt& material ) const;
341 
342  //! Get solid second Lame coefficient
343  /*!
344  * @param material material ID (1 by default)
345  * @return Solid second Lame coefficient
346  */
347  Real mu ( const UInt& material ) const;
348 
349  //! Get bulk modulus (nearly incompressible materials)
350  /*!
351  * @param material material ID (1 by default)
352  * @return bulk modulus
353  */
354  Real bulk ( const UInt& material = 1 ) const;
355 
356  //! Get alpha parameter (nearly incompressible materials)
357  /*!
358  * @param material material ID (1 by default)
359  * @return alpha parameter (neraly incompressible materials)
360  */
361  Real alpha ( const UInt& material = 1 ) const;
362 
363  //! Get gamma parameter (nearly incompressible materials)
364  /*!
365  * @param material material ID (1 by default)
366  * @return gamma parameter (nearly incompressible materials)
367  */
368  Real gamma ( const UInt& material = 1 ) const;
369 
370  //! Get FE order
371  /*!
372  * @return FE order
373  */
374  const std::string& order() const
375  {
376  return M_order;
377  }
378 
379  //! Get verbose level
380  /*!
381  * @return verbose level
382  */
383  const UInt& verbose() const
384  {
385  return M_verbose;
386  }
387 
388  //! Get isotropic law
389  /*!
390  * @return solid type isotropic
391  */
393  {
394  return M_solidTypeIsotropic;
395  }
396 
397  //! Get anisotropic law
398  /*!
399  * @return solid type anisotropic
400  */
401 
403  {
404  return M_constitutiveLaw;
405  }
406 
408  {
409  return M_solidTypeAnisotropic;
410  }
411 
413  {
414  return M_numberFibers;
415  }
416 
417  const Real ithStiffnessFibers( const UInt i )
418  {
419  return M_stiffnessParametersFibers[ i ];
420  }
421 
422  const Real ithNonlinearityFibers( const UInt i )
423  {
424  return M_nonlinearityParametersFibers[ i ];
425  }
426 
428  {
429  return M_characteristicStretch[ i ];
430  }
431 
432  const Real ithDistributionFibers( const UInt i )
433  {
434  return M_distributionParametersFibers[ i ];
435  }
436 
437  const Real smoothness( void )
438  {
439  return M_epsilon;
440  }
441 
442  const std::string fiberActivation( void )
443  {
444  return M_fiberActivation;
445  }
446 
447  const Real toleranceActivation( void )
448  {
449  return M_toleranceActivation;
450  }
451 
452 
453 
454  //! Get law type
455  /*!
456  * @return law type
457  */
458  const std::string& lawType()
459  {
460  return M_lawType;
461  }
462 
463  //! Get whether to use or not exact Jacobian
464  /*!
465  * @return true: if using exact Jacobian, false: otherwise
466  */
467  const bool& getUseExactJacobian() const
468  {
469  return M_useExactJacobian;
470  }
471 
472 
473  //! Get the vector of the set material_flags
474  /*!
475  * @return the vector of the material_flags set in the data file
476  */
478  {
479  return M_vectorMaterialFlags;
480  }
481 
482  //@}
483 
484 private:
485 
486  //! Data containers for time and mesh
489 
490  //! Physics
494 
496 
497  //! Young Modulus and Poisson ratio
500 
501  //! Bulk modulus k, alpha, gamma
505 
506  //! Space discretization
508 
509  //! Miscellaneous
510  UInt M_verbose; // temporal output verbose
511 
525 
527 
533 };
534 
535 } // end namespace LifeV
536 
537 #endif // StructuralConstitutiveLawData_H
void setPoisson(const Real &poisson, const UInt &material)
Set poisson.
Real young(const UInt &material) const
Get solid young modulus.
void setDensity(const Real &density)
Set density.
void setThickness(const Real &thickness)
Set thickness.
Real bulk(const UInt &material=1) const
Get bulk modulus (nearly incompressible materials)
void setGamma(const Real &gamma, const UInt &material)
Set Gamma (nearly imcompressible materials)
Real gamma(const UInt &material=1) const
Get gamma parameter (nearly incompressible materials)
timeAdvancePtr_Type dataTimeAdvance() const
Get data time advance container.
const Real & externalPressure() const
Get the external pressure to be applied to the external surface of the solid.
timePtr_Type dataTime() const
Get data time container.
void setAlpha(const Real &alpha, const UInt &material)
Set Alfa modulus (nearly incompressible materials)
const UInt & verbose() const
Get verbose level.
materialContainer_Type::const_iterator materialContainerIterator_Type
const std::string & lawType()
Get law type.
const Real & rho() const
Get solid density.
const vectorFlags_Type & vectorFlags() const
Get the vector of the set material_flags.
const std::string & solidTypeIsotropic()
Get isotropic law.
void setTimeAdvanceData(const timeAdvancePtr_Type timeAdvanceData)
Set data time advance container.
void setExternalPressure(const Real &externalPressure)
Set data external pressure for the external surface of the solid.
const Real errorTolerance() const
Get solid etamax.
void setup(const GetPot &dataFile, const std::string &section="solid")
Read the dataFile and set all the quantities.
Real alpha(const UInt &material=1) const
Get alpha parameter (nearly incompressible materials)
void setTimeData(const timePtr_Type timeData)
Set data time container.
const Real relativeTolerance() const
Get solid reltol newton.
Real lambda(const UInt &material) const
Get solid first lame coefficient.
const UInt NonLinearLineSearch() const
Get solid nonLinear Line Search ofr Newton.
const std::string & order() const
Get FE order.
materialContainer_Type M_bulk
Bulk modulus k, alpha, gamma.
double Real
Generic real data.
Definition: LifeV.hpp:175
const std::string & constitutiveLaw()
Get anisotropic law.
Real mu(const UInt &material) const
Get solid second Lame coefficient.
materialContainer_Type M_poisson
Young Modulus and Poisson ratio.
const UInt maxSubIterationNumber() const
Get solid thickness.
std::shared_ptr< timeAdvance_Type > timeAdvancePtr_Type
void setYoung(const Real &young, const UInt &material)
Set Young modulus.
const Real & thickness() const
Get solid thickness.
const bool & getUseExactJacobian() const
Get whether to use or not exact Jacobian.
DataElasticStructure - Data container for solid problems with elastic structure.
Real poisson(const UInt &material) const
Get solid poisson coefficient.
timePtr_Type M_time
Data containers for time and mesh.
const Real absoluteTolerance() const
Get solid thickness.
StructuralConstitutiveLawData & operator=(const StructuralConstitutiveLawData &structuralConstitutiveLawData)
Operator=.
StructuralConstitutiveLawData(const StructuralConstitutiveLawData &structuralConstitutiveLawData)
Copy constructor.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
void setBulk(const Real &bulk, const UInt &material)
Set bulk modulus (nearly incompressible materials)
void showMe(std::ostream &output=std::cout) const
Display the values.