当前位置: 首页>>代码示例>>C++>>正文


C++ CommunicationBuffer::givePackSize方法代码示例

本文整理汇总了C++中CommunicationBuffer::givePackSize方法的典型用法代码示例。如果您正苦于以下问题:C++ CommunicationBuffer::givePackSize方法的具体用法?C++ CommunicationBuffer::givePackSize怎么用?C++ CommunicationBuffer::givePackSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CommunicationBuffer的用法示例。


在下文中一共展示了CommunicationBuffer::givePackSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: estimatePackSize

int
MisesMatNl :: estimatePackSize(CommunicationBuffer &buff, GaussPoint *ip)
{
    // Note: nlStatus localStrainVectorForAverage memeber must be properly sized!
    // IDNLMaterialStatus *nlStatus = (IDNLMaterialStatus*) this -> giveStatus (ip);
    return buff.givePackSize(MPI_DOUBLE, 1);
}
开发者ID:vivianyw,项目名称:oofem,代码行数:7,代码来源:misesmatnl.C

示例2: estimateMaxPackSize

int
NonLinearDynamic :: estimateMaxPackSize(IntArray &commMap, CommunicationBuffer &buff, int packUnpackType)
{
    int mapSize = commMap.giveSize();
    int i, j, ndofs, count = 0, pcount = 0;
    IntArray locationArray;
    Domain *domain = this->giveDomain(1);
    DofManager *dman;
    Dof *jdof;

    if ( packUnpackType == ProblemCommMode__ELEMENT_CUT ) {
        for ( i = 1; i <= mapSize; i++ ) {
            count += domain->giveDofManager( commMap.at(i) )->giveNumberOfDofs();
        }

        return ( buff.givePackSize(MPI_DOUBLE, 1) * count );
    } else if ( packUnpackType == ProblemCommMode__NODE_CUT ) {
        for ( i = 1; i <= mapSize; i++ ) {
            ndofs = ( dman = domain->giveDofManager( commMap.at(i) ) )->giveNumberOfDofs();
            for ( j = 1; j <= ndofs; j++ ) {
                jdof = dman->giveDof(j);
                if ( jdof->isPrimaryDof() && ( jdof->__giveEquationNumber() ) ) {
                    count++;
                } else {
                    pcount++;
                }
            }
        }

        //printf ("\nestimated count is %d\n",count);
        return ( buff.givePackSize(MPI_DOUBLE, 1) * max(count, pcount) );
    } else if ( packUnpackType == ProblemCommMode__REMOTE_ELEMENT_MODE ) {
        for ( i = 1; i <= mapSize; i++ ) {
            count += domain->giveElement( commMap.at(i) )->estimatePackSize(buff);
        }

        return count;
    }

    return 0;
}
开发者ID:Benjamin-git,项目名称:OOFEM_LargeDef,代码行数:41,代码来源:nlineardynamic.C

示例3: estimateMaxPackSize

int
FreeWarping :: estimateMaxPackSize(IntArray &commMap, CommunicationBuffer &buff, int packUnpackType)
{
    int count = 0, pcount = 0;
    IntArray locationArray;
    Domain *domain = this->giveDomain(1);

    if ( packUnpackType == ProblemCommMode__ELEMENT_CUT ) {
        for ( int map: commMap ) {
            count += domain->giveDofManager( map )->giveNumberOfDofs();
        }

        return ( buff.givePackSize(MPI_DOUBLE, 1) * count );
    } else if ( packUnpackType == ProblemCommMode__NODE_CUT ) {
        for ( int map: commMap ) {
            for ( Dof *jdof: *domain->giveDofManager( map ) ) {
                if ( jdof->isPrimaryDof() && ( jdof->__giveEquationNumber() ) ) {
                    count++;
                } else {
                    pcount++;
                }
            }
        }

        // --------------------------------------------------------------------------------
        // only pcount is relevant here, since only prescribed components are exchanged !!!!
        // --------------------------------------------------------------------------------

        return ( buff.givePackSize(MPI_DOUBLE, 1) * pcount );
    } else if ( packUnpackType == ProblemCommMode__REMOTE_ELEMENT_MODE ) {
        for ( int map: commMap ) {
            count += domain->giveElement( map )->estimatePackSize(buff);
        }

        return count;
    }

    return 0;
}
开发者ID:xyuan,项目名称:oofem,代码行数:39,代码来源:freewarping.C

示例4: estimateMaxPackSize

int
NonLinearDynamic :: estimateMaxPackSize(IntArray &commMap, CommunicationBuffer &buff, int packUnpackType)
{
    int count = 0, pcount = 0;
    IntArray locationArray;
    Domain *domain = this->giveDomain(1);

    if ( packUnpackType == ProblemCommMode__ELEMENT_CUT ) {
        for ( int map: commMap ) {
            count += domain->giveDofManager( map )->giveNumberOfDofs();
        }

        return ( buff.givePackSize(MPI_DOUBLE, 1) * count );
    } else if ( packUnpackType == ProblemCommMode__NODE_CUT ) {
        for ( int map: commMap ) {
            DofManager *dman = domain->giveDofManager( map );
            for ( Dof *dof: *dman ) {
                if ( dof->isPrimaryDof() && ( dof->__giveEquationNumber() ) ) {
                    count++;
                } else {
                    pcount++;
                }
            }
        }

        //printf ("\nestimated count is %d\n",count);
        return ( buff.givePackSize(MPI_DOUBLE, 1) * max(count, pcount) );
    } else if ( packUnpackType == ProblemCommMode__REMOTE_ELEMENT_MODE ) {
        for ( int map: commMap ) {
            count += domain->giveElement( map )->estimatePackSize(buff);
        }

        return count;
    }

    return 0;
}
开发者ID:vivianyw,项目名称:oofem,代码行数:37,代码来源:nlineardynamic.C

示例5: givePackSize

int
FloatArray :: givePackSize(CommunicationBuffer &buff) const
{
    return buff.givePackSize(MPI_INT, 1) + buff.givePackSize(MPI_DOUBLE, this->size);
}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:5,代码来源:flotarry.C


注:本文中的CommunicationBuffer::givePackSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。