[MOAB-dev] Detecting file types

Steve Jackson sjackson at cae.wisc.edu
Mon Nov 30 15:19:15 CST 2009


On Nov 26, 2009, at 5:36 , Jed Brown wrote:

>> Dagmc loads a file by calling MBInterface::load_file().  For several  
>> reasons, dagmc wants to know what type of file is thus loaded, but  
>> MBInterface does not provide an obvious way to find out.
> 
> Why specifically does it need to know?  

There are two reasons, one serious, and one cosmetic.

Serious reason: 
DagMC has a feature that allows ray tracing to be performed directly on a CAD representation of a geometry, rather than on the faceted representation stored in MOAB.  This is done by calling CGM functions (specifically GeometryQueryTool::fire_ray).  This CGM-level ray casting only works when the relevant geometry is stored in CGM-- which is expected only if ReadCGM was used to import the geometry into MOAB.  In contrast, CAD-based ray casting should be disabled if the file was loaded by some other file loader.  So DagMC needs some way to find out if CGM was used to load data.

DagMC used to do CGM loading internally, rather than calling out to MOAB.  The recent abstraction of the CGM loading code into the ReadCGM module has broken DagMC's assumption that it can know if a CAD geometry was loaded.  

Cosmetic reason: 
DagMC passes some file loading options to MBInterface::load_file.  These options go unhandled by MOAB's native file reader, causing load_file to return the MB_UNHANDLED_OPTION error code.  This isn't really an error condition, though; we wouldn't pass the options in the first place if we knew the file was going to be handled by MOAB's native loader.

~S





More information about the moab-dev mailing list