[MOAB-dev] Using Mesquite with MOAB

Jason Kraftcheck kraftche at cae.wisc.edu
Thu Feb 11 10:07:21 CST 2010


Roman Putanowicz wrote:
> Dear Jason,
> 
> I am trying to figure how to use Mesquite to smooth MOAB mesh.
> 
> I have compiled MOAB with options:
> 
>   with options \"'--prefix=/usr/local/install/' '--enable-shared'
>   '--enable-tools' '--disable-mbzoltan' '--disable-qvdual' '--disable-mbchaco'
>   '--disable-mbcoupler' '--disable-mcnpmit' 'QTDIR=/usr' '--enable-imesh'\"
> 

Those are mostly the default options.  I think it would be the same to do:
  --prefix=/usr/local/install --enable-shared

> and Mesquite-2.99 with options:
>  --prefix=/usr/local/install/' '--enable-imesh'"
> 
> Then I am lost. I do not see the way to transer MBInterface* pointer
> to iMesh_Instance.
> 
> If I do just bold cast like (which I know fill fail on runtime :)
> 
> MBCore mesh;
> ....
> iMesh_Instance mp = (iMesh_Instance)&mesh;
> 

This definitely will not work.  There is no method to convert between an
MBInterface* and an iMesh_Instance because, for conformance with the iMesh
API specification, our implementation of the iMesh interface must impose
additional constraints on the state of the MOAB data model that could be
undercut by accessing the underlying MBInterface instance directly.  The two
options at present are to either a) always work through the iMesh API rather
than MBInterface or b) provide an implementation of the Mesquite::Mesh
interface that communicates with MOAB through the MBInterface API rather
than the iMesh one.  The latter is something that I have been considering
including in Mesquite for some time, but have never had time to do.


> the I get the linking errors like:
> 
> /usr/local/install/lib/libmesquite.a(MsqIMesh.o): In function
> `Mesquite2::MsqIMesh::vertex_set_coordinates(void*, Mesquite2::Vector3D const&,
> Mesquite2::MsqError&)':
> MsqIMesh.cpp:(.text+0x4f7): undefined reference to `imesh_setvtxcoord_'
> 

This problem is not related to the above issue.  The two most common causes
for this are:
  a) "-lmesquite" must be specified before "-liMesh -lmoab" in the link
     command because libmesquite requires symbols provided in libiMesh.
  b) The Fortran name mangling assumed for the iMesh API is inconsistent
     between Mesquite and MOAB.  This often happens if you have multiple
     Fortran compilers installed or something changed with the installed
     Fortran compiler between when you compiled MOAB and when you compiled
     Mesquite.  To check for this, try the following command:
      'nm /usr/local/install/lib/libiMesh.so | grep -i imesh_setvtxcoord'
     If the function name detected with that command doesn't match
     'imesh_setvtxcoord_' in both case and trailing underscore, then
     try re-building MOAB and/or Mesquite, and verify that both are
     detecting the same Fortran compiler during the configuration.

-jason


More information about the moab-dev mailing list