[MOAB-dev] Neumann boundary condition

Tim Tautges (ANL) tautges at mcs.anl.gov
Thu Dec 12 16:09:22 CST 2013


And regarding boundary conditions: the NEUMANN_SET tag is of type integer, and is meant to identify and keep separate 
the different neumann boundary condition *groupings*.  The physical property that constitutes the boundary condition, 
e.g. mass flux across a face, would appear as a different tag, probably on that set.  That assumes you're accessing the 
boundary condition in a loop over faces in that set.  If you're looping over hexes and want to get whether a boundary 
condition is associated with a face (i.e. you need random access from a face handle) you might be better off storing the 
flux value on each face (it's a speed-memory tradeoff, and MOAB usually chooses memory before speed, assuming you can 
loop over those groupings without needing random access).


- tim

On 12/11/2013 06:00 PM, Iulian Grindeanu wrote:
>
>
> ------------------------------------------------------------------------------------------------------------------------
>
>         What solver do you use?
>
>     I'm trying to implement MOAB in our CFD code
>
>         Again, I don't understand the  question, what do you need?
>
>     Initially i've got only nodes and hexes.
>
>     Every time step i've got loop over cells (hexes). For each cell the scheme demands info from its each face. I can
>     get faces with get_adjacencies method. I've read somewhere that after first calling of that method MOAB stores faces
>     array internally to speed up future calls. Or i should better store them myself before time-stepping?
>
> moab, after first adjacency call, will store up-vertex adjacencies (so for each vertex in the mesh, what are the
> entities adjacent to each vertex; it will be a list ordered by handles, it will contain edges, faces, hexas)
> In your case, you should first create all faces with get_adjacency() call, with create = true
> No edges will be created if you do not request it.
>
> These lists (upvertex adjacencies) will be used for subsequent adjacency calls, to determine the adjacency between a
> face and a hex, for example;
>
> If you do it many times, it may be better to store those adjacencies yourself, in your arrays/data
>
>         Opposing face to what?
>
>     For each face X i also have to get two faces which are:
>
>     - belong to the cells sharing face X
>
>     - not having common vertices with face X
>
>     That's what i meant by faces lying opposite to face X
>
>     Sorry for not always being clear
>
> You can use for this:
> ErrorCode MeshTopoUtil::opposite_entity(const EntityHandle parent,
>                                            const EntityHandle child,
>                                            EntityHandle &opposite_element)
>
> Again, if you do it many times, it may be  better to store that info somewhere else.
>
> be careful about orientation of the face within a hexa; you can use side_number to see how are they oriented
> (so one face between 2 hexas will be oriented positively for one, and negatively for the other one; moab convention is
> positive if its normal points outward)
>
>     Thanks
>
> Best Regards,
> Iulian
>
>
>     On Wed, 11 Dec 2013 16:56:35 -0600 (CST), Iulian Grindeanu wrote:
>
>         p { margin: 0; }
>
>
>         ------------------------------------------------------------------------------------------------------------------------
>
>             So, as i can understand, any value of NEUMANN_SET tag corresponds to some certain rule implemented in solver
>
>         the value is set by the user, but used by the solver. What solver do you use? for moab, the value is just an
>         integer, and should be unique for each set, but it is not mandatory. It is really just a way to group and
>         differentiate boundary conditions;
>
>             I've got one more question - having only nodes and hexagonals in .h5m mesh file, what is the best way to
>             find and store the opposite face from the neighbouring cell for each hexagonal's face?
>
>         hexagons? I assume you mean hexahedra, because you are asking about "faces". A hexagon is 2d, it has only one
>         face, in moab terms.
>         a hexahedron has 6 faces.
>
>         a hexahedron can have though 6 neighbors, with which shares a face (unless it is on the boundary).
>         Again, I don't understand the  question, what do you need?
>         from each hexahedron, you get the connected vertices with get_connectivity; you can get adjacent faces with
>         get_adjacencies method.
>
>         Opposing face to what?
>         A common face between 2 hexagons can be found with get_adjacencies method too, something like this:
>         std::vector adjacencies, from_entities = {hex1, hex2};
>              // generate common face between these 2 hexas, if it exists
>              mb->get_adjacencies( from_entities, 2, 2, true, adjacencies, Interface::INTERSECT);
>
>         // adjacencies.size() should be 1 (or 0, if the hexes for not share a face)
>
>         Iulian
>
>             Thanks
>
>
>             On Wed, 11 Dec 2013 15:25:00 -0600 (CST), Iulian Grindeanu wrote:
>
>                 p { margin: 0; }
>                 programmatically?
>                 a neumann set in moab is usually a set of boundary faces (quads in a hexahedral mesh, or triangles in a
>                 tetrahedral mesh)
>                 what kind of solver do you have?
>                 if you know the tag value, you can obtain the set that has that tag value, with something like
>                            Range neumann_sets;
>                            Tag neu_tag;
>                            int value_neumann_tag= 100; // your value, set it accordingly
>
>                            mb->tag_get_handle(NEUMANN_SET_TAG_NAME, neu_tag, 1, MB_TYPE_INTEGER);
>                            mb->get_entities_by_type_and_tag(0, MBENTITYSET, &neu_tag, &value_neumann_tag, 1, neumann_sets);
>
>                 neumann_sets[0] should be your  set.
>
>                   then you can get entities from it with
>                    Range entities;
>                       mb->get_entities_by_handle(neumann_sets[0],    entities);
>
>                 Entities should be your quads or triangles. it is up to the specific solver syntax to set pressure on
>                 them (or other BCs)
>
>                 Maybe I didn't understand your question
>
>                 Iulian
>                 ------------------------------------------------------------------------------------------------------------------------
>
>                     Hello MOAB-dev,
>
>                     Can you please explain how can i set a certain Neumann boundary condition
>                     for selected set of faces via NEUMANN_SET tag?
>
>                     For example the normal derivative of pressure
>
>                     Thanks
>                     Anton
>
>
>
>

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
  phone (gvoice): (608) 354-1459      1500 Engineering Dr.
             fax: (608) 263-4499      Madison, WI 53706



More information about the moab-dev mailing list