本文整理汇总了C++中TPZStack::Pop方法的典型用法代码示例。如果您正苦于以下问题:C++ TPZStack::Pop方法的具体用法?C++ TPZStack::Pop怎么用?C++ TPZStack::Pop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPZStack
的用法示例。
在下文中一共展示了TPZStack::Pop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExpandConnected
void TPZAnalysisError::ExpandConnected(TPZStack<TPZCompElSide> &singel){
int64_t nelem = singel.NElements();
TPZStack<TPZGeoElSide> gelstack;
TPZStack<TPZCompElSide> celstack;
int64_t iel;
for(iel=0; iel<nelem; iel++) {
TPZCompElSide celside = singel[iel];
TPZGeoElSide gelside;
gelside = celside.Reference();
if(!gelside.Exists()) continue;
gelstack.Resize(0);
cout << "This part needs to be fixed\n";
// gelside.Element()->LowerDimensionSides(gelside.Side(),gelstack);
while(gelstack.NElements()) {
TPZGeoElSide gelsideloc;
gelsideloc = gelstack.Pop();
gelsideloc.EqualLevelCompElementList(celstack,1,0);
while(celstack.NElements()) {
TPZCompElSide celsideloc = celstack.Pop();
if(! celsideloc.Exists()) continue;
int64_t nelsing = singel.NElements();
int64_t smel;
for(smel=0; smel<nelsing; smel++) if(singel[smel].Element() == celsideloc.Element()) break;
if(smel != nelsing) singel.Push(celsideloc);
}
}
}
}
示例2: ZoomInSingularity
//SingularElements(..)
void TPZAnalysisError::ZoomInSingularity(REAL csi, TPZCompElSide elside, REAL singularity_strength) {
REAL hn = 1./pow(csi,1./singularity_strength);
REAL Q=2.;
REAL NcReal = log( 1.+(1./hn - 1.)*(Q - 1.) )/log(Q);
int Nc = 0;
while(REAL(Nc) < (NcReal+0.5)) Nc++;
int minporder = 2;
TPZStack<TPZCompElSide> ElToRefine;
TPZStack<int> POrder;
TPZStack<TPZGeoElSide> subelements;
TPZStack<int64_t> csubindex;
ElToRefine.Push(elside);
POrder.Push(Nc);
while(ElToRefine.NElements()) {
/** Take the next element and its interpolation order from the stack*/
TPZCompElSide curelside = ElToRefine.Pop();
int curporder = POrder.Pop();
if(!curelside.Exists()) continue;
int64_t cindex = curelside.Element()->Index();
if(cindex < 0) continue;
/** Cast the element to an interpolated element if possible*/
TPZCompEl *cel = curelside.Element();
TPZInterpolatedElement *cintel = 0;
cintel = dynamic_cast<TPZInterpolatedElement *> (cel);
/** If the element is not interpolated, nothing to do */
if(!cintel) continue;
/** Set the interpolation order of the current element to curporder*/
if(curporder == minporder) {
cintel->PRefine(Nc);
fSingular.Push(curelside);
} else {
cintel->PRefine(curporder);
cintel->Divide(cindex,csubindex,1);
/** Identify the subelements along the side and push them on the stack*/
}
TPZGeoElSide gelside = curelside.Reference();
if(!gelside.Exists()) continue;
gelside.GetSubElements2(subelements);
int64_t ns = subelements.NElements();
curporder--;
int64_t is;
for(is=0; is<ns; is++) {
TPZGeoElSide sub = subelements[is];
TPZCompElSide csub = sub.Reference();
if(csub.Exists()) {
ElToRefine.Push(csub);
POrder.Push(curporder);
}
}
}
ExpandConnected(fSingular);
/*
REAL H1_error,L2_error,estimate;
TPZBlock *flux=0;
int64_t nel = fElIndexes.NElements();
for(int64_t elloc=0;elloc<nel;elloc++) {
int64_t el = fElIndexes[elloc];
estimate = fElErrors[elloc];
REAL csi = estimate / fAdmissibleError;
REAL h = h_Parameter(intellist[el]);
REAL hn = h/pow(csi,1./.9);
REAL Nc = log( 1.+(h/hn - 1.)*(Q - 1.) )/log(Q);
if(hn > 1.3*h) hn = 2.0*h*hn / (h + hn);
REAL hsub = h;//100.0;//pode ser = h ; Cedric
TPZCompEl *locel = intellist[el];
//obter um subelemento que contem o ponto singular e tem tamanho <= hn
TPZAdmChunkVector<TPZCompEl *> sublist;
while(hsub > hn) {
TPZVec<int64_t> indexsubs;
int64_t index = locel->Index();
locel->Divide(index,indexsubs,1);
int64_t nsub = indexsubs.NElements();
TPZAdmChunkVector<TPZCompEl *> listsub(0);
for(int64_t k=0;k<nsub;k++) {
index = listsub.AllocateNewElement();
listsub[index] = Mesh()->ElementVec()[indexsubs[k]];
}
//existe um unico filho que contem o ponto singular
SingularElement(point,listsub,sublist);
hsub = h_Parameter(sublist[0]);
}
TPZInterpolatedElement *intel = (TPZInterpolatedElement *) locel;
intel->PRefine(Nc+1);
indexlist.Push(intel->Index());
//os elemento viz devem ter ordens menores a cel quanto mais longe de point
TPZInterpolatedElement *neighkeep,*neigh;
//feito s�para o caso 1d , extender para o caso geral
int dim = intel->Dimension();
if(dim != 1) {
cout << "TPZAnalysisError::Step3 not dimension implemented , dimension = " << intellist[el]->Dimension() << endl;
return ;//exit(1);
}
for(int side=0;side<2;side++) {
int ly = 1;
TPZGeoElSide neighside = intel->Reference()->Neighbour(side);
//.........这里部分代码省略.........