[MOAB-dev] GEOM_SENSE_2 tag

Jason Kraftcheck kraftche at cae.wisc.edu
Mon Jun 13 14:29:35 CDT 2011


On 06/13/2011 01:42 PM, Steve Jackson wrote:
> (Mostly for Iulian and Jason's attention.)
> 
> There's a problem with the GEOM_SENSE_2 tag that is used by GeomTopoTool
> and DagMC.
> 
> The tag is a sparse tag containing a pair of entity handles.  DagMC does
> not specify a default value for the tag.  GeomTopoTool sets {0, 0} as the
> default value (see GeomTopoTool::check_face_sense_tag()).  Using the
> default value this way introduces an ordering dependence.  If DagMC gets
> this tag handle before GeomTopoTool does, then GeomTopoTool's call to
> tag_get_handle() will fail,  because the first call to tag_get_handle()
> specifies no default value, and the second call (from GeomTopoTool)
> specifies a default.  Since this tag is sparse, there is no implicit zero
> default, as there would be for a dense tag.
> 
> This issue is causing DagMC::load_file() to fail for any .sat file,
> because DagMC initializes its tags before loading a file, and ReadCGM
> uses GeomTopoTool.  (Unfortunately, there is no MOAB test for this case
> right now; the current DagMC tests use h5m files.)  This  issue also
> prevents MOAB from successfully loading any .sat file after first loading
> a mesh file that contains the GEOM_SENSE_2 tag without a default value.
> Such files include any .sat file that was converted to a mesh using
> mbconvert or dagmc_preproc before the default value was introduced.  (It
> appears to have been introduced in r4843.)
> 
> The simplest fix would be to remove the default value specifier from
> GeomTopoTool, but doing so causes `make check` to fail.  

This is precisely the reason the check of the default value was added.  If
some code depends on there being a default value, that code will break if
DagMC creates the tag w/out that default.

> Alternatively,
> we could make all get_tag_handle() calls that involve this tag specify
> the same default value.  That would fix DagMC::load_file(), but it would
> not fix the issue where loading old mesh files that do not contain a
> default value for the tag will confuse future uses of the tag.  We could
> also load the tag using the MB_TAG_DFTOK flag, in order to make
> tag_get_handle() forgo any checking of default tag values, but that seems
> like a hack.
> 
> What is the best way to fix this? ~S

My preference, from best and most time to quickest:
1) Find out why make check fails when GEOM_SENSE_2 doesn't have a default
value.  If there is no good reason for a default value for that tag then it
shouldn't have one.  Fix the failing code and drop the default value.
2) Be consistent about creating tags with the same default value.
3) Use MB_TAG_DFTOK.  That is somewhat of a hack.  But it is the quickest
way to get things working again.




More information about the moab-dev mailing list