[MOAB-dev] cgm2moab as a script

Jason Kraftcheck kraftche at cae.wisc.edu
Tue Aug 17 14:18:10 CDT 2010


On 08/17/2010 12:20 PM, Steve Jackson wrote:
> If MOAB is built with dagmc enabled and CGM support, one of the programs
> installed in bin/ is cgm2moab, a tool for converting CAD files to MOAB
> meshes.  Over time, almost all the the functionality of this program has
> migrated into MOAB's native CGM reader, so it's now possible to do
> essentially everything that cgm2moab does using an appropriate call to
> mbconvert.  (Not a terse or convenient call, though, because cgm2moab
> specifies a lot of lengthy arguments to ReadCGM.)  This has led the dagmc
> users to consider changing cgm2moab into a wrapper script that calls
> mbconvert, instead of a C++ program.
> 
> I'm wondering what our primary maintainers think about this idea.  Can
> Tim and/or Jason comment on the following possibilities?
> 
> * Convert cgm2moab to a python script.  (Readability win, requires
> python, and possibly requires autoconf things to portably detect
> python.) 

I don't think we should add a dependency on python to MOAB for something
this minor.  I'm also a little unsure about it being a readability win.
While python does a little more to force readability, you don't have to
write unmaintainable code in other languages (except perhaps for
autoconf/m4, which will have to use to add the configure logic.)

> * Convert cgm2moab to a plain bash script.  (Messier code, but
> probably more portable.) 

I'm not sure it'd really be more portable.  Windows users are more likely to
have a python interpreter than a bourne shell.

> * No thanks, leave it as C++.
> 

This is probably the most portable option.

Why do you want to make this change at all?  Is there any active development
on cgm2moab that would be made easier?

Should we just remove the utility?  Is it frequently used?  It is a lot
simpler to use a more specialized utility as opposed to mbconvert, but is
there a sufficient number of users to justify maintaining such a utility in
MOAB, installing it for all users, etc. as opposed to just letting users
write their own wrapper script?

- jason


More information about the moab-dev mailing list