iMOAB
imoab.h File Reference

Go to the source code of this file.

Functions

ErrorCode InitializeMoab (int argc, char **argv)
ErrorCode FinalizeMoab ()
ErrorCode RegisterApplication (char *app_name, MPI_Comm *comm, int *pid, int len_name)
ErrorCode DeregisterApplication (int *pid)
ErrorCode ReadHeaderInfo (int *pid, char *filename, int *GlobalVertices, int *GlobalElements, int *NumDimensions, int *NumPartitions, int len_filename)
ErrorCode LoadMesh (int *pid, char *filename, char *readOptions, MPI_Comm *comm, int *ghost_layers, int len_filename, int len_options)
ErrorCode WriteMesh (int *pid, char *filename, char *writeOptions, MPI_Comm *comm, int len_filename, int len_options)
ErrorCode GetMeshInfo (int *pid, int *VisibleVertices, int *VisibleElements, int *VisibleBlocks, int *VisibleSurfaceBC, int *VisibleVertexBC)
ErrorCode GetVisibleVerticesCoordinates (int *pid, double *coords, int *len)
ErrorCode GetVertexOwnership (int *pid, int *VisibleGlobalRankID, int *len)
ErrorCode GetVertexID (int *pid, int *VisibleID, int *len)
ErrorCode GetBlockInfo (int *pid, int *Block, int *VerticesPerElement, int *NumElements, char *BlockName, int lenBlockName)
ErrorCode GetElementConnectivity (int *pid, int *Block, int *Connectivity, int *len)
ErrorCode GetElementOwnership (int *pid, int *Block, int *ElementRankID, int *len)
ErrorCode GetElementID (int *pid, int *Block, int *ElementID, int *len)
ErrorCode GetPointerToSurfaceBC (int *pid, int *ElementID, int *ReferenceSurfaceID, int *BoundaryConditionType, int *len)
ErrorCode GetPointerToVertexBC (int *pid, int *VertexID, int *BoundaryConditionType, int *len)
ErrorCode DefineVectorStorage (int *pid, char *Name, int *VectorType, int *VectorDimensions)
ErrorCode SolutionVectorStorage (int *pid,, char *Name, double *Value)
ErrorCode AdjacentElements (int *pid, int *eid, int *numadj, int *adjElems)

Function Documentation

ErrorCode AdjacentElements ( int *  pid,
int *  eid,
int *  numadj,
int *  adjElems 
)

FIXME adjancency calls?

Parameters:
(in)pid application id
(in)eid element global ID
(out)numadj number of adjacent elements
(in/out)adjacent elements (in terms of element ID) (size of number of sides?)
ErrorCode DefineVectorStorage ( int *  pid,
char *  Name,
int *  VectorType,
int *  VectorDimensions 
)

FIXME (in moab, it will create a dense, double tag ; do we care about sparse tags/ bit tags, integer tags, handle tags, etc)

Parameters:
(in)pid application id
(in)Name will correspond to name of the tag in moab
(in)VectorType ?? (in moab, tags can be associated to all entities, elements or vertices, or even sets, we do not restrict a tag to a specific entity type)
(in)VectorDimensions : corresponding to the size of the tag (how many doubles per entity?)
ErrorCode DeregisterApplication ( int *  pid)

deregister application: delete mesh associated with it (collective)

Parameters:
(in)pid application id
ErrorCode FinalizeMoab ( )

deletes the moab instance

ErrorCode GetBlockInfo ( int *  pid,
int *  Block,
int *  VerticesPerElement,
int *  NumElements,
char *  BlockName,
int  lenBlockName 
)

obtain block information

Parameters:
(in)pid application id
(in)Block block ID
(out)VerticesPerElement number of vertices per element
(out)NumElements number of elements in block
(out)BlockName return for the material set the name (if given as NAME in h5m file?)
(out)lenBlockName name length
ErrorCode GetElementConnectivity ( int *  pid,
int *  Block,
int *  Connectivity,
int *  len 
)

GetElementConnectivity get element connectivity for block

Parameters:
(in)pid application id
(in)Block block ID (index from 1 to VisibleBlocks? )
(in/out)Connectivity connectivity array (allocated by client, size VerticesPerElement*NumElements; it will be local index in coords array)
(in/out)len allocated size of array (on input); on output, it should be actual length, VerticesPerElement*NumElements.
ErrorCode GetElementID ( int *  pid,
int *  Block,
int *  ElementID,
int *  len 
)

GetElementID get element ownership information

Parameters:
(in)pid application id
(in)Block: block ID (num from 1 to VisibleBlocks) : we don't know how many global blocks
(in/out)ElementID global ID for each element (allocated by client, size NumElements) (this will be global ID in moab terms)
(in/out)len allocated size of array (on input);
ErrorCode GetElementOwnership ( int *  pid,
int *  Block,
int *  ElementRankID,
int *  len 
)

GetElementOwnership get element ownership information

Parameters:
(in)pid application id
(in)block ID (num from 1 to VisibleBlocks) : we don't know how many global blocks
(in/out)ownership array (allocated by client, size NumElements)
(in/out)len allocated size of array (on input); on output, actual length (should be NumElements)
ErrorCode GetMeshInfo ( int *  pid,
int *  VisibleVertices,
int *  VisibleElements,
int *  VisibleBlocks,
int *  VisibleSurfaceBC,
int *  VisibleVertexBC 
)

obtain local mesh size information

Parameters:
(in)pid application id
(out)VisibleVertices number of vertices on current process (including ghosts + shared)
(out)VisibleElements number of elements on current process (including ghosts )
(out)VisibleBlocks number of visible material sets in local mesh (that includes ghosts)
(out)VisibleSurfaceBC (is this the count of surface elem that have a bc?) is this including ghosts or not?
(out)VisibleVertexBC (is this the count of vertices that have a BC?) is this including ghosts or not?
ErrorCode GetPointerToSurfaceBC ( int *  pid,
int *  ElementID,
int *  ReferenceSurfaceID,
int *  BoundaryConditionType,
int *  len 
)

GetPointerToSurfaceBC surface boundary condition information (all arrays allocated by client, size VisibleSurfaceBC?)

Parameters:
(in)pid application id
(in/out)ElementID element global id ( corresponding to moab global ID )
(in/out)ReferenceSurfaceID, (from 1 to 6 for hex, 1-4 for tetras) side number
(in/out)BoundaryConditionType boundary condition type ( a number corresponding to NeumannSet ?)
(in/out)len allocated size of both arrays (on input);
ErrorCode GetPointerToVertexBC ( int *  pid,
int *  VertexID,
int *  BoundaryConditionType,
int *  len 
)

GetPointerToVertexBC vertex boundary condition info (all arrays allocated by client, size VisibleVertexBC)

Parameters:
(in)pid application id
(in/out)VertexID vertex global id
(in/out)BoundaryConditionType boundary condition type ( a number corresponding to Dirichlet Set ?)
(in/out)len allocated size of both arrays (on input);
ErrorCode GetVertexID ( int *  pid,
int *  VisibleID,
int *  len 
)

GetVertexID get global ID for each vertex (local, shared or ghost)

Parameters:
(in)pid application id
(in/out)VisibleID global ID for each vertex (array allocated by client, should be size VisibleVertices)
(in/out)len allocated size of array (on input); on output, it should be actual length, VisibleVertices.
ErrorCode GetVertexOwnership ( int *  pid,
int *  VisibleGlobalRankID,
int *  len 
)

GetVertexOwnership get mesh rank (processor that owns it) for each vertex (local, shared or ghost)

Parameters:
(in)pid application id
(in/out)VisibleGlobalRankID processor rank for each vertex (array allocated by client, should be size VisibleVertices)
(in/out)len allocated size of array (on input); on output, it should be actual length, VisibleVertices.
ErrorCode GetVisibleVerticesCoordinates ( int *  pid,
double *  coords,
int *  len 
)

get vertex coordinates

Parameters:
(in)pid application id
(in/out)coords pointer to memory that will be filled with interleaved coordinates; client allocates this
(in/out)len; at input, usable memory (numdim*numv?); on output, actual or is this parameter not needed at all? assume everything is allocated fine?
ErrorCode InitializeMoab ( int  argc,
char **  argv 
)

imoab: simple interface to moab callable from c, fortran77, fortran90; fortran 2003 ?

Notes: pass everything by reference, so we do not have to use VAL() arrays are allocated by the client; pass the pointer to the start of array, and the allocated length ? return the filled array, and the actual length (should be most of the time allocated length) or should we assume that the user allocated everything fine? this will create the moab instance, if not created already

Parameters:
(in)argc number of command line arguments
(in)argv command line arguments
ErrorCode LoadMesh ( int *  pid,
char *  filename,
char *  readOptions,
MPI_Comm *  comm,
int *  ghost_layers,
int  len_filename,
int  len_options 
)

load mesh and ghost if needed (collective)

Parameters:
(in)pid application id
(in)filename
(in)readOptions additional options for reading
(in)comm MPI communicator (is this needed if already passed at registration?)
(in)ghost_layers number of layers
(in)len_filename filename length
(in)len_options read options length

(this will exchange ghosts and exchange all important tags, like global id, material(block) tags, neumann tags and dirichlett tags or should the exchange happen explicitly for the tags user specifies? )

ErrorCode ReadHeaderInfo ( int *  pid,
char *  filename,
int *  GlobalVertices,
int *  GlobalElements,
int *  NumDimensions,
int *  NumPartitions,
int  len_filename 
)

Get global information from the file

Parameters:
(in)pid application id
(in)filename application mesh file
(out)GlobalVertices number of global vertices
(out)GlobalElements number of global elements (highest dimension only?)
(out)NumDimensions ( 2 or 3 )
(out)NumPartitions num partitions in the file
(in)len_filename file name length
ErrorCode RegisterApplication ( char *  app_name,
MPI_Comm *  comm,
int *  pid,
int  len_name 
)

register application (internally, a mesh set will be associated with this integer; all mesh for this application will reside in this mesh/file set) whenever something is required about the mesh, this integer id will need to be passed collective

Parameters:
(in)app_name application name (PROTEUS, NEK5000, etc)
(in)comm MPI communicator
(out)pid application id pointer
(in)length of application name
ErrorCode SolutionVectorStorage ( int *  pid,
char *  Name,
double *  Value 
)

FIXME

Parameters:
(in)pid application id
(in)Name will correspond to name of the tag in moab
(out)Value double pointer for internal tag memory (it assumes the entities in moab are contiguous, no gaps, and only one entity sequence)
ErrorCode WriteMesh ( int *  pid,
char *  filename,
char *  writeOptions,
MPI_Comm *  comm,
int  len_filename,
int  len_options 
)

write mesh (collective)

Parameters:
(in)pid application id
(in)filename
(in)writeOptions additional options for writing
(in)comm MPI communicator (is this needed if already passed at registration?)
(in)len_filename filename length
(in)len_options write options length ( we write one single file; in serial, it will write one file per task)
 All Files Functions