コード例 #1
0
void SDCFsiSolver::setSolution(
    const fsi::vector & solution,
    const fsi::vector & f
    )
{
    Eigen::Map<const fsi::vector> solFluid( solution.data(), dofFluid );
    Eigen::Map<const fsi::vector> solSolid( solution.data() + dofFluid, dofSolid );

    Eigen::Map<const fsi::vector> fFluid( f.data(), dofFluid );
    Eigen::Map<const fsi::vector> fSolid( f.data() + dofFluid, dofSolid );

    fluid->setSolution( solFluid, fFluid );
    solid->setSolution( solSolid, fSolid );
}
コード例 #2
0
void SDCFsiSolver::implicitSolve(
    bool corrector,
    const int k,
    const int kold,
    const scalar t,
    const scalar dt,
    const fsi::vector & qold,
    const fsi::vector & rhs,
    fsi::vector & f,
    fsi::vector & result
    )
{
    Eigen::Map<const fsi::vector> qoldFluid( qold.data(), dofFluid );
    Eigen::Map<const fsi::vector> qoldSolid( qold.data() + dofFluid, dofSolid );

    Eigen::Map<const fsi::vector> rhsFluid( rhs.data(), dofFluid );
    Eigen::Map<const fsi::vector> rhsSolid( rhs.data() + dofFluid, dofSolid );

    fluid->prepareImplicitSolve( corrector, k, kold, t, dt, qoldFluid, rhsFluid );
    solid->prepareImplicitSolve( corrector, k, kold, t, dt, qoldSolid, rhsSolid );

    // Perform FSI iterations to solve the coupled problem

    postProcessing->fsi->newMeasurementSeries();

    // Initial solution
    fsi::vector x0;

    if ( corrector )
        x0 = xStages.at( k + 1 );
    else
        x0 = xStages.at( k );

    postProcessing->initStage( k );
    postProcessing->performPostProcessing( x0, postProcessing->fsi->x );
    postProcessing->finalizeStage();

    getSolution( result, f );
    evaluateFunction( k, result, t, f );

    xStages.at( k + 1 ) = postProcessing->fsi->x;

    fluid->finalizeImplicitSolve( k );
    solid->finalizeImplicitSolve( k );
}
コード例 #3
0
void SDCFsiSolver::evaluateFunction(
    const int k,
    const fsi::vector & q,
    const scalar t,
    fsi::vector & f
    )
{
    fsi::vector fFluid( dofFluid ), fSolid( dofSolid );

    Eigen::Map<const fsi::vector> qFluid( q.data(), dofFluid );
    Eigen::Map<const fsi::vector> qSolid( q.data() + dofFluid, dofSolid );

    fluid->evaluateFunction( k, qFluid, t, fFluid );
    solid->evaluateFunction( k, qSolid, t, fSolid );

    f.head( dofFluid ) = fFluid;
    f.tail( dofSolid ) = fSolid;
}