46 #include <lifev/structure/solver/StructuralConstitutiveLawData.hpp> 54 StructuralConstitutiveLawData::StructuralConstitutiveLawData() :
59 M_externalPressure ( ),
60 M_materialsFlagSet (
false ),
68 M_solidTypeIsotropic ( ),
69 M_constitutiveLaw ( ),
70 M_solidTypeAnisotropic ( ),
72 M_stiffnessParametersFibers ( ),
73 M_nonlinearityParametersFibers ( ),
74 M_characteristicStretch ( ),
75 M_distributionParametersFibers ( ),
77 M_fiberActivation ( ),
78 M_toleranceActivation ( ),
80 M_useExactJacobian (
false ),
81 M_vectorMaterialFlags ( ),
82 M_maxSubIterationNumber ( ),
83 M_absoluteTolerance ( ),
84 M_relativeTolerance ( ),
86 M_NonLinearLineSearch ( )
90 StructuralConstitutiveLawData::StructuralConstitutiveLawData (
const StructuralConstitutiveLawData& structuralConstitutiveLawData ) :
91 M_time ( structuralConstitutiveLawData.M_time ),
92 M_timeAdvance ( structuralConstitutiveLawData.M_timeAdvance ),
93 M_density ( structuralConstitutiveLawData.M_density ),
94 M_thickness ( structuralConstitutiveLawData.M_thickness ),
95 M_externalPressure ( structuralConstitutiveLawData.M_externalPressure ),
96 M_materialsFlagSet ( structuralConstitutiveLawData.M_materialsFlagSet ),
97 M_poisson ( structuralConstitutiveLawData.M_poisson ),
98 M_young ( structuralConstitutiveLawData.M_young ),
99 M_bulk ( structuralConstitutiveLawData.M_bulk ),
100 M_alpha ( structuralConstitutiveLawData.M_alpha ),
101 M_gamma ( structuralConstitutiveLawData.M_gamma ),
102 M_order ( structuralConstitutiveLawData.M_order ),
103 M_verbose ( structuralConstitutiveLawData.M_verbose ),
104 M_solidTypeIsotropic ( structuralConstitutiveLawData.M_solidTypeIsotropic ),
105 M_constitutiveLaw ( structuralConstitutiveLawData.M_constitutiveLaw ),
106 M_solidTypeAnisotropic ( structuralConstitutiveLawData.M_solidTypeAnisotropic ),
107 M_numberFibers ( structuralConstitutiveLawData.M_numberFibers ),
108 M_stiffnessParametersFibers ( structuralConstitutiveLawData.M_stiffnessParametersFibers ),
109 M_nonlinearityParametersFibers ( structuralConstitutiveLawData.M_nonlinearityParametersFibers ),
110 M_characteristicStretch ( structuralConstitutiveLawData.M_characteristicStretch ),
111 M_distributionParametersFibers ( structuralConstitutiveLawData.M_distributionParametersFibers ),
112 M_epsilon ( structuralConstitutiveLawData.M_epsilon ),
113 M_fiberActivation ( structuralConstitutiveLawData.M_fiberActivation ),
114 M_toleranceActivation ( structuralConstitutiveLawData.M_toleranceActivation ),
115 M_lawType ( structuralConstitutiveLawData.M_lawType ),
116 M_useExactJacobian ( structuralConstitutiveLawData.M_useExactJacobian ),
117 M_vectorMaterialFlags ( structuralConstitutiveLawData.M_vectorMaterialFlags ),
118 M_maxSubIterationNumber ( structuralConstitutiveLawData.M_maxSubIterationNumber ),
119 M_absoluteTolerance ( structuralConstitutiveLawData.M_absoluteTolerance ),
120 M_relativeTolerance ( structuralConstitutiveLawData.M_relativeTolerance ),
121 M_errorTolerance ( structuralConstitutiveLawData.M_errorTolerance ),
122 M_NonLinearLineSearch ( structuralConstitutiveLawData.M_NonLinearLineSearch )
130 StructuralConstitutiveLawData&
131 StructuralConstitutiveLawData::operator= (
const StructuralConstitutiveLawData& structuralConstitutiveLawData )
133 if (
this != &structuralConstitutiveLawData )
135 M_time = structuralConstitutiveLawData.M_time;
136 M_timeAdvance = structuralConstitutiveLawData.M_timeAdvance;
137 M_density = structuralConstitutiveLawData.M_density;
138 M_thickness = structuralConstitutiveLawData.M_thickness;
139 M_externalPressure = structuralConstitutiveLawData.M_externalPressure;
140 M_materialsFlagSet = structuralConstitutiveLawData.M_materialsFlagSet;
141 M_poisson = structuralConstitutiveLawData.M_poisson;
142 M_young = structuralConstitutiveLawData.M_young;
143 M_bulk = structuralConstitutiveLawData.M_bulk;
144 M_alpha = structuralConstitutiveLawData.M_alpha;
145 M_gamma = structuralConstitutiveLawData.M_gamma;
146 M_order = structuralConstitutiveLawData.M_order;
147 M_verbose = structuralConstitutiveLawData.M_verbose;
148 M_solidTypeIsotropic = structuralConstitutiveLawData.M_solidTypeIsotropic;
149 M_constitutiveLaw = structuralConstitutiveLawData.M_constitutiveLaw;
150 M_solidTypeAnisotropic = structuralConstitutiveLawData.M_solidTypeAnisotropic;
151 M_numberFibers = structuralConstitutiveLawData.M_numberFibers;
152 M_stiffnessParametersFibers = structuralConstitutiveLawData.M_stiffnessParametersFibers;
153 M_nonlinearityParametersFibers = structuralConstitutiveLawData.M_nonlinearityParametersFibers;
154 M_characteristicStretch = structuralConstitutiveLawData.M_characteristicStretch;
155 M_distributionParametersFibers = structuralConstitutiveLawData.M_distributionParametersFibers;
156 M_epsilon = structuralConstitutiveLawData.M_epsilon;
157 M_fiberActivation = structuralConstitutiveLawData.M_fiberActivation;
158 M_toleranceActivation = structuralConstitutiveLawData.M_toleranceActivation;
159 M_lawType = structuralConstitutiveLawData.M_lawType;
160 M_useExactJacobian = structuralConstitutiveLawData.M_useExactJacobian;
161 M_vectorMaterialFlags = structuralConstitutiveLawData.M_vectorMaterialFlags;
162 M_maxSubIterationNumber = structuralConstitutiveLawData.M_maxSubIterationNumber;
163 M_absoluteTolerance = structuralConstitutiveLawData.M_absoluteTolerance;
164 M_relativeTolerance = structuralConstitutiveLawData.M_relativeTolerance;
165 M_errorTolerance = structuralConstitutiveLawData.M_errorTolerance;
166 M_NonLinearLineSearch = structuralConstitutiveLawData.M_NonLinearLineSearch;
176 StructuralConstitutiveLawData::setup (
const GetPot& dataFile,
const std::string& section )
181 M_time.reset (
new time_Type ( dataFile, section +
"/time_discretization" ) );
184 if ( !M_timeAdvance.get() )
186 M_timeAdvance.reset (
new timeAdvance_Type ( dataFile, section +
"/time_discretization" ) );
190 M_solidTypeIsotropic = dataFile ( ( section +
"/model/solidTypeIsotropic" ).data(),
"NO_DEFAULT_SOLID_TYPE_ISOTROPIC" );
193 M_constitutiveLaw = dataFile ( ( section +
"/model/constitutiveLaw" ).data(),
"isotropic" );
195 if( !M_constitutiveLaw.compare(
"anisotropic") )
197 M_solidTypeAnisotropic = dataFile ( ( section +
"/model/solidTypeAnisotropic" ).data(),
"NO_DEFAULT_SOLID_TYPE_ANISOTROPIC" );
198 M_numberFibers = dataFile ( ( section +
"/model/fibers/numberFamilies" ).data(), 0 );
200 ASSERT( M_numberFibers,
" The number of fibers of the anisotropic law has to be different from 0!" );
204 if( !M_solidTypeIsotropic.compare(
"linearVenantKirchhoff") )
206 M_lawType =
"linear";
210 M_lawType =
"nonlinear";
213 if( !M_constitutiveLaw.compare(
"anisotropic") )
215 ASSERT ( M_lawType.compare (
"linear"),
"The Linear Elastic law cannot be used with anisotropic laws");
218 M_externalPressure = dataFile ( ( section +
"/physics/externalPressure" ).data(), 0. );
219 M_density = dataFile ( ( section +
"/physics/density" ).data(), 1. );
220 M_thickness = dataFile ( ( section +
"/physics/thickness" ).data(), 0.1 );
223 UInt materialsNumber = dataFile.vector_variable_size ( ( section +
"/physics/material_flag" ).data() );
225 if( !M_constitutiveLaw.compare(
"anisotropic") )
227 UInt numberOfStiffnesses = dataFile.vector_variable_size ( ( section +
"/model/fibers/stiffness" ).data() );
228 UInt numberOfNonlinearities = dataFile.vector_variable_size ( ( section +
"/model/fibers/nonlinearity" ).data() );
231 ASSERT( M_numberFibers ,
" The number of fiber families is equal to zero, change the variable constitutiveLaw from anisotropic to isotropic " );
232 ASSERT( ( M_numberFibers == numberOfStiffnesses ) && ( M_numberFibers == numberOfNonlinearities ),
" Inconsistency in the set up of the fiber parameters" );
234 if( !M_solidTypeAnisotropic.compare(
"multimechanism") ||
235 !M_solidTypeAnisotropic.compare(
"holzapfelGeneralized") )
237 UInt numberStretches = dataFile.vector_variable_size ( ( section +
"/model/fibers/stretch" ).data() );
238 ASSERT( ( M_numberFibers == numberOfStiffnesses ) &&
239 ( M_numberFibers == numberOfNonlinearities ) &&
240 ( M_numberFibers == numberStretches ) ,
" Inconsistency in the set up of the fiber parameters" );
243 if( !M_solidTypeAnisotropic.compare(
"distributedHolzapfel") )
245 UInt numberOfDistribution = dataFile.vector_variable_size ( ( section +
"/model/fibers/distribution" ).data() );
246 ASSERT( ( M_numberFibers == numberOfStiffnesses ) && ( M_numberFibers == numberOfNonlinearities )
247 && ( M_numberFibers == numberOfDistribution ),
" Inconsistency in the set up of the fiber parameters" );
252 ASSERT ( materialsNumber,
"Set the materrial_flag variable in [solid]/physics");
254 if ( materialsNumber == 0 )
258 M_materialsFlagSet =
false;
259 M_vectorMaterialFlags.resize (1);
261 M_vectorMaterialFlags[0] = 1;
262 M_young[1] = dataFile ( ( section +
"/model/young" ).data(), 0. );
263 M_poisson[1] = dataFile ( ( section +
"/model/poisson" ).data(), 0. );
265 M_bulk[1] = dataFile ( ( section +
"/model/bulk" ).data(), 0. );
266 M_alpha[1] = dataFile ( ( section +
"/model/alpha" ).data(), 0. );
267 M_gamma[1] = dataFile ( ( section +
"/model/gamma" ).data(), 0. );
271 M_materialsFlagSet =
true;
278 for (
UInt i (0) ; i < materialsNumber ; ++i )
281 M_vectorMaterialFlags.resize ( materialsNumber );
282 material = dataFile ( ( section +
"/physics/material_flag" ).data(), 0., i );
284 M_vectorMaterialFlags[i] = material;
285 M_young[material] = dataFile ( ( section +
"/model/young" ).data(), 0., i );
286 M_poisson[material] = dataFile ( ( section +
"/model/poisson" ).data(), 0., i );
288 M_bulk[material] = dataFile ( ( section +
"/model/bulk" ).data(), 0.0, i );
289 M_alpha[material] = dataFile ( ( section +
"/model/alpha" ).data(), 0.0, i );
290 M_gamma[material] = dataFile ( ( section +
"/model/gamma" ).data(), 0.0, i );
294 if( !M_constitutiveLaw.compare(
"anisotropic") )
296 M_stiffnessParametersFibers .resize ( M_numberFibers );
297 M_nonlinearityParametersFibers .resize ( M_numberFibers );
298 M_distributionParametersFibers .resize ( M_numberFibers );
300 if( !M_solidTypeAnisotropic.compare(
"multimechanism") ||
301 !M_solidTypeAnisotropic.compare(
"holzapfelGeneralized") )
303 M_characteristicStretch .resize ( M_numberFibers );
306 for (
UInt i (0) ; i < M_numberFibers ; ++i )
308 M_stiffnessParametersFibers[ i ] = dataFile ( ( section +
"/model/fibers/stiffness" ).data(), 0., i );
309 M_nonlinearityParametersFibers[ i ] = dataFile ( ( section +
"/model/fibers/nonlinearity" ).data(), 0., i );
311 if( !M_solidTypeAnisotropic.compare(
"multimechanism") ||
312 !M_solidTypeAnisotropic.compare(
"holzapfelGeneralized") )
314 M_characteristicStretch[ i ] = dataFile ( ( section +
"/model/fibers/stretch" ).data(), 0., i );
317 if( !M_solidTypeAnisotropic.compare(
"distributedHolzapfel") )
319 M_distributionParametersFibers[ i ] = dataFile ( ( section +
"/model/fibers/distribution" ).data(), 0., i );
322 M_epsilon = dataFile ( ( section +
"/model/fibers/smoothness" ).data(), 0. );
323 M_fiberActivation = dataFile ( ( section +
"/model/fiberActivation" ).data(),
"implicit" );
324 M_toleranceActivation = dataFile ( ( section +
"/model/fibers/tolActivation" ).data(), 0.001 );
328 M_order = dataFile ( ( section +
"/space_discretization/order" ).data(),
"P1" );
331 M_verbose = dataFile ( ( section +
"/miscellaneous/verbose" ).data(), 0 );
332 M_useExactJacobian = dataFile ( ( section +
"/useExactJacobian" ).data(),
false );
335 M_maxSubIterationNumber = dataFile ( ( section +
"/newton/maxSubIter" ).data(), 300 );
336 M_absoluteTolerance = dataFile ( ( section +
"/newton/abstol" ).data(), 1.e-07 );
337 M_relativeTolerance = dataFile ( ( section +
"/newton/reltol" ).data(), 1.e-07 );
338 M_errorTolerance = dataFile ( ( section +
"/newton/etamax" ).data(), 1.e-03 );
339 M_NonLinearLineSearch =
static_cast<Int> ( dataFile ( ( section +
"/newton/NonLinearLineSearch" ).data(), 0 ) );
344 StructuralConstitutiveLawData::showMe ( std::ostream& output )
const 347 output <<
"\n*** Values for data [solid/physics]\n\n";
348 output <<
"external pressure = " << M_externalPressure << std::endl;
349 output <<
"density = " << M_density << std::endl;
350 output <<
"thickness = " << M_thickness << std::endl;
351 for ( materialContainerIterator_Type i = M_young.begin() ; i != M_young.end() ; ++i )
353 output <<
"young[" << i->first <<
"] = " << i->second << std::endl;
355 for ( materialContainerIterator_Type i = M_poisson.begin() ; i != M_poisson.end() ; ++i )
357 output <<
"poisson[" << i->first <<
"] = " << i->second << std::endl;
360 for ( materialContainerIterator_Type i = M_bulk.begin() ; i != M_bulk.end() ; ++i )
362 output <<
"bulk[" << i->first <<
"] = " << i->second << std::endl;
365 for ( materialContainerIterator_Type i = M_alpha.begin() ; i != M_alpha.end() ; ++i )
367 output <<
"alpha[" << i->first <<
"] = " << i->second << std::endl;
370 for ( materialContainerIterator_Type i = M_gamma.begin() ; i != M_gamma.end() ; ++i )
372 output <<
"gamma[" << i->first <<
"] = " << i->second << std::endl;
375 for ( materialContainerIterator_Type i = M_poisson.begin() ; i != M_poisson.end() ; ++i )
377 output <<
"Lame - lambda[" << i->first <<
"] = " << lambda ( i->first ) << std::endl;
378 output <<
"Lame - mu[" << i->first <<
"] = " << mu ( i->first ) << std::endl;
381 for ( UInt i (0); i < M_vectorMaterialFlags.size(); i++ )
383 output <<
"Position:" << i <<
" -> Material Flag: = " << M_vectorMaterialFlags[i] << std::endl;
387 output <<
"\n*** Values for data [solid/miscellaneous]\n\n";
388 output <<
"verbose = " << M_verbose << std::endl;
390 output <<
"\n*** Values for data [solid/space_discretization]\n\n";
391 output <<
"FE order = " << M_order << std::endl;
393 output <<
"\n*** Values for data [solid/time_discretization]\n\n";
394 M_time->showMe ( output );
395 M_timeAdvance->showMe ( output );
397 output <<
" Informations on the constitutive law " << std::endl;
398 output <<
" Type of constitutive law " << M_constitutiveLaw << std::endl;
399 output <<
" Isotropic Part: " << M_solidTypeIsotropic << std::endl;
401 if( !M_constitutiveLaw.compare(
"anisotropic") )
403 output <<
" Anisotropic Part: " << M_solidTypeAnisotropic << std::endl;
405 for (
UInt i (0) ; i < M_numberFibers ; ++i )
407 std::cout << i + 1 <<
"-th coupled of parameters ( stiffness, nonlinearity ) : ( " << M_stiffnessParametersFibers[ i ]
408 <<
", " << M_nonlinearityParametersFibers[ i ] <<
" ); " << std::endl;
411 if( !M_solidTypeAnisotropic.compare(
"multimechanism") ||
412 !M_solidTypeAnisotropic.compare(
"holzapfelGeneralized"))
414 for (
UInt i (0) ; i < M_numberFibers ; ++i )
417 <<
"-th characteristic stretch : " << M_characteristicStretch[ i ]
422 if( !M_solidTypeAnisotropic.compare(
"distributedHolzapfel") )
424 for (
UInt i (0) ; i < M_numberFibers ; ++i )
427 <<
"-th distribution: " << M_distributionParametersFibers[ i ]
438 StructuralConstitutiveLawData::poisson (
const UInt& material )
const 440 materialContainer_Type::const_iterator IT;
442 if ( M_materialsFlagSet )
444 IT = M_poisson.find ( material );
448 IT = M_poisson.find ( 1 );
451 if ( IT != M_poisson.end() )
457 std::cout <<
" !!! Warning: the Poisson modulus has not been set !!!" << std::endl;
463 StructuralConstitutiveLawData::young (
const UInt& material )
const 465 materialContainer_Type::const_iterator IT;
466 if ( M_materialsFlagSet )
468 IT = M_young.find ( material );
472 IT = M_young.find ( 1 );
475 if ( IT != M_young.end() )
481 std::cout <<
" !!! Warning: the Young modulus has not been set !!!" << std::endl;
487 StructuralConstitutiveLawData::bulk (
const UInt& material )
const 489 materialContainer_Type::const_iterator IT;
490 if ( M_materialsFlagSet )
492 IT = M_bulk.find ( material );
496 IT = M_bulk.find ( 1 );
499 if ( IT != M_bulk.end() )
505 std::cout <<
" !!! Warning: the bulk modulus has not been set !!!" << std::endl;
511 StructuralConstitutiveLawData::alpha (
const UInt& material )
const 513 materialContainer_Type::const_iterator IT;
514 if ( M_materialsFlagSet )
516 IT = M_alpha.find ( material );
520 IT = M_alpha.find ( 1 );
523 if ( IT != M_alpha.end() )
529 std::cout <<
" !!! Warning: the alpha modulus has not been set !!!" << std::endl;
535 StructuralConstitutiveLawData::gamma (
const UInt& material )
const 537 materialContainer_Type::const_iterator IT;
538 if ( M_materialsFlagSet )
540 IT = M_gamma.find ( material );
544 IT = M_gamma.find ( 1 );
547 if ( IT != M_gamma.end() )
553 std::cout <<
" !!! Warning: the gamma modulus has not been set !!!" << std::endl;
560 StructuralConstitutiveLawData::lambda (
const UInt& material )
const 562 Real youngC, poissonC;
564 youngC =
this->young ( material );
565 poissonC =
this->poisson ( material );
567 return youngC * poissonC / ( ( 1.0 + poissonC ) * ( 1.0 - 2.0 * poissonC ) );
571 StructuralConstitutiveLawData::mu (
const UInt& material )
const 573 Real youngC, poissonC;
575 youngC =
this->young ( material );
576 poissonC =
this->poisson ( material );
578 return youngC / ( 2.0 * ( 1.0 + poissonC ) );
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.
uint32_type UInt
generic unsigned integer (used mainly for addressing)