当前位置: 首页>>代码示例>>C++>>正文


C++ TPZAutoPointer::Dimension方法代码示例

本文整理汇总了C++中TPZAutoPointer::Dimension方法的典型用法代码示例。如果您正苦于以下问题:C++ TPZAutoPointer::Dimension方法的具体用法?C++ TPZAutoPointer::Dimension怎么用?C++ TPZAutoPointer::Dimension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TPZAutoPointer的用法示例。


在下文中一共展示了TPZAutoPointer::Dimension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetElIndexCoarseMesh

void GetElIndexCoarseMesh(TPZAutoPointer<TPZGeoMesh>  gmesh, std::set<int64_t> &coarseindex)
{
    int nel = gmesh->NElements();
    int iel;
    int hassubel=0;
    int dim = gmesh->Dimension();
    int eldim;
    for(iel = 0; iel<nel; iel++)
    {
        TPZGeoEl * gel = gmesh->ElementVec()[iel];
        if(!gel) DebugStop();
        
        hassubel = gel->HasSubElement();
        eldim = gel->Dimension();
        if(!hassubel && eldim ==dim)
        {
            coarseindex.insert(gel->Index());
        }
    }
    
}
开发者ID:labmec,项目名称:neopz,代码行数:21,代码来源:main.cpp

示例2: DrawSolution

void TPZDXGraphMesh::DrawSolution(int step, REAL time){//0,
	//								  TPZVec<char *> &scalarnames, TPZVec<char *> &vectornames) {
	
	TPZAutoPointer<TPZMaterial> matp = Material();
	int i,nel;
	if(!matp) return;
	int dim = matp->Dimension();
	int dim1 = dim-1;
	
	int numscal = fScalarNames.NElements();
	int numvec = fVecNames.NElements();
	TPZVec<int> scalind(0);
	TPZVec<int> vecind(0);
	scalind.Resize(numscal);
	vecind.Resize(numvec);
	scalind.Fill(-1);
	vecind.Fill(-1);
	int n;
	for(n=0; n<numscal; n++) {
		scalind[n] = matp->VariableIndex( fScalarNames[n]);
	}
	for(n=0; n<numvec; n++) {
		vecind[n] = matp->VariableIndex( fVecNames[n]);
	}
	fFirstFieldValues[dim1].Push(fNextDataField+1);
	fTimes.Push(time);
	cout << "TPZDXGraphMesh.DrawSolution step = " << step << " time = " << time << endl;
	long numpoints = NPoints();
	TPZVec<int> scal(1);
	for(n=0; n<numscal; n++) {
		(fOutFile) << "object " << fNextDataField << " class array type float rank 0 items "
		<< numpoints << " data follows " << endl;
		scal[0] = scalind[n];
		nel = fNodeMap.NElements();
		for(i=0;i<nel;i++) {
			TPZGraphNode *np = &fNodeMap[i];
			if(np) np->DrawSolution(scal, fStyle);
		}
		(fOutFile) << "attribute \"dep\" string \"positions\"" << endl;
		(fOutFile) << "#" << endl;
		fNextDataField ++;
		
		
		//+++++ Cubes    
		if(dim == 3 && (NNodes() == 8 || NNodes() == 6)) {
			(fOutFile) << "object " << (fNextDataField) << " class field" << endl;
			(fOutFile) << "component \"data\" value " << (fNextDataField-1) << endl;
			(fOutFile) << "component \"positions\" value " << fNodePosObject[dim1] << endl;
			(fOutFile) << "component \"connections\" value " << fElConnectivityObject[ECube] << endl;
			(fOutFile) << "attribute \"name\" string \"" << (std::string) fScalarNames[n]
			<< step << (0) << "\"" << endl;
			(fOutFile) << "#" << endl;
			fNextDataField ++;
		}
		
		if(dim == 2 && (NNodes() == 4 || NNodes() == 3)) {
			(fOutFile) << "object " << (fNextDataField) << " class field" << endl;
			(fOutFile) << "component \"data\" value " << (fNextDataField-1) << endl;
			(fOutFile) << "component \"positions\" value " << fNodePosObject[dim1] << endl;
			(fOutFile) << "component \"connections\" value " << fElConnectivityObject[EQuadrilateral] << endl;
			(fOutFile) << "attribute \"name\" string \"" << (std::string) fScalarNames[n]; (fOutFile).flush();
			(fOutFile) << step; (fOutFile).flush();
			(fOutFile) << (0); (fOutFile).flush();
			(fOutFile) << "\""; (fOutFile).flush();
			(fOutFile) << endl; (fOutFile).flush();
			(fOutFile) << "#" << endl; (fOutFile).flush();
			fNextDataField ++;
		}
		if(dim == 1) {
			(fOutFile) << "object " << (fNextDataField) << " class field" << endl;
			(fOutFile) << "component \"data\" value " << (fNextDataField-1) << endl;
			(fOutFile) << "component \"positions\" value " << fNodePosObject[dim1] << endl;
			(fOutFile) << "component \"connections\" value " << fElConnectivityObject[EOned] << endl;
			if(fNormalObject > 0) (fOutFile) << "component \"normals\" value " << fNormalObject << endl;
			(fOutFile) << "attribute \"name\" string \"" << (std::string) fScalarNames[n]
			<< step << (0) << "\"" << endl;
			(fOutFile) << "#" << endl;
			fNextDataField ++;
		}
	}
	TPZVec<int> vec(1);
	for(n=0; n<numvec; n++) {
		(fOutFile) << "object " << fNextDataField << " class array type float rank 1 shape " <<
		matp->NSolutionVariables(vecind[n]) << " items "
		<< numpoints << " data follows " << endl;
		vec[0] = vecind[n];
		nel = fNodeMap.NElements();
		for(i=0;i<nel;i++) {
			TPZGraphNode *np = &fNodeMap[i];
			if(np) np->DrawSolution(vec, fStyle);
		}
		(fOutFile) << "attribute \"dep\" string \"positions\"" << endl;
		(fOutFile) << "#" << endl;
		fNextDataField ++;
		//+++++ Cubes        
		if(dim == 3 && fElConnectivityObject[ECube]) {
			(fOutFile) << "object " << (fNextDataField) << " class field" << endl;
			(fOutFile) << "component \"data\" value " << (fNextDataField-1) << endl;
			(fOutFile) << "component \"positions\" value " << fNodePosObject[dim1] << endl;
			(fOutFile) << "component \"connections\" value " << fElConnectivityObject[ECube] << endl;
//.........这里部分代码省略.........
开发者ID:JoaoFelipe,项目名称:oceano,代码行数:101,代码来源:pzdxmesh.cpp


注:本文中的TPZAutoPointer::Dimension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。