當前位置: 首頁>>代碼示例>>C++>>正文


C++ TPZAutoPointer::Id方法代碼示例

本文整理匯總了C++中TPZAutoPointer::Id方法的典型用法代碼示例。如果您正苦於以下問題:C++ TPZAutoPointer::Id方法的具體用法?C++ TPZAutoPointer::Id怎麽用?C++ TPZAutoPointer::Id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TPZAutoPointer的用法示例。


在下文中一共展示了TPZAutoPointer::Id方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: ReadRefPatternDBase

//.........................................................................................................................................
void TPZRefPatternDataBase::ReadRefPatternDBase(std::ifstream &filename)
{
    fElTypeRefPatterns.clear();
    fIdRefPatterns.clear();
    
	int nRefpatterns;
	filename >> nRefpatterns;
	for(int i = 0; i < nRefpatterns; i++)
	{
		TPZAutoPointer<TPZRefPattern> refP = new TPZRefPattern;
		refP->ReadPattern(filename);
		
        MElementType eltype = refP->Element(0)->Type();
        fElTypeRefPatterns[eltype].push_back(refP);
        fIdRefPatterns[refP->Id()] = refP;
	}
}
開發者ID:labmec,項目名稱:neopz,代碼行數:18,代碼來源:TPZRefPatternDataBase.cpp

示例2: Clone

void TPZBndCond::Clone(std::map<int, TPZAutoPointer<TPZMaterial> > &matvec) {
    int matid = Id();

    TPZAutoPointer<TPZMaterial> refmaterial = Material();
    TPZAutoPointer<TPZMaterial> newrefmaterial;
    int refmatid = 0;
    if(refmaterial) {
        refmaterial->Clone(matvec);
        refmatid = refmaterial->Id();
        newrefmaterial = matvec[refmatid];
    }
    std::map<int, TPZAutoPointer<TPZMaterial> >::iterator matit;
    matit = matvec.find(matid);
    if(matit == matvec.end())
    {
        TPZAutoPointer<TPZMaterial> newmat = TPZAutoPointer<TPZMaterial>(new TPZBndCond(*this, newrefmaterial));
        matvec[matid] = newmat;
    }
}
開發者ID:JoaoFelipe,項目名稱:oceano,代碼行數:19,代碼來源:pzbndcond.cpp

示例3: AddPlacaOrtho

void TPZMulticamadaOrthotropic::AddPlacaOrtho(TPZAutoPointer<TPZMaterial> material, REAL height){
	
	TPZAutoPointer<TPZMaterial> bcptr;
	fCompMesh->InsertMaterialObject(material);
	TPZFNMatrix<9> val1(3,3,0.),val2(3,1,0.);
	TPZBCTension *bc = new TPZBCTension(material,-material->Id()*4,4,val1,val2, 1., this,fPlacaOrth.NElements());
	bcptr = TPZAutoPointer<TPZMaterial>(bc);
	fCompMesh->InsertMaterialObject(bcptr);
	bc = new TPZBCTension(material,-material->Id()*4-1,4,val1,val2, 1., this,fPlacaOrth.NElements());
	bcptr = TPZAutoPointer<TPZMaterial>(bc);
	fCompMesh->InsertMaterialObject(bcptr);
	bc = new TPZBCTension(material,-material->Id()*4-2,4,val1,val2, -1., this,fPlacaOrth.NElements());
	bcptr = TPZAutoPointer<TPZMaterial>(bc);
	fCompMesh->InsertMaterialObject(bcptr);
	bc = new TPZBCTension(material,-material->Id()*4-3,4,val1,val2, -1.,this,fPlacaOrth.NElements());
	bcptr = TPZAutoPointer<TPZMaterial>(bc);
	fCompMesh->InsertMaterialObject(bcptr);
	
	//  fPlacaOrth.Push(placa);
	int nnodes = fGeoMesh->NodeVec().NElements();
	fGeoMesh->NodeVec().Resize(nnodes+(fNelx+1)*(fNely+1));
	int ix, iy;
	TPZManVector<REAL,3> coord(3,fZMax+height);
	fZMax += height;
	for(ix=0; ix<= fNelx; ix++) {
		for(iy=0; iy<= fNely; iy++) {
			coord[0] = ix*fDx-fDx*REAL(fNelx/2.);
			coord[1] = iy*fDy-fDy*REAL(fNely/2.);
			fGeoMesh->NodeVec()[nnodes+ix+iy*(fNelx+1)].Initialize(coord,*fGeoMesh);
		}
	}
	int nodebase1 = nnodes - (fNelx+1)*(fNely+1);
	int elx, ely;
	TPZManVector<int,8> nodeindexes(8,-1);
	for(elx=0; elx<fNelx; elx++) {
		for(ely=0; ely<fNely; ely++) {
			nodeindexes[0] = nodebase1+elx+ely*(fNelx+1);
			nodeindexes[1] = nodebase1+elx+1+ely*(fNelx+1);
			nodeindexes[2] = nodebase1+elx+1+(ely+1)*(fNelx+1);
			nodeindexes[3] = nodebase1+elx+(ely+1)*(fNelx+1);
			int i;
			for(i=0; i<4; i++) nodeindexes[i+4] = nodeindexes[i]+(fNelx+1)*(fNely+1);
			int index;
			TPZGeoEl *gel = fGeoMesh->CreateGeoElement (ECube, nodeindexes, material->Id(), index);
			if(ely == 0) TPZGeoElBC gbc1(gel,21,-material->Id()*4);
			if(elx == fNelx-1) TPZGeoElBC gbc2(gel,22,-material->Id()*4-1);
			if(ely == fNely-1) TPZGeoElBC gbc3(gel,23,-material->Id()*4-2);
			if(elx == 0) TPZGeoElBC gbc4(gel,24,-material->Id()*4-3);
			int nplaca = fPlacaOrth.NElements();
			if(nplaca == 0 && elx == 0 && ely == 0) {
				TPZBndCond *bc2 = new TPZBndCond(material,-100,0,val1,val2);
				bcptr = TPZAutoPointer<TPZMaterial>(bc2);
				fCompMesh->InsertMaterialObject(bcptr);
				TPZGeoElBC gbc5(gel,0,-100);
				val1(0,0) = 1.e12;
				val1(2,2) = 1.e12;
				TPZBndCond *bc3 = new TPZBndCond(material,-101,2,val1,val2);
				bcptr = TPZAutoPointer<TPZMaterial>(bc3);
				fCompMesh->InsertMaterialObject(bcptr);
				TPZGeoElBC gbc6(gel,3,-101);
				val1.Zero();
				val1(0,0) = 0.;
				val1(2,2) = 1.e12;
				TPZBndCond *bc4 = new TPZBndCond(material,-102,2,val1,val2);
				bcptr = TPZAutoPointer<TPZMaterial>(bc4);
				
				fCompMesh->InsertMaterialObject(bcptr);
				TPZGeoElBC gbc7(gel,2,-102);
			}
			if(elx == fNelx/2 && ely == fNely/2) {
				TPZPlacaOrthotropic placa(gel,fZMax-height,fZMax);
				fPlacaOrth.Push(placa);
			}
		}
	}
}
開發者ID:JoaoFelipe,項目名稱:oceano,代碼行數:76,代碼來源:TPZMulticamadaOrtho.cpp


注:本文中的TPZAutoPointer::Id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。