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

« back to all changes in this revision

Viewing changes to nfem/lib/branch-paraview.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:
48
48
    vtk << setbasename(basename)
49
49
        << setprecision(numeric_limits<Float>::digits10);
50
50
 
 
51
    assert_macro (n_field() > 0, "empty branch (n_field = 0)");
 
52
    const field& u0 = operator[](0).second;
 
53
    string approx = u0.get_approx();
 
54
    const geo& g0 = u0.get_geo();
51
55
    field z = iofem::gettopography(out);
52
56
    if (z.size() != 0) {
53
57
        // elevation view using topography
55
59
                << " elevation field");
56
60
        z.put_vtk_2d_elevation_P1 (vtk);
57
61
    } else {
58
 
        assert_macro (n_field() > 0, "empty branch (n_field = 0)");
59
 
        geo g = operator[](0).second.get_geo();
60
 
        // vtk << vtkdata << g;
61
 
        vtk << vtkpolydata << g;
 
62
        if (approx == "P1" || approx == "P0" ) {
 
63
            vtk << vtkdata << g0;
 
64
        } else if (approx == "P2") {
 
65
            vtk << lattice << vtkdata << g0;
 
66
        } else if (approx == "P1d") {
 
67
            g0.data().put_vtk_P1d(vtk);
 
68
        } else {
 
69
            fatal_macro ("P0, P1, P1d or P2 approximation expected: `" << approx << "' founded");
 
70
        }
62
71
    }
63
72
    bool have_header = false;
64
73
    for (size_t i = 0; i < n_field(); i++) {
65
74
      const string& xname  = operator[](i).first;
66
75
      const field&  x      = operator[](i).second;
67
 
      check_macro (x.get_approx() == "P1", "unsupported " << x.get_approx()
68
 
        << " field (HINT: use the -proj option)");
 
76
      check_macro (x.get_approx() == approx,
 
77
        "field #"<<i<<" approx `"<<x.get_approx()<<"' incompatible with field #0 approx `"<<approx<<"'");
69
78
      if (x.get_valued() == "scalar") {
70
79
          x.put_vtk(vtk, xname, !have_header);
71
80
      } else if (x.get_valued() == "vector") {