1 #include <lifev/fsi_blocks/solver/FSIcouplingCE.hpp> 51 std::map<ID, ID>::const_iterator ITrow;
53 M_lambdaToFluidMomentum.reset (
new MatrixEpetra<Real> ( M_fluidVelocityFESpace->map() ) );
55 if ( lambda_num_structure )
57 for (
UInt dim = 0; dim < 3; ++dim)
59 for (ITrow = localDofMap.begin(); ITrow != localDofMap.end(); ++ITrow)
61 if ( M_numerationInterface->map().map (Unique)->LID (
static_cast<EpetraInt_Type> (ITrow->second) ) >= 0 )
63 M_lambdaToFluidMomentum->addToCoefficient( ITrow->first + dim * M_fluidVelocityFESpace->dof().numTotalDof(),
64 (
int) (*M_numerationInterface)[ITrow->second] + dim * M_interface,
72 for (
UInt dim = 0; dim < 3; ++dim)
74 for (ITrow = localDofMap.begin(); ITrow != localDofMap.end(); ++ITrow)
76 if ( M_numerationInterface->map().map (Unique)->LID (
static_cast<EpetraInt_Type> (ITrow->first) ) >= 0 )
78 M_lambdaToFluidMomentum->addToCoefficient( ITrow->first + dim * M_fluidVelocityFESpace->dof().numTotalDof(),
79 (
int) (*M_numerationInterface)[ITrow->first] + dim * M_interface,
86 M_lambdaToFluidMomentum->globalAssemble(M_interfaceMap, M_fluidVelocityFESpace->mapPtr());
91 M_lambdaToStructureMomentum.reset (
new MatrixEpetra<Real> ( M_structureDisplacementFESpace->map() ) );
93 if ( lambda_num_structure )
95 for (
UInt dim = 0; dim < 3; ++dim)
97 for (ITrow = localDofMap.begin(); ITrow != localDofMap.end(); ++ITrow)
99 if ( M_numerationInterface->map().map (Unique)->LID (
static_cast<EpetraInt_Type> (ITrow->second) ) >= 0 )
101 M_lambdaToStructureMomentum->addToCoefficient( ITrow->second + dim * M_structureDisplacementFESpace->dof().numTotalDof(),
102 (
int) (*M_numerationInterface)[ITrow->second] + dim * M_interface,
110 for (
UInt dim = 0; dim < 3; ++dim)
112 for (ITrow = localDofMap.begin(); ITrow != localDofMap.end(); ++ITrow)
114 if ( M_numerationInterface->map().map (Unique)->LID (
static_cast<EpetraInt_Type> (ITrow->first) ) >= 0 )
116 M_lambdaToStructureMomentum->addToCoefficient( ITrow->second + dim * M_structureDisplacementFESpace->dof().numTotalDof(),
117 (
int) (*M_numerationInterface)[ITrow->first] + dim * M_interface,
124 M_lambdaToStructureMomentum->globalAssemble(M_interfaceMap, M_structureDisplacementFESpace->mapPtr());
129 M_fluidVelocityToLambda.reset (
new MatrixEpetra<Real> ( *M_interfaceMap ) );
131 if ( lambda_num_structure )
133 for (
UInt dim = 0; dim < 3; ++dim)
135 for (ITrow = localDofMap.begin(); ITrow != localDofMap.end(); ++ITrow)
137 if ( M_numerationInterface->map().map (Unique)->LID (
static_cast<EpetraInt_Type> (ITrow->second) ) >= 0 )
139 M_fluidVelocityToLambda->addToCoefficient( (
int) (*M_numerationInterface)[ITrow->second] + dim * M_interface,
140 ITrow->first + dim * M_fluidVelocityFESpace->dof().numTotalDof(),
148 for (
UInt dim = 0; dim < 3; ++dim)
150 for (ITrow = localDofMap.begin(); ITrow != localDofMap.end(); ++ITrow)
152 if ( M_numerationInterface->map().map (Unique)->LID (
static_cast<EpetraInt_Type> (ITrow->first) ) >= 0 )
154 M_fluidVelocityToLambda->addToCoefficient( (
int) (*M_numerationInterface)[ITrow->first] + dim * M_interface,
155 ITrow->first + dim * M_fluidVelocityFESpace->dof().numTotalDof(),
162 M_fluidVelocityToLambda->globalAssemble(M_fluidVelocityFESpace->mapPtr(), M_interfaceMap);
175 M_structureDisplacementToLambda.reset (
new MatrixEpetra<Real> ( *M_interfaceMap ) );
177 if ( lambda_num_structure )
179 for (
UInt dim = 0; dim < 3; ++dim)
181 for (ITrow = localDofMap.begin(); ITrow != localDofMap.end(); ++ITrow)
183 if ( M_numerationInterface->map().map (Unique)->LID (
static_cast<EpetraInt_Type> (ITrow->second) ) >= 0 )
185 M_structureDisplacementToLambda->addToCoefficient( (
int) (*M_numerationInterface)[ITrow->second] + dim * M_interface,
186 ITrow->second + dim * M_structureDisplacementFESpace->dof().numTotalDof(),
194 for (
UInt dim = 0; dim < 3; ++dim)
196 for (ITrow = localDofMap.begin(); ITrow != localDofMap.end(); ++ITrow)
198 if ( M_numerationInterface->map().map (Unique)->LID (
static_cast<EpetraInt_Type> (ITrow->first) ) >= 0 )
200 M_structureDisplacementToLambda->addToCoefficient( (
int) (*M_numerationInterface)[ITrow->first] + dim * M_interface,
201 ITrow->second + dim * M_structureDisplacementFESpace->dof().numTotalDof(),
208 M_structureDisplacementToLambda->globalAssemble(M_structureDisplacementFESpace->mapPtr(), M_interfaceMap);
213 M_structureDisplacementToFluidDisplacement.reset(
new MatrixEpetra<Real> ( M_fluidVelocityFESpace->map() ) );
215 if ( lambda_num_structure )
217 for (
UInt dim = 0; dim < 3; ++dim)
219 for (ITrow = localDofMap.begin(); ITrow != localDofMap.end(); ++ITrow)
221 if ( M_numerationInterface->map().map (Unique)->LID (
static_cast<EpetraInt_Type> (ITrow->second) ) >= 0 )
223 M_structureDisplacementToFluidDisplacement->addToCoefficient( ITrow->first + dim * M_fluidVelocityFESpace->dof().numTotalDof(),
224 ITrow->second + dim * M_structureDisplacementFESpace->dof().numTotalDof(),
232 for (
UInt dim = 0; dim < 3; ++dim)
234 for (ITrow = localDofMap.begin(); ITrow != localDofMap.end(); ++ITrow)
236 if ( M_numerationInterface->map().map (Unique)->LID (
static_cast<EpetraInt_Type> (ITrow->first) ) >= 0 )
238 M_structureDisplacementToFluidDisplacement->addToCoefficient( ITrow->first + dim * M_fluidVelocityFESpace->dof().numTotalDof(),
239 ITrow->second + dim * M_structureDisplacementFESpace->dof().numTotalDof(),
246 M_structureDisplacementToFluidDisplacement->globalAssemble(M_structureDisplacementFESpace->mapPtr(), M_fluidVelocityFESpace->mapPtr());
void buildBlocks(std::map< ID, ID > const &locDofMap, const bool &lambda_num_structure, bool useBDF=false)
Builds the coupling blocks.
void updateInverseJacobian(const UInt &iQuadPt)
commPtr_Type M_comm
communicator
FESpacePtr_Type M_structureDisplacementFESpace
std::shared_ptr< VectorEpetra > vectorPtr_Type
~FSIcouplingCE()
Destructor.
void setUp(const Real &timeStep, const Real &interfaceDofs, const Real &coefficientBDF, const mapPtr_Type &interfaceMap, const FESpacePtr_Type &fluidVelocityFESpace, const FESpacePtr_Type &structureDisplacementFESpace, const vectorPtr_Type &numerationInterface)
Set parameters. To be used when Newmark is used on the structure.
FESpacePtr_Type M_fluidVelocityFESpace
std::shared_ptr< map_Type > mapPtr_Type
double Real
Generic real data.
vectorPtr_Type M_numerationInterface
FSIcouplingCE - File handling the coupling blocks when conforming discretizations are used...
void setUp(const Real &timeStep, const Real &interfaceDofs, const Real &beta, const Real &gamma, const mapPtr_Type &interfaceMap, const FESpacePtr_Type &fluidVelocityFESpace, const FESpacePtr_Type &structureDisplacementFESpace, const vectorPtr_Type &numerationInterface)
Set parameters. To be used when Newmark is used on the structure.
std::shared_ptr< comm_Type > commPtr_Type
FSIcouplingCE(const commPtr_Type &communicator)
Constructor.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
mapPtr_Type M_interfaceMap
std::shared_ptr< FESpace_Type > FESpacePtr_Type