本文整理匯總了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;
}
}
示例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);
}
示例3: SetStructuralMatrix
void TPZAnalysis::SetStructuralMatrix(TPZAutoPointer<TPZStructMatrix> strmatrix){
fStructMatrix = TPZAutoPointer<TPZStructMatrix>(strmatrix->Clone());
}