[MOAB-dev] Detecting file types
Jason Kraftcheck
kraftche at cae.wisc.edu
Mon Nov 30 15:36:29 CST 2009
Steve Jackson wrote:
> 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.
>
So you don't need to know the file type. You need to know whether or not
the file contained geometry that was read into CGM. Why not just query CGM
to see if it has any geometry?
> 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.
Returning the loaded file type after the fact is unlikely to be helpful in
this case, and MOAB cannot correctly determine the file type in all cases
until it has successfully loaded it.
- jason
More information about the moab-dev
mailing list