moab::ScdInterface Class Reference

A structured mesh interface for MOAB-based data. More...

#include <moab/ScdInterface.hpp>

List of all members.

Public Types

enum  PartitionMethod { ALLJORKORI = 0, ALLJKBAL, SQIJ, SQJK }
 

Partition method enumeration.

More...

Public Member Functions

 ScdInterface (Core *impl, bool find_boxes=false)
 Constructor.
 ~ScdInterface ()
Interfaceimpl () const
 Return the MOAB Interface instance *.
ErrorCode construct_box (HomCoord low, HomCoord high, double *coords, unsigned int num_coords, ScdBox *&new_box, bool is_periodic_i=false, bool is_periodic_j=false)
 Construct new structured mesh box, including both vertices and elements.
ErrorCode create_scd_sequence (HomCoord low, HomCoord high, EntityType type, int starting_id, ScdBox *&new_box, bool is_periodic_i=false, bool is_periodic_j=false)
 Create a structured sequence of vertices, quads, or hexes.
ErrorCode find_boxes (std::vector< ScdBox * > &boxes)
 Return all the structured mesh blocks in this MOAB instance, as ScdBox objects.
ErrorCode find_boxes (Range &boxes)
 Return all the structured mesh blocks in this MOAB instance, as entity set handles.
ErrorCode get_boxes (std::vector< ScdBox * > &boxes)
 Return all the structured mesh blocks known by ScdInterface (does not search).
Tag box_dims_tag (bool create_if_missing=true)
 Return the tag marking the lower and upper corners of boxes.
Tag global_box_dims_tag (bool create_if_missing=true)
 Return the tag marking the global lower and upper corners of boxes.
Tag part_method_tag (bool create_if_missing=true)
 Return the tag marking the partitioning method used to partition the box in parallel.
Tag box_periodic_tag (bool create_if_missing=true)
 Return the tag marking whether box is periodic in i and j.
Tag box_set_tag (bool create_if_missing=true)
 Return the tag marking the ScdBox for a set.
ScdBoxget_scd_box (EntityHandle eh)
 Return the ScdBox corresponding to the entity set passed in.
ErrorCode tag_shared_vertices (ParallelComm *pcomm, EntityHandle seth)
 Tag vertices with sharing data for parallel representations.

Static Public Member Functions

static ErrorCode compute_partition (int part_method, int np, int nr, const int *gijk, int *lijk)
 Compute a partition of structured parameter space.
static ErrorCode get_neighbor (int pfrom, int np, int part_method, const int *gdims, const int *ldims, bool periodic_i, bool periodic_j, int di, int dj, int dk, int &pto, int *bdy_ind, int *rdims, int *facedims)

Protected Member Functions

ErrorCode remove_box (ScdBox *box)
 Remove the box from the list on ScdInterface.
ErrorCode add_box (ScdBox *box)
 Add the box to the list on ScdInterface.

Friends

class ScdBox

Detailed Description

A structured mesh interface for MOAB-based data.

Structured mesh in MOAB is created and accessed through the ScdInterface and ScdBox classes.

Construction and Representation

Structured mesh can be constructed in one of two ways. First, a rectangular block of mesh, both vertices and edges/quads/hexes, can be created in one shot, using the construct_box method. In this case, there are single sequences of vertices/entities. The second method for creating structured mesh is to create the structured blocks of vertices and elements separately. In this case, different blocks of elements can share blocks of vertices, and each block of elements has its own independent parametric space. The algorithms behind this representation are described in T. Tautges, "MOAB-SD: Integrated structured and unstructured mesh representation", Eng. w Comp, vol 20 no. 3.

Structured mesh is represented in MOAB down at the element sequence level, which is something applications don't see. In addition, when structured mesh is created, entity sets are also created and tagged with information about the parametric space. In particular, the BOX_DIMS tag is used to indicate the lower and upper corners in parametric space (this tag is integer size 6). Structured mesh blocks are also available through ScdBox class objects returned by ScdInterface. These class objects should be treated only as references to the structured mesh blocks; that is, the structured mesh referenced by these objects is not deleted when the ScdBox instance is destroyed. Functions for destroying the actual mesh are are available on this class, though.

Structured mesh blocks are returned in the form of ScdBox class objects. Each ScdBox instance represents a rectangular block of vertices and possibly elements (edges, quads, or hexes). The edge/quad/hex entity handles for a ScdBox are guaranteed to be contiguous, starting at a starting value which is also available through the ScdBox class. However, vertex handles may or may not be contiguous, depending on the construction method. The start vertex handle is also available from the ScdBox class.

Parametric Space

Each structured box has a parametric (ijk) space, which can be queried through the ScdBox interface. For non-periodic boxes, the edge/quad/hex parameter bounds are one less in each dimension than that of the vertices. Entity handles are allocated in column-major order, that is, with the i parameter varying fastest, then j, then k.

Boxes can be periodic in i, or j, or both i and j. If only i or j is periodic, the corresponding mesh is a ring or annular cylinder; if both i and j are periodic, the corresponding mesh is an annular torus. A box cannot be periodic in all three parameters. If i and/or j is periodic, the parameter extent in the/each periodic direction is equal to that of the vertices in that direction.

Adjacent Entities

This interface supports parametric access to intermediate-dimension entities, e.g. adjacent faces and edges in a 3d mesh. In this case, a direction parameter is added, to identify the parametric direction of the entities being requested. For example, to retrieve the faces adjacent to a hex with parameters ijk, in the i parametric direction, you would use the parameters ijk0. These intermediate entities are not stored in a structured representation, but their parametric positions can be evaluated based on their adjacencies to higher-dimensional entities. Thanks to Milad Fatenejad for the thinking behind this.

Evaluation

The ScdBox class provides functions for evaluating the mesh based on the ijk parameter space. These functions are inlined where possible, for efficiency.


Member Enumeration Documentation

Partition method enumeration.

Enumerator:
ALLJORKORI 
ALLJKBAL 
SQIJ 
SQJK 

Constructor & Destructor Documentation

moab::ScdInterface::ScdInterface ( Core impl,
bool  find_boxes = false 
)

Constructor.

Constructor; if find_boxes is true, this will search for entity sets marked as structured blocks, based on the BOX_DIMS tag. Structured mesh blocks will be stored in this interface class for future retrieval. Structured mesh blocks created through this interface will also be stored here.

Parameters:
impl MOAB instance
find_boxes If true, search all the entity sets, caching the structured mesh blocks
moab::ScdInterface::~ScdInterface (  ) 

Member Function Documentation

ErrorCode moab::ScdInterface::add_box ( ScdBox box  )  [protected]

Add the box to the list on ScdInterface.

Tag moab::ScdInterface::box_dims_tag ( bool  create_if_missing = true  ) 

Return the tag marking the lower and upper corners of boxes.

Parameters:
create_if_missing If the tag does not yet exist, create it
Tag moab::ScdInterface::box_periodic_tag ( bool  create_if_missing = true  ) 

Return the tag marking whether box is periodic in i and j.

Parameters:
create_if_missing If the tag does not yet exist, create it
Tag moab::ScdInterface::box_set_tag ( bool  create_if_missing = true  ) 

Return the tag marking the ScdBox for a set.

Parameters:
create_if_missing If the tag does not yet exist, create it
ErrorCode moab::ScdInterface::compute_partition ( int  part_method,
int  np,
int  nr,
const int *  gijk,
int *  lijk 
) [inline, static]

Compute a partition of structured parameter space.

Compute a partition of structured parameter space

Parameters:
part_method Partition method; should be from PartitionMethod enum, or -1
np procs
nr Rank of this proc
iMin/jMax Global minimum/maximum i parameter
jMin/jMax Global minimum/maximum j parameter
kMin/kMax Global minimum/maximum k parameter
iMin/jMax Local minimum/maximum i parameter
jMin/jMax Local minimum/maximum j parameter
kMin/kMax Local minimum/maximum k parameter
ErrorCode moab::ScdInterface::construct_box ( HomCoord  low,
HomCoord  high,
double *  coords,
unsigned int  num_coords,
ScdBox *&  new_box,
bool  is_periodic_i = false,
bool  is_periodic_j = false 
)

Construct new structured mesh box, including both vertices and elements.

Parameter range for vertex box is [low-high], for elements is [low-high). Construct quads by passing in low[2] == high[2], and edges by passing in low[1] == high[1] and low[2] == high[2]. The result is passed back in a ScdBox*, which is a *reference* to the box of structured mesh. That is, the actual mesh is retained in MOAB when the ScdBox is destroyed. To actually destroy the mesh, call the destroy_mesh function on the ScdBox object first, before destroying it.

Parameters:
low Lower corner in parameter space
high Higher corner in parameter space
coords Coordinates of vertices, in column-major order; if NULL, no coords are set
num_coords Number of coordinate values; if zero, no coords are set
new_box Reference to box of structured mesh
is_periodic_i True if box is periodic in i direction
is_periodic_j True if box is periodic in j direction
ErrorCode moab::ScdInterface::create_scd_sequence ( HomCoord  low,
HomCoord  high,
EntityType  type,
int  starting_id,
ScdBox *&  new_box,
bool  is_periodic_i = false,
bool  is_periodic_j = false 
)

Create a structured sequence of vertices, quads, or hexes.

Starting handle for the sequence is available from the returned ScdBox. If creating a structured quad or hex box, subsequent calls must be made to ScdBox::add_vbox, until all the vertices have been filled in for the box.

Parameters:
low Lower corner of structured box
high Higher corner of structured box
type EntityType, one of MBVERTEX, MBEDGE, MBQUAD, MBHEX
starting_id Requested start id of entities
new_box Reference to the newly created box of entities
is_periodic_i True if box is periodic in i direction
is_periodic_j True if box is periodic in j direction
ErrorCode moab::ScdInterface::find_boxes ( Range boxes  ) 

Return all the structured mesh blocks in this MOAB instance, as entity set handles.

Return the structured blocks in this MOAB instance. If these were not searched for at instantiation time, then the search is done now.

Parameters:
boxes Range of entity set objects representing structured mesh blocks
ErrorCode moab::ScdInterface::find_boxes ( std::vector< ScdBox * > &  boxes  ) 

Return all the structured mesh blocks in this MOAB instance, as ScdBox objects.

Return the structured blocks in this MOAB instance. If these were not searched for at instantiation time, then the search is done now.

Parameters:
boxes Vector of ScdBox objects representing structured mesh blocks
ErrorCode moab::ScdInterface::get_boxes ( std::vector< ScdBox * > &  boxes  ) 

Return all the structured mesh blocks known by ScdInterface (does not search).

Return the structured blocks in this ScdInterface instance. Does not search for new boxes, just returns the contents of the list.

Parameters:
boxes Structured boxes
ErrorCode moab::ScdInterface::get_neighbor ( int  pfrom,
int  np,
int  part_method,
const int *  gdims,
const int *  ldims,
bool  periodic_i,
bool  periodic_j,
int  di,
int  dj,
int  dk,
int &  pto,
int *  bdy_ind,
int *  rdims,
int *  facedims 
) [inline, static]
ScdBox* moab::ScdInterface::get_scd_box ( EntityHandle  eh  ) 

Return the ScdBox corresponding to the entity set passed in.

If the entity isn't a structured box set, NULL is returned.

Parameters:
eh Entity whose box is being queried
Tag moab::ScdInterface::global_box_dims_tag ( bool  create_if_missing = true  ) 

Return the tag marking the global lower and upper corners of boxes.

Parameters:
create_if_missing If the tag does not yet exist, create it
Interface* moab::ScdInterface::impl (  )  const

Return the MOAB Interface instance *.

Tag moab::ScdInterface::part_method_tag ( bool  create_if_missing = true  ) 

Return the tag marking the partitioning method used to partition the box in parallel.

Parameters:
create_if_missing If the tag does not yet exist, create it
ErrorCode moab::ScdInterface::remove_box ( ScdBox box  )  [protected]

Remove the box from the list on ScdInterface.

ErrorCode moab::ScdInterface::tag_shared_vertices ( ParallelComm pcomm,
EntityHandle  seth 
)

Tag vertices with sharing data for parallel representations.

Given the ParallelComm object to use, tag the vertices shared with other processors


Friends And Related Function Documentation

friend class ScdBox [friend]

The documentation for this class was generated from the following file:
Generated on Thu Nov 3 00:32:02 2011 for moab by  doxygen 1.6.3