37 #ifndef MESH_PARTITIONER_OFFLINE_FSI_H 38 #define MESH_PARTITIONER_OFFLINE_FSI_H 1
41 #include <boost/scoped_ptr.hpp> 42 #include <boost/shared_ptr.hpp> 45 #include <lifev/core/fem/FESpace.hpp> 46 #include <lifev/core/fem/DOFInterface3Dto3D.hpp> 47 #include <lifev/core/mesh/Marker.hpp> 48 #include <lifev/core/mesh/MeshPartitioner.hpp> 67 template<
typename MeshType>
126 const Int fluidPartitionNumber,
127 const Int solidPartitionNumber,
128 const std::string velocityOrder,
129 const std::string displacementOrder,
132 const Real interfaceTolerance,
133 const Int fluidInterfaceVertexFlag,
134 const Int solidInterfaceVertexFlag,
148 void showMe (std::ostream& output = std::cout)
const;
163 return M_fluidMeshCutter->elementDomains();
167 return M_solidMeshCutter->elementDomains();
171 return M_fluidMeshCutter->meshPartitions();
176 return M_solidMeshCutter->meshPartitions();
280 template<
typename MeshType>
284 const Int fluidPartitionNumber,
285 const Int solidPartitionNumber,
286 const std::string velocityOrder,
287 const std::string displacementOrder,
290 const Real interfaceTolerance,
291 const Int fluidInterfaceVertexFlag,
292 const Int solidInterfaceVertexFlag,
308 if (M_comm->NumProc() == 1)
311 M_fluidMeshCutter.reset (
new meshCutter_Type);
312 M_fluidMeshCutter->setup (M_fluidPartitionNumber, M_comm);
313 M_fluidMeshCutter->attachUnpartitionedMesh (M_uncutFluidMesh);
315 M_solidMeshCutter.reset (
new meshCutter_Type);
316 M_solidMeshCutter->setup (M_solidPartitionNumber, M_comm);
317 M_solidMeshCutter->attachUnpartitionedMesh (M_uncutSolidMesh);
330 ERROR_MSG (
"Offline FSI partitioning is designed to run" 331 " with a single process.");
335 template<
typename MeshType>
339 output <<
"=======================================" << std::endl;
340 output <<
"Internal state of MeshPartitionerOfflineFSI" << std::endl;
343 output <<
"Number of fluid partitions: " << M_fluidPartitionNumber
345 output <<
"Number of solid partitions: " << M_solidPartitionNumber
347 output <<
"Velocity order: " << M_velocityOrder
349 output <<
"Displacement order: " << M_displacementOrder
351 output <<
"Fluid interface flag: " << M_fluidInterfaceFlag
353 output <<
"Solid interface flag: " << M_solidInterfaceFlag
355 output <<
"Interface tolerance: " << M_interfaceTolerance
359 output <<
"Fluid interface vertex flag: " << M_fluidInterfaceVertexFlag
364 output <<
"Solid interface vertex flag: " << M_solidInterfaceVertexFlag
367 output <<
"Fluid mesh is stored at: " << M_uncutFluidMesh.get()
369 output <<
"Solid mesh is stored at: " << M_uncutSolidMesh.get()
371 output <<
"=======================================" << std::endl;
379 template<
typename MeshType>
382 std::cout <<
"\nPartitioning fluid mesh...\n" << std::endl;
383 M_fluidMeshCutter->doPartitionGraph();
384 M_fluidMeshCutter->fillEntityPID();
385 M_fluidMeshCutter->doPartitionMesh();
386 M_fluidMeshCutter->releaseUnpartitionedMesh();
387 std::cout <<
"\nPartitioning solid mesh...\n" << std::endl;
388 M_solidMeshCutter->doPartitionGraph();
389 M_solidMeshCutter->fillEntityPID();
390 M_solidMeshCutter->doPartitionMesh();
391 M_solidMeshCutter->releaseUnpartitionedMesh();
392 std::cout << std::endl;
395 template<
typename MeshType>
407 if ( M_velocityOrder.compare (
"P2") == 0 )
409 refFE_vel = &feTetraP2;
415 if ( M_velocityOrder.compare (
"P1") == 0 )
417 refFE_vel = &feTetraP1;
423 if ( M_velocityOrder.compare (
"P1Bubble") == 0 )
425 refFE_vel = &feTetraP1bubble;
436 if ( M_displacementOrder.compare (
"P2") == 0 )
438 refFE_disp = &feTetraP2;
444 if ( M_displacementOrder.compare (
"P1") == 0 )
446 refFE_disp = &feTetraP1;
457 std::cout <<
"Creating velocity finite element space... ";
458 M_velocityFESpaces.reset (
new feSpaceVector_Type);
459 M_velocityFESpaces->resize (M_fluidPartitionNumber);
462 (*M_velocityFESpaces) [i].reset (
new feSpace_Type (M_fluidMeshCutter->getPartition (i),
469 std::cout <<
"done." << std::endl;
470 std::cout <<
"Creating displacement finite element space... ";
471 M_displacementFESpace.reset (
new feSpace_Type (M_uncutSolidMesh,
477 std::cout <<
"done." << std::endl;
481 std::cout <<
"Number of dofs for the fluid velocity: " << velocity.dof().numTotalDof()*3 << std::endl;
482 std::cout <<
"Number of dofs for the structure displacement: " << M_displacementFESpace->dof().numTotalDof()*3 << std::endl;
485 template<
typename MeshType>
489 std::cout << std::endl;
490 std::cout <<
"Creating the DOF interfaces..." << std::endl;
491 std::cout << std::endl;
492 std::cout <<
"Fluid interface flag is: " << M_fluidInterfaceFlag << std::endl;
493 std::cout <<
"Solid interface flag is: " << M_solidInterfaceFlag << std::endl;
494 std::cout << std::endl;
496 M_dofStructureToHarmonicExtension.reset (
new interfaceVector_Type);
497 M_dofStructureToHarmonicExtension->resize (M_fluidPartitionNumber);
503 ifPtr.reset (
new interface_Type);
504 ifPtr->setup (velSpacePtr->refFE(),
506 M_displacementFESpace->refFE(),
507 M_displacementFESpace->dof() );
508 ifPtr->update (* (velSpacePtr->mesh() ), M_fluidInterfaceFlag,
509 * (M_displacementFESpace->mesh() ), M_solidInterfaceFlag,
510 M_interfaceTolerance, &M_fluidInterfaceVertexFlag );
512 std::cout <<
"dofStructureToHarmonicExtension done." << std::endl;
514 std::cout <<
"All done." << std::endl << std::endl;
const uncutMeshVectorPtr_Type & solidPartitions() const
const QuadratureRule quadRuleTetra64pt(pt_tetra_64pt, 6, "Quadrature rule 64 points on a tetraedra", TETRA, 64, 7)
virtual ~MeshPartitionerOfflineFSI()
Destructor.
std::shared_ptr< meshCutter_Type > meshCutterPtr_Type
std::shared_ptr< graph_Type > graphPtr_Type
markerID_Type M_solidInterfaceFlag
void showMe(std::ostream &output=std::cout) const
Display general information about the content of the class.
interfaceVectorPtr_Type M_dofFluidToStructure
interfaceVectorPtr_Type M_dofStructureToSolid
const QuadratureRule quadRuleTetra15pt(pt_tetra_15pt, 5, "Quadrature rule 15 points on a tetraedra", TETRA, 15, 5)
const QuadratureRule quadRuleTetra4pt(pt_tetra_4pt, 2, "Quadrature rule 4 points on a tetraedra", TETRA, 4, 2)
std::shared_ptr< comm_Type > commPtr_Type
int32_type Int
Generic integer data.
const markerID_Type fluidInterfaceFlag() const
MeshPartitionerOfflineFSI & operator=(const MeshPartitionerOfflineFSI &)
const markerID_Type solidInterfaceFlag() const
const Int M_fluidInterfaceVertexFlag
ID markerID_Type
markerID_Type is the type used to store the geometric entity marker IDs
std::vector< interfacePtr_Type > interfaceVector_Type
Real M_interfaceTolerance
void updateInverseJacobian(const UInt &iQuadPt)
std::shared_ptr< interfaceVector_Type > interfaceVectorPtr_Type
const uncutMeshVectorPtr_Type & fluidPartitions() const
Int M_fluidPartitionNumber
void runTheCutters()
Create the MeshPartitioner objects for fluid and solid.
Epetra_Import const & importer()
Getter for the Epetra_Import.
uncutMeshPtr_Type M_uncutFluidMesh
std::vector< uncutMeshPtr_Type > uncutMeshVector_Type
std::shared_ptr< feSpaceVector_Type > feSpaceVectorPtr_Type
DOFInterface3Dto3D interface_Type
interfaceVectorPtr_Type M_dofStructureToFluid
std::shared_ptr< uncutMesh_Type > uncutMeshPtr_Type
const Int M_solidInterfaceVertexFlag
feSpaceVectorPtr_Type M_velocityFESpaces
void mapTheInterface()
Create the interface map between fluid and solid.
FESpace< uncutMesh_Type, MapEpetra > feSpace_Type
double Real
Generic real data.
MeshPartitionerOfflineFSI - Offline mesh partitioning for FSI.
const QuadratureRule quadRuleTria3pt(pt_tria_3pt, 2, "Quadrature rule 3 points on a triangle", TRIANGLE, 3, 2)
const graphPtr_Type & solidGraph() const
meshCutterPtr_Type M_solidMeshCutter
The class for a reference Lagrangian finite element.
const interfaceVectorPtr_Type & dofStructureToHarmonicExtension() const
MeshPartitionerOfflineFSI(const uncutMeshPtr_Type &uncutFluidMesh, const uncutMeshPtr_Type &uncutSolidMesh, const Int fluidPartitionNumber, const Int solidPartitionNumber, const std::string velocityOrder, const std::string displacementOrder, const markerID_Type fluidInterfaceFlag, const markerID_Type solidInterfaceFlag, const Real interfaceTolerance, const Int fluidInterfaceVertexFlag, const Int solidInterfaceVertexFlag, const commPtr_Type &comm)
Constructor.
std::shared_ptr< interface_Type > interfacePtr_Type
Int M_solidPartitionNumber
std::string M_displacementOrder
const graphPtr_Type & fluidGraph() const
std::shared_ptr< uncutMeshVector_Type > uncutMeshVectorPtr_Type
void createSpaces()
Create the finite element spaces.
MeshPartitioner< uncutMesh_Type > meshCutter_Type
QuadratureRule - The basis class for storing and accessing quadrature rules.
interfaceVectorPtr_Type M_dofHarmonicExtensionToFluid
feSpacePtr_Type M_displacementFESpace
std::vector< feSpacePtr_Type > feSpaceVector_Type
meshCutterPtr_Type M_fluidMeshCutter
interfaceVectorPtr_Type M_dofStructureToHarmonicExtension
std::string M_velocityOrder
MeshPartitionerOfflineFSI(const MeshPartitionerOfflineFSI &)
std::shared_ptr< feSpace_Type > feSpacePtr_Type
markerID_Type M_fluidInterfaceFlag
std::vector< std::vector< Int > > graph_Type
uncutMeshPtr_Type M_uncutSolidMesh