44 #ifndef OSEENSOLVERSHAPEDERIVATIVE_H 45 #define OSEENSOLVERSHAPEDERIVATIVE_H 1
47 #include <lifev/navier_stokes/solver/OseenSolver.hpp> 69 class OseenSolverShapeDerivative:
70 public OseenSolver< MeshType, SolverType >
78 typedef MeshType mesh_Type;
79 typedef SolverType linearSolver_Type;
80 typedef OseenSolver< mesh_Type, linearSolver_Type > oseenSolver_Type;
81 typedef typename oseenSolver_Type::vector_Type vector_Type;
82 typedef typename oseenSolver_Type::solution_Type solution_Type;
83 typedef typename oseenSolver_Type::solutionPtr_Type solutionPtr_Type;
84 typedef typename oseenSolver_Type::matrix_Type matrix_Type;
85 typedef typename oseenSolver_Type::matrixPtr_Type matrixPtr_Type;
86 typedef typename oseenSolver_Type::data_Type data_Type;
87 typedef typename oseenSolver_Type::preconditioner_Type preconditioner_Type;
88 typedef typename oseenSolver_Type::preconditionerPtr_Type preconditionerPtr_type;
89 typedef typename oseenSolver_Type::bcHandler_Type bcHandler_Type;
97 OseenSolverShapeDerivative();
107 OseenSolverShapeDerivative ( std::shared_ptr<data_Type> dataType,
108 FESpace<mesh_Type,
MapEpetra>& velocityFESpace,
109 FESpace<mesh_Type,
MapEpetra>& pressureFESpace,
110 std::shared_ptr<Epetra_Comm>& communicator,
111 const Int lagrangeMultiplier = 0);
122 OseenSolverShapeDerivative ( std::shared_ptr<data_Type> dataType,
123 FESpace<mesh_Type,
MapEpetra>& velocityFESpace,
124 FESpace<mesh_Type,
MapEpetra>& pressureFESpace,
125 std::shared_ptr<Epetra_Comm>& communicator,
127 const UInt offset = 0 );
139 OseenSolverShapeDerivative ( std::shared_ptr<data_Type> dataType,
140 FESpace<mesh_Type,
MapEpetra>& velocityFESpace,
141 FESpace<mesh_Type,
MapEpetra>& pressureFESpace,
142 FESpace<mesh_Type,
MapEpetra>& mmFESpace,
143 std::shared_ptr<Epetra_Comm>& communicator,
145 const UInt offset = 0 );
148 virtual ~OseenSolverShapeDerivative();
160 void setUp (
const GetPot& dataFile );
166 void solveLinearSystem ( bcHandler_Type& bcHandler );
179 void updateLinearSystem (
const matrix_Type& matrixNoBC,
181 const vector_Type& un,
182 const vector_Type& uk,
183 const vector_Type& disp,
184 const vector_Type& w,
185 const vector_Type& dw,
186 const vector_Type& sourceVector);
201 void updateShapeDerivatives ( matrix_Type& matrixNoBC,
203 const vector_Type& un,
204 const vector_Type& uk,
206 const vector_Type& w,
209 bool wImplicit =
true,
210 bool convectiveTermDerivative =
false);
222 void updateLinearRightHandSideNoBC (
const vector_Type& rightHandSide)
224 M_linearRightHandSideNoBC = rightHandSide;
236 vector_Type& linearRightHandSideNoBC()
238 return M_linearRightHandSideNoBC;
241 const vector_Type& linearRightHandSideNoBC()
const 243 return M_linearRightHandSideNoBC;
250 const vector_Type& linearSolution()
const 252 return M_linearSolution;
261 return this->M_stabilization;
264 const bool& stabilization()
const 266 return this->M_stabilization;
291 Real linearLagrangeMultiplier (
const markerID_Type& flag, bcHandler_Type& bcHandler );
312 Real linearKineticNormalStress (
const markerID_Type& flag,
const vector_Type& solution,
const vector_Type& linearSolution );
322 Real linearMeanNormalStress (
const markerID_Type& flag, bcHandler_Type& bcHandler );
333 Real linearMeanNormalStress (
const markerID_Type& flag, bcHandler_Type& bcHandler,
const vector_Type& linearSolution );
343 Real linearMeanTotalNormalStress (
const markerID_Type& flag, bcHandler_Type& bcHandler );
355 Real linearMeanTotalNormalStress (
const markerID_Type& flag, bcHandler_Type& bcHandler,
const vector_Type& solution,
const vector_Type& linearSolution );
365 OseenSolverShapeDerivative (
const OseenSolverShapeDerivative& oseenShapeDerivative );
369 vector_Type M_linearRightHandSideNoBC;
370 vector_Type M_linearRightHandSideFull;
372 vector_Type M_linearSolution;
374 linearSolver_Type M_linearLinSolver;
375 preconditionerPtr_type M_linearPreconditioner;
390 bool M_reuseLinearPreconditioner;
400 template<
typename MeshType,
typename SolverType>
401 OseenSolverShapeDerivative<MeshType, SolverType>::
402 OseenSolverShapeDerivative ( std::shared_ptr<data_Type> dataType,
403 FESpace<mesh_Type,
MapEpetra>& velocityFESpace,
404 FESpace<mesh_Type,
MapEpetra>& pressureFESpace,
405 std::shared_ptr<Epetra_Comm>& communicator,
406 const Int lagrangeMultiplier) :
407 oseenSolver_Type ( dataType,
411 lagrangeMultiplier ),
412 M_linearRightHandSideNoBC (
this->getMap() ),
413 M_linearRightHandSideFull (
this->getMap() ),
414 M_linearSolution (
this->getMap() ),
415 M_linearLinSolver ( communicator ),
416 M_linearPreconditioner ( ),
417 M_elementVectorVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
418 M_elementVectorPressure (
this->M_pressureFESpace.fe().nbFEDof(), 1 ),
420 M_elementMeshVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
421 M_elementVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
422 M_elementPressure (
this->M_pressureFESpace.fe().nbFEDof(), 1 ),
423 M_elementConvectionVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
424 M_elementDisplacement (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
425 M_elementVelocityRightHandSide (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
426 M_u_loc (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
427 M_reuseLinearPreconditioner (
true )
432 template<
typename MeshType,
typename SolverType>
433 OseenSolverShapeDerivative<MeshType, SolverType>::
434 OseenSolverShapeDerivative ( std::shared_ptr<data_Type> dataType,
435 FESpace<mesh_Type,
MapEpetra>& velocityFESpace,
436 FESpace<mesh_Type,
MapEpetra>& pressureFESpace,
437 std::shared_ptr<Epetra_Comm>& communicator,
439 const UInt offset ) :
440 oseenSolver_Type ( dataType,
446 M_linearRightHandSideNoBC (
this->getMap() ),
447 M_linearRightHandSideFull (
this->getMap() ),
448 M_linearSolution (
this->getMap() ),
449 M_linearLinSolver ( communicator ),
450 M_linearPreconditioner ( ),
451 M_elementVectorVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
452 M_elementVectorPressure (
this->M_pressureFESpace.fe().nbFEDof(), 1 ),
454 M_elementMeshVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
455 M_elementVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
456 M_elementPressure (
this->M_pressureFESpace.fe().nbFEDof(), 1 ),
457 M_elementConvectionVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
458 M_elementDisplacement (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
459 M_elementVelocityRightHandSide (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
460 M_u_loc (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
461 M_reuseLinearPreconditioner (
true )
466 template<
typename MeshType,
typename SolverType>
467 OseenSolverShapeDerivative<MeshType, SolverType>::
468 OseenSolverShapeDerivative ( std::shared_ptr<data_Type> dataType,
469 FESpace<mesh_Type,
MapEpetra>& velocityFESpace,
470 FESpace<mesh_Type,
MapEpetra>& pressureFESpace,
471 FESpace<mesh_Type,
MapEpetra>& mmFESpace,
472 std::shared_ptr<Epetra_Comm>& communicator,
475 oseenSolver_Type (dataType,
481 M_linearRightHandSideNoBC (
this->getMap() ),
482 M_linearRightHandSideFull (
this->getMap() ),
483 M_linearSolution (
this->getMap() ),
484 M_linearLinSolver( ),
485 M_linearPreconditioner ( ),
486 M_elementVectorVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
487 M_elementVectorPressure (
this->M_pressureFESpace.fe().nbFEDof(), 1 ),
489 M_elementMeshVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
490 M_elementVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
491 M_elementPressure (
this->M_pressureFESpace.fe().nbFEDof(), 1 ),
492 M_elementConvectionVelocity (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
493 M_elementDisplacement (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
494 M_elementVelocityRightHandSide (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
495 M_u_loc (
this->M_velocityFESpace.fe().nbFEDof(), nDimensions ),
496 M_reuseLinearPreconditioner (
true ),
497 M_mmFESpace ( &mmFESpace )
502 template<
typename MeshType,
typename SolverType>
503 OseenSolverShapeDerivative<MeshType, SolverType>::
504 ~OseenSolverShapeDerivative()
514 template<
typename MeshType,
typename SolverType>
516 OseenSolverShapeDerivative<MeshType, SolverType>::linearFlux (
const markerID_Type& flag )
518 return this->flux ( flag, M_linearSolution );
521 template<
typename MeshType,
typename SolverType>
523 OseenSolverShapeDerivative<MeshType, SolverType>::getLinearFlux (
const markerID_Type& flag )
525 if (
this->M_displayer->isLeader() )
527 std::cerr <<
"Warning: getLinearFlux is deprecated!" << std::endl
528 <<
" You should use linearFlux instead!" << std::endl;
531 return linearFlux ( flag );
534 template<
typename MeshType,
typename SolverType>
536 OseenSolverShapeDerivative<MeshType, SolverType>::linearPressure (
const markerID_Type& flag )
538 return this->pressure ( flag, M_linearSolution );
541 template<
typename MeshType,
typename SolverType>
543 OseenSolverShapeDerivative<MeshType, SolverType>::getLinearPressure (
const markerID_Type& flag )
545 if (
this->M_displayer->isLeader() )
547 std::cerr <<
"Warning: getLinearPressure is deprecated!" << std::endl
548 <<
" You should use linearPressure instead!" << std::endl;
551 return linearPressure ( flag );
554 template<
typename MeshType,
typename SolverType>
556 OseenSolverShapeDerivative<MeshType, SolverType>::linearLagrangeMultiplier (
const markerID_Type& flag, bcHandler_Type& bcHandler )
558 return lagrangeMultiplier ( flag, bcHandler, M_linearSolution );
561 template<
typename MeshType,
typename SolverType>
563 OseenSolverShapeDerivative<MeshType, SolverType>::getLinearLagrangeMultiplier (
const markerID_Type& flag, bcHandler_Type& bcHandler )
565 if (
this->M_displayer->isLeader() )
567 std::cerr <<
"Warning: getLinearLagrangeMultiplier is deprecated!" << std::endl
568 <<
" You should use linearLagrangeMultiplier instead!" << std::endl;
571 return linearLagrangeMultiplier ( flag, bcHandler );
574 template<
typename MeshType,
typename SolverType>
576 OseenSolverShapeDerivative<MeshType, SolverType>::linearKineticNormalStress (
const markerID_Type& flag )
578 return this->linearKineticNormalStress ( flag, *
this->M_solution, M_linearSolution );
581 template<
typename MeshType,
typename SolverType>
583 OseenSolverShapeDerivative<MeshType, SolverType>::linearKineticNormalStress (
const markerID_Type& flag,
const vector_Type& solution,
const vector_Type& linearSolution )
585 vector_Type velocityAndPressure ( solution, Repeated, Add );
586 vector_Type velocity (
this->M_velocityFESpace.map(),
Repeated );
587 velocity.subset ( velocityAndPressure );
589 vector_Type linearVelocityAndPressure ( linearSolution,
Repeated );
590 vector_Type linearVelocity (
this->M_velocityFESpace.map(),
Repeated );
591 linearVelocity.subset ( linearVelocityAndPressure );
593 return this->M_postProcessing->kineticNormalStressDerivative ( velocity, linearVelocity,
this->M_oseenData->density(), flag );
596 template<
typename MeshType,
typename SolverType>
598 OseenSolverShapeDerivative<MeshType, SolverType>::linearMeanNormalStress (
const markerID_Type& flag, bcHandler_Type& bcHandler )
600 return this->linearMeanNormalStress ( flag, bcHandler, M_linearSolution );
603 template<
typename MeshType,
typename SolverType>
605 OseenSolverShapeDerivative<MeshType, SolverType>::linearMeanNormalStress (
const markerID_Type& flag, bcHandler_Type& bcHandler,
const vector_Type& linearSolution )
607 return this->meanNormalStress ( flag, bcHandler, linearSolution );
610 template<
typename MeshType,
typename SolverType>
612 OseenSolverShapeDerivative<MeshType, SolverType>::linearMeanTotalNormalStress (
const markerID_Type& flag, bcHandler_Type& bcHandler )
614 return this->meanNormalStress ( flag, bcHandler, M_linearSolution ) - linearKineticNormalStress ( flag, *
this->M_solution, M_linearSolution );
617 template<
typename MeshType,
typename SolverType>
619 OseenSolverShapeDerivative<MeshType, SolverType>::linearMeanTotalNormalStress (
const markerID_Type& flag, bcHandler_Type& bcHandler,
const vector_Type& solution,
const vector_Type& linearSolution )
621 return this->meanNormalStress ( flag, bcHandler, linearSolution ) - linearKineticNormalStress ( flag, solution, linearSolution );
624 template<
typename MeshType,
typename SolverType>
625 void OseenSolverShapeDerivative<MeshType, SolverType>::setUp (
const GetPot& dataFile )
630 oseenSolver_Type::setUp ( dataFile );
632 M_reuseLinearPreconditioner = dataFile
( "lin_fluid/prec/reuse", true );
642 template<
typename MeshType,
typename SolverType>
643 void OseenSolverShapeDerivative<MeshType, SolverType>::solveLinearSystem ( bcHandler_Type& bcHandler )
645 this->M_Displayer.leaderPrint (
" LF- Finalizing the matrix and vectors ... " );
651 this->M_matrixNoBC->globalAssemble();
653 M_linearRightHandSideNoBC.globalAssemble();
655 matrixPtr_Type matrixFull (
new matrix_Type (
this->M_localMap,
this->M_matrixNoBC->meanNumEntries() ) );
657 this->updateStabilization ( *matrixFull );
658 this->getFluidMatrix ( *matrixFull );
660 vector_Type rightHandSideFull ( M_linearRightHandSideNoBC );
663 this->M_Displayer.leaderPrintMax (
"done in " , chrono
.diff() );
666 this->M_Displayer.leaderPrint (
" LF- Applying boundary conditions ... " );
669 this->applyBoundaryConditions ( *matrixFull, rightHandSideFull, bcHandler );
672 this->M_Displayer.leaderPrintMax (
"done in ", chrono
.diff() );
678 matrixFull->globalAssemble();
679 this->M_linearSolver->setMatrix ( *matrixFull );
680 this->M_linearSolver->setReusePreconditioner ( M_reuseLinearPreconditioner );
681 std::shared_ptr<MatrixEpetra<Real> > staticCast = std::static_pointer_cast<MatrixEpetra<Real> > (matrixFull);
682 this->M_linearSolver->solveSystem ( rightHandSideFull, M_linearSolution, staticCast );
684 *
this->M_residual = M_linearRightHandSideNoBC;
685 *
this->M_residual -= *
this->M_matrixNoBC *
this->M_linearSolution;
694 template<
typename MeshType,
typename SolverType>
696 OseenSolverShapeDerivative<MeshType, SolverType>::updateLinearSystem (
const matrix_Type& ,
698 const vector_Type& un,
699 const vector_Type& uk,
700 const vector_Type& disp,
701 const vector_Type& w,
702 const vector_Type& dw,
703 const vector_Type& sourceVector )
705 this->M_Displayer.leaderPrint (
" LF- Updating the right hand side ... " );
711 M_linearRightHandSideNoBC = sourceVector;
713 if (
this->M_oseenData->useShapeDerivatives() )
717 vector_Type unRepeated ( un ,
Repeated );
718 vector_Type ukRepeated ( uk ,
Repeated );
719 vector_Type dispRepeated ( disp,
Repeated );
720 vector_Type wRepeated ( w ,
Repeated );
721 vector_Type dwRepeated ( dw ,
Repeated );
727 vector_Type linearRightHandSideNoBC ( M_linearRightHandSideNoBC.map(),
Repeated );
729 for (
UInt i = 0; i <
this->M_velocityFESpace.mesh()->numVolumes(); i++ )
732 this->M_pressureFESpace.fe().update (
this->M_pressureFESpace.mesh()->volumeList ( i ) );
733 this->M_velocityFESpace.fe().updateFirstDerivQuadPt (
this->M_velocityFESpace.mesh()->volumeList ( i ) );
736 M_elementVectorVelocity.zero();
737 M_elementVectorPressure.zero();
739 for (
UInt iNode = 0 ; iNode <
this->M_velocityFESpace.fe().nbFEDof() ; iNode++ )
741 UInt iLocal =
this->M_velocityFESpace.fe().patternFirst ( iNode );
743 for (
Int iComponent = 0; iComponent < numVelocityComponent; ++iComponent )
745 UInt iGlobal =
this->M_velocityFESpace.dof().localToGlobalMap ( i, iLocal ) + iComponent *
this->dimVelocity();
748 M_elementConvectionVelocity.vec( ) [ iLocal + iComponent *
this->M_velocityFESpace.fe().nbFEDof() ] = unRepeated (iGlobal)
749 - wRepeated ( iGlobal );
751 M_elementMeshVelocity.vec( ) [ iLocal + iComponent *
this->M_velocityFESpace.fe().nbFEDof() ] = wRepeated ( iGlobal );
753 M_elementVelocity.vec( ) [ iLocal + iComponent *
this->M_velocityFESpace.fe().nbFEDof() ] = ukRepeated ( iGlobal );
755 M_elementDisplacement.vec( ) [ iLocal + iComponent *
this->M_velocityFESpace.fe().nbFEDof() ] = dispRepeated ( iGlobal );
757 M_elementVelocityRightHandSide.vec( ) [ iLocal + iComponent *
this->M_velocityFESpace.fe().nbFEDof() ] = dwRepeated ( iGlobal );
759 M_u_loc.vec() [ iLocal + iComponent *
this->M_velocityFESpace.fe().nbFEDof() ] = unRepeated ( iGlobal );
770 for (
UInt iNode = 0 ; iNode <
this->M_pressureFESpace.fe().nbFEDof() ; iNode++ )
772 UInt iLocal =
this->M_pressureFESpace.fe().patternFirst ( iNode );
773 UInt iGlobal =
this->M_pressureFESpace.dof().localToGlobalMap ( i, iLocal ) + numVelocityComponent *
this->dimVelocity();
774 M_elementPressure[ iLocal ] = ukRepeated[ iGlobal ];
783 AssemblyElemental::source_mass1 ( -
this->M_oseenData->density(),
785 M_elementMeshVelocity,
786 M_elementConvectionVelocity,
787 M_elementDisplacement,
788 M_elementVectorVelocity,
789 this->M_velocityFESpace.fe() );
795 AssemblyElemental::source_mass2 (
this->M_oseenData->density(),
797 M_elementVelocityRightHandSide,
798 M_elementVectorVelocity,
799 this->M_velocityFESpace.fe() );
805 AssemblyElemental::source_mass3 ( - 0.5 *
this->M_oseenData->density(),
808 M_elementDisplacement,
809 M_elementVectorVelocity,
810 this->M_velocityFESpace.fe() );
816 AssemblyElemental::source_stress ( - 1.0,
817 this->M_oseenData->viscosity(),
820 M_elementDisplacement,
821 M_elementVectorVelocity,
822 this->M_velocityFESpace.fe(),
823 this->M_pressureFESpace.fe() );
829 AssemblyElemental::source_stress2 (
this->M_oseenData->viscosity(),
831 M_elementDisplacement,
832 M_elementVectorVelocity,
833 this->M_velocityFESpace.fe() );
839 AssemblyElemental::source_press ( -1.0,
841 M_elementDisplacement,
842 M_elementVectorPressure,
843 this->M_velocityFESpace.fe(),
844 this->M_pressureFESpace.fe() );
859 assembleVector ( linearRightHandSideNoBC,
860 M_elementVectorPressure,
861 this->M_pressureFESpace.fe(),
862 this->M_pressureFESpace.dof(),
864 numVelocityComponent *
this->dimVelocity() );
867 for (
Int iComponent = 0; iComponent < numVelocityComponent; iComponent++ )
870 assembleVector ( linearRightHandSideNoBC,
871 M_elementVectorVelocity,
872 this->M_velocityFESpace.fe(),
873 this->M_velocityFESpace.dof(),
875 iComponent *
this->dimVelocity() );
879 linearRightHandSideNoBC.globalAssemble();
880 M_linearRightHandSideNoBC += linearRightHandSideNoBC;
888 this->M_Displayer.leaderPrintMax (
"done in ", chrono
.diff() );
893 template<
typename MeshType,
typename SolverType>
895 OseenSolverShapeDerivative<MeshType, SolverType>::
896 updateShapeDerivatives ( matrix_Type& matrix,
898 const vector_Type& un,
899 const vector_Type& uk,
901 const vector_Type& w,
903 FESpace<mesh_Type,
MapEpetra>& mmFESpace,
905 bool convectiveTermDerivative )
913 if (
this->M_oseenData->useShapeDerivatives() )
915 this->M_Displayer.leaderPrint (
" LF- Updating shape derivative blocks ... " );
924 vector_Type unRepeated ( un ,
Repeated );
925 vector_Type ukRepeated ( uk ,
Repeated );
927 vector_Type wRepeated ( w ,
Repeated );
936 for (
UInt i = 0; i <
this->M_velocityFESpace.mesh()->numVolumes(); i++ )
939 this->M_pressureFESpace.fe().update (
this->M_pressureFESpace.mesh()->volumeList ( i ) );
940 this->M_velocityFESpace.fe().updateFirstDerivQuadPt (
this->M_velocityFESpace.mesh()->volumeList ( i ) );
941 this->M_pressureFESpace.fe().updateFirstDerivQuadPt (
this->M_velocityFESpace.mesh()->volumeList ( i ) );
947 mmFESpace.fe().updateFirstDerivQuadPt ( mmFESpace.mesh()->volumeList ( i ) );
950 std::shared_ptr<MatrixElemental> elementMatrixPressure (
new MatrixElemental (
this->M_pressureFESpace.fe().nbFEDof(),
953 mmFESpace.fe().nbFEDof(),
956 std::shared_ptr<MatrixElemental> elementMatrixVelocity (
new MatrixElemental (
this->M_velocityFESpace.fe().nbFEDof(),
959 this->M_velocityFESpace.fe().nbFEDof(),
962 std::shared_ptr<MatrixElemental> elementMatrixConvective;
964 if ( convectiveTermDerivative )
966 elementMatrixConvective.reset (
new MatrixElemental (
this->M_velocityFESpace.fe().nbFEDof(),
969 this->M_velocityFESpace.fe().nbFEDof(),
972 elementMatrixConvective->zero();
975 elementMatrixPressure->zero();
976 elementMatrixVelocity->zero();
978 for (
UInt iNode = 0 ; iNode <
this->M_velocityFESpace.fe().nbFEDof() ; iNode++ )
980 UInt iLocal =
this->M_velocityFESpace.fe().patternFirst ( iNode );
982 for (
UInt iComponent = 0; iComponent < numVelocityComponent; ++iComponent )
984 UInt iGlobal =
this->M_velocityFESpace.dof().localToGlobalMap ( i, iLocal ) + iComponent *
this->dimVelocity();
988 M_elementConvectionVelocity.vec() [ iLocal + iComponent *
this->M_velocityFESpace.fe().nbFEDof() ] = unRepeated (iGlobal)
989 - wRepeated ( iGlobal );
995 M_elementMeshVelocity.vec( ) [ iLocal + iComponent *
this->M_velocityFESpace.fe().nbFEDof() ] = wRepeated ( iGlobal );
997 M_elementVelocity.vec( ) [ iLocal + iComponent *
this->M_velocityFESpace.fe().nbFEDof() ] = ukRepeated ( iGlobal );
1003 M_u_loc.vec() [ iLocal + iComponent *
this->M_velocityFESpace.fe().nbFEDof() ] = unRepeated ( iGlobal );
1014 for (
UInt iNode = 0 ; iNode <
this->M_pressureFESpace.fe().nbFEDof() ; iNode++ )
1017 UInt iLocal =
this->M_pressureFESpace.fe().patternFirst ( iNode );
1018 UInt iGlobal =
this->M_pressureFESpace.dof().localToGlobalMap ( i, iLocal ) + numVelocityComponent *
this->dimVelocity();
1020 M_elementPressure[ iLocal ] = ukRepeated[ iGlobal ];
1023 AssemblyElemental::shape_terms (
1024 this->M_oseenData->density(),
1025 this->M_oseenData->viscosity(),
1028 M_elementMeshVelocity,
1029 M_elementConvectionVelocity,
1031 *elementMatrixVelocity,
1033 this->M_pressureFESpace.fe(),
1034 (ID) mmFESpace.fe().nbFEDof(),
1035 *elementMatrixPressure,
1052 AssemblyElemental::source_press ( 1.0,
1054 *elementMatrixPressure,
1056 this->M_pressureFESpace.fe(),
1057 (ID) mmFESpace.fe().nbFEDof() );
1060 if ( convectiveTermDerivative )
1061 AssemblyElemental::mass_gradu (
this->M_oseenData->density(),
1063 *elementMatrixConvective,
1064 this->M_velocityFESpace.fe() );
1078 UInt const velocityTotalDof (
this->M_velocityFESpace.dof().numTotalDof() );
1079 UInt const meshTotalDof ( mmFESpace.dof().numTotalDof() );
1080 for (
UInt iComponent = 0; iComponent < numVelocityComponent; ++iComponent )
1082 for (
UInt jComponent = 0; jComponent < numVelocityComponent; ++jComponent )
1084 assembleMatrix ( matrix,
1085 *elementMatrixVelocity,
1086 this->M_velocityFESpace.fe(),
1088 this->M_velocityFESpace.dof(),
1092 iComponent * velocityTotalDof,
1093 offset + jComponent * meshTotalDof );
1096 if ( convectiveTermDerivative )
1097 assembleMatrix ( matrix,
1098 *elementMatrixConvective,
1099 this->M_velocityFESpace.fe(),
1100 this->M_velocityFESpace.fe(),
1101 this->M_velocityFESpace.dof(),
1102 this->M_velocityFESpace.dof(),
1105 iComponent * velocityTotalDof,
1106 jComponent * velocityTotalDof );
1109 assembleMatrix ( matrix,
1110 *elementMatrixPressure,
1111 this->M_pressureFESpace.fe(),
1113 this->M_pressureFESpace.dof(),
1117 (UInt) numVelocityComponent * velocityTotalDof,
1118 offset + iComponent * meshTotalDof );
1124 this->M_Displayer.leaderPrintMax (
"done in ", chrono
.diff() );
void start()
Start the timer.
SolverAztecOO - Class to wrap linear solver.
int32_type Int
Generic integer data.
ID markerID_Type
markerID_Type is the type used to store the geometric entity marker IDs
void updateInverseJacobian(const UInt &iQuadPt)
Epetra_Import const & importer()
Getter for the Epetra_Import.
Real diff()
Compute the difference in time between start and stop.
double Real
Generic real data.
const UInt nDimensions(NDIM)
void stop()
Stop the timer.
#define LIFEV_DEPRECATED(func)
bool operator()(const char *VarName, bool Default) const
uint32_type UInt
generic unsigned integer (used mainly for addressing)