<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi.<br>
      <br>
      The dgfwriter knows nothing about the gmsh file. It just takes a
      constructed grid and<br>
      produces a dgf file from the leaf level of that grid. Boundary id
      are written to that file<br>
      taking the intersection.boundaryId method which is not standard. <br>
      <br>
      The gmsh writer might read your id but it is not used during grid
      creation so the <br>
      grid that the gmsh reader produces does not have those ids any
      more (but just a default 1).<br>
      <br>
      My question is now: <br>
      does the gmsh reader store the boundary ds that it obtained from
      the<br>
      gmsh file and does it have some method so that the user can
      extract them after grid creation <br>
      something like gmshreader.boundaryData( intersection ) or
      whatever. <br>
      <br>
      If it does you can go into the dgfwriter.hh and modify the line
      where it<br>
      uses the method intersection.boundaryId() replacing it with the <br>
      gmshreader.boundaryData( intersection ) method or whatever the
      Gmsh reader provides<br>
      to access the data provided in the gmsh file (provide it has such
      a method in place).<br>
      <br>
      Hope that clears it up<br>
      Andreas<br>
      <br>
      On 27/06/14 11:45, Jelena Grižić wrote:<br>
    </div>
    <blockquote
cite="mid:CABBkLKjZ4tfXdNBzFeoEyXeb4kCPc4d-X1-ZTEUUyEDTF=5r9w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Gmsh writes elements this way:<br>
          <br>
          elm-number elm-type number-of-tags < tag > ...
          node-number-list<br>
          <br>
          In my code there are two tags: physical entity (which has to
          be written to boundarysegments block of dgf file) and
          elementary geometrical entity.<br>
          <br>
          Part of gmsh reader responsible for "reading" boundary
          elements:<br>
          <br>
          for (int i=1; i<=number_of_elements; i++)<br>
                {<br>
                  int id, elm_type, number_of_tags;<br>
                  readfile(file,3,"%d %d %d
          ",&id,&elm_type,&number_of_tags);<br>
                  int physical_entity = -1;<br>
                  std::vector<int> mesh_partitions;<br>
                  if ( version_number < 2.2 )<br>
                  {<br>
                    mesh_partitions.resize(1);<br>
                  }<br>
                  for (int k=1; k<=number_of_tags; k++)<br>
                  {<br>
                    int blub;<br>
                    readfile(file,1,"%d ",&blub);       ->  PICKS
          UP PHYSICAL ENTITY FROM FILE<br>
                    if (k==1) physical_entity = blub;  ->SAVING
          PHYSICAL ENTITY FOR PASSING FURTHER<br>
                    // k == 2: elementary entity (not used here)<br>
                    if ( version_number < 2.2 )<br>
                    {<br>
                      if (k==3) mesh_partitions[0] = blub;<br>
                    }<br>
                    else<br>
                    {<br>
                      if (k > 3)<br>
                        mesh_partitions[k-4] = blub;<br>
                      else<br>
                        mesh_partitions.resize(blub);<br>
                    }<br>
                  }<br>
                  pass2HandleElement(file, elm_type, renumber, nodes,
          physical_entity);<br>
                }<br>
          <br>
        </div>
        Reader picks up wright physical entities (checked by printing
        them out)  but I coudn't figure out where they "get lost" on the
        way to dgf writer.<br>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">2014-06-27 12:00 GMT+02:00 <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:dune-request@dune-project.org"
              target="_blank">dune-request@dune-project.org</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            Send Dune mailing list submissions to<br>
                    <a moz-do-not-send="true"
              href="mailto:dune@dune-project.org">dune@dune-project.org</a><br>
            <br>
            To subscribe or unsubscribe via the World Wide Web, visit<br>
                    <a moz-do-not-send="true"
              href="http://lists.dune-project.org/mailman/listinfo/dune"
              target="_blank">http://lists.dune-project.org/mailman/listinfo/dune</a><br>
            or, via email, send a message with subject or body 'help' to<br>
                    <a moz-do-not-send="true"
              href="mailto:dune-request@dune-project.org">dune-request@dune-project.org</a><br>
            <br>
            You can reach the person managing the list at<br>
                    <a moz-do-not-send="true"
              href="mailto:dune-owner@dune-project.org">dune-owner@dune-project.org</a><br>
            <br>
            When replying, please edit your Subject line so it is more
            specific<br>
            than "Re: Contents of Dune digest..."<br>
            <br>
            Today's Topics:<br>
            <br>
               1. Re: Fwd: gmsh2dgf (Oliver Sander)<br>
               2. Re: Fwd: gmsh2dgf (Andreas Dedner)<br>
            <br>
            <br>
            ---------- Proslijeđena poruka ----------<br>
            From: Oliver Sander <<a moz-do-not-send="true"
              href="mailto:sander@igpm.rwth-aachen.de">sander@igpm.rwth-aachen.de</a>><br>
            To: <a moz-do-not-send="true"
              href="mailto:dune@dune-project.org">dune@dune-project.org</a><br>
            Cc: <br>
            Date: Thu, 26 Jun 2014 15:53:23 +0200<br>
            Subject: Re: [Dune] Fwd: gmsh2dgf<br>
            Hi,<br>
            I don't know much about either dgf or the
            EXPERIMENTAL_GRID_EXTENSIONS.<br>
            It may well be that the gmshreader contains a bug (it was me
            who wrote parts<br>
            of it, after all :-) ) but to look into that we'd need a
            more precise<br>
            report of what's going wrong.<br>
            Best,<br>
            Oliver<br>
            <br>
            Am <a moz-do-not-send="true" href="tel:26.06.2014%2011"
              value="+12606201411">26.06.2014 11</a>:52, schrieb Andreas
            Dedner:<br>
            > Hi,<br>
            ><br>
            > Since you are getting the boundarysegment block in your
            dgf file, you seem to be using<br>
            > the DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS so that
            intersection.boundaryId() is<br>
            > available. The problem is that adding boundary ids was
            decided to be unnecessary.<br>
            > I don't know that much about the gmsh format or the
            reader to know if boundary id information<br>
            > from the gmsh file is in some way passed on to the
            user. If so it will not be made available ithriough<br>
            > the intersection.boundaryId method but stored somehow
            externally and you will have to modify the<br>
            > code in io/file/dgfparser/dgfwriter.hh accordingly<br>
            > (search for iit->boundaryId(); and replace that
            call).<br>
            ><br>
            > Perhaps experts on gmsh to provide the way to get the
            boundary ids out of the gmsh file.<br>
            ><br>
            > Best<br>
            > Andreas<br>
            ><br>
            ><br>
            > On 26/06/14 07:19, Jelena Griz(ic' wrote:<br>
            >> Dear all,<br>
            >><br>
            >> I have a problem using gmsh2dgf (also applies to
            gmshreader.hh): it doesn't seem to pick boundary segment ids
            from.msh file rather using some default value (1) for all
            boundary elements.<br>
            >><br>
            >> Example of .msh and .dgf file obtained using
            gmsh2dgf are in attachment.<br>
            >><br>
            >> Thank you in advance,<br>
            >><br>
            >> Jelena Grizic<br>
            >><br>
            >><br>
            >><br>
            >> _______________________________________________<br>
            >> Dune mailing list<br>
            >> <a moz-do-not-send="true"
              href="mailto:Dune@dune-project.org">Dune@dune-project.org</a><br>
            >> <a moz-do-not-send="true"
              href="http://lists.dune-project.org/mailman/listinfo/dune"
              target="_blank">http://lists.dune-project.org/mailman/listinfo/dune</a><br>
            ><br>
            ><br>
            ><br>
            ><br>
            > _______________________________________________<br>
            > Dune mailing list<br>
            > <a moz-do-not-send="true"
              href="mailto:Dune@dune-project.org">Dune@dune-project.org</a><br>
            > <a moz-do-not-send="true"
              href="http://lists.dune-project.org/mailman/listinfo/dune"
              target="_blank">http://lists.dune-project.org/mailman/listinfo/dune</a><br>
            ><br>
            <br>
            <br>
            <br>
            <br>
            ---------- Proslijeđena poruka ----------<br>
            From: Andreas Dedner <<a moz-do-not-send="true"
              href="mailto:a.s.dedner@warwick.ac.uk">a.s.dedner@warwick.ac.uk</a>><br>
            To: <<a moz-do-not-send="true"
              href="mailto:dune@dune-project.org">dune@dune-project.org</a>><br>
            Cc: <br>
            Date: Thu, 26 Jun 2014 16:28:19 +0100<br>
            Subject: Re: [Dune] Fwd: gmsh2dgf<br>
            <div text="#000000" bgcolor="#FFFFFF">
              <div>My question has nothing to do with dgf or
                experimental grid extensions.<br>
                The dgfwriter just takes a grid and used the
                intersection.boundaryId() method to write<br>
                the ids into the file (that method is now only available
                with DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS <br>
                So that will not work since the gmsh reader will not set
                these boundaryId so that this<br>
                metod could actually read them. <br>
                <br>
                So the question is: how can the user extract boundary
                data provided in a gmsh file using the<br>
                gmsh reader. So just a question about gmsh and the
                reader not about dgf or any grid extensions....<br>
                <br>
                Best<br>
                Andreas<br>
                <br>
                On 26/06/14 14:53, Oliver Sander wrote:<br>
              </div>
              <blockquote type="cite">
                <pre>Hi,
I don't know much about either dgf or the EXPERIMENTAL_GRID_EXTENSIONS.
It may well be that the gmshreader contains a bug (it was me who wrote parts
of it, after all :-) ) but to look into that we'd need a more precise
report of what's going wrong.
Best,
Oliver

Am <a moz-do-not-send="true" href="tel:26.06.2014%2011" value="+12606201411" target="_blank">26.06.2014 11</a>:52, schrieb Andreas Dedner:
</pre>
                <blockquote type="cite">
                  <pre>Hi,

Since you are getting the boundarysegment block in your dgf file, you seem to be using
the DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS so that intersection.boundaryId() is
available. The problem is that adding boundary ids was decided to be unnecessary.
I don't know that much about the gmsh format or the reader to know if boundary id information
from the gmsh file is in some way passed on to the user. If so it will not be made available ithriough
the intersection.boundaryId method but stored somehow externally and you will have to modify the
code in io/file/dgfparser/dgfwriter.hh accordingly
(search for iit->boundaryId(); and replace that call).

Perhaps experts on gmsh to provide the way to get the boundary ids out of the gmsh file.

Best
Andreas


On 26/06/14 07:19, Jelena Griz(ic' wrote:
</pre>
                  <blockquote type="cite">
                    <pre>Dear all,

I have a problem using gmsh2dgf (also applies to gmshreader.hh): it doesn't seem to pick boundary segment ids from.msh file rather using some default value (1) for all boundary elements.

Example of .msh and .dgf file obtained using gmsh2dgf are in attachment.

Thank you in advance,

Jelena Grizic



_______________________________________________
Dune mailing list
<a moz-do-not-send="true" href="mailto:Dune@dune-project.org" target="_blank">Dune@dune-project.org</a>
<a moz-do-not-send="true" href="http://lists.dune-project.org/mailman/listinfo/dune" target="_blank">http://lists.dune-project.org/mailman/listinfo/dune</a>
</pre>
                  </blockquote>
                  <pre>

_______________________________________________
Dune mailing list
<a moz-do-not-send="true" href="mailto:Dune@dune-project.org" target="_blank">Dune@dune-project.org</a>
<a moz-do-not-send="true" href="http://lists.dune-project.org/mailman/listinfo/dune" target="_blank">http://lists.dune-project.org/mailman/listinfo/dune</a>

</pre>
                </blockquote>
                <br>
                <fieldset></fieldset>
                <br>
                <pre>_______________________________________________
Dune mailing list
<a moz-do-not-send="true" href="mailto:Dune@dune-project.org" target="_blank">Dune@dune-project.org</a>
<a moz-do-not-send="true" href="http://lists.dune-project.org/mailman/listinfo/dune" target="_blank">http://lists.dune-project.org/mailman/listinfo/dune</a>
</pre>
              </blockquote>
              <br>
            </div>
            <br>
            _______________________________________________<br>
            Dune mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:Dune@dune-project.org">Dune@dune-project.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.dune-project.org/mailman/listinfo/dune"
              target="_blank">http://lists.dune-project.org/mailman/listinfo/dune</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Dune mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dune@dune-project.org">Dune@dune-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.dune-project.org/mailman/listinfo/dune">http://lists.dune-project.org/mailman/listinfo/dune</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>