本文整理汇总了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());
}
}
}
示例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;
//.........这里部分代码省略.........