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> 66 template<
typename MeshType>
136 const Int& fluidPartitionNumber,
137 const Int& solidPartitionNumber,
138 const std::string& velocityOrder,
139 const std::string& displacementOrder,
142 const Real& interfaceTolerance,
143 const Int& fluidInterfaceVertexFlag,
144 const Int& solidInterfaceVertexFlag,
159 void showMe (std::ostream& output = std::cout)
const;
175 return M_fluidMeshCutter->elementDomains();
179 return M_solidMeshCutter->elementDomains();
183 return M_fluidMeshCutter->meshPartitions();
188 return M_solidMeshCutter->meshPartitions();
295 template<
typename MeshType>
298 const Int& fluidPartitionNumber,
299 const Int& solidPartitionNumber,
300 const std::string& velocityOrder,
301 const std::string& displacementOrder,
304 const Real& interfaceTolerance,
305 const Int& fluidInterfaceVertexFlag,
306 const Int& solidInterfaceVertexFlag,
312 if (M_comm->NumProc() == 1)
324 if (fluidInterfaceVertexFlag > 0)
326 M_fluidInterfaceVertexFlag.reset (
new const Int (fluidInterfaceVertexFlag) );
328 if (solidInterfaceVertexFlag > 0)
330 M_solidInterfaceVertexFlag.reset (
new const Int (solidInterfaceVertexFlag) );
337 M_fluidMeshCutter.reset (
new meshCutter_Type);
338 M_fluidMeshCutter->setup (M_fluidPartitionNumber, M_comm);
339 M_fluidMeshCutter->attachUnpartitionedMesh (M_uncutFluidMesh);
341 M_solidMeshCutter.reset (
new meshCutter_Type);
342 M_solidMeshCutter->setup (M_solidPartitionNumber, M_comm);
343 M_solidMeshCutter->attachUnpartitionedMesh (M_uncutSolidMesh);
347 ERROR_MSG (
"Offline FSI partitioning is designed to run" 348 " with a single process.");
352 template<
typename MeshType>
365 template<
typename MeshType>
369 output <<
"=======================================" << std::endl;
370 output <<
"Internal state of MeshPartitionerOfflineFSI" << std::endl;
373 output <<
"Number of fluid partitions: " << M_fluidPartitionNumber
375 output <<
"Number of solid partitions: " << M_solidPartitionNumber
377 output <<
"Velocity order: " << M_velocityOrder
379 output <<
"Displacement order: " << M_displacementOrder
381 output <<
"Fluid interface flag: " << M_fluidInterfaceFlag
383 output <<
"Solid interface flag: " << M_solidInterfaceFlag
385 output <<
"Interface tolerance: " << M_interfaceTolerance
387 if (M_fluidInterfaceVertexFlag.get() )
389 output <<
"Fluid interface vertex flag: " << *M_fluidInterfaceVertexFlag
392 if (M_solidInterfaceVertexFlag.get() )
394 output <<
"Solid interface vertex flag: " << *M_solidInterfaceVertexFlag
397 output <<
"Fluid mesh is stored at: " << M_uncutFluidMesh.get()
399 output <<
"Solid mesh is stored at: " << M_uncutSolidMesh.get()
401 output <<
"=======================================" << std::endl;
409 template<
typename MeshType>
412 std::cout <<
"\nPartitioning fluid mesh...\n" << std::endl;
413 M_fluidMeshCutter->doPartitionGraph();
414 M_fluidMeshCutter->doPartitionMesh();
415 M_fluidMeshCutter->releaseUnpartitionedMesh();
416 std::cout <<
"\nPartitioning solid mesh...\n" << std::endl;
417 M_solidMeshCutter->doPartitionGraph();
418 M_solidMeshCutter->doPartitionMesh();
419 M_solidMeshCutter->releaseUnpartitionedMesh();
420 std::cout << std::endl;
423 template<
typename MeshType>
435 if ( M_velocityOrder.compare (
"P2") == 0 )
437 refFE_vel = &feTetraP2;
443 if ( M_velocityOrder.compare (
"P1") == 0 )
445 refFE_vel = &feTetraP1;
451 if ( M_velocityOrder.compare (
"P1Bubble") == 0 )
453 refFE_vel = &feTetraP1bubble;
464 if ( M_displacementOrder.compare (
"P2") == 0 )
466 refFE_disp = &feTetraP2;
472 if ( M_displacementOrder.compare (
"P1") == 0 )
474 refFE_disp = &feTetraP1;
485 std::cout <<
"Creating velocity finite element space... ";
486 M_velocityFESpaces.reset (
new feSpaceVector_Type);
487 M_velocityFESpaces->resize (M_fluidPartitionNumber);
490 (*M_velocityFESpaces) [i].reset (
new feSpace_Type (M_fluidMeshCutter->getPartition (i),
497 std::cout <<
"done." << std::endl;
498 std::cout <<
"Creating displacement finite element space... ";
499 M_displacementFESpace.reset (
new feSpace_Type (M_uncutSolidMesh,
505 std::cout <<
"done." << std::endl;
508 template<
typename MeshType>
512 std::cout << std::endl;
513 std::cout <<
"Creating the DOF interfaces..." << std::endl;
514 std::cout << std::endl;
515 std::cout <<
"Fluid interface flag is: " << M_fluidInterfaceFlag << std::endl;
516 std::cout <<
"Solid interface flag is: " << M_solidInterfaceFlag << std::endl;
517 std::cout << std::endl;
519 M_dofStructureToHarmonicExtension.reset (
new interfaceVector_Type);
520 M_dofStructureToHarmonicExtension->resize (M_fluidPartitionNumber);
526 ifPtr.reset (
new interface_Type);
527 ifPtr->setup (velSpacePtr->refFE(),
529 M_displacementFESpace->refFE(),
530 M_displacementFESpace->dof() );
531 ifPtr->update (* (velSpacePtr->mesh() ), M_fluidInterfaceFlag,
532 * (M_displacementFESpace->mesh() ), M_solidInterfaceFlag,
533 M_interfaceTolerance, M_fluidInterfaceVertexFlag.get() );
535 std::cout <<
"dofStructureToHarmonicExtension done." << std::endl;
537 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)
void execute()
Execute the partitioning and create the interface map.
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)
MeshPartitionerOfflineFSI()
Empty Constructor.
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
std::shared_ptr< interface_Type > interfacePtr_Type
Int M_solidPartitionNumber
std::string M_displacementOrder
const graphPtr_Type & fluidGraph() const
void setup(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)
Setup the data members of the class after construction.
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