本文整理汇总了C++中TPZCompMesh::CleanUp方法的典型用法代码示例。如果您正苦于以下问题:C++ TPZCompMesh::CleanUp方法的具体用法?C++ TPZCompMesh::CleanUp怎么用?C++ TPZCompMesh::CleanUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPZCompMesh
的用法示例。
在下文中一共展示了TPZCompMesh::CleanUp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
InitializePZLOG();
gRefDBase.InitializeUniformRefPattern(EOned);
gRefDBase.InitializeUniformRefPattern(EQuadrilateral);
gRefDBase.InitializeUniformRefPattern(ETriangle);
ofstream saidaerros("ErroMDP.txt");
saidaerros << "\nCalculo do Erro\n";
int h= 0;
int p=0, pr;
int dim = 1;
fc = 0.1;
fk = 0.0001;
saidaerros.precision(8);
for(p=1; p<2; p++)
{
pr = p+3;
saidaerros << "\n";
saidaerros << "Ordens p = " << p << " and Ordens pr = " << pr <<"\n";
for(h=7; h<8; h++)
{
saidaerros << "\nRefinamento: h = "<< h <<"\n";
//if(dim>1){
//TPZAutoPointer<TPZGeoMesh> gmesh;
TPZGeoMesh *gmesh;
if(dim>1){
gmesh = MalhaGeom(1.,1.,false);
TPZVec<int> dims(dim,dim);
if(dim>1) dims[0]=1;
int nref = h;
RefinamentoUniforme(gmesh, nref, dims);
}else
gmesh = MalhaGeom1D(3.,h);
ofstream arg("gmesh.txt");
gmesh->Print(arg);
TPZCompMesh * cmesh1;
TPZCompMesh * cmesh2;
if(dim>1){
cmesh1 = CompMesh(gmesh,pr);
cmesh2 = CompMesh(gmesh,p);
}else{
cmesh1 = CompMesh1D(gmesh,pr);
cmesh2 = CompMesh1D(gmesh,p);
}
// Criando a malha computacional multifísica
//malha multifisica
TPZVec<TPZCompMesh *> meshvec(2);
meshvec[0] = cmesh1;
meshvec[1] = cmesh2;
TPZCompMesh * mphysics;
if(dim>1){
mphysics = MalhaMDP(meshvec,gmesh);
}else
mphysics = MalhaMDP1D(meshvec,gmesh);
//analysis
TPZAnalysis an(mphysics,false);
TPZStepSolver<STATE> step;
//TPZBandStructMatrix bst(mphysics);
//TPZFStructMatrix bst(mphysics);
TPZSkylineNSymStructMatrix bst(mphysics);
an.SetStructuralMatrix(bst);
//bst.SetNumThreads(8);
step.SetDirect(ELU);
an.SetSolver(step);
an.Assemble();
an.Solve();
TPZBuildMultiphysicsMesh::TransferFromMultiPhysics(meshvec, mphysics);
std::string plotfile("result.vtk");
TPZStack<std::string> scalnames,vecnames;
scalnames.Push("Solution");
scalnames.Push("ExactSolution");
scalnames.Push("OptimalTestFunction");
an.DefineGraphMesh(mphysics->Dimension(), scalnames, vecnames, plotfile);
an.PostProcess(0,dim);
saidaerros<<"\n\nErro da simulacao MDP para a pressao";
// TPZVec<REAL> erros(3);
// TPZAnalysis an2(cmesh2);
// an2.SetExact(*SolSuave);
// an2.PostProcessError(erros, saidaerros);
ErrorH1(cmesh2, saidaerros);
mphysics->CleanUp();
gmesh->CleanUp();
delete mphysics;
}
}
return EXIT_SUCCESS;
//.........这里部分代码省略.........
示例2: mainfem
int mainfem(int argc, char *argv[])
{
//InitializePZLOG();
gRefDBase.InitializeUniformRefPattern(EOned);
gRefDBase.InitializeUniformRefPattern(EQuadrilateral);
gRefDBase.InitializeUniformRefPattern(ETriangle);
ofstream saidaerros("ErroProjecaoSemiH1.txt");
saidaerros << "\nCalculo do Erro\n";
int h= 0;
int p=0;
saidaerros.precision(16);
for(p=1; p<5; p++)
{
saidaerros << "\n";
saidaerros << "Ordens p = " << p <<"\n";
for(h=0; h<6; h++)
{
saidaerros << "\nRefinamento: h = "<< h <<"\n";
//TPZGeoMesh * gmesh = MalhaGeom(1.,1.,false);
TPZAutoPointer<TPZGeoMesh> gmesh = MalhaGeom(1.,1.,false);
TPZVec<int> dims(2,0);
dims[0]=1; dims[1]=2;
int nref = h;
RefinamentoUniforme(gmesh, nref, dims);
TPZCompMesh * cmesh = CompMesh(gmesh.operator->(),p);
//analysis
TPZAnalysis an(cmesh,false);
TPZSkylineStructMatrix skyl(cmesh);
an.SetStructuralMatrix(skyl);
TPZStepSolver<STATE> step;
step.SetDirect(ELDLt);
an.SetSolver(step);
an.Assemble();
an.Solve();
// std::string plotfile("result.vtk");
// TPZStack<std::string> scalnames,vecnames;
// scalnames.Push("Solution");
// scalnames.Push("ExactPressure");
// an.DefineGraphMesh(cmesh->Dimension(), scalnames, vecnames, plotfile);
// an.PostProcess(0,2);
// TPZVec<REAL> erros(3);
// an.SetExact(*SolSuave);
// an.PostProcessError(erros,saidaerros);
ErrorH1(cmesh, saidaerros);
cmesh->CleanUp();
gmesh->CleanUp();
delete cmesh;
}
}
return EXIT_SUCCESS;
}