1 #include <lifev/fsi_blocks/solver/FSIApplyOperatorNonConforming.hpp> 3 #include <lifev/core/util/Displayer.hpp> 4 #include <lifev/core/util/LifeChrono.hpp> 16 M_label(
"FSIApplyOperatorNonConforming"),
50 M_ds_map = structure_displacement_map;
55 M_fluidVelocity = M_u_map->mapSize();
56 M_fluid = M_fluidVelocity + M_p_map->mapSize();
57 M_structure = M_fluid + M_ds_map->mapSize();
58 M_lambda = M_structure + M_lambda_map->mapSize();
61 M_X_velocity.reset(
new VectorEpetra_Type (*M_u_map, Unique) );
62 M_X_pressure.reset(
new VectorEpetra_Type (*M_p_map, Unique) );
63 M_X_displacement.reset(
new VectorEpetra_Type (*M_ds_map, Unique) );
64 M_X_lambda.reset(
new VectorEpetra_Type (*M_lambda_map, Unique) );
65 M_X_geometry.reset(
new VectorEpetra_Type (*M_ale_map, Unique) );
67 M_Y_velocity.reset(
new VectorEpetra_Type (*M_u_map, Unique) );
68 M_Y_pressure.reset(
new VectorEpetra_Type (*M_p_map, Unique) );
69 M_Y_displacement.reset(
new VectorEpetra_Type (*M_ds_map, Unique) );
70 M_Y_lambda.reset(
new VectorEpetra_Type (*M_lambda_map, Unique) );
71 M_Y_geometry.reset(
new VectorEpetra_Type (*M_ale_map, Unique) );
119 Teuchos::RCP< Teuchos::ParameterList > belosList = Teuchos::rcp (
new Teuchos::ParameterList );
120 belosList = Teuchos::getParametersFromXmlFile (
"SolverParamList_rbf3d.xml" );
123 prec_Type* precRawPtr;
124 basePrecPtr_Type precPtr;
125 precRawPtr =
new prec_Type;
126 precRawPtr->setDataFromGetPot ( M_datafile,
"prec" );
127 precPtr.reset ( precRawPtr );
131 solver.setCommunicator ( M_comm );
132 solver.setParameters ( *belosList );
133 solver.setPreconditioner ( precPtr );
139 solver.setOperator ( M_fluid_interface_mass );
140 solver.setRightHandSide ( X );
145 FSIApplyOperatorNonConforming::setInterfaceMassMatrices (
const matrixEpetraPtr_Type & fluid_interface_mass,
146 const matrixEpetraPtr_Type & structure_interface_mass)
148 M_fluid_interface_mass = fluid_interface_mass;
149 M_structure_interface_mass = structure_interface_mass;
153 FSIApplyOperatorNonConforming::Apply(
const vector_Type & X, vector_Type & Y)
const 155 ASSERT_PRE(X.NumVectors() == Y.NumVectors(),
"X and Y must have the same number of vectors");
159 const VectorEpetra_Type X_vectorEpetra(X, M_monolithicMap, Unique);
164 M_X_velocity->zero();
165 M_X_velocity->subset(X_vectorEpetra, *M_u_map, 0, 0);
167 M_X_pressure->zero();
168 M_X_pressure->subset(X_vectorEpetra, *M_p_map, M_fluidVelocity, 0 );
170 M_X_displacement->zero();
171 M_X_displacement->subset(X_vectorEpetra, *M_ds_map, M_fluid, 0 );
174 M_X_lambda->subset(X_vectorEpetra, *M_lambda_map, M_structure, 0 );
176 M_X_geometry->zero();
177 M_X_geometry->subset(X_vectorEpetra, *M_ale_map, M_lambda , 0 );
182 VectorEpetraPtr_Type lambda_omega_f(
new VectorEpetra_Type (*M_u_map) );
183 lambda_omega_f->zero();
185 M_FluidToStructureInterpolant->expandGammaToOmega_Known(M_X_lambda, lambda_omega_f);
191 M_Y_velocity->zero();
192 M_Y_pressure->zero();
194 if ( M_useStabilization )
196 if ( M_useShapeDerivatives )
198 *M_Y_velocity = (*M_F_00) * (*M_X_velocity ) + (*M_F_01) * (*M_X_pressure) + *lambda_omega_f + (*M_shapeVelocity) * (*M_X_geometry);
199 *M_Y_pressure = (*M_F_10) * (*M_X_velocity ) + (*M_F_11) * (*M_X_pressure) + (*M_shapePressure) * (*M_X_geometry);
203 *M_Y_velocity = (*M_F_00) * (*M_X_velocity ) + (*M_F_01) * (*M_X_pressure) + *lambda_omega_f;
204 *M_Y_pressure = (*M_F_10) * (*M_X_velocity ) + (*M_F_11) * (*M_X_pressure);
209 if ( M_useShapeDerivatives )
211 *M_Y_velocity = (*M_F_00) * (*M_X_velocity ) + (*M_F_01) * (*M_X_pressure) + *lambda_omega_f + (*M_shapeVelocity) * (*M_X_geometry);
212 *M_Y_pressure = (*M_F_10) * (*M_X_velocity ) + (*M_shapePressure) * (*M_X_geometry);
216 *M_Y_velocity = (*M_F_00) * (*M_X_velocity ) + (*M_F_01) * (*M_X_pressure) + *lambda_omega_f;
217 *M_Y_pressure = (*M_F_10) * (*M_X_velocity );
225 M_Y_displacement->zero();
226 *M_Y_displacement = *M_S * ( *M_X_displacement );
234 VectorEpetraPtr_Type X_lambda_strong (
new VectorEpetra_Type ( *M_lambda_map ) );
235 X_lambda_strong->zero();
236 applyInverseInterfaceFluidMass(M_X_lambda, X_lambda_strong);
240 VectorEpetraPtr_Type X_lambda_strong_omega_f (
new VectorEpetra_Type ( *M_u_map ) );
241 X_lambda_strong_omega_f->zero();
243 M_FluidToStructureInterpolant->expandGammaToOmega_Known( X_lambda_strong, X_lambda_strong_omega_f );
245 M_FluidToStructureInterpolant->updateRhs(X_lambda_strong_omega_f);
247 M_FluidToStructureInterpolant->interpolate();
249 VectorEpetraPtr_Type X_lambda_strong_omega_s (
new VectorEpetra_Type ( *M_ds_map ) );
251 X_lambda_strong_omega_s->zero();
253 M_FluidToStructureInterpolant->solution(X_lambda_strong_omega_s);
256 VectorEpetraPtr_Type X_lambda_strong_gamma_s;
258 M_StructureToFluidInterpolant->restrictOmegaToGamma_Known(X_lambda_strong_omega_s, X_lambda_strong_gamma_s);
261 VectorEpetraPtr_Type X_lambda_weak_gamma_s (
new VectorEpetra_Type ( X_lambda_strong_gamma_s->map() ) );
263 X_lambda_weak_gamma_s->zero();
265 *X_lambda_weak_gamma_s = *M_structure_interface_mass * (*X_lambda_strong_gamma_s);
268 VectorEpetraPtr_Type X_lambda_weak_omega_s (
new VectorEpetra_Type ( *M_ds_map ) );
270 X_lambda_weak_omega_s->zero();
272 M_StructureToFluidInterpolant->expandGammaToOmega_Known( X_lambda_weak_gamma_s, X_lambda_weak_omega_s );
274 *M_Y_displacement -= *X_lambda_weak_omega_s;
278 M_FluidToStructureInterpolant->updateRhs(lambda_omega_f);
280 M_FluidToStructureInterpolant->interpolate();
282 VectorEpetraPtr_Type X_lambda_weak_omega_s (
new VectorEpetra_Type ( *M_ds_map ) );
284 M_FluidToStructureInterpolant->solution(X_lambda_weak_omega_s);
286 *M_Y_displacement -= *X_lambda_weak_omega_s;
295 VectorEpetraPtr_Type M_Y_lambda_tmp;
297 M_FluidToStructureInterpolant->restrictOmegaToGamma_Known(M_X_velocity, M_Y_lambda_tmp);
299 *M_Y_lambda += *M_Y_lambda_tmp;
301 VectorEpetraPtr_Type structure_vel(
new VectorEpetra_Type ( *M_ds_map ) );
302 structure_vel->zero();
304 if ( M_useBDFStructure )
306 *structure_vel += ( M_coefficientBDF / M_timeStep * (*M_X_displacement) );
310 *structure_vel += ( M_gamma / (M_timeStep*M_beta) * (*M_X_displacement) );
313 M_StructureToFluidInterpolant->updateRhs(structure_vel);
314 M_StructureToFluidInterpolant->interpolate();
316 VectorEpetraPtr_Type structure_vel_omega_f (
new VectorEpetra_Type ( *M_u_map ) );
317 structure_vel_omega_f->zero();
318 M_StructureToFluidInterpolant->solution(structure_vel_omega_f);
320 VectorEpetraPtr_Type structure_vel_gamma_f (
new VectorEpetra_Type ( *M_lambda_map ) );
321 structure_vel_gamma_f->zero();
323 M_FluidToStructureInterpolant->restrictOmegaToGamma_Known(structure_vel_omega_f, structure_vel_gamma_f);
325 *M_Y_lambda -= *structure_vel_gamma_f;
331 M_Y_geometry->zero();
332 *M_Y_geometry = ( *M_G ) * ( *M_X_geometry );
334 M_StructureToFluidInterpolant->updateRhs(M_X_displacement);
335 M_StructureToFluidInterpolant->interpolate();
337 VectorEpetraPtr_Type tmp (
new VectorEpetra_Type ( *M_ale_map ) );
339 M_StructureToFluidInterpolant->solution(tmp);
341 *M_Y_geometry -= *tmp;
344 VectorEpetra_Type Y_vectorEpetra(Y, M_monolithicMap, Unique);
345 Y_vectorEpetra.zero();
348 Y_vectorEpetra.subset(*M_Y_velocity, M_Y_velocity->map(), 0, 0 );
349 Y_vectorEpetra.subset(*M_Y_pressure, M_Y_pressure->map(), 0, M_fluidVelocity );
350 Y_vectorEpetra.subset(*M_Y_displacement, M_Y_displacement->map(), 0, M_fluid );
351 Y_vectorEpetra.subset(*M_Y_lambda, M_Y_lambda->map(), 0, M_structure );
352 Y_vectorEpetra.subset(*M_Y_geometry, M_Y_geometry->map(), 0, M_lambda );
360 Y =
dynamic_cast<Epetra_MultiVector &>( Y_vectorEpetra.epetraVector() );