本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例5: givePackSize
int
FloatArray :: givePackSize(CommunicationBuffer &buff) const
{
return buff.givePackSize(MPI_INT, 1) + buff.givePackSize(MPI_DOUBLE, this->size);
}