本文整理汇总了C++中TPZCompMesh::SetAllCreateFunctionsMultiphysicElem方法的典型用法代码示例。如果您正苦于以下问题:C++ TPZCompMesh::SetAllCreateFunctionsMultiphysicElem方法的具体用法?C++ TPZCompMesh::SetAllCreateFunctionsMultiphysicElem怎么用?C++ TPZCompMesh::SetAllCreateFunctionsMultiphysicElem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPZCompMesh
的用法示例。
在下文中一共展示了TPZCompMesh::SetAllCreateFunctionsMultiphysicElem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TPZCompMesh
//malha multifisica para o metodo da dupla projecao
TPZCompMesh *MalhaMDP(TPZVec<TPZCompMesh *> meshvec,TPZGeoMesh * gmesh){
//Creating computational mesh for multiphysic elements
gmesh->ResetReference();
TPZCompMesh *mphysics = new TPZCompMesh(gmesh);
//criando material
int dim =2;
TPZMDPMaterial *material = new TPZMDPMaterial(1,dim);
//incluindo os dados do problema
REAL coefk = 1.;
material->SetParameters(coefk, 0.);
//solucao exata
TPZAutoPointer<TPZFunction<STATE> > solexata;
solexata = new TPZDummyFunction<STATE>(SolSuave);
material->SetForcingFunctionExact(solexata);
//funcao do lado direito da equacao do problema
TPZAutoPointer<TPZFunction<STATE> > force;
TPZDummyFunction<STATE> *dum;
dum = new TPZDummyFunction<STATE>(ForceSuave);
dum->SetPolynomialOrder(20);
force = dum;
material->SetForcingFunction(force);
//inserindo o material na malha computacional
TPZMaterial *mat(material);
mphysics->InsertMaterialObject(mat);
//Criando condicoes de contorno
TPZFMatrix<STATE> val1(2,2,0.), val2(2,1,0.);
int boundcond = dirichlet;
//BC -1
TPZMaterial * BCondD1 = material->CreateBC(mat, bc1,boundcond, val1, val2);
TPZAutoPointer<TPZFunction<REAL> > bcmatDirichlet1 = new TPZDummyFunction<REAL>(DirichletSuave);
BCondD1->SetForcingFunction(bcmatDirichlet1);
mphysics->InsertMaterialObject(BCondD1);
//BC -2
TPZMaterial * BCondD2 = material->CreateBC(mat, bc2,boundcond, val1, val2);
TPZAutoPointer<TPZFunction<REAL> > bcmatDirichlet2 = new TPZDummyFunction<REAL>(DirichletSuave);
BCondD2->SetForcingFunction(bcmatDirichlet2);
mphysics->InsertMaterialObject(BCondD2);
//BC -3
TPZMaterial * BCondD3 = material->CreateBC(mat, bc3,boundcond, val1, val2);
TPZAutoPointer<TPZFunction<REAL> > bcmatDirichlet3 = new TPZDummyFunction<REAL>(DirichletSuave);
BCondD3->SetForcingFunction(bcmatDirichlet3);
mphysics->InsertMaterialObject(BCondD3);
//BC -4
TPZMaterial * BCondD4 = material->CreateBC(mat, bc4,boundcond, val1, val2);
TPZAutoPointer<TPZFunction<REAL> > bcmatDirichlet4 = new TPZDummyFunction<REAL>(DirichletSuave);
BCondD4->SetForcingFunction(bcmatDirichlet4);
mphysics->InsertMaterialObject(BCondD4);
mphysics->InsertMaterialObject(BCondD1);
mphysics->InsertMaterialObject(BCondD2);
mphysics->InsertMaterialObject(BCondD3);
mphysics->InsertMaterialObject(BCondD4);
//set multiphysics element
mphysics->SetDimModel(dim);
mphysics->SetAllCreateFunctionsMultiphysicElem();
//Fazendo auto build
mphysics->AutoBuild();
mphysics->AdjustBoundaryElements();
mphysics->CleanUpUnconnectedNodes();
// Creating multiphysic elements into mphysics computational mesh
TPZBuildMultiphysicsMesh::AddElements(meshvec, mphysics);
TPZBuildMultiphysicsMesh::AddConnects(meshvec,mphysics);
TPZBuildMultiphysicsMesh::TransferFromMeshes(meshvec, mphysics);
return mphysics;
}
示例2: TPZCompMesh
TPZCompMesh *MalhaMultifisicaOpt(TPZVec<TPZCompMesh *> meshvec, TPZGeoMesh *gmesh){
//Creating computational mesh for multiphysic elements
gmesh->ResetReference();
TPZCompMesh *mphysics = new TPZCompMesh(gmesh);
//criando material
int dim =2;
TPZMatPoissonControl *material = new TPZMatPoissonControl(MatId,dim);
//incluindo os dados do problema
REAL k=1;
REAL alpha=1;
material-> SetParameters( k, alpha);
//solucao exata
TPZAutoPointer<TPZFunction<STATE> > solexata;
solexata = new TPZDummyFunction<STATE>(StateAd, 5);
material->SetForcingFunctionExact(solexata);
//funcao do lado direito da equacao do problema
TPZAutoPointer<TPZFunction<STATE> > force;
TPZDummyFunction<STATE> *dum;
dum = new TPZDummyFunction<STATE>(OptForcing, 5);
dum->SetPolynomialOrder(20);
force = dum;
material->SetForcingFunction(force);
//inserindo o material na malha computacional
TPZMaterial *mat(material);
mphysics->InsertMaterialObject(mat);
mphysics->SetDimModel(dim);
//Criando condicoes de contorno
TPZFMatrix<STATE> val1(2,2,0.), val2(2,1,0.);
TPZMaterial * BCond0 = material->CreateBC(mat, bc0, bcdirichlet, val1, val2);
TPZMaterial * BCond1 = material->CreateBC(mat, bc1, bcdirichlet, val1, val2);
TPZMaterial * BCond2 = material->CreateBC(mat, bc2, bcdirichlet, val1, val2);
TPZMaterial * BCond3 = material->CreateBC(mat, bc3, bcdirichlet, val1, val2);
///Inserir condicoes de contorno
mphysics->InsertMaterialObject(BCond0);
mphysics->InsertMaterialObject(BCond1);
mphysics->InsertMaterialObject(BCond2);
mphysics->InsertMaterialObject(BCond3);
mphysics->SetAllCreateFunctionsMultiphysicElem();
//Fazendo auto build
mphysics->AutoBuild();
mphysics->AdjustBoundaryElements();
mphysics->CleanUpUnconnectedNodes();
TPZBuildMultiphysicsMesh::AddElements(meshvec, mphysics);
TPZBuildMultiphysicsMesh::AddConnects(meshvec,mphysics);
TPZBuildMultiphysicsMesh::TransferFromMeshes(meshvec, mphysics);
return mphysics;
}