37 #include <lifev/core/LifeV.hpp> 42 #pragma GCC diagnostic ignored "-Wunused-variable" 43 #pragma GCC diagnostic ignored "-Wunused-parameter" 45 #include "Epetra_config.h" 49 #include <Epetra_MpiComm.h> 52 #pragma GCC diagnostic warning "-Wunused-variable" 53 #pragma GCC diagnostic warning "-Wunused-parameter" 55 #include <lifev/core/mesh/MeshPartitioner.hpp> 56 #include <lifev/core/filter/PartitionIO.hpp> 57 #include <lifev/core/filter/ExporterHDF5Mesh3D.hpp> 58 #include <lifev/core/mesh/RegionMesh.hpp> 59 #include <lifev/core/mesh/MeshData.hpp> 61 #include <lifev/fsi_blocks/mesh/MeshPartitionerOfflineFSI.hpp> 62 #include <lifev/fsi_blocks/filter/DOFInterfaceIO.hpp> 64 using namespace LifeV;
69 int main (
int argc,
char** argv)
74 typedef RegionMesh<LinearTetra> mesh_Type;
76 MPI_Init (&argc, &argv);
77 std::shared_ptr<Epetra_Comm> comm (
new Epetra_MpiComm (MPI_COMM_WORLD) );
79 if (comm->NumProc() != 1)
81 std::cout <<
"This test needs to be run " 82 <<
"with a single process. Aborting." 84 return (EXIT_FAILURE);
87 GetPot commandLine (argc, argv);
88 std::string dataFileName = commandLine.follow (
"data", 2,
"-f",
"--file");
89 GetPot dataFile (dataFileName);
91 const UInt numParts (dataFile (
"test/num_parts", 4) );
92 const std::string fluidPartsFileName (dataFile (
"test/fluid_hdf5_file_name",
94 const std::string solidPartsFileName (dataFile (
"test/solid_hdf5_file_name",
96 const std::string interfacePartsFileName (dataFile (
"test/interface_hdf5_file_name",
99 UInt fluidVertexFlag = dataFile (
"test/fluidVertexFlag", 33 );
101 std::cout <<
"Number of parts: " << numParts << std::endl;
102 std::cout <<
"Name of fluid HDF5 container: " 103 << fluidPartsFileName << std::endl;
104 std::cout <<
"Name of solid HDF5 container: " 105 << solidPartsFileName << std::endl;
106 std::cout <<
"Name of interface HDF5 container: " 107 << interfacePartsFileName << std::endl;
109 std::shared_ptr<mesh_Type> fluidMeshPtr (
new mesh_Type ( comm ) );
110 std::shared_ptr<mesh_Type> solidMeshPtr (
new mesh_Type ( comm ) );
113 MeshData fluidMeshData (dataFile,
"fluid_mesh");
114 readMesh (*fluidMeshPtr, fluidMeshData);
117 MeshData solidMeshData (dataFile,
"solid_mesh");
118 readMesh (*solidMeshPtr, solidMeshData);
121 std::string fluidOrder (dataFile (
"fluid_mesh/order",
"P1") );
122 std::string solidOrder (dataFile (
"solid_mesh/order",
"P1") );
125 markerID_Type fluidInterfaceFlag (dataFile (
"fluid_mesh/interface_flag", 1) );
126 markerID_Type solidInterfaceFlag (dataFile (
"solid_mesh/interface_flag", 1) );
129 MeshPartitionerOfflineFSI<mesh_Type> fsiPartitioner (
130 fluidMeshPtr, solidMeshPtr, numParts, numParts, fluidOrder, solidOrder,
131 fluidInterfaceFlag, solidInterfaceFlag, 0, fluidVertexFlag, 0, comm);
134 fsiPartitioner.showMe();
138 fluidMeshPtr.reset();
139 solidMeshPtr.reset();
142 std::shared_ptr<Epetra_MpiComm> mpiComm =
143 std::dynamic_pointer_cast<Epetra_MpiComm> (comm);
145 PartitionIO<mesh_Type> fluidPartitionIO (fluidPartsFileName, mpiComm);
146 fluidPartitionIO.write (fsiPartitioner.fluidPartitions() );
147 PartitionIO<mesh_Type> solidPartitionIO (solidPartsFileName, mpiComm);
148 solidPartitionIO.write (fsiPartitioner.solidPartitions() );
149 DOFInterfaceIO interfaceIO (interfacePartsFileName, mpiComm);
150 interfaceIO.write (fsiPartitioner.dofStructureToHarmonicExtension() );
155 std::cout <<
"This test needs MPI to run. Aborting." << std::endl;
156 return (EXIT_FAILURE);
159 std::cout <<
"This test needs HDF5 to run. Aborting." << std::endl;
160 return (EXIT_FAILURE);
163 return (EXIT_SUCCESS);
int main(int argc, char **argv)