/* Saves the element data to a stream */ void TPZMaterial::Write(TPZStream &buf, int withclassid) { if(ClassId() == TPZMATERIALID) { DebugStop(); } TPZSaveable::Write(buf,withclassid); buf.Write(&fId,1); buf.Write(&gBigNumber,1); fForcingFunction->Write(buf, 1); /* int forcingIdx = -1; if (fForcingFunction) { for (forcingIdx=0;forcingIdx<GFORCINGVEC.NElements();forcingIdx++) { if (GFORCINGVEC[ forcingIdx ] == fForcingFunction) break; } if ( forcingIdx == GFORCINGVEC.NElements() ) forcingIdx = -1; } #ifdef DEBUG2 { std::stringstream sout; sout << __PRETTY_FUNCTION__ << " writing forcing function index " << forcingIdx; LOGPZ_DEBUG( logger,sout.str().c_str() ); } #endif buf.Write( &forcingIdx,1 ); */ }
void TPZTransform::Write(TPZStream &buf){ buf.Write(&this->fRow, 1); buf.Write(&this->fCol, 1); this->fMult.Write(buf, false); this->fSum.Write(buf, false); buf.Write(&fStore[0], 12); }
void TPZArtDiff::Write(TPZStream &buf, int withclassid) const { int tmp = static_cast<int>(fArtDiffType); buf.Write(&tmp,1); buf.Write(&fGamma, 1); buf.Write(&fDelta, 1); buf.Write(&fCFL, 1); }
void TPZConservationLaw::Write(TPZStream &buf, int withclassid) { TPZMaterial::Write(buf, withclassid); buf.Write(&fDim,1); buf.Write(&fTimeStep,1); buf.Write(&fCFL,1); buf.Write(&fGamma,1); }
void TPZBndCond::Write(TPZStream &buf, int withclassid) { TPZMaterial::Write(buf, withclassid); buf.Write(&fType, 1); fBCVal1.Write(buf, 0); fBCVal2.Write(buf, 0); int MatId =fMaterial->Id(); buf.Write(&MatId, 1); }
void TPZGeoCloneMesh::Write(TPZStream &buf, int withclassid) const { TPZGeoMesh::Write(buf,withclassid); try { if(!fGeoReference) { std::cout << "Cloned geo mesh without geometric mesh from which this mesh is cloned." << std::endl; DebugStop(); } TPZPersistenceManager::WritePointer(fGeoReference, &buf); buf.Write(fMapNodes); // Maps elements with original elements std::map<int64_t,int64_t> MappingElements; TPZGeoEl *gel; int64_t indexorig, indexcloned; std::map<TPZGeoEl* , TPZGeoEl* >::const_iterator it; for(it=fMapElements.begin();it!=fMapElements.end();it++) { gel = it->first; indexorig = gel->Index(); gel = it->second; indexcloned = gel->Index(); MappingElements.insert(std::make_pair(indexorig,indexcloned)); } buf.Write(MappingElements); // Writing index of the elements in fReferenceElement TPZStack<int64_t> RefElements; int64_t sz = fReferenceElement.size(); for(int64_t ii=0;ii<sz;ii++) { RefElements.push_back(fReferenceElement[ii]->Index()); } buf.Write(RefElements); // Have to save a compact structure of the vector?? // Writing index of the elements in fPatchElement std::set<int> PatchElements; std::set<TPZGeoEl* >::iterator itpatch = fPatchElements.begin(); while(itpatch != fPatchElements.end()) { PatchElements.insert((*itpatch)->Index()); itpatch++; } buf.Write(PatchElements); int64_t rootindex = fGeoRoot->Index(); buf.Write(&rootindex,1); } catch(const exception& e) { cout << "Exception catched! " << e.what() << std::endl; cout.flush(); DebugStop(); } }//method
void TPZMaterialTest3D::Write(TPZStream &buf, int withclassid) { TPZMaterial::Write(buf,withclassid); fXf.Write( buf,0); buf.Write( &geq3,1 ); #ifdef DEBUG2 int classid = ClassId(); buf.Write( &classid,1 ); #endif }
void OOPMergeMatrix::Write(TPZStream & buf, int withclassid){ OOPTask::Write(buf, withclassid); int clsid = ClassId(); buf.Write(&clsid); buf.Write(&m_SubId, 1); cout << "m_SubId " << m_SubId << endl; cout.flush(); m_Vector.Write(buf, 0); m_Vector.Print("Na tarefa Merge", cout, EFormatted); cout.flush(); }
void OOPDataVersion::Write (TPZStream & buf, int) { int aux = fVersion.size (); buf.Write (&aux); vector < int >::iterator ivl; for (ivl = fVersion.begin (); ivl != fVersion.end (); ivl++) buf.Write (&*ivl); aux = fLevelCardinality.size (); buf.Write (&aux); for (ivl = fLevelCardinality.begin ();ivl != fLevelCardinality.end (); ivl++) buf.Write (&*ivl); }
void OOPDMOwnerTask::Write (TPZStream& buf, int withclassid) { { #ifdef LOG4CXX stringstream sout; sout << "Packing Owner task for Obj " << fTag.Id() << " message type " << fTag.AccessMode() << " with objptr " << (fTag.AutoPointer() != 0) << " version " << fTag.Version() << " To Proc " << fTag.Proc(); if(fTag.AutoPointer()) sout << " class id " << fTag.AutoPointer()->ClassId(); sout << "\nTransferReqTask size " << fTransferRequests.size() << endl; sout << "Access Requests : "; std::set<OOPAccessTag>::iterator it; for(it = fTransferRequests.begin(); it != fTransferRequests.end(); it++) { sout << endl; it->ShortPrint(sout); } LOGPZ_DEBUG(logger,sout.str().c_str()); #endif } OOPDaemonTask::Write (buf, withclassid); fTag.Write( buf, 0); int size = fTransferRequests.size(); buf.Write(&size,1); std::set<OOPAccessTag>::iterator it; for(it=fTransferRequests.begin(); it!=fTransferRequests.end(); it++) { OOPAccessTag tag(*it); tag.Write(buf,0); } }
/* Saves the element data to a stream */ void TPZNullMaterial::Write(TPZStream &buf, int withclassid) const { TPZMaterial::Write(buf,withclassid); if (fDim < 1 || fDim >3) { DebugStop(); } buf.Write(&fDim); }
void TMedonhoTask::Write(TPZStream & buf, int withclassid) { LOG4CXX_INFO(logger,"Entering pack"); OOPTask::Write(buf,withclassid); //pack start buf.Write (&fStart,1); //pack end buf.Write (&fEnd,1); /* //pack fX TPZSaveable::WriteObjects(buf,fX); //pack fY TPZSaveable::WriteObjects(buf,fY); //pack dot buf.Write(&fDotResult,1); //pack cross TPZSaveable::WriteObjects(buf,fCrossResult);*/ LOG4CXX_INFO(logger,"Exiting pack"); }
void OOPTask::Write (TPZStream & buf, int withclassid) { TPZSaveable::Write (buf, withclassid); // ObjectId packing and unpacking fTaskId.Write (buf); //Logging purpose only buf.Write (&fProc); // Processor where the task should be int updateversion = fUpdateVersions; buf.Write(&updateversion,1); // executed fDependRequest.Write(buf,0);//, withclassid); #ifdef LOG4CXX stringstream sout; sout << "Writing Task ClassId: " << ClassId() << " ObjID: " << Id() << " Depend list \n"; fDependRequest.ShortPrint( sout); LOGPZ_DEBUG(logger, sout.str ()); #endif }
void TPZDohrMatrix<TVar,TSubStruct >::Write( TPZStream &buf, int withclassid ) { SAVEABLE_STR_NOTE(buf,"TPZMatrix<TVar>::Write ()"); TPZMatrix<TVar>::Write(buf, withclassid); SAVEABLE_STR_NOTE(buf,"fAssembly->Write"); TPZPersistenceManager::WritePointer(fAssembly.operator ->(), &buf); SAVEABLE_STR_NOTE(buf,"fNumCoarse"); buf.Write(&fNumCoarse); SAVEABLE_STR_NOTE(buf,"fNumThreads"); buf.Write(&fNumThreads); typename SubsList::iterator it; int size = fGlobal.size(); SAVEABLE_STR_NOTE(buf,"fGlobal.size()"); buf.Write(&size); for (it=fGlobal.begin(); it != fGlobal.end(); it++) { SAVEABLE_STR_NOTE(buf,"fGlobal[...]"); (*it)->Write(buf,0); } size = 0; int classid = ClassId(); SAVEABLE_STR_NOTE(buf,"ClassId"); buf.Write(&classid ); }
void TPZYCCamClayPV::Write(TPZStream& buf, int withclassid) const { buf.Write(&fGamma); buf.Write(&fM); buf.Write(&fPt); buf.Write(&fLogHardening); buf.Write(&fLogBulkModulus); buf.Write(&fA0); buf.Write(&fE0); fER.Write(buf, withclassid); }
void TPZStepSolver<TVar>::Write(TPZStream &buf, int withclassid) { TPZSolver<TVar>::Write(buf, withclassid); fPrecond->Write(buf, 1); int lfSolver = fSolver; buf.Write(&lfSolver, 1); int lfDT = fDecompose; buf.Write(&lfDT, 1); buf.Write(&fNumIterations, 1); buf.Write(&fNumVectors, 1); buf.Write(&fTol, 1); buf.Write(&fOverRelax, 1); buf.Write(&fFromCurrent, 1); int size = fSingular.size(); buf.Write(&size, 1); std::list<int>::iterator it = fSingular.begin(); for(;it != fSingular.end(); it++) { buf.Write(&*it, 1); } }
/** * Packs the object in on the buffer so it can be transmitted through the network. * The Pack function packs the object's class_id while function Unpack() doesn't, * allowing the user to identify the next object to be unpacked. * @param buf A pointer to TSendStorage class to be packed. */ void TContribution::Write (TPZStream & buf, int withclassid){ fDestinationMesh.Write(buf); int i,sz; sz = fFrom.size(); buf.Write(&sz); for(i=0; i<sz; i++) buf.Write(&fFrom[i]); sz = fTo.size(); buf.Write(&sz); for(i=0; i<sz; i++) buf.Write(&fTo[i]); sz = fLocalIndices.size(); buf.Write(&sz); for(i=0; i<sz; i++) { int lsz = fLocalIndices[i].size(); int il; buf.Write(&lsz); for(il=0; il<lsz; il++) { buf.Write(&fLocalIndices[i][il]); } } buf.Write(&fNContributions); }
void TPZGraphMesh::Read(TPZStream& buf, void* context) { fCompMesh = dynamic_cast<TPZCompMesh *>(TPZPersistenceManager::GetInstance(&buf)); fGeoMesh = dynamic_cast<TPZGeoMesh *>(TPZPersistenceManager::GetInstance(&buf)); TPZManVector<int> mat_ids; buf.Read(mat_ids); for (auto matid: mat_ids) { fMaterialIds.insert(matid); } buf.Write(&fDimension); buf.Read(&fDimension); buf.ReadPointers(fElementList); fNodeMap.Read(buf, context); buf.Read(&fResolution); int fStyleInt; buf.Read(&fStyleInt); fStyle = TPZDrawStyle(fStyleInt); buf.Read(&fFileName); this->SetFileName(fFileName); ///Forcing to close the previously open file, if any. buf.Read(fScalarNames); buf.Read(fVecNames); buf.Read(fTensorNames); }
void TPZGraphMesh::Write(TPZStream& buf, int withclassid) const { TPZPersistenceManager::WritePointer(fCompMesh, &buf); TPZPersistenceManager::WritePointer(fGeoMesh, &buf); TPZManVector<int> mat_ids(fMaterialIds.size()); auto it = fMaterialIds.begin(); for (int i = 0; i < fMaterialIds.size(); i++, it++ ) { mat_ids[i] = *it; } buf.Write(mat_ids); buf.Write(&fDimension); buf.WritePointers(fElementList); fNodeMap.Write(buf, withclassid); buf.Write(&fResolution); int fStyleInt = as_integer(fStyle); buf.Write(&fStyleInt); buf.Write(&fFileName); buf.Write(fScalarNames); buf.Write(fVecNames); buf.Write(fTensorNames); }
/** @brief Saves the element data to a stream */ void TPZLagrangeMultiplier::Write(TPZStream &buf, int withclassid) const { TPZDiscontinuousGalerkin::Write(buf, withclassid); buf.Write(&fNStateVariables); }
void OOPDouble::Write(TPZStream & buf, int withclassid){ TPZSaveable::Write(buf, withclassid); buf.Write(&fValue); int clsid = ClassId(); buf.Write(&clsid); }