当前位置: 首页>>代码示例>>C++>>正文


C++ TPZAutoPointer::Clone方法代码示例

本文整理汇总了C++中TPZAutoPointer::Clone方法的典型用法代码示例。如果您正苦于以下问题:C++ TPZAutoPointer::Clone方法的具体用法?C++ TPZAutoPointer::Clone怎么用?C++ TPZAutoPointer::Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TPZAutoPointer的用法示例。


在下文中一共展示了TPZAutoPointer::Clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Clone

void TPZBndCond::Clone(std::map<int, TPZAutoPointer<TPZMaterial> > &matvec) {
    int matid = Id();

    TPZAutoPointer<TPZMaterial> refmaterial = Material();
    TPZAutoPointer<TPZMaterial> newrefmaterial;
    int refmatid = 0;
    if(refmaterial) {
        refmaterial->Clone(matvec);
        refmatid = refmaterial->Id();
        newrefmaterial = matvec[refmatid];
    }
    std::map<int, TPZAutoPointer<TPZMaterial> >::iterator matit;
    matit = matvec.find(matid);
    if(matit == matvec.end())
    {
        TPZAutoPointer<TPZMaterial> newmat = TPZAutoPointer<TPZMaterial>(new TPZBndCond(*this, newrefmaterial));
        matvec[matid] = newmat;
    }
}
开发者ID:JoaoFelipe,项目名称:oceano,代码行数:19,代码来源:pzbndcond.cpp

示例2: Run


//.........这里部分代码省略.........
    
    
    int q = fSimulationData->Getqorder();
    int p = fSimulationData->Getporder();
    int s = 0;
    
    //    if (fSimulationData->GetIsH1approx())
    if (false)
    {
        //        CmeshH1(p);
    }
    else
    {
        CreateMultiphysicsMesh(q,p,s);
//        CreateInterfaces();
    }
    
    
    // Analysis
    bool mustOptimizeBandwidth = true;
    TPZAnalysis *an = new TPZAnalysis(fcmeshdarcy,mustOptimizeBandwidth);
    int numofThreads = 0;
    
    bool IsDirecSolver = fSimulationData->GetIsDirect();
    
    if (IsDirecSolver) {
        
        if (fSimulationData->GetIsBroyden()) {
            TPZFStructMatrix fullMatrix(fcmeshdarcy);
            TPZStepSolver<STATE> step;
            fullMatrix.SetNumThreads(numofThreads);
            step.SetDirect(ELU);
            an->SetStructuralMatrix(fullMatrix);
            an->SetSolver(step);
        }
        else{
            
            TPZSkylineNSymStructMatrix skylnsym(fcmeshdarcy);
            TPZStepSolver<STATE> step;
            skylnsym.SetNumThreads(numofThreads);
            step.SetDirect(ELU);
            an->SetStructuralMatrix(skylnsym);
            an->SetSolver(step);
        }
        
    }
    else
    {
        if (fSimulationData->GetIsBroyden()) {
            TPZFStructMatrix fullMatrix(fcmeshdarcy);
            fullMatrix.SetNumThreads(numofThreads);
            
            TPZAutoPointer<TPZMatrix<STATE> > fullMatrixa = fullMatrix.Create();
            TPZAutoPointer<TPZMatrix<STATE> > fullMatrixaClone = fullMatrixa->Clone();
            
            TPZStepSolver<STATE> *stepre = new TPZStepSolver<STATE>(fullMatrixaClone);
            TPZStepSolver<STATE> *stepGMRES = new TPZStepSolver<STATE>(fullMatrixa);
            TPZStepSolver<STATE> *stepGC = new TPZStepSolver<STATE>(fullMatrixa);
            stepre->SetDirect(ELU);
            stepre->SetReferenceMatrix(fullMatrixa);
            stepGMRES->SetGMRES(10, 20, *stepre, 1.0e-10, 0);
            stepGC->SetCG(10, *stepre, 1.0e-10, 0);
            if (fSimulationData->GetIsCG()) {
                an->SetSolver(*stepGC);
            }
            else{
                an->SetSolver(*stepGMRES);
            }
            
        }
        else{
            
            TPZSkylineNSymStructMatrix skylnsym(fcmeshdarcy);
            skylnsym.SetNumThreads(numofThreads);
            
            TPZAutoPointer<TPZMatrix<STATE> > skylnsyma = skylnsym.Create();
            TPZAutoPointer<TPZMatrix<STATE> > skylnsymaClone = skylnsyma->Clone();
            
            TPZStepSolver<STATE> *stepre = new TPZStepSolver<STATE>(skylnsymaClone);
            TPZStepSolver<STATE> *stepGMRES = new TPZStepSolver<STATE>(skylnsyma);
            TPZStepSolver<STATE> *stepGC = new TPZStepSolver<STATE>(skylnsyma);
            
            stepre->SetDirect(ELU);
            stepre->SetReferenceMatrix(skylnsyma);
            stepGMRES->SetGMRES(10, 20, *stepre, 1.0e-10, 0);
            stepGC->SetCG(10, *stepre, 1.0e-10, 0);
            if (fSimulationData->GetIsCG()) {
                an->SetSolver(*stepGC);
            }
            else{
                an->SetSolver(*stepGMRES);
            }
        }
        
    }
    
    this->InitializeSolution(an);
    this->TimeForward(an);
    
}
开发者ID:labmec,项目名称:neopz,代码行数:101,代码来源:TPZDarcyAnalysis.cpp

示例3: SetStructuralMatrix

void TPZAnalysis::SetStructuralMatrix(TPZAutoPointer<TPZStructMatrix> strmatrix){
	fStructMatrix = TPZAutoPointer<TPZStructMatrix>(strmatrix->Clone());
}
开发者ID:JoaoFelipe,项目名称:oceano,代码行数:3,代码来源:pzanalysis.cpp


注:本文中的TPZAutoPointer::Clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。