示例#1
0
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);
	}
}
示例#2
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);
}
示例#3
0
void TPZBndCond::Read(TPZStream &buf, void *context)
{
    TPZMaterial::Read(buf, context);
    buf.Read(&fType, 1);
    fBCVal1.Read(buf, 0);
    fBCVal2.Read(buf, 0);
    int MatId;
    buf.Read(&MatId,1);
    TPZCompMesh * pCM = (TPZCompMesh * )/*dynamic_cast<TPZCompMesh *>*/(context);
    fMaterial = pCM->FindMaterial(MatId);
    if(!fMaterial)
    {
        std::cout << " reading a boundary condition without material object!!\n";
#ifdef LOG4CXX
        LOGPZ_FATAL(logger,"reading a boundary condition without material object!!");
#endif
    }
}
示例#4
0
void TPZMaterialTest3D::Read(TPZStream &buf, void *context)
{
    TPZMaterial::Read(buf,context);
    fXf.Read( buf,0 );
    buf.Read( &geq3, 1);
#ifdef DEBUG2
    int classid = -1;
    buf.Read( &classid,1 );
    if( classid != ClassId() )
    {
        std::stringstream sout;
        sout << "Error restoring object " << __PRETTY_FUNCTION__
             << " waiting for ClassId()= " << ClassId()
             << " restored : " << classid;
        LOGPZ_ERROR( logger,sout.str().c_str() );
    }
#endif
}
示例#5
0
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");
}
示例#6
0
/* Reads the element data from a stream */
void TPZNullMaterial::Read(TPZStream &buf, void *context)
{
	TPZMaterial::Read(buf,context);
    buf.Read(&fDim);
#ifdef PZDEBUG
    if (fDim < 1 || fDim >3) {
        DebugStop();
    }
#endif
}
示例#7
0
void OOPDataVersion::Read (TPZStream & buf, void * context)
{
	int aux = 0, size = 0;
	buf.Read (&size);
	fVersion.resize (0);
	int i;
	for (i = 0; i < size; i++) {
		buf.Read (&aux);
		fVersion.push_back (aux);
	}
	buf.Read (&size);
	fLevelCardinality.resize (0);
	for (i = 0; i < size; i++) {
		buf.Read (&aux);
		fLevelCardinality.push_back (aux);
	}
	// vector<int>::iterator ivc = aux_vc.begin();
	/* buf->UpkInt(&aux_vc[0],aux); i->fVersion.SetData(aux_vc,aux_vl); */
}
示例#8
0
void TMedonhoTask::Read(TPZStream & buf, void * context)
{
	LOG4CXX_INFO(logger,"Entering unpack");
	OOPTask::Read(buf,context);
	
	//unpack start
	buf.Read (&fStart,1);
	//pack end
	buf.Read (&fEnd,1);
	//   //unpack fX  
	//   TPZSaveable::ReadObjects(buf,fX);
	//   //unpack fY
	//   TPZSaveable::ReadObjects(buf,fY);
	//   //unpack dot
	//   buf.Read(&fDotResult,1);
	//   //unpack cross
	//   TPZSaveable::ReadObjects(buf,fCrossResult);
	
	LOG4CXX_INFO(logger,"Exiting unpack");
}
示例#9
0
文件: ooptask.cpp 项目: labmec/oopar
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
	
}
示例#10
0
文件: ooptask.cpp 项目: labmec/oopar
void
OOPTask::Read (TPZStream & buf, void *context)
{
	TPZSaveable::Read (buf, context);
	fTaskId.Read (buf);
	// Finished OOPObjectId unpacking
	//Logging purpose only
	buf.Read (&fProc);
    int updateversion;
    buf.Read(&updateversion);
    fUpdateVersions = (updateversion != 0);
	fDependRequest.Read (buf, context);
#ifdef LOG4CXX
	stringstream sout;
	sout << "Read Task ClassId: " << ClassId() << " ObjID:" << Id();
	fDependRequest.ShortPrint( sout);
	LOGPZ_DEBUG(logger, sout.str().c_str());
#endif
	
}
示例#11
0
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);
}
示例#12
0
/*
 Reads the element data from a stream
 */
void TPZMaterial::Read(TPZStream &buf, void *context)
{
	TPZSaveable::Read(buf,context);
	buf.Read(&fId,1);
	buf.Read(&gBigNumber,1);
    TPZSaveable *sav = TPZSaveable::Restore(buf, context);
    {
        TPZFunction *func = dynamic_cast<TPZFunction *>(sav);
        if(!func) 
        {
            DebugStop();
        }
        fForcingFunction = func;
    }
    /*
	int forcingIdx = -1;
	buf.Read( &forcingIdx,1 );
#ifdef DEBUG2
	{
		std::stringstream sout;
		sout << " Read forcing function index " << forcingIdx;
		LOGPZ_DEBUG( logger,sout.str().c_str() );
	}
#endif
	
	if ( forcingIdx > -1 && forcingIdx < GFORCINGVEC.NElements() )
	{
		fForcingFunction = GFORCINGVEC[ forcingIdx ] ;
#ifdef DEBUG2
		{
			std::stringstream sout;
			sout << " Seting forcing function index " << forcingIdx;
			LOGPZ_DEBUG( logger,sout.str().c_str() );
		}
#endif
	}
    */
}
示例#13
0
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 );
}
示例#14
0
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);
	}
}
示例#15
0
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);
}
示例#16
0
void TPZYCCamClayPV::Read(TPZStream& buf, void* context) {
    buf.Read(&fGamma);
    buf.Read(&fM);
    buf.Read(&fPt);
    buf.Read(&fLogHardening);
    buf.Read(&fLogBulkModulus);
    buf.Read(&fA0);
    buf.Read(&fE0);
    fER.Read(buf, context);
}
示例#17
0
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);
}
示例#18
0
/**
 * Unpacks the object class_id
 * @param buf A pointer to TSendStorage class to be unpacked.
 */
void TContribution::Read (TPZStream & buf, void * context){
	fDestinationMesh.Read(buf);
	int i,sz;
	buf.Read(&sz);
	fFrom.resize(sz);
	for(i=0; i<sz; i++) buf.Read(&fFrom[i]);
	buf.Read(&sz);
	fTo.resize(sz);
	for(i=0; i<sz; i++) buf.Read(&fTo[i]);
	buf.Read(&sz);
	fLocalIndices.resize(sz);
	for(i=0; i<sz; i++) {
		int lsz,il;
		buf.Read(&lsz);
		fLocalIndices[i].resize(lsz);
		for(il=0; il<lsz; il++) {
			buf.Read(&fLocalIndices[i][il]);
		}
	}
	buf.Read(&fNContributions);
}
示例#19
0
/**
 * 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);
}
示例#20
0
void OOPDMOwnerTask::Read (TPZStream & buf, void * context)
{
	OOPDaemonTask::Read (buf, context);
	fTag.Read( buf, context);
	int size;
	buf.Read(&size,1);
#ifdef LOG4CXX
	{
		stringstream sout;
		sout << "Tag Received ";
		fTag.ShortPrint( sout);
		sout << "TransferReqTask size " << size << "\n";
		LOGPZ_DEBUG(DaemonLogger, sout.str().c_str());
	}
#endif
	int i;
	for(i=0; i<size; i++)
	{
		OOPAccessTag tag;
		tag.Read(buf,0);
		fTransferRequests.insert(tag);
	}
#ifdef LOG4CXX
	{
		stringstream sout;
		sout << "<--Receiveing OwnerTask with Tag:";
		fTag.ShortPrint( sout);
		sout << "\nAccess Requests : ";
		std::set<OOPAccessTag>::iterator it;
		for(it = fTransferRequests.begin(); it != fTransferRequests.end(); it++)
		{
			sout << endl;
			it->ShortPrint(sout);
		}
		LOGPZ_DEBUG(DaemonLogger, sout.str().c_str());
	}
#endif
}
示例#21
0
/** @brief Saves the element data to a stream */
void TPZLagrangeMultiplier::Write(TPZStream &buf, int withclassid) const
{
    TPZDiscontinuousGalerkin::Write(buf, withclassid);
    buf.Write(&fNStateVariables);
}
示例#22
0
void OOPDouble::Write(TPZStream & buf, int withclassid){
	TPZSaveable::Write(buf, withclassid);
	buf.Write(&fValue);
	int clsid = ClassId();
	buf.Write(&clsid);
}
示例#23
0
/** @brief Reads the element data from a stream */
void TPZLagrangeMultiplier::Read(TPZStream &buf, void *context)
{
    TPZDiscontinuousGalerkin::Read(buf, context);
    buf.Read(&fNStateVariables);
    
}