当前位置: 首页>>代码示例>>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;未经允许,请勿转载。