27 #include <lifev/fsi/solver/FSIFixedPoint.hpp> 54 const vector_Type& res,
59 if (M_data->algorithm() ==
"RobinNeumann")
65 muk = M_nonLinearAitken.computeDeltaLambdaScalar (
this->lambdaSolidOld(), res);
74 std::cout <<
"*** Residual computation g(x_" << iter <<
" )";
77 std::cout <<
" [NEW TIME STEP] ";
79 std::cout << std::endl;
82 this->setLambdaSolidOld (disp);
87 res -=
this->lambdaSolid();
94 super::setLinearFluid (
false);
95 super::setLinearSolid (
false);
97 super::setupFEspace();
109 super::setLinearFluid (
false);
110 super::setLinearSolid (
false);
112 super::setupFluidSolid();
114 if (
this->isFluid() )
116 M_rhsNew.reset (
new vector_Type (
this->M_fluid->getMap() ) );
117 M_beta.reset (
new vector_Type (
this->M_fluid->getMap() ) );
125 super::setDataFile ( dataFile );
127 M_nonLinearAitken.setDefaultOmega (M_data->defaultOmega(), 0.001);
128 M_nonLinearAitken.setOmegaRange ( M_data->OmegaRange() );
130 if ( M_data->algorithm() ==
"RobinNeumann" )
132 M_nonLinearAitken.setDefaultOmega (-1, 1);
147 bool recomputeMatrices ( iter == 0 || ( M_data->updateEvery() > 0 && iter % M_data->updateEvery() == 0 ) );
149 std::cout <<
"recomputeMatrices = " << recomputeMatrices <<
" == " <<
true 150 <<
"; iter = " << iter
151 <<
"; updateEvery = " << M_data->updateEvery() << std::endl;
153 if (iter == 0 &&
this->isFluid() )
155 M_nonLinearAitken.restart();
156 this->M_fluid->resetPreconditioner();
160 M_epetraWorldComm->Barrier();
163 this->setLambdaFluid (_disp);
167 if (M_data->algorithm() ==
"RobinNeumann")
169 this->setMinusSigmaFluid (
this->sigmaSolid() );
173 vector_Type sigmaFluidUnique (
this->sigmaFluid().map(), Unique);
175 if (
this->isFluid() )
177 this->M_meshMotion->iterate (*M_BCh_mesh);
196 vector_Type meshDisp ( M_meshMotion->disp(), Repeated );
197 this->moveMesh (meshDisp);
201 M_fluidTimeAdvance->extrapolation ( *M_beta);
205 *M_beta += *
this->M_fluid->solution();
208 vector_Type meshVelocity ( M_meshMotion->disp(), Repeated );
209 meshVelocity = M_ALETimeAdvance->firstDerivative (meshDisp);
210 this->transferMeshMotionOnFluid (meshVelocity,
211 this->veloFluidMesh() );
213 *M_beta -=
this->veloFluidMesh();
215 double alpha = M_fluidTimeAdvance->coefficientFirstDerivative ( 0 ) / M_data->dataFluid()->dataTime()->timeStep();
222 if (M_data->dataFluid()->conservativeFormulation() )
224 *M_rhs = M_fluidMassTimeAdvance->rhsContributionFirstDerivative();
226 if (recomputeMatrices)
229 this->M_fluid->updateSystem ( alpha, *M_beta, *M_rhs );
233 this->M_fluid->updateRightHandSide ( *M_rhs );
235 if (!M_data->dataFluid()->conservativeFormulation() )
237 *M_rhs = M_fluid->matrixMass() * M_fluidTimeAdvance->rhsContributionFirstDerivative();
238 this->M_fluid->updateRightHandSide ( *M_rhs );
243 this->M_fluid->iterate ( *M_BCh_u );
245 std::cout <<
"Finished iterate, transfering to interface \n" << std::flush;
247 this->transferFluidOnInterface (
this->M_fluid->residual(), sigmaFluidUnique);
250 M_epetraWorldComm->Barrier();
252 if (
true &&
this->isFluid() )
254 vector_Type vel (
this->fluid().velocityFESpace().map() );
255 vector_Type press (
this->fluid().pressureFESpace().map() );
257 vel.subset (*
this->M_fluid->solution() );
258 press.subset (*
this->M_fluid->solution(),
this->fluid().velocityFESpace().dim() *
this->fluid().pressureFESpace().fieldDim() );
260 std::cout <<
"norm_inf( vel ) " << vel.normInf() << std::endl;
261 std::cout <<
"norm_inf( press ) " << press.normInf() << std::endl;
265 this->setSigmaFluid ( sigmaFluidUnique );
266 this->setSigmaSolid ( sigmaFluidUnique );
268 M_epetraWorldComm->Barrier();
271 vector_Type lambdaSolidUnique (
this->lambdaSolid().map(), Unique);
272 vector_Type lambdaDotSolidUnique (
this->lambdaDotSolid().map(), Unique);
273 vector_Type sigmaSolidUnique (
this->sigmaSolid().map(), Unique);
274 if (
this->isSolid() )
276 this->M_solid->iterate ( M_BCh_d );
277 this->transferSolidOnInterface (
this->M_solid->displacement(), lambdaSolidUnique);
278 this->transferSolidOnInterface ( M_solidTimeAdvance->firstDerivative (
this->solid().displacement() ), lambdaDotSolidUnique );
279 this->transferSolidOnInterface (
this->M_solid->residual(), sigmaSolidUnique);
282 this->setLambdaSolid ( lambdaSolidUnique );
283 this->setLambdaDotSolid ( lambdaDotSolidUnique );
284 this->setSigmaSolid ( sigmaSolidUnique );
286 M_epetraWorldComm->Barrier();
292 norm = _disp.normInf();
293 if (
this->isSolid() &&
this->isLeader() )
295 std::cout <<
" ::: norm(disp ) = " << norm << std::endl;
298 norm =
this->lambdaSolid().normInf();
299 if (
this->isSolid() &&
this->isLeader() )
301 std::cout <<
" ::: norm(dispNew ) = " << norm << std::endl;
304 norm =
this->lambdaDotSolid().normInf();
305 if (
this->isSolid() &&
this->isLeader() )
307 std::cout <<
" ::: norm(velo ) = " << norm << std::endl;
310 norm =
this->sigmaFluid().normInf();
311 if (
this->isSolid() &&
this->isLeader() )
313 std::cout <<
" ::: max Residual Fluid = " << norm << std::endl;
316 norm =
this->sigmaSolid().normInf();
317 if (
this->isSolid() &&
this->isLeader() )
319 std::cout <<
" ::: max Residual Solid = " << norm << std::endl;
322 if (
this->isFluid() )
324 norm = M_fluid->residual().normInf();
325 if (
this->isLeader() )
327 std::cout <<
"Max ResidualF = " << norm << std::endl;
330 if (
this->isSolid() )
332 norm = M_solid->displacement().norm2();
333 if (
this->isLeader() )
335 std::cout <<
"NL2 DiplacementS = " << norm << std::endl;
338 norm = M_solid->residual().normInf();
340 if (
this->isLeader() )
342 std::cout <<
"Max ResidualS = " << norm << std::endl;
353 FSIFactory_Type::instance().registerProduct (
"fixedPoint", &createFP );
355 solid_Type::material_Type::isotropicLaw_Type::StructureIsotropicMaterialFactory::instance().registerProduct (
"linearVenantKirchhoff", &createVenantKirchhoffLinear );
356 solid_Type::material_Type::isotropicLaw_Type::StructureIsotropicMaterialFactory::instance().registerProduct (
"nonLinearVenantKirchhoff", &createVenantKirchhoffNonLinear );
void registerMyProducts()
register the product for the factory
FSIFixedPoint()
Empty Constructor.
void assignFunction(bcBase_Type &base)
Assign the function to the base of the BCHandler.
void setupFEspace()
sets the space discretization parameters
double Real
Generic real data.
NdebugStream noDebugStream(int=0, NdebugStream::stprintf=&printf)
FSIFixedPont - Implementation of an FSI with fixed point iterations.
void setupFluidSolid()
setup of the fluid and solid solver classes
void solveJac(vector_Type &_muk, const vector_Type &_res, const Real _linearRelTol)
solves the Jacobian system
void setDataFile(GetPot const &data)
initializes the GetPot data file
~FSIFixedPoint()
Destructor.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
void eval(const vector_Type &disp, UInt status)