<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'><br><br><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><blockquote style="padding-left: 5px; border-left-color: #1010ff; border-left-width: 2px; border-left-style: solid; margin-left: 5px; width: 1109px">
<div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt">
<span style="font-size: 12pt">What solver do you use? </span><span style="font-size: 12pt"> </span><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px"> </span>
</div>
</blockquote>
<p>
I'm trying to implement MOAB in our CFD code
</p>
<blockquote style="padding-left: 5px; border-left-color: #1010ff; border-left-width: 2px; border-left-style: solid; margin-left: 5px; width: 1109px">
<div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt">
<span style="font-size: 12pt">Again, I don't understand the question, what do you need?</span><span style="font-size: 12pt"> </span>
</div>
</blockquote>
<p>
Initially i've got only nodes and hexes.
</p>
<p>
</p>
<p>
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?
</p>
<p id="DWT486">
</p></blockquote>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)<br>In your case, you should first create all faces with get_adjacency() call, with create = true<br>No edges will be created if you do not request it. <br><br>These lists (upvertex adjacencies) will be used for subsequent adjacency calls, to determine the adjacency between a face and a hex, for example; <br><br>If you do it many times, it may be better to store those adjacencies yourself, in your arrays/data <br><br><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><p></p>
<blockquote style="padding-left: 5px; border-left-color: #1010ff; border-left-width: 2px; border-left-style: solid; margin-left: 5px; width: 1109px">
<div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt">
Opposing face to what?
</div>
</blockquote>
<p>
</p>
<p>
For each face X i also have to get two faces which are:
</p>
<p>
- belong to the cells sharing face X
</p>
<p>
- not having common vertices with face X
</p>
<p>
That's what i meant by faces lying opposite to face X
</p>
<p>
</p>
<p>
Sorry for not always being clear
</p>
<p id="DWT487">
</p></blockquote>You can use for this:<br><font face="courier new,courier,monaco,monospace,sans-serif">ErrorCode MeshTopoUtil::opposite_entity(const EntityHandle parent,<br> const EntityHandle child,<br> EntityHandle &opposite_element) </font><br><br>Again, if you do it many times, it may be better to store that info somewhere else. <br><br>be careful about orientation of the face within a hexa; you can use side_number to see how are they oriented<br>(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)<br><br><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><p></p>
<p>
Thanks
</p>
<p id="DWT488">
</p></blockquote>Best Regards,<br>Iulian<br><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><p></p>
<p>
</p>
<p>
<br>
On Wed, 11 Dec 2013 16:56:35 -0600 (CST), Iulian Grindeanu wrote:
</p>
<blockquote style="padding-left: 5px; border-left-color: #1010ff; border-left-width: 2px; border-left-style: solid; margin-left: 5px; width: 100%">
p { margin: 0; }
<div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; color: #000000">
<br>
<br>
<hr>
<blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt">
<p>
<font face="arial, helvetica, sans-serif"><font size="2">So, as i can understand, any value of NEUMANN_SET tag corresponds to some certain rule implemented in solver</font></font>
</p>
</blockquote>
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; <br>
<blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt">
<p>
<font face="arial, helvetica, sans-serif"><font size="2"></font></font>
</p>
<p>
</p>
<p id="DWT331">
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?
</p>
</blockquote>
hexagons? I assume you mean hexahedra, because you are asking about "faces". A hexagon is 2d, it has only one face, in moab terms.<br>
a hexahedron has 6 faces.<br>
<br>
a hexahedron can have though 6 neighbors, with which shares a face (unless it is on the boundary).<br>
Again, I don't understand the question, what do you need? <br>
from each hexahedron, you get the connected vertices with get_connectivity; you can get adjacent faces with get_adjacencies method.<br>
<br>
Opposing face to what? <br>
A common face between 2 hexagons can be found with get_adjacencies method too, something like this:<br>
<font face="courier new,courier,monaco,monospace,sans-serif">std::vector adjacencies, from_entities = {hex1, hex2};<br>
// generate common face between these 2 hexas, if it exists<br>
mb->get_adjacencies( from_entities, 2, 2, true, adjacencies, Interface::INTERSECT);</font><br>
<br>
<font face="courier new,courier,monaco,monospace,sans-serif">// adjacencies.size() should be 1 (or 0, if the hexes for not share a face)</font><br>
<br>
Iulian<br>
<br>
<blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt">
<p>
</p>
<p>
</p>
<p>
Thanks
</p>
<p>
<br>
On Wed, 11 Dec 2013 15:25:00 -0600 (CST), Iulian Grindeanu wrote:
</p>
<blockquote style="padding-left: 5px; border-left-color: #1010ff; border-left-width: 2px; border-left-style: solid; margin-left: 5px; width: 100%">
p { margin: 0; }
<div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; color: #000000">
programmatically? <br>
a neumann set in moab is usually a set of boundary faces (quads in a hexahedral mesh, or triangles in a tetrahedral mesh)<br>
what kind of solver do you have? <br>
if you know the tag value, you can obtain the set that has that tag value, with something like<br>
<font face="courier new,courier,monaco,monospace,sans-serif"> Range neumann_sets;<br>
Tag neu_tag;<br>
int value_neumann_tag= 100; // your value, set it accordingly<br>
<br>
mb->tag_get_handle(NEUMANN_SET_TAG_NAME, neu_tag, 1, MB_TYPE_INTEGER);<br>
mb->get_entities_by_type_and_tag(0, MBENTITYSET, &neu_tag, &value_neumann_tag, 1, neumann_sets);</font><br>
<br>
neumann_sets[0] should be your set. <br>
<br>
then you can get entities from it with<br>
<font face="courier new,courier,monaco,monospace,sans-serif"> Range entities;<br>
mb->get_entities_by_handle(neumann_sets[0], entities);<br>
</font><br>
Entities should be your quads or triangles. it is up to the specific solver syntax to set pressure on them (or other BCs)<br>
<br>
Maybe I didn't understand your question<br>
<br>
Iulian<br>
<hr>
<blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt">
Hello MOAB-dev, <br>
<br>
Can you please explain how can i set a certain Neumann boundary condition<br>
for selected set of faces via NEUMANN_SET tag? <br>
<br>
For example the normal derivative of pressure <br>
<br>
Thanks<br>
Anton<br>
<br>
</blockquote>
<br>
</div>
</blockquote>
<p>
</p>
</blockquote>
<br>
</div>
</blockquote>
<p>
</p>
</blockquote><br></div></body></html>