int FloatArray :: packToCommBuffer(CommunicationBuffer &buff) const { int result = 1; // pack size result &= buff.packInt(size); // pack data result &= buff.packArray(this->values, size); return result; }
int FloatArray :: unpackFromCommBuffer(CommunicationBuffer &buff) { int newSize, result = 1; // unpack size result &= buff.unpackInt(newSize); // resize yourself this->resize(newSize); result &= buff.unpackArray(this->values, newSize); return result; }
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); }
int MisesMatNl :: packUnknowns(CommunicationBuffer &buff, TimeStep *tStep, GaussPoint *ip) { MisesMatNlStatus *nlStatus = static_cast< MisesMatNlStatus * >( this->giveStatus(ip) ); this->buildNonlocalPointTable(ip); this->updateDomainBeforeNonlocAverage(tStep); return buff.packDouble( nlStatus->giveLocalCumPlasticStrainForAverage() ); }
int RankineMatNl :: packUnknowns(CommunicationBuffer &buff, TimeStep *stepN, GaussPoint *ip) { RankineMatNlStatus *nlStatus = ( RankineMatNlStatus * ) this->giveStatus(ip); this->buildNonlocalPointTable(ip); this->updateDomainBeforeNonlocAverage(stepN); return buff.packDouble( nlStatus->giveLocalCumPlasticStrainForAverage() ); }
int MazarsNLMaterial :: packUnknowns(CommunicationBuffer &buff, TimeStep *stepN, GaussPoint *ip) { MazarsNLMaterialStatus *status = ( MazarsNLMaterialStatus * ) this->giveStatus(ip); this->buildNonlocalPointTable(ip); this->updateDomainBeforeNonlocAverage(stepN); return buff.packDouble( status->giveLocalEquivalentStrainForAverage() ); }
int MisesMatNl :: unpackAndUpdateUnknowns(CommunicationBuffer &buff, TimeStep *tStep, GaussPoint *ip) { int result; MisesMatNlStatus *nlStatus = static_cast< MisesMatNlStatus * >( this->giveStatus(ip) ); double localCumPlasticStrainForAverage; result = buff.unpackDouble(localCumPlasticStrainForAverage); nlStatus->setLocalCumPlasticStrainForAverage(localCumPlasticStrainForAverage); return result; }
int RankineMatNl :: unpackAndUpdateUnknowns(CommunicationBuffer &buff, TimeStep *stepN, GaussPoint *ip) { int result; RankineMatNlStatus *nlStatus = ( RankineMatNlStatus * ) this->giveStatus(ip); double localCumPlasticStrainForAverage; result = buff.unpackDouble(localCumPlasticStrainForAverage); nlStatus->setLocalCumPlasticStrainForAverage(localCumPlasticStrainForAverage); return result; }
int MazarsNLMaterial :: unpackAndUpdateUnknowns(CommunicationBuffer &buff, TimeStep *stepN, GaussPoint *ip) { int result; MazarsNLMaterialStatus *status = ( MazarsNLMaterialStatus * ) this->giveStatus(ip); double localEquivalentStrainForAverage; result = buff.unpackDouble(localEquivalentStrainForAverage); status->setLocalEquivalentStrainForAverage(localEquivalentStrainForAverage); return result; }
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; }
int TrabBoneNL3D :: estimatePackSize(CommunicationBuffer &buff, GaussPoint *ip) { abort(); return 0; #if 0 // Note: nlStatus localStrainVectorForAverage memeber must be properly sized! // IDNLMaterialStatus *nlStatus = (IDNLMaterialStatus*) this -> giveStatus (ip); return buff.givePackSize(MPI_DOUBLE, 1); #endif }
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; }
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; }
int TrabBoneNL3D :: packUnknowns(CommunicationBuffer &buff, TimeStep *tStep, GaussPoint *ip) { abort(); return 0; #if 0 IDNLMaterialStatus *nlStatus = static_cast< IDNLMaterialStatus * >( this->giveStatus(ip) ); this->buildNonlocalPointTable(ip); this->updateDomainBeforeNonlocAverage(tStep); return buff.packDouble( nlStatus->giveLocalEquivalentStrainForAverage() ); #endif }
int TrabBoneNL3D :: unpackAndUpdateUnknowns(CommunicationBuffer &buff, TimeStep *tStep, GaussPoint *ip) { abort(); return 0; #if 0 int result; IDNLMaterialStatus *nlStatus = static_cast< IDNLMaterialStatus * >( this->giveStatus(ip) ); double localEquivalentStrainForAverage; result = buff.unpackDouble(localEquivalentStrainForAverage); nlStatus->setLocalEquivalentStrainForAverage(localEquivalentStrainForAverage); return result; #endif }
int FloatArray :: givePackSize(CommunicationBuffer &buff) const { return buff.givePackSize(MPI_INT, 1) + buff.givePackSize(MPI_DOUBLE, this->size); }