~ubuntu-branches/ubuntu/trusty/rheolef/trusty

« back to all changes in this revision

Viewing changes to nfem/bin/xgeo.cc

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito
  • Date: 2012-04-06 09:12:21 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120406091221-m58me99p1nxqui49
Tags: 6.0-1
* New upstream release 6.0 (major changes):
  - massively distributed and parallel support
  - full FEM characteristic method (Lagrange-Gakerkin method) support
  - enhanced users documentation 
  - source code supports g++-4.7 (closes: #667356)
* debian/control: dependencies for MPI distributed solvers added
* debian/rules: build commands simplified
* debian/librheolef-dev.install: man1/* to man9/* added
* debian/changelog: package description rewritted (closes: #661689)

Show diffs side-by-side

added added

removed removed

Lines of Context:
546
546
        input_grummp, 
547
547
        input_gmsh, 
548
548
        input_qmg, 
549
 
        input_cemagref
 
549
        input_cemagref,
 
550
        input_peschetola
550
551
} input_type;
551
552
 
552
553
typedef enum { 
568
569
    bool has_geo = false;
569
570
    bool do_dump = false;
570
571
    bool do_check = false;
 
572
    bool use_tmp = false;
571
573
    string domain_names;
572
574
    string name = "output";
573
575
    string showdom = "";
594
596
 
595
597
             if (strcmp (argv[i], "-input-geo") == 0)      input_format = input_geo;
596
598
        else if (strcmp (argv[i], "-input-bamg") == 0)     input_format = input_bamg;
 
599
        else if (strcmp (argv[i], "-input-peschetola") == 0)     input_format = input_peschetola;
597
600
        else if (strcmp (argv[i], "-input-tetgen") == 0)   input_format = input_tetgen;
598
601
        else if (strcmp (argv[i], "-input-mmg3d") == 0)    input_format = input_mmg3d;
599
602
        else if (strcmp (argv[i], "-input-grummp") == 0)   input_format = input_grummp; 
635
638
 
636
639
        else if (strcmp (argv[i], "-check") == 0)     do_check = true;
637
640
        else if (strcmp (argv[i], "-dump") == 0)      do_dump = true;
 
641
        else if (strcmp ("-tmp",  argv [i]) == 0)     use_tmp=true; 
638
642
        
639
643
      // graphic options
640
644
 
691
695
 
692
696
            // input geo on standard input
693
697
                 if (input_format == input_bamg)     cin >> bamg;
 
698
            else if (input_format == input_peschetola)  {  cin >> peschetola; cerr << "PES";}
694
699
            else if (input_format == input_mmg3d)    cin >> mmg3d;
695
700
            else if (input_format == input_tetgen)   cin >> tetgen;
696
701
            else if (input_format == input_grummp)   cin >> grummp;
714
719
            usage();
715
720
        }
716
721
    }
 
722
    if (use_tmp) { name="/tmp/" + name; cerr << "tmp "<< name; }
717
723
    cout << setprecision(digits10);
718
724
    if (!has_geo) {
719
725
        cerr << "geo: no input specified" << endl;
744
750
        g.dump(cerr);
745
751
    }
746
752
    if (showdom!="") {
 
753
        domain d;
 
754
        if (showdom=="boundary") d=g.boundary();
 
755
        else {
747
756
        // Skip delimiters at beginning.
748
757
        showdom=showdom+"+";
749
758
        string::size_type lastPos = showdom.find_first_not_of("+", 0);
750
759
        // Find first "non-delimiter".
751
760
        string::size_type pos     = showdom.find_first_of("+", lastPos);
752
 
        domain d= g[showdom.substr(lastPos, pos - lastPos)];
 
761
        d= g[showdom.substr(lastPos, pos - lastPos)];
753
762
        while (string::npos != pos && string::npos != lastPos)
754
763
        {
755
764
            lastPos = showdom.find_first_not_of("+", pos);
758
767
            if (string::npos == pos) break;
759
768
            d=d+g[showdom.substr(lastPos, pos - lastPos)];
760
769
        };
 
770
        }
761
771
        g=geo(g, d);
762
772
        if (name=="output") cout << setbasename(showdom+"_from_"+name);
763
773
    }