本文整理汇总了C++中TPZCompMesh::SetAllCreateFunctionsDiscontinuous方法的典型用法代码示例。如果您正苦于以下问题:C++ TPZCompMesh::SetAllCreateFunctionsDiscontinuous方法的具体用法?C++ TPZCompMesh::SetAllCreateFunctionsDiscontinuous怎么用?C++ TPZCompMesh::SetAllCreateFunctionsDiscontinuous使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPZCompMesh
的用法示例。
在下文中一共展示了TPZCompMesh::SetAllCreateFunctionsDiscontinuous方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mat
TPZCompMesh *MalhaCompDois(TPZGeoMesh * gmesh, int pOrder, bool isdiscontinuous)
{
/// criar materiais
int dim = 2;
TPZMatPoisson3d *material;
material = new TPZMatPoisson3d(matId,dim);
TPZMaterial * mat(material);
material->SetNoPenalty();
material->SetNonSymmetric();
REAL diff = -1.;
REAL conv = 0.;
TPZVec<REAL> convdir(3,0.);
REAL flux = 0.;
material->SetParameters(diff, conv, convdir);
material->SetInternalFlux(flux);
material->NStateVariables();
TPZCompEl::SetgOrder(pOrder);
TPZCompMesh * cmesh = new TPZCompMesh(gmesh);
cmesh->SetDimModel(dim);
//cmesh->SetAllCreateFunctionsContinuous();
cmesh->InsertMaterialObject(mat);
TPZAutoPointer<TPZFunction<STATE> > forcef = new TPZDummyFunction<STATE>(ForcingF, 5);
material->SetForcingFunction(forcef);
///Inserir condicao de contorno
TPZFMatrix<STATE> val1(2,2,0.), val2(2,1,0.);
TPZMaterial * BCond0 = material->CreateBC(mat, bc0,dirichlet, val1, val2);
TPZMaterial * BCond2 = material->CreateBC(mat, bc2,dirichlet, val1, val2);
TPZMaterial * BCond1 = material->CreateBC(mat, bc1,dirichlet, val1, val2);
TPZMaterial * BCond3 = material->CreateBC(mat, bc3,dirichlet, val1, val2);
cmesh->InsertMaterialObject(BCond0);
cmesh->InsertMaterialObject(BCond1);
cmesh->InsertMaterialObject(BCond2);
cmesh->InsertMaterialObject(BCond3);
//Ajuste da estrutura de dados computacional
if (isdiscontinuous==true) {
//Set discontinuous functions
cmesh->SetAllCreateFunctionsDiscontinuous();
cmesh->AutoBuild();
cmesh->ExpandSolution();
cmesh->AdjustBoundaryElements();
cmesh->CleanUpUnconnectedNodes();
}
else{
cmesh->SetAllCreateFunctionsContinuous();
cmesh->AutoBuild();
cmesh->ExpandSolution();
cmesh->AdjustBoundaryElements();
cmesh->CleanUpUnconnectedNodes();
}
return cmesh;
}
示例2: TPZCompMesh
TPZCompMesh *MeshL2(TPZGeoMesh *gmesh, int pOrder, int dim)
{
/// criar materiais
dim = 2;
TPZMatPoisson3d *material = new TPZMatPoisson3d( MatId, dim);
material->NStateVariables();
TPZCompMesh * cmesh = new TPZCompMesh(gmesh);
cmesh->SetDimModel(dim);
TPZMaterial * mat(material);
cmesh->InsertMaterialObject(mat);
///Inserir condicao de contorno
// TPZFMatrix<STATE> val1(2,2,0.), val2(2,1,0.);
//
// TPZMaterial * BCond0 = material->CreateBC(mat, bc0,dirichlet, val1, val2);
// TPZMaterial * BCond1 = material->CreateBC(mat, bc1,dirichlet, val1, val2);
// TPZMaterial * BCond2 = material->CreateBC(mat, bc2,dirichlet, val1, val2);
// TPZMaterial * BCond3 = material->CreateBC(mat, bc3,dirichlet, val1, val2);
//
// cmesh->InsertMaterialObject(BCond0);
// cmesh->InsertMaterialObject(BCond1);
// cmesh->InsertMaterialObject(BCond2);
// cmesh->InsertMaterialObject(BCond3);
// //solucao exata
// TPZAutoPointer<TPZFunction<STATE> > solexata;
// solexata = new TPZDummyFunction<STATE>(EstadoAd);
// material->SetForcingFunctionExact(solexata);
//
// //funcao do lado direito da equacao do problema
// TPZAutoPointer<TPZFunction<STATE> > force;
// TPZDummyFunction<STATE> *dum;
//
// dum = new TPZDummyFunction<STATE>(OptForcing);
// dum->SetPolynomialOrder(20);
// force = dum;
// material->SetForcingFunction(force);
cmesh->SetDefaultOrder(pOrder);
cmesh->SetDimModel(dim);
cmesh->SetAllCreateFunctionsDiscontinuous();
//cmesh->SetAllCreateFunctionsContinuous();
//Ajuste da estrutura de dados computacional
cmesh->AutoBuild();
return cmesh;
}