Exemple #1
0
TPZGraphMesh::TPZGraphMesh(TPZCompMesh *cm, int dimension, TPZAutoPointer<TPZMaterial> mat)
{
	int nel,i;
	fElementList.Resize(0);
	fElementList.CompactDataStructure(1);
	fNodeMap.Resize(0);
	fNodeMap.CompactDataStructure(1);
	fMaterial = mat;
	fCompMesh = cm;
	fDimension = dimension;
	//   TPZGeoMesh *geomesh = fCompMesh->Reference();
	//   TPZAdmChunkVector<TPZGeoEl *> &gelvec = geomesh->ElementVec();
	//   TPZGeoEl *ge;
	//   nel = gelvec.NElements();
	//   for(i=0;i<nel;i++) {
	//     ge = gelvec[i];
	//     if(!ge || !ge->Reference() || ge->Reference()->Type() == EInterface ) continue;
	//       ge->Reference()->CreateGraphicalElement(*this, dimension);
	//   }
	
	TPZAdmChunkVector<TPZCompEl *> &celvec = fCompMesh->ElementVec();
	TPZCompEl *ce;
	nel = celvec.NElements();
	for(i=0;i<nel;i++) {
		ce = (TPZCompEl *) celvec[i];
		if(!ce) continue;
		//    if (ce->Dimension() != dimension) continue;
		ce->CreateGraphicalElement(*this, dimension);
	}
	
	fScalarNames = "";
	fVecNames = "";
}
Exemple #2
0
TPZGraphMesh::TPZGraphMesh(TPZCompMesh *cm, int dimension, const std::set<int> & matids, const TPZVec<std::string> &scalarnames, const TPZVec<std::string> &vecnames, const TPZVec<std::string> &tensornames) :
fCompMesh(cm), fDimension(dimension), fMaterialIds(matids), fScalarNames(scalarnames), fVecNames(vecnames), fTensorNames(tensornames)
{
    int64_t nel,i;
    fElementList.Resize(0);
    fElementList.CompactDataStructure(fElementList.NOW);
    fNodeMap.Resize(0);
    fNodeMap.CompactDataStructure(fNodeMap.NOW);
    
    TPZAdmChunkVector<TPZCompEl *> &celvec = fCompMesh->ElementVec();
    TPZCompEl *ce;
    nel = celvec.NElements();
    for(i=0;i<nel;i++) {
        ce = (TPZCompEl *) celvec[i];
        if(!ce) continue;
        ce->CreateGraphicalElement(*this, dimension);
    }
    
}
Exemple #3
0
void TPZGraphMesh::SetCompMesh(TPZCompMesh *mesh, const std::set<int> & matids){
	if(fCompMesh == mesh && matids == fMaterialIds) return;
	int64_t i;
	fCompMesh = mesh;
	fMaterialIds = matids;
	int64_t nel = fElementList.NElements();
	TPZGraphEl *el;
	for(i=0;i<nel;i++) {
		el = fElementList[i]; 
		if(!el) continue;
		if(el) delete el;
	}
	fElementList.Resize(0);
	fNodeMap.Resize(0);
	TPZAdmChunkVector<TPZCompEl *> &celvec = fCompMesh->ElementVec();
	TPZCompEl *ce;
	nel = celvec.NElements();
	for(i=0;i<nel;i++) {
		ce = (TPZCompEl *) celvec[i];
		if(ce)  ce->CreateGraphicalElement(*this, fDimension);
	}	
}