示例#1
0
void MonolithicBlockComposed::coupler( mapPtr_Type& map,
                                       const std::map<ID, ID>& locDofMap,
                                       const vectorPtr_Type& numerationInterface,
                                       const Real& timeStep,
                                       const Real& coefficient,
                                       const Real& rescaleFactor,
                                       UInt couplingBlock)
{
    matrixPtr_Type coupling(new matrix_Type(*map));
    couplingMatrix( coupling,  (*M_couplingFlags)[couplingBlock], M_FESpace, M_offset, locDofMap, numerationInterface, timeStep, 1., coefficient, rescaleFactor);
    UInt totalDofs( map->map(Unique)->NumGlobalElements() );

    coupling->insertValueDiagonal( 1., 0 , M_offset[couplingBlock] );
    coupling->insertValueDiagonal( 1., M_offset[couplingBlock]+M_FESpace[couplingBlock]->map().map(Unique)->NumGlobalElements(), totalDofs );

    if(couplingBlock != M_coupling.size()+1)
    {
        M_coupling.insert(M_coupling.begin()+couplingBlock, coupling);
    }
    else
        M_coupling.push_back(coupling);
}
void MonolithicBlockComposedDN::coupler (mapPtr_Type& map,
                                         const std::map<ID, ID>& locDofMap,
                                         const vectorPtr_Type& numerationInterface,
                                         const Real& timeStep,
                                         const Real& coefficient,
                                         const Real& rescaleFactor)
{
    UInt totalDofs ( map->map (Unique)->NumGlobalElements() );
    UInt solidAndFluid (M_offset[solid] + M_FESpace[solid]->map().map (Unique)->NumGlobalElements() );

    matrixPtr_Type coupling (new matrix_Type (*map) );
    couplingMatrix ( coupling,  (*M_couplingFlags) [solid], M_FESpace, M_offset, locDofMap, numerationInterface, timeStep, 1., coefficient, rescaleFactor);
    coupling->insertValueDiagonal ( 1., M_offset[fluid], M_offset[solid] );
    coupling->insertValueDiagonal ( 1., solidAndFluid, totalDofs );
    M_coupling.push_back (coupling);

    coupling.reset (new matrix_Type (*map) );
    couplingMatrix ( coupling,  (*M_couplingFlags) [fluid], M_FESpace, M_offset, locDofMap, numerationInterface, timeStep, 1., coefficient, rescaleFactor);
    coupling->insertValueDiagonal ( 1. , M_offset[solid], solidAndFluid );
    coupling->insertValueDiagonal ( 1. , solidAndFluid + nDimensions * numerationInterface->map().map (Unique)->NumGlobalElements(), totalDofs );
    M_coupling.push_back (coupling);

}