74 #include <boost/timer.hpp> 76 #include <Epetra_ConfigDefs.h> 79 #include <Epetra_MpiComm.h> 81 #include <Epetra_SerialComm.h> 87 #include <lifev/core/fem/FESpace.hpp> 88 #include <lifev/core/array/MapEpetra.hpp> 89 #include <lifev/core/fem/BCHandler.hpp> 90 #include <lifev/core/LifeV.hpp> 92 #include <lifev/core/algorithm/PreconditionerIfpack.hpp> 93 #include <lifev/core/algorithm/PreconditionerML.hpp> 95 #include <lifev/fsi/solver/FSISolver.hpp> 96 #include <lifev/structure/solver/StructuralOperator.hpp> 97 #include <lifev/fsi/solver/FSIMonolithicGI.hpp> 99 #include <lifev/core/filter/ExporterEnsight.hpp> 100 #include <lifev/core/filter/ExporterEmpty.hpp> 102 #include <lifev/core/filter/ExporterHDF5.hpp> 112 typedef std::shared_ptr<LifeV::FSISolver> FSISolverPtr_Type;
114 typedef LifeV::FSIOperator::data_Type data_Type;
115 typedef LifeV::FSIOperator::dataPtr_Type dataPtr_Type;
117 typedef LifeV::FSIOperator::vector_Type vector_Type;
118 typedef LifeV::FSIOperator::vectorPtr_Type vectorPtr_Type;
120 typedef std::shared_ptr< LifeV::Exporter<LifeV::RegionMesh<LifeV::LinearTetra> > > filterPtr_Type;
122 typedef LifeV::ExporterEnsight<LifeV::FSIOperator::mesh_Type> ensightFilter_Type;
123 typedef std::shared_ptr<ensightFilter_Type> ensightFilterPtr_Type;
125 typedef LifeV::ExporterHDF5<LifeV::FSIOperator::mesh_Type> hdf5Filter_Type;
126 typedef std::shared_ptr<hdf5Filter_Type> hdf5FilterPtr_Type;
128 typedef LifeV::FactorySingleton<LifeV::Factory<LifeV::FSIOperator, std::string> > FSIFactory_Type;
129 typedef LifeV::RegionMesh<LifeV::LinearTetra> mesh_Type;
130 typedef LifeV::MapEpetra map_Type;
131 typedef LifeV::FESpace<mesh_Type, map_Type> fespace_Type;
141 Problem ( GetPot
const& data_file ) :
145 using namespace LifeV;
147 FSIOperator::solid_Type::material_Type::isotropicLaw_Type::StructureIsotropicMaterialFactory::instance().registerProduct (
"linearVenantKirchhoff", &FSIOperator::createVenantKirchhoffLinear );
148 FSIOperator::solid_Type::material_Type::isotropicLaw_Type::StructureIsotropicMaterialFactory::instance().registerProduct (
"exponential", &FSIOperator::createExponentialMaterialNonLinear );
149 FSIOperator::solid_Type::material_Type::isotropicLaw_Type::StructureIsotropicMaterialFactory::instance().registerProduct (
"neoHookean", &FSIOperator::createNeoHookeanMaterialNonLinear );
150 FSIOperator::solid_Type::material_Type::isotropicLaw_Type::StructureIsotropicMaterialFactory::instance().registerProduct (
"nonLinearVenantKirchhoff", &FSIOperator::createVenantKirchhoffNonLinear );
152 std::cout <<
"register MonolithicGE : " << FSIMonolithicGE::S_register << std::endl;
153 std::cout <<
"register MonolithicGI : " << FSIMonolithicGI::S_register << std::endl;
156 M_data = dataPtr_Type (
new data_Type() );
157 M_data->setup ( data_file );
159 M_fsi = FSISolverPtr_Type (
new FSISolver( ) );
160 MPI_Barrier ( MPI_COMM_WORLD );
162 M_fsi->setData ( M_data );
163 M_fsi->FSIOper()->setDataFile ( data_file );
167 std::string fluidMeshPartitioned = data_file (
"problem/fluidMeshPartitioned",
"none" );
168 std::string solidMeshPartitioned = data_file (
"problem/solidMeshPartitioned",
"none" );
170 if ( fluidMeshPartitioned.compare (
"none" ) )
172 FSIOperator::meshFilter_Type fluidMeshFilter ( data_file, fluidMeshPartitioned );
173 fluidMeshFilter.setComm ( M_fsi->FSIOper()->worldComm() );
174 FSIOperator::meshFilter_Type solidMeshFilter ( data_file, solidMeshPartitioned );
175 solidMeshFilter.setComm ( M_fsi->FSIOper( )->worldComm( ) );
176 M_fsi->FSIOper( )->partitionMeshes ( fluidMeshFilter, solidMeshFilter );
177 M_fsi->FSIOper( )->setupFEspace( );
178 M_fsi->FSIOper( )->setupDOF ( fluidMeshFilter );
179 fluidMeshFilter.closeFile( );
180 solidMeshFilter.closeFile( );
185 M_fsi->FSIOper( )->partitionMeshes( );
186 M_fsi->FSIOper( )->setupFEspace( );
187 M_fsi->FSIOper( )->setupDOF( );
190 MPI_Barrier ( MPI_COMM_WORLD );
192 M_fsi->setFluidBC ( BCh_monolithicFlux( ) );
193 M_fsi->setSolidBC ( BCh_monolithicSolid ( *M_fsi->FSIOper( ) ) );
197 M_fsi->setFluidBC ( BCh_monolithicFluid ( *M_fsi->FSIOper( ) ) );
198 M_fsi->setHarmonicExtensionBC ( BCh_harmonicExtension ( *M_fsi->FSIOper( ) ) );
200 dynamic_cast<LifeV::FSIMonolithic*> (M_fsi->FSIOper().get() )->mergeBCHandlers();
202 std::string
const exporterType = data_file (
"exporter/type",
"ensight" );
203 std::string
const fluidName = data_file (
"exporter/fluid/filename",
"fluid" );
204 std::string
const solidName = data_file (
"exporter/solid/filename",
"solid" );
207 if (exporterType.compare (
"hdf5") == 0)
209 M_exporterFluid.reset (
new hdf5Filter_Type ( data_file, fluidName) );
210 M_exporterSolid.reset (
new hdf5Filter_Type ( data_file, solidName) );
215 if (exporterType.compare (
"none") == 0)
217 M_exporterFluid.reset (
new ExporterEmpty<RegionMesh<LinearTetra> > ( data_file, M_fsi->FSIOper()->uFESpace().mesh(), fluidName, M_fsi->FSIOper()->uFESpace().map().comm().MyPID() ) );
218 M_exporterSolid.reset (
new ExporterEmpty<RegionMesh<LinearTetra> > ( data_file, M_fsi->FSIOper()->dFESpace().mesh(), solidName, M_fsi->FSIOper()->uFESpace().map().comm().MyPID() ) );
222 M_exporterFluid.reset (
new ensightFilter_Type ( data_file, fluidName) );
223 M_exporterSolid.reset (
new ensightFilter_Type ( data_file, solidName) );
229 M_saveEvery = data_file (
"exporter/saveEvery", 1);
232 std::string restartType (data_file (
"importer/restartType",
"newSimulation") );
233 std::cout <<
"The load state is: " << restartType << std::endl;
235 if (!restartType.compare (
"Stokes") )
237 initializeStokes (data_file);
239 else if (!restartType.compare (
"restartFSI") )
241 restartFSI (data_file);
246 M_Tstart = data_file (
"fluid/time_discretization/initialtime", 0.);
248 M_velAndPressure.reset (
new vector_Type ( M_fsi->FSIOper()->fluid().getMap(), M_exporterFluid->mapType() ) );
250 M_fluidDisp.reset (
new vector_Type ( M_fsi->FSIOper()->mmFESpace().map(), M_exporterFluid->mapType() ) );
252 M_solidDisp.reset (
new vector_Type ( M_fsi->FSIOper()->dFESpace().map(), M_exporterSolid->mapType() ) );
256 M_exporterFluid->setMeshProcId (M_fsi->FSIOper()->uFESpace().mesh(), M_fsi->FSIOper()->uFESpace().map().comm().MyPID() );
257 M_exporterSolid->setMeshProcId (M_fsi->FSIOper()->dFESpace().mesh(), M_fsi->FSIOper()->dFESpace().map().comm().MyPID() );
258 M_exporterFluid->addVariable ( ExporterData<FSIOperator::mesh_Type>::VectorField,
"f-velocity",
259 M_fsi->FSIOper()->uFESpacePtr(), M_velAndPressure, UInt (0) );
260 M_exporterFluid->addVariable ( ExporterData<FSIOperator::mesh_Type>::ScalarField,
"f-pressure",
261 M_fsi->FSIOper()->pFESpacePtr(), M_velAndPressure,
262 UInt (3 * M_fsi->FSIOper()->uFESpace().dof().numTotalDof() ) );
264 M_exporterFluid->addVariable ( ExporterData<FSIOperator::mesh_Type>::VectorField,
"f-displacement",
265 M_fsi->FSIOper()->mmFESpacePtr(), M_fluidDisp, UInt (0) );
272 M_exporterSolid->addVariable ( ExporterData<FSIOperator::mesh_Type>::VectorField,
"s-displacement",
273 M_fsi->FSIOper()->dFESpacePtr(), M_solidDisp, UInt (0) );
281 M_data->dataFluid()->dataTime()->setInitialTime ( M_Tstart );
282 M_data->dataFluid()->dataTime()->setTime ( M_data->dataFluid()->dataTime()->initialTime() );
283 M_data->dataSolid()->dataTime()->setInitialTime ( M_Tstart );
284 M_data->dataSolid()->dataTime()->setTime ( M_data->dataFluid()->dataTime()->initialTime() );
285 M_data->timeDataALE()->setInitialTime ( M_Tstart );
286 M_data->timeDataALE()->setTime ( M_data->dataFluid()->dataTime()->initialTime() );
295 boost::timer _overall_timer;
297 LifeV::UInt iter = 1;
298 LifeV::UInt offset =
dynamic_cast<LifeV::FSIMonolithic*> (M_fsi->FSIOper().get() )->offset();
300 dynamic_cast<LifeV::FSIMonolithic*> (M_fsi->FSIOper().get() )->enableStressComputation (1);
310 for ( ; M_data->dataFluid()->dataTime()->canAdvance(); M_data->dataFluid()->dataTime()->updateTime(), M_data->dataSolid()->dataTime()->updateTime(), ++iter)
314 if (iter % M_saveEvery == 0)
316 M_fsi->FSIOper()->exportSolidDisplacement (*M_solidDisp);
319 M_fsi->FSIOper()->exportFluidVelocityAndPressure (*M_velAndPressure);
320 M_exporterSolid->postProcess ( M_data->dataFluid()->dataTime()->time() );
324 *M_fluidDisp = M_fsi->FSIOper()->meshDisp();
325 M_exporterFluid->postProcess ( M_data->dataFluid()->dataTime()->time() );
331 M_fsi->FSIOper()->displayer().leaderPrintMax (
"[fsi_run] Iteration ", iter);
332 M_fsi->FSIOper()->displayer().leaderPrintMax (
" was done in : ", _timer.elapsed() );
338 if (M_data->method().compare (
"monolithicGI") )
340 vectorPtr_Type solution (
new vector_Type ( (*M_fsi->FSIOper()->couplingVariableMap() ) ) );
341 M_fsi->FSIOper()->extrapolation ( *solution );
342 M_fsi->FSIOper()->iterateMesh (*solution);
344 M_solidDisp->subset (*solution, offset);
349 *M_velAndPressure = *solution;
350 M_exporterSolid->postProcess ( M_data->dataFluid()->dataTime()->time() );
351 *M_fluidDisp = M_fsi->FSIOper()->meshMotion().disp();
352 M_exporterFluid->postProcess ( M_data->dataFluid()->dataTime()->time() );
355 std::cout <<
"Total computation time = " 356 << _overall_timer.elapsed() <<
"s" <<
"\n";
362 void initializeStokes ( GetPot
const& data_file);
363 void restartFSI ( GetPot
const& data_file);
365 FSISolverPtr_Type M_fsi;
368 filterPtr_Type M_exporterSolid;
369 filterPtr_Type M_exporterFluid;
370 filterPtr_Type M_importerSolid;
371 filterPtr_Type M_importerFluid;
372 vectorPtr_Type M_velAndPressure;
373 vectorPtr_Type M_fluidDisp;
374 vectorPtr_Type M_solidDisp;
376 std::vector<vectorPtr_Type> M_solidStencil;
377 std::vector<vectorPtr_Type> M_fluidStencil;
378 std::vector<vectorPtr_Type> M_ALEStencil;
381 LifeV::Real M_Tstart;
383 LifeV::UInt M_saveEvery;
385 struct RESULT_CHANGED_EXCEPTION
388 RESULT_CHANGED_EXCEPTION (LifeV::Real time)
390 std::cout <<
"Some modifications led to changes in the l2 norm of the solution at time" << time << std::endl;
403 std::shared_ptr<Problem> fsip;
407 fsip = std::shared_ptr<Problem> (
new Problem ( data_file ) );
411 catch ( std::exception
const& _ex )
413 std::cout <<
"caught exception : " << _ex.what() <<
"\n";
434 int main (
int argc,
char** argv)
437 MPI_Init (&argc, &argv);
439 std::cout <<
"% using serial Version" << std::endl;
443 const bool check = command_line
.search (2
, "-c", "--check");
462 const std::string data_file_name = command_line
.follow ("data", 2
, "-f", "--file");
475 void Problem::restartFSI ( GetPot
const& data_file)
478 using namespace LifeV;
480 typedef FSIOperator::mesh_Type mesh_Type;
483 std::string
const importerType = data_file (
"importer/type",
"ensight");
484 std::string
const fluidName = data_file (
"importer/fluid/filename",
"fluid");
485 std::string
const solidName = data_file (
"importer/solid/filename",
"solid");
487 std::string
const loadInitSol = data_file (
"importer/initSol",
"00000");
488 std::string
const loadInitSolFD = data_file (
"importer/initSolFD",
"-1");
489 std::string iterationString;
491 M_Tstart = data_file (
"fluid/time_discretization/initialtime", 0.);
493 std::cout <<
"The file for fluid is : " << fluidName << std::endl;
494 std::cout <<
"The file for solid is : " << solidName << std::endl;
495 std::cout <<
"The importerType is : " << importerType << std::endl;
496 std::cout <<
"The iteration is : " << loadInitSol << std::endl;
497 std::cout <<
"For the fluid disp is : " << loadInitSolFD << std::endl;
498 std::cout <<
"Starting time : " << M_Tstart << std::endl;
501 if (importerType.compare (
"hdf5") == 0)
503 M_importerFluid.reset (
new hdf5Filter_Type ( data_file, fluidName) );
504 M_importerSolid.reset (
new hdf5Filter_Type ( data_file, solidName) );
509 if (importerType.compare (
"none") == 0)
511 M_importerFluid.reset (
new ExporterEmpty<mesh_Type > ( data_file, M_fsi->FSIOper()->uFESpace().mesh(),
"fluid", M_fsi->FSIOper()->uFESpace().map().comm().MyPID() ) );
512 M_importerSolid.reset (
new ExporterEmpty<mesh_Type > ( data_file, M_fsi->FSIOper()->dFESpace().mesh(),
"solid", M_fsi->FSIOper()->uFESpace().map().comm().MyPID() ) );
516 M_importerFluid.reset (
new ensightFilter_Type ( data_file, fluidName) );
517 M_importerSolid.reset (
new ensightFilter_Type ( data_file, solidName) );
521 M_importerFluid->setMeshProcId (M_fsi->FSIOper()->uFESpace().mesh(), M_fsi->FSIOper()->uFESpace().map().comm().MyPID() );
522 M_importerSolid->setMeshProcId (M_fsi->FSIOper()->dFESpace().mesh(), M_fsi->FSIOper()->dFESpace().map().comm().MyPID() );
532 vectorPtr_Type fluidSol (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique) );
533 vectorPtr_Type initFluid (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique, Zero) );
534 vectorPtr_Type HarmonicSol (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique, Zero) );
535 vectorPtr_Type structureSol (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique, Zero) );
536 vectorPtr_Type temporarySol (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique, Zero) );
538 vectorPtr_Type vel (
new vector_Type (M_fsi->FSIOper()->uFESpace().map(), M_importerFluid->mapType() ) );
539 vectorPtr_Type pressure (
new vector_Type (M_fsi->FSIOper()->pFESpace().map(), M_importerFluid->mapType() ) );
540 vectorPtr_Type solidDisp (
new vector_Type (M_fsi->FSIOper()->dFESpace().map(), M_importerSolid->mapType() ) );
541 vectorPtr_Type fluidDisp (
new vector_Type (M_fsi->FSIOper()->mmFESpace().map(), M_importerFluid->mapType() ) );
543 vectorPtr_Type firstFluidDisp (
new vector_Type (M_fsi->FSIOper()->mmFESpace().map(), M_importerFluid->mapType() ) );
545 UInt offset =
dynamic_cast<LifeV::FSIMonolithic*> (M_fsi->FSIOper().get() )->offset();
547 iterationString = loadInitSol;
548 std::cout <<
"Fluid size TimeAdvance:" << M_fsi->FSIOper()->fluidTimeAdvance()->size() << std::endl;
549 for (UInt iterInit = 0; iterInit < M_fsi->FSIOper()->fluidTimeAdvance()->size(); iterInit++ )
555 temporarySol.reset (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique, Zero) );
556 fluidSol.reset (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique) );
557 initFluid.reset (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique, Zero) );
560 LifeV::ExporterData<mesh_Type> initSolFluidVel (LifeV::ExporterData<mesh_Type>::VectorField, std::string (
"f-velocity." + iterationString), M_fsi->FSIOper()->uFESpacePtr(), vel, UInt (0), LifeV::ExporterData<mesh_Type>::UnsteadyRegime );
561 LifeV::ExporterData<mesh_Type> initSolFluidPress (LifeV::ExporterData<mesh_Type>::ScalarField, std::string (
"f-pressure." + iterationString), M_fsi->FSIOper()->pFESpacePtr(), pressure, UInt (0), LifeV::ExporterData<mesh_Type>::UnsteadyRegime );
564 M_importerFluid->readVariable (initSolFluidVel);
565 M_importerFluid->readVariable (initSolFluidPress);
567 fluidSol.reset (
new vector_Type (*pressure, Unique, Zero) );
568 initFluid->subset (*fluidSol, fluidSol->map(), UInt (0), (UInt) 3 * M_fsi->FSIOper()->uFESpace().dof().numTotalDof() );
569 vector_Type tmpVec (*initFluid);
571 fluidSol.reset (
new vector_Type (*vel, Unique, Zero) );
573 *initFluid += tmpVec;
578 std::cout <<
"Norm of first Fluid sol: " << initFluid->norm2() << std::endl;
579 *temporarySol = *initFluid;
586 M_fluidStencil.push_back (temporarySol);
588 int iterations = std::atoi (iterationString.c_str() );
591 std::ostringstream iter;
593 iter << std::setw (5) << ( iterations );
594 iterationString = iter.str();
598 iterationString = loadInitSol;
599 for (UInt iterInit = 0; iterInit < M_fsi->FSIOper()->solidTimeAdvance()->size(); iterInit++ )
604 temporarySol.reset (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique, Zero) );
605 structureSol.reset (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique, Zero) );
609 LifeV::ExporterData<mesh_Type> initSolSolidDisp (LifeV::ExporterData<mesh_Type>::VectorField,
"s-displacement." + iterationString, M_fsi->FSIOper()->dFESpacePtr(), solidDisp, UInt (0) , LifeV::ExporterData<mesh_Type>::UnsteadyRegime );
612 M_importerSolid->readVariable (initSolSolidDisp);
614 structureSol->subset (*solidDisp, solidDisp->map(), (UInt) 0, offset);
616 *temporarySol = *structureSol / (M_fsi->FSIOper()->solid().rescaleFactor() );
618 M_solidStencil.push_back (temporarySol);
621 UInt iterations = std::atoi (iterationString.c_str() );
624 std::ostringstream iter;
626 iter << std::setw (5) << ( iterations );
627 iterationString = iter.str();
631 Int convectiveTerm = 0;
632 if (!M_data->dataFluid()->domainVelImplicit() )
636 HarmonicSol.reset (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique, Zero) );
638 iterationString = loadInitSolFD;
640 for (UInt iterInit = 0; iterInit < M_fsi->FSIOper()->ALETimeAdvance()->size() + convectiveTerm + 1; iterInit++ )
642 temporarySol.reset (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV:: Unique, Zero) );
647 LifeV::ExporterData<mesh_Type> initSolFluidDisp (LifeV::ExporterData<mesh_Type>::VectorField,
"f-displacement." + iterationString, M_fsi->FSIOper()->mmFESpacePtr(), fluidDisp, UInt (0), LifeV::ExporterData<mesh_Type>::UnsteadyRegime );
650 M_importerFluid->readVariable (initSolFluidDisp);
652 std::cout <<
"Reloaded Harmonic sol norm: " << fluidDisp->norm2() << std::endl;
655 HarmonicSol->subset (*fluidDisp, fluidDisp->map(), (UInt) 0,
dynamic_cast<LifeV::FSIMonolithicGI*> (M_fsi->FSIOper().get() )->mapWithoutMesh().map (Unique)->NumGlobalElements() );
658 *firstFluidDisp = *fluidDisp;
661 else if (convectiveTerm && iterInit == 1)
663 *firstFluidDisp = *fluidDisp;
667 M_ALEStencil.push_back (fluidDisp);
670 int iterations = std::atoi (iterationString.c_str() );
673 std::ostringstream iter;
675 iter << std::setw (5) << ( iterations );
676 iterationString = iter.str();
679 *M_fluidStencil[0] += *M_solidStencil[0];
680 *M_fluidStencil[0] += *HarmonicSol;
683 M_fsi->initialize (M_fluidStencil, M_solidStencil, M_ALEStencil);
685 if (!M_data->dataFluid()->domainVelImplicit() )
688 M_fsi->FSIOper()->ALETimeAdvance()->updateRHSFirstDerivative ( M_data->dataSolid()->dataTime()->timeStep() );
689 M_fsi->FSIOper()->ALETimeAdvance()->shiftRight (*firstFluidDisp);
692 M_velAndPressure.reset (
new vector_Type ( M_fsi->FSIOper()->fluid().getMap(), M_importerFluid->mapType() ) );
693 M_velAndPressure->subset (*pressure, pressure->map(), UInt (0), (UInt) 3 * M_fsi->FSIOper()->uFESpace().dof().numTotalDof() );
694 *M_velAndPressure += *vel;
696 M_fluidDisp.reset (
new vector_Type ( *fluidDisp, M_importerFluid->mapType() ) );
698 M_solidDisp.reset (
new vector_Type ( *solidDisp, M_importerSolid->mapType() ) );
700 M_data->dataFluid()->dataTime()->updateTime(), M_data->dataSolid()->dataTime()->updateTime();
704 void Problem::initializeStokes ( GetPot
const& data_file)
707 using namespace LifeV;
709 typedef FSIOperator::mesh_Type mesh_Type;
713 filterPtr_Type importer;
714 std::string
const importerType = data_file (
"importer/type",
"hdf5");
715 std::string
const filename = data_file (
"importer/fluid/filename",
"fluid");
717 std::string
const loadInitSol = data_file (
"importer/initSol",
"00000");
718 std::string
const loadInitSolFD = data_file (
"importer/initSolFD",
"-1");
719 std::string iterationString;
721 std::cout <<
"The filename is : " << filename << std::endl;
722 std::cout <<
"The importerType is: " << importerType << std::endl;
725 if (importerType.compare (
"hdf5") == 0)
727 importer.reset (
new hdf5Filter_Type ( data_file, filename) );
732 if (importerType.compare (
"none") == 0)
734 importer.reset (
new ExporterEmpty<RegionMesh<LinearTetra> > ( data_file, M_fsi->FSIOper()->uFESpace().mesh(),
"fluid", M_fsi->FSIOper()->uFESpace().map().comm().MyPID() ) );
738 importer.reset (
new ensightFilter_Type ( data_file, filename) );
742 importer->setMeshProcId (M_fsi->FSIOper()->uFESpace().mesh(), M_fsi->FSIOper()->uFESpace().map().comm().MyPID() );
745 std::vector<vectorPtr_Type> fluidStencil;;
747 vectorPtr_Type temporarySol (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), LifeV::Unique) );
751 iterationString = loadInitSol;
752 for (UInt iterInit = 0; iterInit < M_fsi->FSIOper()->fluidTimeAdvance()->size(); ++iterInit )
758 temporarySol.reset (
new vector_Type (*M_fsi->FSIOper()->couplingVariableMap(), Unique) );
760 vectorPtr_Type vel (
new vector_Type (M_fsi->FSIOper()->uFESpace().map(), M_importerFluid->mapType() ) );
761 vectorPtr_Type pressure (
new vector_Type (M_fsi->FSIOper()->pFESpace().map(), M_importerFluid->mapType() ) );
766 LifeV::ExporterData<mesh_Type> initSolFluidVel (LifeV::ExporterData<mesh_Type>::VectorField, std::string (
"f-velocity." + iterationString), M_fsi->FSIOper()->uFESpacePtr(), vel, UInt (0), LifeV::ExporterData<mesh_Type>::UnsteadyRegime );
767 LifeV::ExporterData<mesh_Type> initSolFluidPress (LifeV::ExporterData<mesh_Type>::ScalarField, std::string (
"f-pressure." + iterationString), M_fsi->FSIOper()->pFESpacePtr(), pressure, UInt (0), LifeV::ExporterData<mesh_Type>::UnsteadyRegime );
770 importer->readVariable (initSolFluidVel);
771 importer->readVariable (initSolFluidPress);
773 int iterations = std::atoi (iterationString.c_str() );
776 std::ostringstream iter;
778 iter << std::setw (5) << ( iterations );
779 iterationString = iter.str();
781 *temporarySol = *vel + *pressure;
782 fluidStencil.push_back (temporarySol);
int main(int argc, char **argv)
GetPot(const int argc_, char **argv_, const char *FieldSeparator=0x0)
static const LifeV::UInt elm_nodes_num[]
FSIChecker(GetPot const &_data_file)
GetPot(const char *FileName, const char *CommentStart=0x0, const char *CommentEnd=0x0, const char *FieldSeparator=0x0)
bool search(unsigned No, const char *P,...)
GetPot(const STRING_VECTOR &FileNameList)
const std::string follow(const char *Default, unsigned No, const char *Option,...)