本文整理汇总了C++中libutilities::SessionReaderSharedPtr::DefinesSolverInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ SessionReaderSharedPtr::DefinesSolverInfo方法的具体用法?C++ SessionReaderSharedPtr::DefinesSolverInfo怎么用?C++ SessionReaderSharedPtr::DefinesSolverInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libutilities::SessionReaderSharedPtr
的用法示例。
在下文中一共展示了SessionReaderSharedPtr::DefinesSolverInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
Array<OneD,NekDouble> fce;
Array<OneD,NekDouble> xc0,xc1,xc2;
if(argc < 2)
{
fprintf(stderr,"Usage: XmlToTecplot meshfile\n");
exit(1);
}
LibUtilities::SessionReader::RegisterCmdLineFlag(
"multi-zone", "m", "Output multi-zone format (one element per zone).");
LibUtilities::SessionReaderSharedPtr vSession
= LibUtilities::SessionReader::CreateInstance(argc, argv);
//----------------------------------------------
// Read in mesh from input file
string meshfile(argv[argc-1]);
SpatialDomains::MeshGraphSharedPtr graphShPt
= SpatialDomains::MeshGraph::Read(vSession);
//----------------------------------------------
//----------------------------------------------
// Set up Expansion information
SpatialDomains::ExpansionMap emap = graphShPt->GetExpansions();
SpatialDomains::ExpansionMapIter it;
for (it = emap.begin(); it != emap.end(); ++it)
{
for (int i = 0; i < it->second->m_basisKeyVector.size(); ++i)
{
LibUtilities::BasisKey tmp1 = it->second->m_basisKeyVector[i];
LibUtilities::PointsKey tmp2 = tmp1.GetPointsKey();
it->second->m_basisKeyVector[i] = LibUtilities::BasisKey(
tmp1.GetBasisType(), tmp1.GetNumModes(),
LibUtilities::PointsKey(tmp1.GetNumModes(),
LibUtilities::ePolyEvenlySpaced));
}
}
//----------------------------------------------
//----------------------------------------------
// Define Expansion
int expdim = graphShPt->GetMeshDimension();
Array<OneD, MultiRegions::ExpListSharedPtr> Exp(1);
switch(expdim)
{
case 1:
{
MultiRegions::ExpList1DSharedPtr Exp1D;
Exp1D = MemoryManager<MultiRegions::ExpList1D>::AllocateSharedPtr(vSession,graphShPt);
Exp[0] = Exp1D;
break;
}
case 2:
{
if(vSession->DefinesSolverInfo("HOMOGENEOUS"))
{
std::string HomoStr = vSession->GetSolverInfo("HOMOGENEOUS");
MultiRegions::ExpList3DHomogeneous1DSharedPtr Exp3DH1;
ASSERTL0(
HomoStr == "HOMOGENEOUS1D" || HomoStr == "Homogeneous1D" ||
HomoStr == "1D" || HomoStr == "Homo1D",
"Only 3DH1D supported for XML output currently.");
int nplanes;
vSession->LoadParameter("HomModesZ", nplanes);
// choose points to be at evenly spaced points at nplanes + 1
// points
const LibUtilities::PointsKey Pkey(
nplanes + 1, LibUtilities::ePolyEvenlySpaced);
const LibUtilities::BasisKey Bkey(
LibUtilities::eFourier, nplanes, Pkey);
NekDouble lz = vSession->GetParameter("LZ");
Exp3DH1 = MemoryManager<MultiRegions::ExpList3DHomogeneous1D>
::AllocateSharedPtr(
vSession, Bkey, lz, false, false, graphShPt);
Exp[0] = Exp3DH1;
}
else
{
MultiRegions::ExpList2DSharedPtr Exp2D;
Exp2D = MemoryManager<MultiRegions::ExpList2D>::AllocateSharedPtr(vSession,graphShPt);
Exp[0] = Exp2D;
}
break;
}
case 3:
{
MultiRegions::ExpList3DSharedPtr Exp3D;
Exp3D = MemoryManager<MultiRegions::ExpList3D>::AllocateSharedPtr(vSession,graphShPt);
Exp[0] = Exp3D;
break;
}
//.........这里部分代码省略.........