9 #include <lifev/core/filter/GetPot.hpp> 10 #include <lifev/core/util/LifeChrono.hpp> 13 #include <lifev/core/mesh/MeshData.hpp> 14 #include <lifev/core/mesh/RegionMesh.hpp> 15 #include <lifev/core/mesh/MeshPartitioner.hpp> 17 #include <lifev/core/filter/ExporterEnsight.hpp> 18 #include <lifev/core/filter/ExporterHDF5.hpp> 19 #include <lifev/core/filter/ExporterEmpty.hpp> 23 int run (
GetPot& dataFile,
bool , std::shared_ptr<Epetra_Comm>& comm)
25 using namespace LifeV;
26 typedef RegionMesh<LinearTetra> mesh_Type;
27 typedef RegionMesh<LinearTriangle> mesh2d_Type;
31 std::string mesh_section (
"mesh");
34 std::list<UInt> boundaryMarkerListToExtract, otherBoundaryMarkerList;
35 parseList ( dataFile ( (mesh_section +
"/interfaceList").c_str(),
""), boundaryMarkerListToExtract );
36 parseList ( dataFile ( (mesh_section +
"/boundaryList").c_str(),
""), otherBoundaryMarkerList );
43 std::shared_ptr<mesh_Type> mesh;
44 std::shared_ptr< MeshPartitioner<mesh_Type> > meshPart;
45 MeshData meshData (dataFile, mesh_section);
46 mesh.reset (
new mesh_Type ( comm ) );
47 readMesh (*mesh, meshData);
50 std::shared_ptr<mesh2d_Type> mesh2d;
51 std::shared_ptr< MeshPartitioner<mesh2d_Type> > mesh2dPart;
52 mesh2d.reset (extractBoundaryMesh (*mesh, *boundaryMarkerListToExtract.begin(), otherBoundaryMarkerList) );
53 mesh2d->showMe (
false, std::cout);
55 meshPart.reset (
new MeshPartitioner<mesh_Type> (mesh, comm) );
56 mesh2dPart.reset (
new MeshPartitioner<mesh2d_Type> (mesh2d, comm) );
61 std::shared_ptr< FESpace<mesh2d_Type, MapEpetra> > feSpace;
62 feSpace.reset (
new FESpace<mesh2d_Type, MapEpetra> (mesh2dPart->meshPartition(),
"P1", 1, comm) );
67 std::shared_ptr<Exporter<mesh2d_Type> > exporter;
68 std::string
const exporterType = dataFile (
"exporter/type",
"hdf5");
71 if (exporterType.compare (
"hdf5") == 0)
73 exporter.reset (
new ExporterHDF5<mesh2d_Type > ( dataFile,
"2dmesh" ) );
78 if (exporterType.compare (
"none") == 0)
80 exporter.reset (
new ExporterEmpty<mesh2d_Type > ( dataFile, mesh2d,
"2dmesh", comm->MyPID() ) );
84 exporter.reset (
new ExporterEnsight<mesh2d_Type > ( dataFile, mesh2d,
"2dmesh", comm->MyPID() ) );
88 exporter->setPostDir (
"./" );
89 exporter->setMeshProcId ( mesh2d, comm->MyPID() );
95 std::shared_ptr<VectorEpetra> u (
new VectorEpetra (feSpace->map(), exporter->mapType() ) );
96 exporter->addVariable (ExporterData<mesh2d_Type >::ScalarField,
"u", feSpace, u, UInt (0) );
98 exporter->postProcess (0);
MeshData - class for handling spatial discretization.