本文整理汇总了C++中TPZAutoPointer::ComputeNodElCon方法的典型用法代码示例。如果您正苦于以下问题:C++ TPZAutoPointer::ComputeNodElCon方法的具体用法?C++ TPZAutoPointer::ComputeNodElCon怎么用?C++ TPZAutoPointer::ComputeNodElCon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPZAutoPointer
的用法示例。
在下文中一共展示了TPZAutoPointer::ComputeNodElCon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SubStructure
int SubStructure(TPZAutoPointer<TPZCompMesh> cmesh, REAL height)
{
int nelem = cmesh->NElements();
TPZManVector<int> subindex(nelem,-1);
int iel;
int nsub = 0;
for (iel=0; iel<nelem; iel++)
{
TPZCompEl *cel = cmesh->ElementVec()[iel];
if (!cel) {
continue;
}
TPZGeoEl *gel = cel->Reference();
if (!gel) {
continue;
}
int nsides = gel->NSides();
TPZManVector<REAL> center(gel->Dimension(),0.), xco(3,0.);
gel->CenterPoint(nsides-1,center);
gel->X(center,xco);
REAL z = xco[2];
int floor = (int) z/height;
nsub = (floor+1) > nsub ? (floor+1) : nsub;
subindex[iel] = floor;
}
#ifdef DEBUG
{
TPZGeoMesh *gmesh = cmesh->Reference();
int nelgeo = gmesh->NElements();
TPZVec<int> domaincolor(nelgeo,-999);
int cel;
int nel = cmesh->NElements();
for (cel=0; cel<nel; cel++) {
TPZCompEl *compel = cmesh->ElementVec()[cel];
if(!compel) continue;
TPZGeoEl *gel = compel->Reference();
if (!gel) {
continue;
}
domaincolor[gel->Index()] = subindex[cel];
}
ofstream vtkfile("partition.vtk");
TPZVTKGeoMesh::PrintGMeshVTK(gmesh, vtkfile, domaincolor);
}
#endif
int isub;
TPZManVector<TPZSubCompMesh *> submeshes(nsub,0);
for (isub=0; isub<nsub; isub++)
{
int index;
std::cout << '^'; std::cout.flush();
submeshes[isub] = new TPZSubCompMesh(cmesh,index);
if (index < subindex.NElements())
{
subindex[index] = -1;
}
}
for (iel=0; iel<nelem; iel++)
{
int domindex = subindex[iel];
if (domindex >= 0)
{
TPZCompEl *cel = cmesh->ElementVec()[iel];
if (!cel)
{
continue;
}
submeshes[domindex]->TransferElement(cmesh.operator->(),iel);
}
}
cmesh->ComputeNodElCon();
for (isub=0; isub<nsub; isub++)
{
submeshes[isub]->MakeAllInternal();
std::cout << '*'; std::cout.flush();
}
cmesh->ComputeNodElCon();
cmesh->CleanUpUnconnectedNodes();
return nsub;
}