本文整理汇总了C++中libutilities::SessionReaderSharedPtr::GetSessionName方法的典型用法代码示例。如果您正苦于以下问题:C++ SessionReaderSharedPtr::GetSessionName方法的具体用法?C++ SessionReaderSharedPtr::GetSessionName怎么用?C++ SessionReaderSharedPtr::GetSessionName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libutilities::SessionReaderSharedPtr
的用法示例。
在下文中一共展示了SessionReaderSharedPtr::GetSessionName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
case 3:
Exp->GetCoords(xc0,xc1,xc2);
break;
}
//----------------------------------------------
//----------------------------------------------
// Define forcing function for first variable defined in file
fce = Array<OneD,NekDouble>(nq);
LibUtilities::EquationSharedPtr ffunc = vSession->GetFunction("Forcing", 0);
ffunc->Evaluate(xc0, xc1, xc2, fce);
//----------------------------------------------
//----------------------------------------------
// Setup expansion containing the forcing function
Fce = MemoryManager<MultiRegions::DisContField3D>::AllocateSharedPtr(*Exp);
Fce->SetPhys(fce);
//----------------------------------------------
Timing("Define forcing ..");
//----------------------------------------------
// Helmholtz solution taking physical forcing
Exp->HelmSolve(Fce->GetPhys(), Exp->UpdateCoeffs(), NullFlagList, factors);
//----------------------------------------------
Timing("Helmholtz Solve ..");
#if 0
for(i = 0; i < 100; ++i)
{
Exp->HelmSolve(Fce->GetPhys(), Exp->UpdateCoeffs(), NullFlagList, factors);
}
Timing("100 Helmholtz Solves:... ");
#endif
//----------------------------------------------
// Backward Transform Solution to get solved values at
Exp->BwdTrans(Exp->GetCoeffs(), Exp->UpdatePhys());
//----------------------------------------------
Timing("Backward Transform ..");
//-----------------------------------------------
// Write solution to file
string out = vSession->GetSessionName() + ".fld";
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
= Exp->GetFieldDefinitions();
std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
for(i = 0; i < FieldDef.size(); ++i)
{
FieldDef[i]->m_fields.push_back("u");
Exp->AppendFieldData(FieldDef[i], FieldData[i]);
}
fld->Write(out, FieldDef, FieldData);
//-----------------------------------------------
//----------------------------------------------
// See if there is an exact solution, if so
// evaluate and plot errors
LibUtilities::EquationSharedPtr ex_sol =
vSession->GetFunction("ExactSolution", 0);
if(ex_sol)
{
//----------------------------------------------
// evaluate exact solution
ex_sol->Evaluate(xc0, xc1, xc2, fce);
//----------------------------------------------
//--------------------------------------------
// Calculate L_inf error
Fce->SetPhys(fce);
Fce->SetPhysState(true);
NekDouble vLinfError = Exp->Linf(Exp->GetPhys(), Fce->GetPhys());
NekDouble vL2Error = Exp->L2 (Exp->GetPhys(), Fce->GetPhys());
NekDouble vH1Error = Exp->H1 (Exp->GetPhys(), Fce->GetPhys());
if (vComm->GetRank() == 0)
{
cout << "L infinity error: " << vLinfError << endl;
cout << "L 2 error : " << vL2Error << endl;
cout << "H 1 error : " << vH1Error << endl;
}
//--------------------------------------------
}
Timing("Output ..");
//----------------------------------------------
vSession->Finalise();
return 0;
}