本文整理汇总了C++中TPZStream类的典型用法代码示例。如果您正苦于以下问题:C++ TPZStream类的具体用法?C++ TPZStream怎么用?C++ TPZStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TPZStream类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Write
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);
}
}
开发者ID:labmec,项目名称:oopar,代码行数:31,代码来源:oopdatamanager.cpp
示例2: Write
/* 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);
}
开发者ID:labmec,项目名称:neopz,代码行数:9,代码来源:TPZNullMaterial.cpp
示例3: Read
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
}
}
开发者ID:JoaoFelipe,项目名称:oceano,代码行数:18,代码来源:pzbndcond.cpp
示例4: ClassId
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
}
开发者ID:JoaoFelipe,项目名称:oceano,代码行数:18,代码来源:pzmattest3d.cpp
示例5: Write
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");
}
开发者ID:labmec,项目名称:oopar,代码行数:19,代码来源:tmedonhotask.cpp
示例6: Read
/* 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
}
开发者ID:labmec,项目名称:neopz,代码行数:11,代码来源:TPZNullMaterial.cpp
示例7: Read
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); */
}
开发者ID:labmec,项目名称:oopar,代码行数:19,代码来源:oopdataversion.cpp
示例8: Read
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");
}
开发者ID:labmec,项目名称:oopar,代码行数:20,代码来源:tmedonhotask.cpp
示例9: ClassId
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
}
开发者ID:labmec,项目名称:oopar,代码行数:20,代码来源:ooptask.cpp
示例10: Read
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);
}
开发者ID:labmec,项目名称:neopz,代码行数:22,代码来源:pzgraphmesh.cpp
示例11: Read
/*
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
}
*/
}
开发者ID:JoaoFelipe,项目名称:oceano,代码行数:41,代码来源:pzmaterial.cpp
示例12: ClassId
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 );
}
开发者ID:labmec,项目名称:neopz,代码行数:23,代码来源:tpzdohrmatrix.cpp
示例13:
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);
}
}
开发者ID:JoaoFelipe,项目名称:oceano,代码行数:21,代码来源:pzstepsolver.cpp
示例14: Write
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);
}
开发者ID:labmec,项目名称:neopz,代码行数:10,代码来源:TPZYCCamClayPV.cpp
示例15: Read
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);
}
开发者ID:labmec,项目名称:neopz,代码行数:10,代码来源:TPZYCCamClayPV.cpp
示例16: Write
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);
}
开发者ID:labmec,项目名称:neopz,代码行数:20,代码来源:pzgraphmesh.cpp
示例17: Read
/**
* 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);
}
开发者ID:labmec,项目名称:oopar,代码行数:25,代码来源:TContribution.cpp
示例18: Write
/**
* 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);
}
开发者ID:labmec,项目名称:oopar,代码行数:27,代码来源:TContribution.cpp
示例19: Read
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
}
开发者ID:labmec,项目名称:oopar,代码行数:38,代码来源:oopdatamanager.cpp
示例20: Write
/** @brief Saves the element data to a stream */
void TPZLagrangeMultiplier::Write(TPZStream &buf, int withclassid) const
{
TPZDiscontinuousGalerkin::Write(buf, withclassid);
buf.Write(&fNStateVariables);
}
开发者ID:labmec,项目名称:neopz,代码行数:6,代码来源:TPZLagrangeMultiplier.cpp
注:本文中的TPZStream类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论