本文整理汇总了C++中TPZCompMesh::AllocateNewConnect方法的典型用法代码示例。如果您正苦于以下问题:C++ TPZCompMesh::AllocateNewConnect方法的具体用法?C++ TPZCompMesh::AllocateNewConnect怎么用?C++ TPZCompMesh::AllocateNewConnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPZCompMesh
的用法示例。
在下文中一共展示了TPZCompMesh::AllocateNewConnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeRaviartTomas
/**
* @brief transform in low order Raviar Tomas
*/
void TPZCreateApproximationSpace::MakeRaviartTomas(TPZCompMesh &cmesh)
{
int numcell = cmesh.NElements();
int el;
for (el = 0; el<numcell ; el++) {
TPZCompEl *cel = cmesh.ElementVec()[el];
TPZInterpolationSpace *intel = dynamic_cast<TPZInterpolationSpace *>(cel);
if (!intel) {
continue;
}
intel->SetPreferredOrder(1);
}
cmesh.ExpandSolution();
for (el = 0; el<numcell ; el++) {
TPZCompEl *cel = cmesh.ElementVec()[el];
TPZInterpolatedElement *intel = dynamic_cast<TPZInterpolatedElement *>(cel);
if (!intel) {
continue;
}
TPZGeoEl *gel = intel->Reference();
int geldim = gel->Dimension();
int is;
int nsides = gel->NSides();
for (is=0; is<nsides; is++) {
if (gel->SideDimension(is) != geldim-1) {
continue;
}
int nsconnects = intel->NSideConnects(is);
// only interested in HDiv elements
if (nsconnects != 1) {
continue;
}
int cindex = intel->SideConnectIndex(0, is);
TPZConnect &c = intel->Connect(intel->SideConnectLocId(0,is));
if (c.HasDependency()) {
continue;
}
int nshape = 1;
int nstate = 1;
int order = 0;
int cindex2 = cmesh.AllocateNewConnect(nshape, nstate, order);
// TPZConnect &c2 = cmesh.ConnectVec()[cindex];
TPZFNMatrix<2> depmat(2,1,1.);
c.AddDependency(cindex, cindex2, depmat, 0, 0, 2, 1);
}
}
cmesh.ExpandSolution();
}