33 #error test_structure cannot be compiled in 2D
37 #pragma GCC diagnostic ignored "-Wunused-variable" 38 #pragma GCC diagnostic ignored "-Wunused-parameter" 40 #include <Epetra_ConfigDefs.h> 43 #include <Epetra_MpiComm.h> 45 #include <Epetra_SerialComm.h> 49 #pragma GCC diagnostic warning "-Wunused-variable" 50 #pragma GCC diagnostic warning "-Wunused-parameter" 52 #include <lifev/core/LifeV.hpp> 54 #include <lifev/core/array/VectorEpetra.hpp> 55 #include <lifev/core/array/MapEpetra.hpp> 57 #include <lifev/core/mesh/MeshData.hpp> 58 #include <lifev/core/mesh/MeshPartitioner.hpp> 60 #include <lifev/structure/fem/ExpressionDefinitions.hpp> 61 #include <lifev/structure/solver/StructuralConstitutiveLawData.hpp> 64 #include <lifev/core/array/MatrixSmall.hpp> 65 #include <lifev/eta/expression/Evaluate.hpp> 67 #include <lifev/core/filter/ExporterEnsight.hpp> 69 #include <lifev/core/filter/ExporterHDF5.hpp> 71 #include <lifev/core/filter/ExporterEmpty.hpp> 77 using namespace LifeV;
83 std::string stringList = list;
84 std::set<UInt> setList;
90 while ( commaPos != std::string::npos )
92 commaPos = stringList.find (
"," );
93 setList.insert ( atoi ( stringList.substr ( 0, commaPos ).c_str() ) );
94 stringList = stringList.substr ( commaPos + 1 );
96 setList.insert ( atoi ( stringList.c_str() ) );
128 std::shared_ptr<Epetra_Comm> structComm );
164 std::shared_ptr<Private> parameters;
180 double rho, poisson, young, bulk, alpha, gamma;
182 std::string data_file_name;
184 std::shared_ptr<Epetra_Comm> comm;
192 std::shared_ptr<Epetra_Comm> structComm) :
196 std::string data_file_name = command_line.follow (
"data", 2,
"-f",
"--file");
197 GetPot dataFile ( data_file_name );
198 parameters->data_file_name = data_file_name;
200 parameters->comm = structComm;
201 int ntasks = parameters->comm->NumProc();
203 if (!parameters->comm->MyPID() )
205 std::cout <<
"My PID = " << parameters->comm->MyPID() <<
" out of " << ntasks <<
" running." << std::endl;
214 std::cout <<
"2D cylinder test case is not available yet\n";
225 typedef std::shared_ptr<vector_Type> vectorPtr_Type;
227 typedef std::shared_ptr<solidFESpace_Type> solidFESpacePtr_Type;
229 typedef ETFESpace< RegionMesh<LinearTetra>, MapEpetra, 3, 3 > solidETFESpace_Type;
230 typedef std::shared_ptr<solidETFESpace_Type> solidETFESpacePtr_Type;
232 typedef ETFESpace< RegionMesh<LinearTetra>, MapEpetra, 3, 1 > scalarETFESpace_Type;
233 typedef std::shared_ptr<scalarETFESpace_Type> scalarETFESpacePtr_Type;
236 typedef std::function<Real ( Real
const&, Real
const&, Real
const&, Real
const&, ID
const& ) > fiberFunction_Type;
237 typedef std::shared_ptr<fiberFunction_Type> fiberFunctionPtr_Type;
239 typedef std::vector<fiberFunctionPtr_Type> vectorFiberFunction_Type;
240 typedef std::shared_ptr<vectorFiberFunction_Type> vectorFiberFunctionPtr_Type;
242 typedef std::vector<vectorPtr_Type> vectorInterpolatedFibers_Type;
246 bool verbose = (parameters->comm->MyPID() == 0);
249 GetPot dataFile ( parameters->data_file_name.c_str() );
250 std::shared_ptr<StructuralConstitutiveLawData> dataStructure (
new StructuralConstitutiveLawData( ) );
251 dataStructure->setup (dataFile);
255 meshData.setup (dataFile,
"solid/space_discretization");
257 std::shared_ptr<mesh_Type > fullMeshPtr (
new RegionMesh<LinearTetra> ( ( parameters->comm ) ) );
258 std::shared_ptr<mesh_Type > localMeshPtr (
new RegionMesh<LinearTetra> ( ( parameters->comm ) ) );
259 readMesh (*fullMeshPtr, meshData);
262 localMeshPtr = meshPart.meshPartition();
265 std::string dOrder = dataFile (
"solid/space_discretization/order",
"P1");
266 solidFESpacePtr_Type dFESpace (
new solidFESpace_Type (localMeshPtr, dOrder, 3, parameters->comm) );
267 solidETFESpacePtr_Type dETFESpace (
new solidETFESpace_Type (meshPart, & (dFESpace->refFE() ), & (dFESpace->fe().geoMap() ), parameters->comm) );
270 solidFESpacePtr_Type dScalarFESpace (
new solidFESpace_Type (localMeshPtr, dOrder, 1, parameters->comm) );
271 scalarETFESpacePtr_Type dScalarETFESpace (
new scalarETFESpace_Type (meshPart, & (dFESpace->refFE() ), & (dFESpace->fe().geoMap() ), parameters->comm) );
276 std::cout << std::endl;
280 vectorPtr_Type solidDisp (
new vector_Type (dFESpace->map(), LifeV::Unique ) );
287 vectorFiberFunctionPtr_Type pointerToVectorOfFamilies(
new vectorFiberFunction_Type( ) );
288 (*pointerToVectorOfFamilies).resize( dataStructure->numberFibersFamilies( ) );
291 std::cout <<
"Size of the number of families: " << (*pointerToVectorOfFamilies).size() << std::endl;
293 fibersDirectionList setOfFiberFunctions;
294 setOfFiberFunctions.setupFiberDefinitions( dataStructure->numberFibersFamilies( ) );
297 for( UInt k(1); k <= pointerToVectorOfFamilies->size( ); k++ )
300 std::string family=
"Family";
302 std::string familyNumber;
303 std::ostringstream number;
305 familyNumber = number.str();
308 std::string creationString = family + familyNumber;
309 (*pointerToVectorOfFamilies)[ k-1 ].reset(
new fiberFunction_Type() );
310 (*pointerToVectorOfFamilies)[ k-1 ] = setOfFiberFunctions.fiberDefinition( creationString );
314 vectorInterpolatedFibers_Type vectorInterpolated(0);
317 vectorInterpolated.resize( (*pointerToVectorOfFamilies).size() );
319 for( UInt k(0); k < (*pointerToVectorOfFamilies).size(); k++ )
321 vectorInterpolated[ k ].reset(
new vector_Type( dFESpace->map() ) );
322 dFESpace->interpolate ( *( ( *(pointerToVectorOfFamilies) )[ k ] ) ,
323 * ( ( vectorInterpolated )[ k ] ),
330 std::shared_ptr< Exporter<RegionMesh<LinearTetra> > > exporter;
332 std::string
const exporterType = dataFile (
"exporter/type",
"hdf5");
333 std::string
const nameExporter = dataFile (
"exporter/name",
"jacobian");
336 if (exporterType.compare (
"hdf5") == 0)
338 exporter.reset (
new hdf5Filter_Type ( dataFile, nameExporter ) );
343 if (exporterType.compare (
"none") == 0)
345 exporter.reset (
new emptyFilter_Type ( dataFile, meshPart.meshPartition(), nameExporter, parameters->comm->MyPID() ) ) ;
350 exporter.reset (
new ensightFilter_Type ( dataFile, meshPart.meshPartition(), nameExporter, parameters->comm->MyPID() ) ) ;
354 exporter->setMeshProcId (dFESpace->mesh(), dFESpace->map().comm().MyPID() );
357 vectorPtr_Type patchAreaVector (
new vector_Type ( dETFESpace->map(), LifeV::Unique ) );
358 vectorPtr_Type patchAreaVectorScalar (
new vector_Type ( dScalarETFESpace->map(), Unique ) );
359 vectorPtr_Type JacobianZero(
new vector_Type( dScalarETFESpace->map(), Unique ) );
360 vectorPtr_Type JacobianZeroA(
new vector_Type( dScalarETFESpace->map(), Unique ) );
361 vectorPtr_Type JacobianA(
new vector_Type( dScalarETFESpace->map(), Unique ) );
367 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::ScalarField,
"J_0", dScalarFESpace, JacobianA, UInt (0) );
368 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::ScalarField,
"J_0(ta)", dScalarFESpace, JacobianZeroA, UInt (0) );
369 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::ScalarField,
"Ja", dScalarFESpace, JacobianA, UInt (0) );
371 vectorInterpolatedFibers_Type stretchesVector(0);
372 stretchesVector.resize( (*pointerToVectorOfFamilies).size() );
374 vectorInterpolatedFibers_Type atanStretchesVector(0);
375 atanStretchesVector.resize( (*pointerToVectorOfFamilies).size() );
377 vectorInterpolatedFibers_Type scalarExpressionMultimechanism(0);
378 scalarExpressionMultimechanism.resize( (*pointerToVectorOfFamilies).size() );
381 vectorInterpolatedFibers_Type Fa_col1(0);
382 Fa_col1.resize( (*pointerToVectorOfFamilies).size() );
384 vectorInterpolatedFibers_Type Fa_col2(0);
385 Fa_col2.resize( (*pointerToVectorOfFamilies).size() );
387 vectorInterpolatedFibers_Type Fa_col3(0);
388 Fa_col3.resize( (*pointerToVectorOfFamilies).size() );
391 vectorInterpolatedFibers_Type Mith_col1(0);
392 Mith_col1.resize( (*pointerToVectorOfFamilies).size() );
394 vectorInterpolatedFibers_Type Mith_col2(0);
395 Mith_col2.resize( (*pointerToVectorOfFamilies).size() );
397 vectorInterpolatedFibers_Type Mith_col3(0);
398 Mith_col3.resize( (*pointerToVectorOfFamilies).size() );
401 vectorInterpolatedFibers_Type FzeroAminusT_col1(0);
402 FzeroAminusT_col1.resize( (*pointerToVectorOfFamilies).size() );
404 vectorInterpolatedFibers_Type FzeroAminusT_col2(0);
405 FzeroAminusT_col2.resize( (*pointerToVectorOfFamilies).size() );
407 vectorInterpolatedFibers_Type FzeroAminusT_col3(0);
408 FzeroAminusT_col3.resize( (*pointerToVectorOfFamilies).size() );
411 vectorInterpolatedFibers_Type P_col1(0);
412 P_col1.resize( (*pointerToVectorOfFamilies).size() );
414 vectorInterpolatedFibers_Type P_col2(0);
415 P_col2.resize( (*pointerToVectorOfFamilies).size() );
417 vectorInterpolatedFibers_Type P_col3(0);
418 P_col3.resize( (*pointerToVectorOfFamilies).size() );
423 for( UInt k(1); k <= pointerToVectorOfFamilies->size( ); k++ )
425 stretchesVector[ k - 1 ].reset(
new vector_Type( dScalarFESpace->map() ) );
426 atanStretchesVector[ k - 1 ].reset(
new vector_Type( dScalarFESpace->map() ) );
427 scalarExpressionMultimechanism[ k - 1 ].reset(
new vector_Type( dScalarFESpace->map() ) );
429 Fa_col1[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
430 Fa_col2[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
431 Fa_col3[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
433 Mith_col1[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
434 Mith_col2[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
435 Mith_col3[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
437 FzeroAminusT_col1[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
438 FzeroAminusT_col2[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
439 FzeroAminusT_col3[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
441 P_col1[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
442 P_col2[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
443 P_col3[ k - 1 ].reset(
new vector_Type( dFESpace->map() ) );
447 std::string stretchfamily=
"stretchFamily-";
448 std::string familyAtan=
"atanStretchFamily-";
449 std::string familyScalar=
"scalarQuantityFamily-";
451 std::string Fa1=
"Fa1-";
452 std::string Fa2=
"Fa2-";
453 std::string Fa3=
"Fa3-";
455 std::string Mith1=
"Mith1-";
456 std::string Mith2=
"Mith2-";
457 std::string Mith3=
"Mith3-";
459 std::string FzeroAminusT1=
"FzeroAminusT1-";
460 std::string FzeroAminusT2=
"FzeroAminusT2-";
461 std::string FzeroAminusT3=
"FzeroAminusT3-";
463 std::string P1=
"P1-";
464 std::string P2=
"P2-";
465 std::string P3=
"P3-";
469 std::string familyNumber;
470 std::ostringstream number;
472 familyNumber = number.str();
475 std::string creationString = stretchfamily + familyNumber;
476 std::string creationStringAtan = familyAtan + familyNumber;
477 std::string creationStringScalar = familyScalar + familyNumber;
479 std::string creationStringFa1 = Fa1 + familyNumber;
480 std::string creationStringFa2 = Fa2 + familyNumber;
481 std::string creationStringFa3 = Fa3 + familyNumber;
483 std::string creationStringFzeroAminusT1 = FzeroAminusT1 + familyNumber;
484 std::string creationStringFzeroAminusT2 = FzeroAminusT2 + familyNumber;
485 std::string creationStringFzeroAminusT3 = FzeroAminusT3 + familyNumber;
487 std::string creationStringMith1 = Mith1 + familyNumber;
488 std::string creationStringMith2 = Mith2 + familyNumber;
489 std::string creationStringMith3 = Mith3 + familyNumber;
491 std::string creationStringP1 = P1 + familyNumber;
492 std::string creationStringP2 = P2 + familyNumber;
493 std::string creationStringP3 = P3 + familyNumber;
495 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::ScalarField, creationString, dScalarFESpace, stretchesVector[ k-1 ], UInt (0) );
496 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::ScalarField, creationStringAtan, dScalarFESpace, atanStretchesVector[ k-1 ], UInt (0) );
497 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::ScalarField, creationStringScalar, dScalarFESpace, scalarExpressionMultimechanism[ k-1 ], UInt (0) );
499 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringFa1, dFESpace, Fa_col1[ k-1 ], UInt (0) );
500 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringFa2, dFESpace, Fa_col2[ k-1 ], UInt (0) );
501 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringFa3, dFESpace, Fa_col3[ k-1 ], UInt (0) );
503 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringFzeroAminusT1, dFESpace, FzeroAminusT_col1[ k-1 ], UInt (0) );
504 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringFzeroAminusT2, dFESpace, FzeroAminusT_col2[ k-1 ], UInt (0) );
505 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringFzeroAminusT3, dFESpace, FzeroAminusT_col3[ k-1 ], UInt (0) );
507 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringMith1, dFESpace, Mith_col1[ k-1 ], UInt (0) );
508 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringMith2, dFESpace, Mith_col2[ k-1 ], UInt (0) );
509 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringMith3, dFESpace, Mith_col3[ k-1 ], UInt (0) );
511 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringP1, dFESpace, P_col1[ k-1 ], UInt (0) );
512 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringP2, dFESpace, P_col2[ k-1 ], UInt (0) );
513 exporter->addVariable ( ExporterData<RegionMesh<LinearTetra> >::VectorField, creationStringP3, dFESpace, P_col3[ k-1 ], UInt (0) );
518 exporter->postProcess ( 0.0 );
520 MPI_Barrier (MPI_COMM_WORLD);
524 Real refElemArea (0);
526 for (UInt iq = 0; iq < dFESpace->qr().nbQuadPt(); iq++)
528 refElemArea += dFESpace->qr().weight (iq);
531 Real wQuad (refElemArea / dFESpace->refFE().nbDof() );
534 std::vector<GeoVector> coords = dFESpace->refFE().refCoor();
535 std::vector<Real> weights (dFESpace->fe().nbFEDof(), wQuad);
536 fakeQuadratureRule.setDimensionShape ( shapeDimension (dFESpace->refFE().shape() ), dFESpace->refFE().shape() );
537 fakeQuadratureRule.setPoints (coords, weights);
553 MatrixSmall<3,3> identity;
554 identity (0, 0) = 1.0;
555 identity (0, 1) = 0.0;
556 identity (0, 2) = 0.0;
557 identity (1, 0) = 0.0;
558 identity (1, 1) = 1.0;
559 identity (1, 2) = 0.0;
560 identity (2, 0) = 0.0;
561 identity (2, 1) = 0.0;
562 identity (2, 2) = 1.0;
568 ExpressionDefinitions::deformationGradient ( dETFESpace, *solidDisp, 0, identity );
575 ExpressionDefinitions::deformationGradient ( dETFESpace, *solidDisp, 0, identity );
580 evaluateNode( elements ( dScalarETFESpace->mesh() ),
584 ) >> patchAreaVectorScalar;
585 patchAreaVectorScalar->globalAssemble();
588 vectorPtr_Type jacobianActivation(
new vector_Type( dScalarETFESpace->map() ) );
589 evaluateNode( elements ( dScalarETFESpace->mesh() ),
592 meas_K * JzeroA * phi_i
593 ) >> jacobianActivation;
594 jacobianActivation->globalAssemble();
595 *( jacobianActivation ) = *( jacobianActivation ) / *patchAreaVectorScalar;
598 ExpressionDefinitions::interpolateScalarValue( dScalarETFESpace, *( jacobianActivation ) );
601 ExpressionMultimechanism::activateDeterminantF( J, ithJzeroA );
605 ExpressionMultimechanism::activeIsochoricDeterminant( Ja );
609 ExpressionDefinitions::tensorC( transpose(F), F );
614 evaluateNode( elements ( dScalarETFESpace->mesh() ),
619 JacobianZero->globalAssemble();
621 *JacobianZero = *JacobianZero / *patchAreaVectorScalar;
624 evaluateNode( elements ( dScalarETFESpace->mesh() ),
627 meas_K * JzeroA * phi_i
629 JacobianZeroA->globalAssemble();
631 *JacobianZeroA = *JacobianZeroA / *patchAreaVectorScalar;
634 evaluateNode( elements ( dScalarETFESpace->mesh() ),
637 meas_K * JactiveEl * phi_i
639 JacobianA->globalAssemble();
641 *JacobianA = *JacobianA / *patchAreaVectorScalar;
647 evaluateNode( elements ( dETFESpace->mesh() ),
651 ) >> patchAreaVector;
652 patchAreaVector->globalAssemble();
654 for( UInt i(0); i < pointerToVectorOfFamilies->size( ); i++ )
658 ExpressionDefinitions::interpolatedValue_Type fiberIth =
659 ExpressionDefinitions::interpolateFiber( dETFESpace, *(vectorInterpolated[ i ] ) );
662 ExpressionDefinitions::deformationGradient_Type ithFzeroA =
663 ExpressionDefinitions::deformationGradient ( dETFESpace, *solidDisp, 0, identity );
666 ExpressionDefinitions::minusTransposedTensor_Type FzeroAminusT =
667 ExpressionDefinitions::minusT( ithFzeroA );
670 ExpressionDefinitions::inverseTensor_Type FzeroAminus1 =
671 ExpressionDefinitions::inv( ithFzeroA );
674 ExpressionMultimechanism::rightCauchyGreenMultiMechanism_Type Ca =
675 ExpressionMultimechanism::activationRightCauchyGreen( FzeroAminusT, C, FzeroAminus1 );
678 ExpressionMultimechanism::activatedFiber_Type activeIthFiber =
679 ExpressionMultimechanism::activateFiberDirection( ithFzeroA, fiberIth );
681 ExpressionMultimechanism::normalizedVector_Type normalizedFiber =
682 ExpressionMultimechanism::unitVector( activeIthFiber );
686 ExpressionMultimechanism::activeNormalizedOuterProduct_Type Mith =
687 ExpressionMultimechanism::activeNormalizedOuterProduct( normalizedFiber );
690 ExpressionMultimechanism::activeStretch_Type IVith =
691 ExpressionMultimechanism::activeFiberStretch( Ca, Mith );
694 ExpressionMultimechanism::activeNoInterpolationStretch_Type IVithBar =
695 ExpressionMultimechanism::activeNoInterpolationFourthInvariant( JactiveEl, IVith );
698 evaluateNode( elements ( dScalarETFESpace->mesh() ),
701 meas_K * IVithBar * phi_i
702 ) >> stretchesVector[ i ];
703 stretchesVector[ i ]->globalAssemble();
705 *( stretchesVector[ i ] ) = *( stretchesVector[ i ] ) / *patchAreaVectorScalar;
707 evaluateNode( elements ( dScalarETFESpace->mesh() ),
710 meas_K * atan( IVithBar - value( dataStructure->ithCharacteristicStretch( i ) ),
711 dataStructure->smoothness() , ( 1.0 / 3.14159265359 ), (1.0/2.0) ) * phi_i
712 ) >> atanStretchesVector[ i ];
713 atanStretchesVector[ i ]->globalAssemble();
715 *( atanStretchesVector[ i ] ) = *( atanStretchesVector[ i ] ) / *patchAreaVectorScalar;
717 Real stretch = dataStructure->ithCharacteristicStretch( i );
718 Real pi = 3.14159265359;
720 evaluateNode( elements ( dScalarETFESpace->mesh() ),
724 JzeroA * atan( IVithBar - value( stretch ) , dataStructure->smoothness(), ( 1 / pi ), ( 1.0/2.0 ) ) * JactiveEl *
725 (value( 2.0 ) * value( dataStructure->ithStiffnessFibers( i ) ) * JactiveEl * ( IVithBar - value( stretch ) ) *
726 exp( value( dataStructure->ithNonlinearityFibers( i ) ) * ( IVithBar- value( stretch ) ) * ( IVithBar- value( stretch ) ) ) ) * phi_i
727 ) >> scalarExpressionMultimechanism[ i ];
728 scalarExpressionMultimechanism[ i ]->globalAssemble();
730 *( scalarExpressionMultimechanism[ i ] ) = *( scalarExpressionMultimechanism[ i ] ) / *patchAreaVectorScalar;
736 ExpressionMultimechanism::deformationActivatedTensor_Type Fa =
737 ExpressionMultimechanism::createDeformationActivationTensor( F , FzeroAminus1);
739 typedef ExpressionProduct<ExpressionMultimechanism::deformationActivatedTensor_Type,
740 ExpressionMultimechanism::activeNormalizedOuterProduct_Type> productFaMith_Type;
742 typedef ExpressionProduct< productFaMith_Type,
743 ExpressionDefinitions::minusTransposedTensor_Type> firstPartPiolaMultimech_Type;
745 productFaMith_Type FaMith( Fa, Mith );
746 firstPartPiolaMultimech_Type firstPartPiola( FaMith, FzeroAminusT );
749 ExpressionVectorFromNonConstantMatrix< ExpressionMultimechanism::deformationActivatedTensor_Type,3 ,3 > Fa_i1( Fa, 0 );
750 ExpressionVectorFromNonConstantMatrix< ExpressionMultimechanism::deformationActivatedTensor_Type,3 ,3 > Fa_i2( Fa, 1 );
751 ExpressionVectorFromNonConstantMatrix< ExpressionMultimechanism::deformationActivatedTensor_Type,3 ,3 > Fa_i3( Fa, 2 );
753 ExpressionVectorFromNonConstantMatrix< ExpressionMultimechanism::activeNormalizedOuterProduct_Type,3 ,3 > Mith_i1( Mith, 0 );
754 ExpressionVectorFromNonConstantMatrix< ExpressionMultimechanism::activeNormalizedOuterProduct_Type,3 ,3 > Mith_i2( Mith, 1 );
755 ExpressionVectorFromNonConstantMatrix< ExpressionMultimechanism::activeNormalizedOuterProduct_Type,3 ,3 > Mith_i3( Mith, 2 );
757 ExpressionVectorFromNonConstantMatrix< ExpressionDefinitions::minusTransposedTensor_Type,3 ,3 > FzeroAminusT_i1( FzeroAminusT, 0 );
758 ExpressionVectorFromNonConstantMatrix< ExpressionDefinitions::minusTransposedTensor_Type,3 ,3 > FzeroAminusT_i2( FzeroAminusT, 1 );
759 ExpressionVectorFromNonConstantMatrix< ExpressionDefinitions::minusTransposedTensor_Type,3 ,3 > FzeroAminusT_i3( FzeroAminusT, 2 );
761 ExpressionVectorFromNonConstantMatrix< firstPartPiolaMultimech_Type,3 ,3 > P_i1( firstPartPiola, 0 );
762 ExpressionVectorFromNonConstantMatrix< firstPartPiolaMultimech_Type,3 ,3 > P_i2( firstPartPiola, 1 );
763 ExpressionVectorFromNonConstantMatrix< firstPartPiolaMultimech_Type,3 ,3 > P_i3( firstPartPiola, 2 );
765 evaluateNode( elements ( dETFESpace->mesh() ),
768 meas_K * dot ( Fa_i1, phi_i)
770 Fa_col1[ i ]->globalAssemble();
772 *(Fa_col1[i]) = *(Fa_col1[i]) / *patchAreaVector;
774 evaluateNode( elements ( dETFESpace->mesh() ),
777 meas_K * dot ( Fa_i2, phi_i)
779 Fa_col2[ i ]->globalAssemble();
780 *(Fa_col2[i]) = *(Fa_col2[i]) / *patchAreaVector;
782 evaluateNode( elements ( dETFESpace->mesh() ),
785 meas_K * dot ( Fa_i3, phi_i)
787 Fa_col3[ i ]->globalAssemble();
788 *(Fa_col3[i]) = *(Fa_col3[i]) / *patchAreaVector;
791 evaluateNode( elements ( dETFESpace->mesh() ),
794 meas_K * dot ( Mith_i1, phi_i)
796 Mith_col1[ i ]->globalAssemble();
797 *(Mith_col1[i]) = *(Mith_col1[i]) / *patchAreaVector;
799 evaluateNode( elements ( dETFESpace->mesh() ),
802 meas_K * dot ( Mith_i2, phi_i)
804 Mith_col2[ i ]->globalAssemble();
805 *(Mith_col2[i]) = *(Mith_col2[i]) / *patchAreaVector;
807 evaluateNode( elements ( dETFESpace->mesh() ),
810 meas_K * dot ( Mith_i3, phi_i)
812 Mith_col3[ i ]->globalAssemble();
813 *(Mith_col3[i]) = *(Mith_col3[i]) / *patchAreaVector;
816 evaluateNode( elements ( dETFESpace->mesh() ),
819 meas_K * dot ( FzeroAminusT_i1, phi_i)
820 ) >> FzeroAminusT_col1[ i ];
821 FzeroAminusT_col1[ i ]->globalAssemble();
822 *(FzeroAminusT_col1[i]) = *(FzeroAminusT_col1[i]) / *patchAreaVector;
824 evaluateNode( elements ( dETFESpace->mesh() ),
827 meas_K * dot ( FzeroAminusT_i2, phi_i)
828 ) >> FzeroAminusT_col2[ i ];
829 FzeroAminusT_col2[ i ]->globalAssemble();
830 *(FzeroAminusT_col2[i]) = *(FzeroAminusT_col2[i]) / *patchAreaVector;
832 evaluateNode( elements ( dETFESpace->mesh() ),
835 meas_K * dot ( FzeroAminusT_i3, phi_i)
836 ) >> FzeroAminusT_col3[ i ];
837 FzeroAminusT_col3[ i ]->globalAssemble();
838 *(FzeroAminusT_col3[i]) = *(FzeroAminusT_col3[i]) / *patchAreaVector;
841 evaluateNode( elements ( dETFESpace->mesh() ),
844 meas_K * dot ( P_i1, phi_i)
846 P_col1[ i ]->globalAssemble();
847 *(P_col1[i]) = *(P_col1[i]) / *patchAreaVector;
849 evaluateNode( elements ( dETFESpace->mesh() ),
852 meas_K * dot ( P_i2, phi_i)
854 P_col2[ i ]->globalAssemble();
855 *(P_col2[i]) = *(P_col2[i]) / *patchAreaVector;
857 evaluateNode( elements ( dETFESpace->mesh() ),
860 meas_K * dot ( P_i3, phi_i)
862 P_col3[ i ]->globalAssemble();
863 *(P_col3[i]) = *(P_col3[i]) / *patchAreaVector;
867 exporter->postProcess ( 1.0 );
871 std::cout <<
"Analysis Completed!" << std::endl;
875 exporter->closeFile();
879 std::cout <<
"finished" << std::endl;
882 MPI_Barrier (MPI_COMM_WORLD);
884 checkResults( patchAreaVectorScalar->normInf(),
885 patchAreaVector->normInf(),
886 JacobianZero->normInf(), JacobianZeroA->normInf(), JacobianA->normInf(),
887 atanStretchesVector[0]->normInf(),atanStretchesVector[1]->normInf(),
888 scalarExpressionMultimechanism[0]->norm2(), scalarExpressionMultimechanism[1]->norm2(),
889 Mith_col1[0]->normInf(), Mith_col1[1]->normInf());
902 if( std::fabs( a - 0.072916) < 1e-6 &&
903 std::fabs( c - 0.072916) < 1e-6 &&
904 std::fabs( e - 1 ) < 1e-6 &&
905 std::fabs( f - 1 ) < 1e-6 &&
906 std::fabs( g - 1 ) < 1e-6 &&
907 std::fabs( h - 3.18309e-05 ) < 1e-9 &&
908 std::fabs( i - 3.18309e-05 ) < 1e-9 &&
909 std::fabs( l - 6968.505143 ) < 1e-6 &&
910 std::fabs( m - 6968.505143 ) < 1e-6 &&
911 std::fabs( n - 0.433012 ) < 1e-6 &&
912 std::fabs( o - 0.433012 ) < 1e-6 )
914 std::cout <<
"Correct result! "<< std::endl;
925 MPI_Init (&argc, &argv);
926 std::shared_ptr<Epetra_MpiComm> Comm (
new Epetra_MpiComm ( MPI_COMM_WORLD ) );
927 if ( Comm->MyPID() == 0 )
929 std::cout <<
"% using MPI" << std::endl;
932 std::shared_ptr<Epetra_SerialComm> Comm (
new Epetra_SerialComm() );
933 std::cout <<
"% using serial Version" << std::endl;
936 Structure structure ( argc, argv, Comm );
VectorEpetra - The Epetra Vector format Wrapper.
Structure(int argc, char **argv, std::shared_ptr< Epetra_Comm > structComm)
class ExpressionEmult Class for representing the transpose operation of an expression ...
ExporterEnsight data exporter.
std::shared_ptr< emptyFilter_Type > emptyFilterPtr_Type
FESpace - Short description here please!
GetPot(const int argc_, char **argv_, const char *FieldSeparator=0x0)
std::function< Real(Real const &, Real const &, Real const &, Real const &, ID const &) > fct_type
LifeV::ExporterEnsight< mesh_Type > ensightFilter_Type
LifeV::Exporter< mesh_Type > filter_Type
std::shared_ptr< hdf5Filter_Type > hdf5FilterPtr_Type
ExpressionIsochoricChangeOfVariable< activatedDeterminantF_Type > activeIsochoricDeterminant_Type
std::set< UInt > parseList(const std::string &list)
LifeV::ExporterEmpty< mesh_Type > emptyFilter_Type
Epetra_Import const & importer()
Getter for the Epetra_Import.
ExpressionInterpolateValue< MeshType, MapEpetra, 3, 1 > interpolatedScalarValue_Type
void run3d()
run the 3D driven cylinder simulation
LifeV::RegionMesh< LinearTetra > mesh_Type
void checkResults(const Real a, const Real c, const Real e, const Real f, const Real g, const Real h, const Real i, const Real l, const Real m, const Real n, const Real o)
ExpressionProduct< ExpressionTranspose< ExpressionAddition< ExpressionInterpolateGradient< MeshType, MapEpetra, 3, 3 >, ExpressionMatrix< 3, 3 > > >, ExpressionAddition< ExpressionInterpolateGradient< MeshType, MapEpetra, 3, 3 >, ExpressionMatrix< 3, 3 > > > rightCauchyGreenTensor_Type
std::shared_ptr< std::vector< Int > > M_isOnProc
void run2d()
run the 2D driven cylinder simulation
std::shared_ptr< ensightFilter_Type > ensightFilterPtr_Type
MeshData - class for handling spatial discretization.
ExpressionMeas - Expression for the measure of the element.
double Real
Generic real data.
ExpressionAddition< ExpressionInterpolateGradient< MeshType, MapEpetra, 3, 3 >, ExpressionMatrix< 3, 3 > > deformationGradient_Type
std::shared_ptr< LifeV::Exporter< mesh_Type > > filterPtr_Type
ExpressionDeterminant< ExpressionAddition< ExpressionInterpolateGradient< MeshType, MapEpetra, 3, 3 >, ExpressionMatrix< 3, 3 > > > determinantTensorF_Type
QuadratureRule - The basis class for storing and accessing quadrature rules.
ExpressionDivision< ExpressionDefinitions::determinantTensorF_Type, ExpressionDefinitions::interpolatedScalarValue_Type > activatedDeterminantF_Type
int main(int argc, char **argv)