本文整理匯總了C++中TPZAutoPointer::InsertMaterialObject方法的典型用法代碼示例。如果您正苦於以下問題:C++ TPZAutoPointer::InsertMaterialObject方法的具體用法?C++ TPZAutoPointer::InsertMaterialObject怎麽用?C++ TPZAutoPointer::InsertMaterialObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TPZAutoPointer
的用法示例。
在下文中一共展示了TPZAutoPointer::InsertMaterialObject方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: InsertViscoElasticity
void InsertViscoElasticity(TPZAutoPointer<TPZCompMesh> mesh)
{
mesh->SetDimModel(3);
int nummat = 1;
STATE Ela = 1.e6;
STATE poisson = 0.2;
TPZManVector<STATE> force(3,0.);
force[2] = -20.;
STATE ElaE = 1000000., poissonE = 0.2, ElaV = 950000., poissonV = 0.14;
STATE lambdaV = 0, muV = 0, alpha = 0, deltaT = 0;
lambdaV = 11.3636;
muV = 45.4545;
alpha = 1.;
deltaT = 0.1;
TPZViscoelastic *viscoelast = new TPZViscoelastic(nummat);
viscoelast->SetMaterialDataHooke(ElaE, poissonE, ElaV, poissonV, alpha, deltaT, force);
TPZMaterial * viscoelastauto(viscoelast);
TPZFMatrix<STATE> val1(3,3,0.),val2(3,1,0.);
TPZBndCond *bc = viscoelast->CreateBC(viscoelastauto, -1, 0, val1, val2);
TPZFNMatrix<6> qsi(6,1,0.);
viscoelast->SetDefaultMem(qsi); //elast
int index = viscoelast->PushMemItem(); //elast
TPZMaterial * bcauto(bc);
mesh->InsertMaterialObject(viscoelastauto);
mesh->InsertMaterialObject(bcauto);
}
示例2: InsertElasticity
void InsertElasticity(TPZAutoPointer<TPZCompMesh> mesh)
{
mesh->SetDimModel(3);
int nummat = 1;
STATE E = 1.e6;
STATE poisson = 0.3;
TPZManVector<STATE> force(3,0.);
force[1] = 20.;
TPZElasticity3D *elast = new TPZElasticity3D(nummat,E,poisson,force);
TPZMaterial * elastauto(elast);
TPZFMatrix<STATE> val1(3,3,0.),val2(3,1,0.);
TPZBndCond *bc = elast->CreateBC(elastauto, -1, 0, val1, val2);
TPZMaterial * bcauto(bc);
mesh->InsertMaterialObject(elastauto);
mesh->InsertMaterialObject(bcauto);
}
示例3: InsertViscoElasticityCubo
void InsertViscoElasticityCubo(TPZAutoPointer<TPZCompMesh> mesh)
{
mesh->SetDimModel(3);
int nummat = 1, neumann = 1, mixed = 2;
// int dirichlet = 0;
int dir1 = -1, dir2 = -2, dir3 = -3, neumann1 = -4., neumann2 = -5, dirp2 = -6;
TPZManVector<STATE> force(3,0.);
//force[1] = 0.;
STATE ElaE = 1000., poissonE = 0.2, ElaV = 970., poissonV = 0.14;
STATE lambdaV = 0, muV = 0, alpha = 0, deltaT = 0;
lambdaV = 11.3636;
muV = 45.4545;
alpha = 1.;
deltaT = 0.1;
TPZViscoelastic *viscoelast = new TPZViscoelastic(nummat);
viscoelast->SetMaterialDataHooke(ElaE, poissonE, ElaV, poissonV, alpha, deltaT, force);
//TPZViscoelastic *viscoelast = new TPZViscoelastic(nummat, ElaE, poissonE, lambdaV, muV, alphaT, force);
//TPZElasticity3D *viscoelast = new TPZElasticity3D(nummat, ElaE, poissonE, force);
TPZFNMatrix<6> qsi(6,1,0.);
viscoelast->SetDefaultMem(qsi); //elast
int index = viscoelast->PushMemItem(); //elast
TPZMaterial * viscoelastauto(viscoelast);
mesh->InsertMaterialObject(viscoelastauto);
// Neumann em x = 1;
TPZFMatrix<STATE> val1(3,3,0.),val2(3,1,0.);
val2(0,0) = 1.;
TPZBndCond *bc4 = viscoelast->CreateBC(viscoelastauto, neumann1, neumann, val1, val2);
TPZMaterial * bcauto4(bc4);
mesh->InsertMaterialObject(bcauto4);
// Neumann em x = -1;
val2(0,0) = -1.;
TPZBndCond *bc5 = viscoelast->CreateBC(viscoelastauto, neumann2, neumann, val1, val2);
TPZMaterial * bcauto5(bc5);
mesh->InsertMaterialObject(bcauto5);
val2.Zero();
// Dirichlet em -1 -1 -1 xyz;
val1(0,0) = 1e4;
val1(1,1) = 1e4;
val1(2,2) = 1e4;
TPZBndCond *bc1 = viscoelast->CreateBC(viscoelastauto, dir1, mixed, val1, val2);
TPZMaterial * bcauto1(bc1);
mesh->InsertMaterialObject(bcauto1);
// Dirichlet em 1 -1 -1 yz;
val1(0,0) = 0.;
val1(1,1) = 1e4;
val1(2,2) = 1e4;
TPZBndCond *bc2 = viscoelast->CreateBC(viscoelastauto, dir2, mixed, val1, val2);
TPZMaterial * bcauto2(bc2);
mesh->InsertMaterialObject(bcauto2);
// Dirichlet em 1 1 -1 z;
val1(0,0) = 0.;
val1(1,1) = 0.;
val1(2,2) = 1e4;
TPZBndCond *bc3 = viscoelast->CreateBC(viscoelastauto, dir3, mixed, val1, val2);
TPZMaterial * bcauto3(bc3);
mesh->InsertMaterialObject(bcauto3);
}