<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div><br></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Tim Tautges <<a href="mailto:tautges@mcs.anl.gov">tautges@mcs.anl.gov</a>><br><span style="font-weight:bold">Date: </span> Tue, 14 Feb 2012 09:30:53 -0500<br><span style="font-weight:bold">To: </span> Christopher Mueller <<a href="mailto:cmueller@asascience.com">cmueller@asascience.com</a>><br><span style="font-weight:bold">Cc: </span> Iulian Grindeanu <<a href="mailto:iulian@mcs.anl.gov">iulian@mcs.anl.gov</a>>, David Stuebe <<a href="mailto:DStuebe@asascience.com">DStuebe@asascience.com</a>>, Guy De Wardener <<a href="mailto:gdewardener@asascience.com">gdewardener@asascience.com</a>>, don brittain <<a href="mailto:don.brittain@instanteffects.com">don.brittain@instanteffects.com</a>>, "<a href="mailto:moab-dev@mcs.anl.gov">moab-dev@mcs.anl.gov</a>" <<a href="mailto:moab-dev@mcs.anl.gov">moab-dev@mcs.anl.gov</a>><br><span style="font-weight:bold">Subject: </span> Re: [MOAB-dev] Questions about Tags and Topology<br></div><div><br></div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div><div><div><br></div><div><br></div><div>On 02/14/2012 07:59 AM, Christopher Mueller wrote:</div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div> Hi Tim,</div><div><br></div><div> Thank you very much for the information. I've added some comments inline.</div><div><br></div><div> Best,</div><div> Chris</div><div><br></div><div> From: Tim Tautges <<a href="mailto:tautges@mcs.anl.gov">tautges@mcs.anl.gov</a> <<a href="mailto:tautges@mcs.anl.gov>">mailto:tautges@mcs.anl.gov></a>></div><div> Date: Mon, 13 Feb 2012 16:00:28 -0500</div><div> To: Christopher Mueller <<a href="mailto:cmueller@asascience.com">cmueller@asascience.com</a> <<a href="mailto:cmueller@asascience.com>">mailto:cmueller@asascience.com></a>></div><div> Cc: Iulian Grindeanu <<a href="mailto:iulian@mcs.anl.gov">iulian@mcs.anl.gov</a> <<a href="mailto:iulian@mcs.anl.gov>">mailto:iulian@mcs.anl.gov></a>>, David Stuebe <<a href="mailto:DStuebe@asascience.com">DStuebe@asascience.com</a></div><div> <<a href="mailto:DStuebe@asascience.com>">mailto:DStuebe@asascience.com></a>>, Guy De Wardener <<a href="mailto:gdewardener@asascience.com">gdewardener@asascience.com</a> <<a href="mailto:gdewardener@asascience.com>">mailto:gdewardener@asascience.com></a>>, don</div><div> brittain <<a href="mailto:don.brittain@instanteffects.com">don.brittain@instanteffects.com</a> <<a href="mailto:don.brittain@instanteffects.com>">mailto:don.brittain@instanteffects.com></a>></div><div> Subject: Re: [MOAB-dev] Questions about Tags and Topology</div><div><br></div><div> [Sent the original just to MOAB-dev...]</div><div><br></div><div> -------- Original Message --------</div><div> Subject: Re: [MOAB-dev] Questions about Tags and Topology</div><div> Date: Mon, 13 Feb 2012 14:59:15 -0600</div><div> From: Tim Tautges <<a href="mailto:tautges@mcs.anl.gov">tautges@mcs.anl.gov</a> <<a href="mailto:tautges@mcs.anl.gov>">mailto:tautges@mcs.anl.gov></a>></div><div> To: <a href="mailto:moab-dev@mcs.anl.gov">moab-dev@mcs.anl.gov</a> <<a href="mailto:moab-dev@mcs.anl.gov">mailto:moab-dev@mcs.anl.gov</a>></div><div><br></div><div><br></div><div><br></div><div> On 02/13/2012 11:32 AM, Christopher Mueller wrote:</div><div> > Hi Iulian,</div><div> ></div><div> > Thank you for the rapid response and great information. I have a couple of follow-up questions (inline).</div><div> ></div><div><br></div><div> A couple of my responses below too. But, first, great questions, you got into it pretty quickly.</div><div><br></div><div> ></div><div> ></div><div> > From: Iulian Grindeanu <<a href="mailto:iulian@mcs.anl.gov">iulian@mcs.anl.gov</a> <<a href="mailto:iulian@mcs.anl.gov">mailto:iulian@mcs.anl.gov</a>> <<a href="mailto:iulian@mcs.anl.gov">mailto:iulian@mcs.anl.gov</a>></div><div> <<a href="mailto:iulian@mcs.anl.gov>>">mailto:iulian@mcs.anl.gov>></a>></div><div> > Date: Sat, 11 Feb 2012 01:02:03 -0500</div><div> > To: Christopher Mueller <<a href="mailto:cmueller@asascience.com">cmueller@asascience.com</a> <<a href="mailto:cmueller@asascience.com">mailto:cmueller@asascience.com</a>> <<a href="mailto:cmueller@asascience.com">mailto:cmueller@asascience.com</a>></div><div> <<a href="mailto:cmueller@asascience.com>>">mailto:cmueller@asascience.com>></a>></div><div> > Cc: Guy De Wardener <<a href="mailto:gdewardener@asascience.com">gdewardener@asascience.com</a> <<a href="mailto:gdewardener@asascience.com">mailto:gdewardener@asascience.com</a>></div><div> <<a href="mailto:gdewardener@asascience.com">mailto:gdewardener@asascience.com</a>> <<a href="mailto:gdewardener@asascience.com>>">mailto:gdewardener@asascience.com>></a>>, David Stuebe</div><div> > <<a href="mailto:DStuebe@asascience.com">DStuebe@asascience.com</a> <<a href="mailto:DStuebe@asascience.com">mailto:DStuebe@asascience.com</a>> <<a href="mailto:DStuebe@asascience.com">mailto:DStuebe@asascience.com</a>></div><div> <<a href="mailto:DStuebe@asascience.com>>">mailto:DStuebe@asascience.com>></a>>, don brittain <<a href="mailto:don.brittain@instanteffects.com">don.brittain@instanteffects.com</a></div><div> <<a href="mailto:don.brittain@instanteffects.com">mailto:don.brittain@instanteffects.com</a>></div><div> > <<a href="mailto:don.brittain@instanteffects.com">mailto:don.brittain@instanteffects.com</a>> <<a href="mailto:don.brittain@instanteffects.com>>">mailto:don.brittain@instanteffects.com>></a>>, "<a href="mailto:moab-dev@mcs.anl.gov">moab-dev@mcs.anl.gov</a></div><div> <<a href="mailto:moab-dev@mcs.anl.gov">mailto:moab-dev@mcs.anl.gov</a>> <<a href="mailto:moab-dev@mcs.anl.gov">mailto:moab-dev@mcs.anl.gov</a>> <<a href="mailto:moab-dev@mcs.anl.gov>>">mailto:moab-dev@mcs.anl.gov>></a>" <<a href="mailto:moab-dev@mcs.anl.gov">moab-dev@mcs.anl.gov</a></div><div> <<a href="mailto:moab-dev@mcs.anl.gov">mailto:moab-dev@mcs.anl.gov</a>></div><div> > <<a href="mailto:moab-dev@mcs.anl.gov">mailto:moab-dev@mcs.anl.gov</a>> <<a href="mailto:moab-dev@mcs.anl.gov>>">mailto:moab-dev@mcs.anl.gov>></a>></div><div> > Subject: Re: [MOAB-dev] Questions about Tags and Topology</div><div> ></div><div> > Hello,</div><div> > I will try to answer to some of those questions;</div><div> ></div><div> ></div><div> ------------------------------------------------------------------------------------------------------------------------</div><div> ></div><div> > Hi Tim,</div><div> ></div><div> > I've had a good deal of success this week and have been able to represent a couple of our simpler datasets in</div><div> > what seems to be a reasonable manner. I have also come up with a few questions.</div><div> ></div><div> > Tags:</div><div> ></div><div> > * DataTypes – from what I can see, tags do not support a few of the numpy datatypes, namely: float32, int16,</div><div> > and int64. Is this a constraint of the PyTAPS wrapper or the underlying iMesh/MOAB infrastructure?</div><div> ></div><div> > itaps has a limited data type set; see MOAB/itaps/iBase.h</div><div> > pytaps is closely related to itaps;</div><div> ></div><div> > some types can be "manufactured" out of byte type, but it is the user responsibility to interpret / convert</div><div> > correctly (so interpret an int16 as a 2-byte value, etc). I am not sure if something like that is possible in</div><div> > python/pytaps. It is for sure possible in c/c++</div><div><br></div><div> We may be adding a float type soon, and I'm open to adding others if we can convince ourselves that it's worth it.</div><div><br></div><div><br></div><div> Good to know. Given the response Jim provided it seems like we should be able to accommodate pretty much any data type,</div><div> including custom ones. May be some efficiency to sticking with "native" types when possible though.</div><div><br></div></blockquote><div><br></div><div>The advantage of using specific data types is mostly that you can read/write machine-independent binary files (i.e.</div><div>HDF5) and not be messed up by things like endian changes.</div></div></div></blockquote></span><div><br></div><div>That's no minor advantage! :)</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div><div><div><br></div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div><br></div><div> ></div><div> ></div><div> > *</div><div> > * Tags-of-tags – Is this possible? I've tried a couple of ways but can't seem to get it to go.</div><div> ></div><div> > tags can be set/get on anything that is an "EntityHandle" in moab. So anything that is an entity handle (node,</div><div> > element, mesh set) can set and get tag values, using a tag handle.</div><div> > I am not sure I understand the question. Would you need to set a tag value on a tag handle? That is not possible.</div><div> ></div><div> ></div><div> > Unfortunately, it is the latter case that I was hoping for – the ability to set a tag value on a tag handle. For</div><div> example:</div><div> ></div><div> > tag1=mesh.createTag("tag1",1,bytes)</div><div> > tag2=mesh.createTag("tag2,1,bytes)</div><div> > tag2[tag1]=value</div><div> ></div><div><br></div><div> I've long wondered about doing tags on tags, that would provide a way of putting attributes on tags, e.g. provenance</div><div> data. I'll add you to the list of users that could potentially use that (the other use is for attributes coming from</div><div> climate data files, so they're related to your uses).</div><div><br></div><div><br></div><div> Thanks for the +1! The precise use case I had for doing this was for representing the attributes applicable to a given</div><div> variable – so it definitely sounds like that fits into the use case you're already aware of.</div><div><br></div></blockquote><div><br></div><div>Yeah. For other emerging conventions on various types of metadata, see the doc/metadata_info.pdf document, and</div><div>specifically the section on .nc files, lots of these are likely relevant to you guys too.</div></div></div></blockquote></span><div><br></div><div>Excellent, I hadn't found that document yet – very useful</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div><div><div><br></div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div><br></div><div> ></div><div> ></div><div> > *</div><div> ></div><div> > Topology:</div><div> ></div><div> > * Is it possible to apply topology over entity sets? One way I've found for dealing with time is to have a</div><div> > "temporal" EntitySet that has child EntitySets for each timestep. This seems to work well, but I can't find</div><div> > a way of relating the various timesteps aside from the inherent indexing of the "temporal" EntitySet. I</div><div> > hoped that it would be possible to do something like make a line_segment that related the timestep</div><div> > EntitySets, but that didn't seem to work.</div><div> ></div><div> > maybe you can set a tag with the time value for each of the child EntitySets. I am not sure I understand what do you</div><div> > mean by "line_segment".</div><div> > Also, if set1 is a child of set2, it does not mean that the set2 is a parent of set1 (and viceversa) see the</div><div> > difference between</div><div> > add_parent_child and add_child_meshset, for example</div><div> ></div><div> > Another thing that can help:</div><div> > you add child1 to set1, then add child2 to set1</div><div> > When you ask for children of set1, you will always get them in order child1, child2. So maybe you can use that for a</div><div> > natural ordering of your children ( EntitySets ).</div><div> ></div><div> ></div><div> > This is the method I'm currently using and it works well as long as the relationship is a linear one (unfortunately,</div><div> > this may not always be the case for us).</div><div> > Do you know if it is possible to "insert" a child into an existing list of children? For example:</div><div> ></div><div> > set1_children=[c1,c2,c3,c4]</div><div> > set.add(c2a,index=2)</div><div> > set1_children=[c1,c2,c2a,c3,c4]</div><div> ></div><div><br></div><div> No, that's not currently possible. Another way to do this would be to implement a "next" tag, effectively implementing</div><div> your own linked list between sets as tags. Note also that there are 2 kinds of sets in moab, list-type and set-type,</div><div> and that only the list type preserves order under all conditions (the set-type sorts by handle and doesn't allow</div><div> multiple inclusions of the same handle).</div><div><br></div><div><br></div><div> OK – I was wondering how the sorting worked when a set is created "ordered=True". I'm using the "ordered=False" for all</div><div> of my sets at this point.</div><div><br></div></blockquote><div><br></div><div>Those names are very counter-intuitive, the ordered=true results in list-type sets, i.e. the order of members of the set</div><div>are *not* sorted, while the ordered=false sets are sorted.</div></div></div></blockquote></span><div><br></div><div>Yes, that confused me at first until I carefully read the documentation. For our purposes (at least right now), I think we'll pretty much always want ordered=False</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div><div><div><br></div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div><br></div><div><br></div><div> ></div><div> ></div><div> > Another question: Is the mesh changing in time? That is one reason you may want EntitySets changing in time. Or</div><div> > maybe some solution uses different mesh elements at a given time</div><div> ></div><div> ></div><div> > This is certainly a possibility, so having an entityset/time is valuable to us.</div><div> ></div><div> ></div><div> ></div><div> > *</div><div> > * Edges from quadrilaterals: After building a set of quadrilateral entities from an array of vertices, I was</div><div> > surprised that there were not edge entities generated as well. Is there a method for doing this? I realize I</div><div> > could generate the edges from the vertex array (perhaps after some reworking), but it seems to me that it</div><div> > might also be possible to get them from the quadrilaterals themselves.</div><div> ></div><div> ></div><div> > this is the easiest question:)</div><div> > you have to use the flag create_if_missing=true in a call like:</div><div> > ErrorCode get_adjacencies(const EntityHandle *from_entities,</div><div> > const int num_entities,</div><div> > const int to_dimension,</div><div> > const bool create_if_missing,</div><div> > std::vector<EntityHandle>& adj_entities,</div><div> > const int operation_type = Interface::INTERSECT) = 0;</div><div> ></div><div> > from_entities are your quads, to_dimension is 1 (edges), and you will get the edges in adj_entities vector.</div><div> ></div><div> ></div><div> > This is great news! I tried applying the argument "create_if_missing" as a kwarg in a handful of the iMesh functions</div><div> > exposed in PyTAPS (mesh.createEntArr, mesh.getEntArr, mesh.getEntAdj), but I kept getting a TypeError stating that</div><div> > "'create_if_missing' is an invalid keyword argument for this function". Do you know if this functionality is available</div><div> > from PyTAPS?</div><div> ></div><div><br></div><div> From iMesh/Pytaps, it's usually an all-or-nothing thing. If you're ok always having edges, then you can call the</div><div> setAdjTable function, with the element with index 5 in the array set to one. That function takes an integer array</div><div> argument that looks like a 4x4 table, indexed in column-major order, where the indices are [from_dim, to_dim], with</div><div> diagonal elements used to indicate whether those entities should always be represented. So, the diagonal element</div><div> pertaining to edges is at [1,1], which is at index 5 in a 0-based indexing.</div><div><br></div><div><br></div><div> At this point, always having edges is not a problem at all. However I can't seem to modify the adjTable attribute (I</div><div> believe Iulian found the same thing). I'm also not seeing a setAdjTable function. Am I missing something?</div><div><br></div></blockquote><div><br></div><div>This has likely not been reflected in the pytaps implementation. Jim?</div></div></div></blockquote></span><div><br></div><div>Ultimately, it would be great to be able to do this on a case-by-case basis (via PyTAPS). In the interim, is there any way of changing the AdjTable 'statically' (i.e. from a config file or even directly modifying a file) so that the table defaults to create all missing entities? At this point, it would be nice to always have all entities as opposed to only having the ones explicitly created (and vertices).</div><div><br></div><div>Thanks,</div><div>Chris</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div><div><div><br></div><div>- tim</div><div><br></div><div><br></div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div> In [1]: from itaps import iMesh</div><div> In [2]: mesh=iMesh.Mesh()</div><div> In [3]: mesh.adjTable</div><div> Out[3]:</div><div> array([[7, 4, 4, 1],</div><div> [1, 0, 5, 5],</div><div> [1, 5, 0, 5],</div><div> [1, 5, 5, 7]], dtype=int32)</div><div> In [4]: mesh.adjTable[1,1]</div><div> Out[4]: 0</div><div> In [5]: mesh.adjTable[1,1]=1</div><div> In [6]: mesh.adjTable[1,1]</div><div> Out[6]: 0</div><div> In [7]: import numpy</div><div> In [8]: mesh.adjTable=numpy.array([[7,4,4,1],[1,1,5,5],[1,5,0,5],[1,5,5,7]],dtype='int32')</div><div> ---------------------------------------------------------------------------</div><div> AttributeError Traceback (most recent call last)</div><div> /Users/cmueller/Development/OOI/Dev/datamodel/prototypes/<ipython-input-8-5671b50e588e> in <module>()</div><div> ----> 1 mesh.adjTable=numpy.array([[7,4,4,1],[1,1,5,5],[1,5,0,5],[1,5,5,7]],dtype='int32')</div><div><br></div><div> AttributeError: attribute 'adjTable' of 'itaps.iMesh.Mesh' objects is not writable</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> - tim</div><div><br></div><div> ></div><div> ></div><div> > Thanks in advance,</div><div> > Chris</div><div> ></div><div> > Hope this helps,</div><div> > Iulian</div><div> ></div><div> ></div><div> > Thanks,</div><div> > Chris</div><div><br></div><div> --</div><div> ================================================================</div><div> "You will keep in perfect peace him whose mind is</div><div> steadfast, because he trusts in you." Isaiah 26:3</div><div><br></div><div> Tim Tautges Argonne National Laboratory</div><div> (<a href="mailto:tautges@mcs.anl.gov">tautges@mcs.anl.gov</a> <<a href="mailto:tautges@mcs.anl.gov>">mailto:tautges@mcs.anl.gov></a>) (telecommuting from UW-Madison)</div><div> phone (gvoice): (608) 354-1459 1500 Engineering Dr.</div><div> fax: (608) 263-4499 Madison, WI 53706</div><div><br></div><div><br></div></blockquote><div><br></div><div>--</div><div>================================================================</div><div>"You will keep in perfect peace him whose mind is</div><div> steadfast, because he trusts in you." Isaiah 26:3</div><div><br></div><div> Tim Tautges Argonne National Laboratory</div><div> (<a href="mailto:tautges@mcs.anl.gov">tautges@mcs.anl.gov</a>) (telecommuting from UW-Madison)</div><div> phone (gvoice): (608) 354-1459 1500 Engineering Dr.</div><div> fax: (608) 263-4499 Madison, WI 53706</div><div><br></div><div><br></div></div></div></blockquote></span></body></html>