本文整理汇总了C++中TPZAutoPointer::CreateBC方法的典型用法代码示例。如果您正苦于以下问题:C++ TPZAutoPointer::CreateBC方法的具体用法?C++ TPZAutoPointer::CreateBC怎么用?C++ TPZAutoPointer::CreateBC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPZAutoPointer
的用法示例。
在下文中一共展示了TPZAutoPointer::CreateBC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mp
//.........这里部分代码省略.........
int in;
nodeindex.Resize(numnos[nel]);
for(in=0; in<numnos[nel]; in++) {
nodeindex[in] = nodind[nel][in];
}
int index;
switch(nel) {
case 0:
// elvec[el] = gmesh->CreateGeoElement(ECube,nodeindex,1,index);
// gelvec[nel]=new TPZGeoElC3d(nodeindex,matid,*gmesh);
break;
case 1:
gelvec[nel] = gmesh->CreateGeoElement(EPiramide,nodeindex,matid,index);
// gelvec[nel]=new TPZGeoElPi3d(nodeindex,matid,*gmesh);
break;
case 2:
gelvec[nel] = gmesh->CreateGeoElement(ETetraedro,nodeindex,matid,index);
// gelvec[nel]=new TPZGeoElT3d(nodeindex,matid,*gmesh);
break;
case 3:
// gelvec[nel]=new TPZGeoElPr3d(nodeindex,matid,*gmesh);
// gelvec[nel] = gmesh->CreateGeoElement(EPrisma,nodeindex,matid,index);
break;
case 4:
// gelvec[nel]=new TPZGeoEl1d(nodeindex,2,*gmesh);
break;
case 5:
// gelvec[nel]=new TPZGeoElQ2d(nodeindex,3,*gmesh);
break;
case 6:
// gelvec[nel]=new TPZGeoElT2d(nodeindex,3,*gmesh);
break;
default:
break;
}
}
gmesh->BuildConnectivity2();
//TPZVec<TPZGeoEl *> sub;
//elvec[0]->Divide(sub);
// elvec[1]->Divide(sub);
// elvec[2]->Divide(sub);
// TPZGeoElBC gbc;
// bc -1 -> Dirichlet
// TPZGeoElBC gbc1(gelvec[0],20,-1,*gmesh);
TPZGeoElBC gbc11(gelvec[1],14,-1,*gmesh);
// TPZGeoElBC gbc12(gelvec[3],15,-1,*gmesh);
// bc -2 -> Neumann at the right x==1
// TPZGeoElBC gbc2(gelvec[0],25,-2,*gmesh);
// TPZGeoElBC gbc21(gelvec[3],19,-2,*gmesh);
TPZGeoElBC gbc22(gelvec[2],10,-2,*gmesh);
TPZCompMesh *cmesh = new TPZCompMesh(gmesh);
TPZAutoPointer<TPZMaterial> mat;
// if(nstate == 3) {
mat = new TPZMaterialTest3D(1);
TPZFMatrix mp (3,1,0.);
TPZMaterialTest3D * mataux = dynamic_cast<TPZMaterialTest3D *> (mat.operator ->());
TPZMaterialTest3D::geq3=1;
mataux->SetMaterial(mp);
/* } else {
TPZMat2dLin *mat2d = new TPZMat2dLin(1);
int ist,jst;
TPZFMatrix xk(nstate,nstate,1.),xc(nstate,nstate,0.),xf(nstate,1,0.);
for(ist=0; ist<nstate; ist++) {
if(nstate != 1) xf(ist,0) = 1.;
for(jst=0; jst<nstate; jst++) {
if(ist != jst) xk(ist,jst) = 0.;
}
}
mat2d->SetMaterial(xk,xc,xf);
mat = mat2d;
}*/
TPZFMatrix val1(3,3,0.),val2(3,1,0.);
TPZAutoPointer<TPZMaterial> bc[2];
bc[0] = mat->CreateBC(mat,-1,0,val1,val2);
val2(0,0) = 1.;
bc[1] = mat->CreateBC(mat,-2,1,val1,val2);
cmesh->InsertMaterialObject(mat);
int i;
for(i=0; i<2; i++) cmesh->InsertMaterialObject(bc[i]);
gmesh->Print(cout);
cmesh->AutoBuild();
cmesh->AdjustBoundaryElements();
cmesh->CleanUpUnconnectedNodes();
gmesh->Print(cout);
return cmesh;
}