mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 21:40:33 +05:00
Script to generate rules cpp files, update makerlsfile.cpp
This commit is contained in:
parent
349c79ed21
commit
88c114e999
12
rules/make_all_rules.sh
Executable file
12
rules/make_all_rules.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
g++ makerlsfile.cpp -o makerls
|
||||||
|
./makerls hexa.rls ../libsrc/meshing/hexarls.cpp hexrules
|
||||||
|
./makerls prisms2.rls ../libsrc/meshing/prism2rls.cpp prismrules2
|
||||||
|
./makerls pyramids.rls ../libsrc/meshing/pyramidrls.cpp pyramidrules
|
||||||
|
./makerls pyramids2.rls ../libsrc/meshing/pyramid2rls.cpp pyramidrules2
|
||||||
|
./makerls quad.rls ../libsrc/meshing/quadrls.cpp quadrules
|
||||||
|
./makerls tetra.rls ../libsrc/meshing/tetrarls.cpp tetrules
|
||||||
|
./makerls triangle.rls ../libsrc/meshing/triarls.cpp triarules
|
||||||
|
rm makerls
|
||||||
|
|
||||||
|
# node: prisms2rls is currently not used (prism2rls_2.cpp is not compiled)
|
||||||
|
# ./makerls prisms2.rls ../libsrc/meshing/prism2rls_2.cpp prismrules2
|
@ -8,9 +8,9 @@ using namespace std;
|
|||||||
|
|
||||||
int main (int argc, char ** argv)
|
int main (int argc, char ** argv)
|
||||||
{
|
{
|
||||||
if (argc != 3)
|
if (argc != 4)
|
||||||
{
|
{
|
||||||
cout << "use: makerlsfile infile outfile" << endl;
|
cout << "use: makerlsfile infile outfile rulename" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,8 +28,10 @@ int main (int argc, char ** argv)
|
|||||||
|
|
||||||
ifstream inf (argv[1]);
|
ifstream inf (argv[1]);
|
||||||
ofstream outf (argv[2]);
|
ofstream outf (argv[2]);
|
||||||
|
string rulename = argv[3];
|
||||||
|
|
||||||
outf << "const char * ngscript[] = {" << endl;
|
outf << "namespace netgen" << endl << '{' << endl;
|
||||||
|
outf << "const char * " << rulename << "[] = {" << endl;
|
||||||
while (inf.good())
|
while (inf.good())
|
||||||
{
|
{
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -61,5 +63,6 @@ int main (int argc, char ** argv)
|
|||||||
outf << "\"" << line << "\\n\",\\" << endl;
|
outf << "\"" << line << "\\n\",\\" << endl;
|
||||||
}
|
}
|
||||||
outf << "0};" << endl;
|
outf << "0};" << endl;
|
||||||
|
outf << '}' << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user