initial upload

This commit is contained in:
2024-09-10 20:25:18 +08:00
parent b8de03ee4f
commit f1cc876972
377 changed files with 2721267 additions and 34 deletions

View File

@@ -0,0 +1,75 @@
/*
tetgen2gmsh: <20><>ȡtetgen<65>ļ<EFBFBD><C4BC><EFBFBD>.node\.ele\.face\.edge<67><65>ת<EFBFBD><D7AA>Ϊ.msh<73>ļ<EFBFBD><C4BC><EFBFBD>tetgen<65><6E>Ȼ<EFBFBD><C8BB>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.msh<73><68>
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>.pos<6F>ļ<EFBFBD>
*/
#include "tetgen2gmsh.h"
void disp_help()
{
cout<<"tetgen2gmsh 0.0.1 - convert tetgen files(.node& .edge& .face& .ele) to gmsh(.msh) file"<<endl<<endl
<<"usage: tetgen2msh input_file [-o<output-file>]"<<endl
<<" -o specify output file's name, the input name will be used if -o is absent"<<endl
<<" the extensions of input and output files will be added atuomaticly"<<endl<<endl
<<"example: tetgen2gmsh in -otest"<<endl;
}
int typeget(char *str, const char* str2,string &str3)//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD>˵<EFBFBD><CBB5>Ӿ<EFBFBD>
{
char* strp = strstr(str, str2); // <20><><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>str<74>в<EFBFBD><D0B2><EFBFBD>str2<72><32>
if (strp == NULL)
{
return 0; // <20><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
string temp = str;
str3=temp.substr(strlen(str2));//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>str2<72><32><EFBFBD><EFBFBD><EFBFBD>Ӿ<EFBFBD>
return 1;
}
//tetgen2gmsh p1;
//p1.call_back();
int main(int argc, char* argv[])
{
string innname="";
string outname="";
string temp;
if (argc==1)
{
disp_help();
}
else if (argc==2)
{
innname=outname=argv[1];
tetgen2gmsh p1;
p1.call_back(innname,outname);
}
else
{
innname=argv[1];
for (int i = 2; i < argc; i++)
{
if (typeget(argv[i],OUTPUT,temp))
{
if (temp=="")
{
cout<<"no output picked, program stopped..."<<endl;
return 0;
}
else outname = temp;
}
}
if (outname=="")
{
cout<<"no output picked, program stopped..."<<endl;
return 0;
}
else
{
tetgen2gmsh p1;
p1.call_back(innname,outname);
}
}
return 0;
}