28 #include <lifev/core/LifeV.hpp> 30 #include <lifev/fsi/solver/MonolithicBlockComposedDN.hpp> 40 void MonolithicBlockComposedDN::setDataFromGetPot (
const GetPot& dataFile,
41 const std::string& section )
43 M_blockPrecs->setDataFromGetPot ( dataFile, section );
47 int MonolithicBlockComposedDN::solveSystem (
const vector_Type& rhs, vector_Type& step, solverPtr_Type& linearSolver )
49 assert (M_blockPrecs.get() );
53 for (UInt k = 0; k < M_blocks.size(); ++k)
55 push_back_precs (M_blocks[ (*M_blockReordering) [k]]);
60 for (UInt k = 0; k < M_blocks.size(); ++k)
62 if (M_recompute[ (*M_blockReordering) [k]])
64 linearSolver->displayer()->leaderPrint (
" M- Computing preconditioner factor: ", k,
"\n");
65 replace_precs (M_blocks[ (*M_blockReordering) [k]], k);
69 linearSolver->displayer()->leaderPrint (
" M- Reusing preconditioner factor: ", k,
"\n");
73 return linearSolver->solveSystem (rhs, step, std::static_pointer_cast<Preconditioner> (M_blockPrecs) );
77 void MonolithicBlockComposedDN::coupler (mapPtr_Type& map,
78 const std::map<ID, ID>& locDofMap,
79 const vectorPtr_Type& numerationInterface,
81 const Real& coefficient,
82 const Real& rescaleFactor)
84 UInt totalDofs ( map->map (Unique)->NumGlobalElements() );
85 UInt solidAndFluid (M_offset[solid] + M_FESpace[solid]->map().map (Unique)->NumGlobalElements() );
87 matrixPtr_Type coupling (
new matrix_Type (*map) );
88 couplingMatrix ( coupling, (*M_couplingFlags) [solid], M_FESpace, M_offset, locDofMap, numerationInterface, timeStep, 1., coefficient, rescaleFactor);
89 coupling->insertValueDiagonal ( 1., M_offset[fluid], M_offset[solid] );
90 coupling->insertValueDiagonal ( 1., solidAndFluid, totalDofs );
91 M_coupling.push_back (coupling);
93 coupling.reset (
new matrix_Type (*map) );
94 couplingMatrix ( coupling, (*M_couplingFlags) [fluid], M_FESpace, M_offset, locDofMap, numerationInterface, timeStep, 1., coefficient, rescaleFactor);
95 coupling->insertValueDiagonal ( 1. , M_offset[solid], solidAndFluid );
96 coupling->insertValueDiagonal ( 1. , solidAndFluid + nDimensions * numerationInterface->map().map (Unique)->NumGlobalElements(), totalDofs );
97 M_coupling.push_back (coupling);
101 void MonolithicBlockComposedDN::push_back_precs ( matrixPtr_Type& Mat )
103 M_blockPrecs->push_back (Mat);
112 void MonolithicBlockComposedDN::replace_precs ( matrixPtr_Type& Mat,
UInt position )
114 M_blockPrecs->replace (Mat, position);
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.
uint32_type UInt
generic unsigned integer (used mainly for addressing)