On 06/06/2017 04:43 AM, Lam DANG wrote:
Dear All

I use /write_ucd/ with /flags.write_faces = true/, but the result of .ucd file is *lack of information of face id 0.*
How I can output the information of face id 0?

The piece of code:
/    Triangulation<2> triangulation;
     GridGenerator::hyper_cube (triangulation, 0, 1, true);
     GridOut grid_out_ucd;
     GridOutFlags::Ucd flags;
     flags.write_faces = true;
     grid_out_ucd.set_flags(flags);
     std::ofstream out_ucd ("triangulation.ucd");
     grid_out_ucd.write_ucd (triangulation, out_ucd);/

The result of "/triangulation.ucd/"
/4 4 0 0 0
1  0 0 0
2  1 0 0
3  0 1 0
4  1 1 0
1 0 quad    1 2 4 3
2  2  line    1 2
3  1  line    2 4
4  3  line    3 4 /

The information of line 0 (/5 0 line 1 3/) is not in output file

For reasons that are no longer entirely clear to me, GridOut documents this behavior as follows:

  struct Ucd
  {
    [...]

    /**
* When writing a mesh, write boundary faces explicitly if their boundary * indicator is not the default boundary indicator, which is zero. This * is necessary if you later want to re-read the grid and want to get the * same boundary indicators for the different parts of the boundary of the
     * triangulation.
     *
* It is not necessary if you only want to write the triangulation to view
     * or print it.
     *
     * Default: @p false.
     */
    bool write_faces;

In other words, it *purposefully* omits faces with a zero boundary indicator. In your case, since you are "coloring" the cube upon mesh generation, the face that's omitted is exactly the one that has boundary indicator zero.

In other words, the function really does as is intended. What the original intent of the rule to omit faces with zero boundary indicator is not completely clear to me any more, however.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 [email protected]
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to