28 #include <Epetra_ConfigDefs.h> 31 #include <Epetra_MpiComm.h> 33 #include <Epetra_SerialComm.h> 36 #include <lifev/core/LifeV.hpp> 38 #include <lifev/core/mesh/MeshData.hpp> 39 #include <lifev/core/mesh/MeshPartitioner.hpp> 41 #include <lifev/core/array/VectorEpetra.hpp> 43 #include <lifev/fsi_blocks/solver/FSIHandler.hpp> 47 using namespace LifeV;
50 main (
int argc,
char** argv )
54 MPI_Init (&argc, &argv);
55 std::shared_ptr<Epetra_Comm> Comm (
new Epetra_MpiComm (MPI_COMM_WORLD) );
56 if ( Comm->MyPID() == 0 )
61 std::shared_ptr<Epetra_Comm> Comm(
new Epetra_SerialComm () );
65 typedef RegionMesh<LinearTetra> mesh_Type;
66 typedef VectorEpetra vector_Type;
67 typedef std::shared_ptr<vector_Type> vectorPtr_Type;
76 const std::string defaultDataName =
"data";
78 std::string data_file_name = command_line.follow (defaultDataName.c_str(), 2,
"-f",
"--file");
79 GetPot dataFile( data_file_name );
87 fsi.setDatafile ( dataFile );
91 bool usePartitionedMeshes = dataFile
("offlinePartioner/readPartitionedMeshes", false);
93 if ( usePartitionedMeshes )
96 std::cout <<
"\n[PreProcessing] - Using partitioned meshes\n";
98 int numParts = dataFile
("offlinePartioner/parts", 2
);
100 if( numParts != Comm->NumProc())
103 std::cout <<
"\n[PreProcessing] - Using the wrong number of processes\n";
112 fsi.readPartitionedMeshes ( );
117 std::cout <<
"\n[PreProcessing] - The meshes will be partioned during this simulation\n\n";
129 fsi.partitionMeshes ( );
137 std::shared_ptr<BCHandler> interfaceFluidBC (
new BCHandler (*BCh_interfaceFluid ( ) ) );
138 fsi.setFluidInterfaceBoundaryConditions(interfaceFluidBC);
140 std::shared_ptr<BCHandler> fluidBC (
new BCHandler (*BCh_fluid () ) );
141 std::shared_ptr<BCHandler> structureBC (
new BCHandler (*BCh_structure () ) );
142 std::shared_ptr<BCHandler> aleBC (
new BCHandler (*BCh_ale () ) );
143 fsi.setBoundaryConditions( fluidBC, structureBC, aleBC );
145 std::string preconditioner = dataFile(
"fluid/preconditionerType",
"none");
157 fsi.buildInterfaceMaps ( );
163 if ( !dataFile(
"interface/nonconforming",
false ) )
164 fsi.assembleCoupling ( );
170 fsi.solveFSIproblem ( );
172 normTwo_sol = fsi.getFSIsolution()->norm2();
179 std::cout <<
"\nMPI Finalization\n" << std::endl;
184 if ( std::abs(normTwo_sol - 162041.4417 ) < 1.0e-3 )
186 return ( EXIT_SUCCESS );
190 return ( EXIT_FAILURE );
GetPot(const int argc_, char **argv_, const char *FieldSeparator=0x0)
double Real
Generic real data.
int operator()(const char *VarName, int Default) const
std::shared_ptr< ExporterHDF5< mesh_Type > > M_importerStructure
bool operator()(const char *VarName, bool Default) const
int main(int argc, char **argv)