當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。