本文整理汇总了C++中TPZAutoPointer::InsertPermuted方法的典型用法代码示例。如果您正苦于以下问题:C++ TPZAutoPointer::InsertPermuted方法的具体用法?C++ TPZAutoPointer::InsertPermuted怎么用?C++ TPZAutoPointer::InsertPermuted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPZAutoPointer
的用法示例。
在下文中一共展示了TPZAutoPointer::InsertPermuted方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitializeUniformRefPattern
//.........................................................................................................................................
void TPZRefPatternDataBase::InitializeUniformRefPattern(MElementType elType)
{
switch (elType)
{
case 0://EPoint
{
break;
}
case 1://EOned
{
std::cout << "\n\tinserting uniform refpattern: line\n";
char buf[] =
"3 3 "
"-50 UnifLin "
"-1. 0. 0. "
" 1. 0. 0. "
" 0. 0. 0. "
" 1 2 0 1 "
" 1 2 0 2 "
" 1 2 2 1 ";
std::istringstream str(buf);
TPZAutoPointer<TPZRefPattern> refpat = new TPZRefPattern(str);
TPZAutoPointer<TPZRefPattern> refpatFound = FindRefPattern(refpat);
if(!refpatFound)
{
InsertRefPattern(refpat);
}
else
{
refpatFound->SetName(refpat->Name());
}
refpat->InsertPermuted();
break;
}
case 2://ETriangle
{
std::cout << "\n\tinserting uniform refpattern: triangle\n";
char buf[] =
"6 5 "
"-50 UnifTri "
"0. 0. 0. "
"1. 0. 0. "
"0. 1. 0. "
"0.5 0. 0. "
"0.5 0.5 0. "
"0. 0.5 0. "
"2 3 0 1 2 "
"2 3 0 3 5 "
"2 3 3 1 4 "
"2 3 5 4 2 "
"2 3 4 5 3 ";
std::istringstream str(buf);
TPZAutoPointer<TPZRefPattern> refpat = new TPZRefPattern(str);
TPZAutoPointer<TPZRefPattern> refpatFound = FindRefPattern(refpat);
if(!refpatFound)
{
InsertRefPattern(refpat);
}
else
{
refpatFound->SetName(refpat->Name());
}
refpat->InsertPermuted();
break;
}
case 3://EQuadrilateral
{
std::cout << "\n\tinserting uniform refpattern: quadrilateral\n";
char buf[] =
"9 5 "
"-50 UnifQua "
"-1. -1. 0. "
" 1. -1. 0. "
" 1. 1. 0. "
"-1. 1. 0. "
" 0. -1. 0. "
" 1. 0. 0. "
" 0. 1. 0. "
"-1. 0. 0. "
" 0. 0. 0. "
" 3 4 0 1 2 3 "
" 3 4 0 4 8 7 "
" 3 4 4 1 5 8 "
" 3 4 8 5 2 6 "
" 3 4 7 8 6 3 ";
std::istringstream str(buf);
TPZAutoPointer<TPZRefPattern> refpat = new TPZRefPattern(str);
TPZAutoPointer<TPZRefPattern> refpatFound = FindRefPattern(refpat);
if(!refpatFound)
{
InsertRefPattern(refpat);
}
else
{
refpatFound->SetName(refpat->Name());
}
refpat->InsertPermuted();
//.........这里部分代码省略.........
示例2: ImportRefPatterns
//.........................................................................................................................................
int TPZRefPatternDataBase::ImportRefPatterns(std::string &Path, int maxdim)
{
std::string bar = "/";
std::string FileTypes ("*.rpt");
std::string Command = std::string("ls -1 ") + Path + bar + FileTypes;
std::cout << "Generated command: " << Command.c_str() << std::endl;
FILE *fp;
#ifdef VC
fp = _popen(Command.c_str(), "r");
#else
#ifndef BORLAND
fp = popen(Command.c_str(), "r");
#else
fp = (FILE *)open(Command.c_str(), O_RDONLY );
#endif
#endif
if (!fp)
{
return -1;
}
int count = 0;
char psBuffer[1024];
while( !feof( fp ) )
{
if( fgets(psBuffer, sizeof(psBuffer), fp ) != NULL )
{
if (psBuffer[strlen(psBuffer)-1] == '\n')
{
psBuffer[strlen(psBuffer)-1] = 0;
}
std::cout << "Reading refinement patern file : " << psBuffer << std::endl;
std::string filref(psBuffer);
TPZAutoPointer<TPZRefPattern> refpat = new TPZRefPattern(filref);
if (refpat->fRefPatternMesh.Dimension() > maxdim) {
std::cout << "skipped\n";
continue;
}
if(!this->FindRefPattern(refpat))
{
this->InsertRefPattern(refpat);
}
refpat->InsertPermuted();
count++;
}
}
#ifndef BORLAND
#ifdef VC
_pclose(fp);
#else
pclose(fp);
#endif
#else
close((int)fp);
#endif
return count;
}