545int main(
int argc,
char**argv) {
551 bool do_upgrade = false ;
552 bool do_check = false ;
553 bool do_add_bdry = false ;
554 bool do_stereo = false ;
555 bool show_n_element = false ;
556 bool show_n_vertex = false ;
557 bool show_sys_coord = false ;
558 bool show_hmin = false ;
559 bool show_hmax = false ;
560 bool show_xmin = false ;
561 bool show_xmax = false ;
562 bool show_min_element_measure = false ;
563 bool show_max_element_measure = false ;
564 bool do_round = false ;
565 Float round_prec =
pow(10., -std::numeric_limits<Float>::digits10/2);
566 std::string name =
"output";
567 dout.os() << verbose;
bool bverbose =
true;
570 dout.os() << lattice;
573 dout.os() << showlabel;
575 dout.os() << setnormal(
point(-0.015940197423022637, -0.9771157601293953, -0.21211011624358989));
576 dout.os() << setorigin(
point(std::numeric_limits<Float>::max()));
577 std::string filename;
578 std::string input_format =
"geo";
579 std::string sys_coord =
"";
583 for (
int i = 1; i < argc; i++) {
586 if (strcmp (argv[i],
"-clean") == 0) dout.os() << clean;
587 else if (strcmp (argv[i],
"-noclean") == 0) dout.os() << noclean;
588 else if (strcmp (argv[i],
"-execute") == 0) dout.os() << execute;
589 else if (strcmp (argv[i],
"-noexecute") == 0) dout.os() << noexecute;
590 else if (strcmp (argv[i],
"-verbose") == 0) { bverbose =
true; dout.os() << verbose; }
591 else if (strcmp (argv[i],
"-noverbose") == 0) { bverbose =
false; dout.os() << noverbose; }
592 else if (strcmp (argv[i],
"-add-boundary") == 0) { do_add_bdry =
true; }
593 else if (strcmp (argv[i],
"-rz") == 0) { sys_coord =
"rz"; }
594 else if (strcmp (argv[i],
"-zr") == 0) { sys_coord =
"zr"; }
595 else if (strcmp (argv[i],
"-size") == 0) { show_n_element =
true; }
596 else if (strcmp (argv[i],
"-n-element") == 0) { show_n_element =
true; }
597 else if (strcmp (argv[i],
"-n-vertex") == 0) { show_n_vertex =
true; }
598 else if (strcmp (argv[i],
"-sys-coord") == 0) { show_sys_coord =
true; }
599 else if (strcmp (argv[i],
"-hmin") == 0) { show_hmin =
true; }
600 else if (strcmp (argv[i],
"-hmax") == 0) { show_hmax =
true; }
601 else if (strcmp (argv[i],
"-xmin") == 0) { show_xmin =
true; }
602 else if (strcmp (argv[i],
"-xmax") == 0) { show_xmax =
true; }
603 else if (strcmp (argv[i],
"-min-element-measure") == 0) { show_min_element_measure =
true; }
604 else if (strcmp (argv[i],
"-max-element-measure") == 0) { show_max_element_measure =
true; }
605 else if (strcmp (argv[i],
"-I") == 0) {
606 if (i == argc-1) { std::cerr <<
"geo -I: option argument missing" << std::endl;
usage(); }
611 else if (strcmp (argv[i],
"-geo") == 0) { dout.os() <<
rheo; render =
file_render; }
612 else if (strcmp (argv[i],
"-gmsh") == 0) { dout.os() <<
gmsh; render =
gmsh_render; }
619 else if (strcmp (argv[i],
"-full") == 0) { dout.os() << full; }
620 else if (strcmp (argv[i],
"-nofull") == 0) { dout.os() << nofull; }
621 else if (strcmp (argv[i],
"-fill") == 0) { dout.os() << fill; }
622 else if (strcmp (argv[i],
"-nofill") == 0) { dout.os() << nofill; }
623 else if (strcmp (argv[i],
"-stereo") == 0) { dout.os() << stereo; do_stereo =
true; }
624 else if (strcmp (argv[i],
"-nostereo") == 0) { dout.os() << nostereo; }
625 else if (strcmp (argv[i],
"-cut") == 0) { dout.os() << cut; }
626 else if (strcmp (argv[i],
"-nocut") == 0) { dout.os() << nocut; }
627 else if (strcmp (argv[i],
"-shrink") == 0) { dout.os() << shrink; }
628 else if (strcmp (argv[i],
"-noshrink") == 0) { dout.os() << noshrink; }
629 else if (strcmp (argv[i],
"-lattice") == 0) { dout.os() << lattice; }
630 else if (strcmp (argv[i],
"-nolattice") == 0) { dout.os() << nolattice; }
631 else if (strcmp (argv[i],
"-showlabel") == 0) { dout.os() << showlabel; }
632 else if (strcmp (argv[i],
"-noshowlabel") == 0){ dout.os() << noshowlabel; }
633 else if (strcmp (argv[i],
"-subdivide") == 0) {
634 if (i == argc-1) { std::cerr <<
"geo -subdivide: option argument missing" << std::endl;
usage(); }
635 size_t nsub = atoi(argv[++i]);
636 dout.os() << setsubdivide (nsub);
638 else if (strcmp (argv[i],
"-image-format") == 0) {
639 if (i == argc-1) { std::cerr <<
"geo -image-format: option argument missing" << std::endl;
usage(); }
640 std::string format = argv[++i];
641 if (format ==
"jpeg") format =
"jpg";
642 if (format ==
"postscript") format =
"ps";
643 dout.os() << setimage_format(format);
645 else if (strcmp (argv[i],
"-resolution") == 0) {
646 if (i == argc-1 || !isdigit(argv[i+1][0])) { std::cerr <<
"geo -resolution: option argument missing" << std::endl;
usage(); }
647 size_t nx = atoi(argv[++i]);
648 size_t ny = (i < argc-1 && isdigit(argv[i+1][0])) ? atoi(argv[++i]) : nx;
651 else if (strcmp (argv[i],
"-round") == 0) {
654 if (i+1 < argc &&
is_float(argv[i+1])) {
659 else if (strcmp (argv[i],
"-upgrade") == 0) { do_upgrade =
true; dout.os() <<
rheo; render =
file_render; }
660 else if (strcmp (argv[i],
"-check") == 0) { do_check =
true; }
661 else if (strcmp (argv[i],
"-name") == 0) {
662 if (i == argc-1) { std::cerr <<
"geo -name: option argument missing" << std::endl;
usage(); }
665 else if (strcmp (argv[i],
"-if") == 0 ||
666 strcmp (argv[i],
"-input-format") == 0) {
667 if (i == argc-1) { std::cerr <<
"geo "<<argv[i]<<
": option argument missing" << std::endl;
usage(); }
668 input_format = argv[++i];
670 else if (strcmp (argv[i],
"-") == 0) {
673 else if (argv[i][0] !=
'-') {
681 if (filename ==
"") {
682 std::cerr <<
"geo: no input file specified" << std::endl;
684 }
else if (filename ==
"-") {
686 if (do_upgrade) std::cin >> upgrade;
688 if (name !=
"output") thename = name;
689 std::cin >> setbasename(thename);
692 dout.os() << setbasename(name) << reader_on_stdin;
695 std::string suffix = input_format;
696 if (name ==
"output") {
700 ips.
open (filename, suffix);
701 check_macro(ips.
good(),
"\"" << filename <<
"[."<<suffix<<
"[.gz]]\" not found.");
702 if (do_upgrade) ips.
is() >> upgrade;
705 ips.
is() >> setbasename(name);
708 dout.os() << setbasename(name);
710 if (sys_coord !=
"") { omega.set_coordinate_system(sys_coord); }
711 if (do_add_bdry) { omega.boundary(); }
714 size_t nsub = iorheo::getsubdivide (std::cout);
717 new_omega.build_by_subdividing (omega, nsub);
722 check_macro (omega.check(bverbose),
"geo check failed");
724 bool show = show_min_element_measure
725 || show_max_element_measure
726 || show_hmin || show_hmax
727 || show_xmin || show_xmax
728 || show_n_element || show_n_vertex || show_sys_coord;
730 if (show_hmin) { dout <<
"hmin = " << omega.hmin() << std::endl; }
731 if (show_hmax) { dout <<
"hmax = " << omega.hmax() << std::endl; }
732 if (show_xmin) { dout <<
"xmin = " << omega.xmin() << std::endl; }
733 if (show_xmax) { dout <<
"xmax = " << omega.xmax() << std::endl; }
734 if (show_n_element) { dout <<
"size = " << omega.dis_size() << std::endl; }
735 if (show_n_vertex) { dout <<
"n_vertex = " << omega.dis_size(0) << std::endl; }
736 if (show_sys_coord) { dout <<
"sys_coord = " << omega.coordinate_system_name() << std::endl; }
737 if (show_min_element_measure) {
740 if (show_max_element_measure) {
746 dout.os() << setrounding_precision(round_prec);
750#if (_RHEOLEF_PARAVIEW_VERSION_MAJOR >= 5) && (_RHEOLEF_PARAVIEW_VERSION_MINOR >= 5)
752 if (do_stereo || omega.dimension() >= 2) {
754 if (do_stereo || omega.dimension() == 3) {