38 #include <lifev/core/LifeV.hpp> 40 #include <lifev/fsi/solver/FSIMonolithicGE.hpp> 50 void FSIMonolithicGE::setupFluidSolid ( UInt
const fluxes )
52 super_Type::setupFluidSolid ( fluxes );
54 M_meshMotion.reset (
new FSIOperator::meshMotion_Type (*M_mmFESpace,
57 M_fluid.reset (
new FSIOperator::fluid_Type (M_data->dataFluid(),
64 M_rhs.reset (
new vector_Type (*
this->M_monolithicMap) );
65 M_rhsFull.reset (
new vector_Type (*
this->M_monolithicMap) );
66 M_beta.reset (
new vector_Type (M_uFESpace->map() ) );
68 M_solid.reset (
new solid_Type() );
70 M_solid->setup (M_data->dataSolid(),
82 void FSIMonolithicGE::setupDOF()
84 M_bcvStructureDispToHarmonicExtension.reset (
new BCVectorInterface );
85 super_Type::setupDOF();
89 FSIMonolithicGE::setupSystem( )
91 super_Type::setupSystem();
92 M_meshMotion->setUp ( M_dataFile );
96 FSIMonolithicGE::updateSystem()
98 super_Type::updateSystem();
103 FSIMonolithicGE::evalResidual ( vector_Type& res,
104 const vector_Type& disp,
114 this->iterateMesh (disp);
118 M_ALETimeAdvance->updateRHSFirstDerivative (M_data->dataFluid()->dataTime()->timeStep() );
120 vector_Type meshDispRepeated ( M_meshMotion->disp(), Repeated );
121 this->moveMesh (meshDispRepeated);
124 vector_Type meshVelocityRepeated (
this->M_ALETimeAdvance->firstDerivative ( M_meshMotion->disp() ), Repeated );
125 vector_Type interpolatedMeshVelocity (
this->M_uFESpace->map() );
127 interpolateVelocity ( meshVelocityRepeated, interpolatedMeshVelocity );
129 M_fluidTimeAdvance->extrapolation (*M_beta);
130 *M_beta -= interpolatedMeshVelocity;
133 assembleSolidBlock (iter, disp);
134 assembleFluidBlock (iter, disp);
137 applyBoundaryConditions();
139 super_Type::evalResidual ( disp, M_rhsFull, res, M_diagonalScale);
143 FSIMonolithicGE::iterateMesh (
const vector_Type& disp)
145 vector_Type lambdaFluid (*M_interfaceMap, Unique);
147 monolithicToInterface (lambdaFluid, disp);
149 lambdaFluid *= (M_solid->rescaleFactor() );
151 this->setLambdaFluid (lambdaFluid);
153 M_meshMotion->iterate (*M_BCh_mesh);
157 void FSIMonolithicGE::applyBoundaryConditions( )
160 if ( !M_BCh_u->bcUpdateDone() )
162 M_BCh_u->bcUpdate ( *M_uFESpace->mesh(), M_uFESpace->feBd(), M_uFESpace->dof() );
164 M_BCh_d->setOffset (M_offset);
165 if ( !M_BCh_d->bcUpdateDone() )
167 M_BCh_d->bcUpdate ( *M_dFESpace->mesh(), M_dFESpace->feBd(), M_dFESpace->dof() );
170 M_monolithicMatrix->setRobin ( M_robinCoupling, M_rhsFull );
171 M_precPtr->setRobin (M_robinCoupling, M_rhsFull);
173 if (!
this->M_monolithicMatrix->set() )
175 M_BChs.push_back (M_BCh_d);
176 M_BChs.push_back (M_BCh_u);
177 M_FESpaces.push_back (M_dFESpace);
178 M_FESpaces.push_back (M_uFESpace);
180 M_monolithicMatrix->push_back_matrix (M_solidBlockPrec,
false);
181 M_monolithicMatrix->push_back_matrix (M_fluidBlock,
true);
182 M_monolithicMatrix->setConditions (M_BChs);
183 M_monolithicMatrix->setSpaces (M_FESpaces);
184 M_monolithicMatrix->setOffsets (2, M_offset, 0);
185 M_monolithicMatrix->coupler (M_monolithicMap, M_dofStructureToFluid->localDofMap(), M_numerationInterface, M_data->dataFluid()->dataTime()->timeStep(), M_solidTimeAdvance->coefficientFirstDerivative ( 0 ), M_solid->rescaleFactor() );
189 M_monolithicMatrix->replace_matrix (M_fluidBlock, 1);
190 M_monolithicMatrix->replace_matrix (M_solidBlockPrec, 0);
193 super_Type::checkIfChangedFluxBC ( M_monolithicMatrix );
195 M_monolithicMatrix->blockAssembling();
196 M_monolithicMatrix->applyBoundaryConditions (dataFluid()->dataTime()->time(), M_rhsFull);
198 M_monolithicMatrix->GlobalAssemble();
202 void FSIMonolithicGE::setALEVectorInStencil (
const vectorPtr_Type& fluidDisp,
const UInt ,
const bool )
208 vector_Type* normalPointerToALEVector (
new vector_Type (*fluidDisp) );
209 (M_ALETimeAdvance->stencil() ).push_back ( normalPointerToALEVector );
213 void FSIMonolithicGE::updateSolution (
const vector_Type& solution )
215 super_Type::updateSolution ( solution );
222 M_ALETimeAdvance->shiftRight (
this->M_meshMotion->disp() );
230 bool FSIMonolithicGE::S_register = FSIFactory_Type::instance().registerProduct (
"monolithicGE", &FSIMonolithicGE::instantiate ) &&
231 BlockPrecFactory::instance().registerProduct (
"ComposedDNND" , &MonolithicBlockComposedDNND::createComposedDNND) &&
232 BlockPrecFactory::instance().registerProduct (
"AdditiveSchwarz" , &MonolithicBlockMatrix::createAdditiveSchwarz) &&
233 MonolithicBlockMatrix::Factory_Type::instance().registerProduct (
"AdditiveSchwarz" , &MonolithicBlockMatrix::createAdditiveSchwarz ) &&
234 BlockPrecFactory::instance().registerProduct (
"AdditiveSchwarzRN" , &MonolithicBlockMatrixRN::createAdditiveSchwarzRN ) &&
235 MonolithicBlockMatrix::Factory_Type::instance().registerProduct (
"AdditiveSchwarzRN" , &MonolithicBlockMatrixRN::createAdditiveSchwarzRN ) &&
236 BlockPrecFactory::instance().registerProduct (
"ComposedDN" , &MonolithicBlockComposedDN::createComposedDN ) &&
237 BlockPrecFactory::instance().registerProduct (
"ComposedDN2" , &MonolithicBlockComposedDN::createComposedDN2 );