PPL Logo

libs/ck-libs/ParFUM-Iterators/ParFUM_Iterators.h File Reference

A ParFUM Iterators compatibility layer API. More...

Go to the source code of this file.

Data Structures

class  MeshModel
 A mesh model is roughly equivalent to a ParFUM FEM_Mesh object. More...
class  MeshNodeItr
 Node Iterator. More...
class  MeshElemItr
 Element Iterator. More...
class  MeshNodeElemItr
 Node->Element adjacency Iterator. More...
class  MeshFacetItr
 Facet Iterator. More...

Functions

void allocateModelForCUDADevice (MeshModel *model)
void deallocateModelForCUDADevice (MeshModel *model)
int lib_FP_Type_Size ()
 Return the size of the FP Type the library was compiled with, in bytes.
void mesh_set_device (MeshModel *m, MeshDevice d)
 Select the device kernels should be run on.
MeshDevice mesh_target_device (MeshModel *m)
 Return the device kernels should be run on.
MeshModelmeshModel_Create_Init ()
 Create and access a mesh model.
void meshModel_Create_Driver (MeshDevice target_device, int elem_attr_sz, int node_attr_sz, int model_attr_sz, void *mAtt, MeshModel &model)
 Create and access a mesh model.
void meshModel_Destroy (MeshModel *m)
 Cleanup a model.
MeshNode meshModel_InsertNode (MeshModel *, float x, float y, float z)
 Insert a node.
MeshNode meshModel_InsertNode (MeshModel *, double x, double y, double z)
void meshModel_SuggestInitialSize (MeshModel *m, unsigned numNodes, unsigned numElements)
void meshNode_SetId (MeshModel *, MeshNode, EntityID id)
 Set id of a node.
void meshNode_SetAttrib (MeshModel *, MeshNode, void *)
 Set attribute of a node.
MeshElement meshModel_InsertElem (MeshModel *, MeshElementType, MeshNode *)
 Insert an element.
void meshElement_SetId (MeshModel *, MeshElement, EntityID id)
 Set id of an element.
int meshElement_GetId (MeshModel *m, MeshElement e)
 Get id of an element.
void meshElement_SetAttrib (MeshModel *, MeshElement, void *)
 Set attribute of an element.
MeshNode meshModel_GetNodeAtId (MeshModel *, EntityID)
 Get node via id.
void * meshNode_GetAttrib (MeshModel *, MeshNode)
 Get nodal attribute.
void * meshElement_GetAttrib (MeshModel *, MeshElement)
 Get element attribute.
MeshNode meshElement_GetNode (MeshModel *, MeshElement, int idx)
 Get node via id.
MeshElement meshModel_GetElemAtId (MeshModel *m, EntityID id)
 Get element via id.
int meshNode_GetId (MeshModel *m, MeshNode n)
int meshModel_GetNNodes (MeshModel *model)
int meshElement_GetNNodes (MeshModel *model, MeshElement elem)
bool meshElement_IsCohesive (MeshModel *m, MeshElement e)
void meshNode_GetPosition (MeshModel *model, MeshNode node, float *x, float *y, float *z)
void meshNode_GetPosition (MeshModel *model, MeshNode node, double *x, double *y, double *z)
void mesh_retrieve_elem_data (MeshModel *m)
void mesh_retrieve_node_data (MeshModel *m)
void mesh_put_elem_data (MeshModel *m)
void mesh_put_node_data (MeshModel *m)
void mesh_retrieve_data (MeshModel *m)
void mesh_put_data (MeshModel *m)
int meshFacet_GetNNodes (MeshModel *m, MeshFacet f)
MeshNode meshFacet_GetNode (MeshModel *m, MeshFacet f, int i)
MeshElement meshFacet_GetElem (MeshModel *m, MeshFacet f, int i)
bool meshElement_IsValid (MeshModel *m, MeshElement e)
bool meshVertex_IsBoundary (MeshModel *m, MeshVertex v)
MeshVertex meshNode_GetVertex (MeshModel *m, MeshNode n)
MeshElement meshModel_InsertCohesiveAtFacet (MeshModel *m, int ElemType, MeshFacet f)
bool haveConfigurableCPUGPUMap ()
bool isPartitionCPU (int partition)
bool isPartitionGPU (int partition)
int configurableCPUGPUMapNumNodes ()
MeshNodeItrmeshModel_CreateNodeItr (MeshModel *)
 Create Iterator for nodes.
void meshNodeItr_Destroy (MeshNodeItr *)
 Destroy Iterator.
void meshNodeItr_Begin (MeshNodeItr *)
 Initialize Iterator.
bool meshNodeItr_IsValid (MeshNodeItr *)
 Determine if Iterator is valid or if it has iterated past last Node.
void meshNodeItr_Next (MeshNodeItr *)
 Increment iterator.
MeshNode meshNodeItr_GetCurr (MeshNodeItr *)
 Get MeshNode associated with the iterator.
int meshModel_GetNElem (MeshModel *m)
 Get total number of elements.
MeshElemItrmeshModel_CreateElemItr (MeshModel *)
 Create Iterator for elements.
void meshElemItr_Destroy (MeshElemItr *)
 Destroy Iterator.
void meshElemItr_Begin (MeshElemItr *)
 Initialize Iterator.
bool meshElemItr_IsValid (MeshElemItr *)
 Determine if Iterator is valid or if it has iterated past last Element.
void meshElemItr_Next (MeshElemItr *)
 Increment iterator.
MeshElement meshElemItr_GetCurr (MeshElemItr *)
 Get MeshElement associated with the iterator.
void meshModel_TestIterators (MeshModel *m)
 Perform sanity check on iterators.
MeshNodeElemItrmeshModel_CreateNodeElemItr (MeshModel *m, MeshNode n)
bool meshNodeElemItr_IsValid (MeshNodeElemItr *neitr)
void meshNodeElemItr_Next (MeshNodeElemItr *neitr)
MeshElement meshNodeElemItr_GetCurr (MeshNodeElemItr *neitr)
void meshNodeElemItr_Destroy (MeshNodeElemItr *neitr)
MeshFacetItrmeshModel_CreateFacetItr (MeshModel *m)
void meshFacetItr_Begin (MeshFacetItr *itr)
bool meshFacetItr_IsValid (MeshFacetItr *itr)
void meshFacetItr_Next (MeshFacetItr *itr)
 Iterate to the next facet.
MeshFacet meshFacetItr_GetCurr (MeshFacetItr *itr)
void meshFacetItr_Destroy (MeshFacetItr *itr)
void setTableReferences (MeshModel *model, bool recomputeHash=false)


Detailed Description

A ParFUM Iterators compatibility layer API.

Author:
Isaac Dooley

Aaron Becker

ParFUM-Iterators provides iterators for ParFUM meshes that work on a variety of platforms.

Note:
NodeAtt and ElemAtt are just replaced with void* for this implementation.

Definition in file ParFUM_Iterators.h.


Function Documentation

void allocateModelForCUDADevice ( MeshModel model  ) 

void deallocateModelForCUDADevice ( MeshModel model  ) 

int lib_FP_Type_Size (  ) 

Return the size of the FP Type the library was compiled with, in bytes.

void mesh_set_device ( MeshModel m,
MeshDevice  d 
)

Select the device kernels should be run on.

MeshDevice mesh_target_device ( MeshModel m  ) 

Return the device kernels should be run on.

MeshModel* meshModel_Create_Init (  ) 

Create and access a mesh model.

Only call from Init Currently only one model can be created. To extend, each model must just reference a different FEM_Mesh object

void meshModel_Create_Driver ( MeshDevice  target_device,
int  elem_attr_sz,
int  node_attr_sz,
int  model_attr_sz,
void *  mAtt,
MeshModel model 
)

Create and access a mesh model.

Only call from Driver

void meshModel_Destroy ( MeshModel m  ) 

Cleanup a model.

Currently does nothing

MeshNode meshModel_InsertNode ( MeshModel ,
float  x,
float  y,
float  z 
)

Insert a node.

MeshNode meshModel_InsertNode ( MeshModel ,
double  x,
double  y,
double  z 
)

void meshModel_SuggestInitialSize ( MeshModel m,
unsigned  numNodes,
unsigned  numElements 
)

void meshNode_SetId ( MeshModel ,
MeshNode  ,
EntityID  id 
)

Set id of a node.

void meshNode_SetAttrib ( MeshModel ,
MeshNode  ,
void *   
)

Set attribute of a node.

MeshElement meshModel_InsertElem ( MeshModel ,
MeshElementType  ,
MeshNode  
)

Insert an element.

void meshElement_SetId ( MeshModel ,
MeshElement  ,
EntityID  id 
)

Set id of an element.

int meshElement_GetId ( MeshModel m,
MeshElement  e 
)

Get id of an element.

void meshElement_SetAttrib ( MeshModel ,
MeshElement  ,
void *   
)

Set attribute of an element.

MeshNode meshModel_GetNodeAtId ( MeshModel ,
EntityID   
)

Get node via id.

void* meshNode_GetAttrib ( MeshModel ,
MeshNode   
)

Get nodal attribute.

void* meshElement_GetAttrib ( MeshModel ,
MeshElement   
)

Get element attribute.

MeshNode meshElement_GetNode ( MeshModel ,
MeshElement  ,
int  idx 
)

Get node via id.

MeshElement meshModel_GetElemAtId ( MeshModel m,
EntityID  id 
) [inline]

Get element via id.

Definition at line 236 of file ParFUM_Iterators.h.

References elem, MeshModel::elemIDHash, CkHashtableT< KEY, OBJ >::get(), ElemID::id, MeshModel::mesh, MESH_ELEMENT_TET4, BasicTable2d< T >::size(), and ElemID::type.

Here is the call graph for this function:

int meshNode_GetId ( MeshModel m,
MeshNode  n 
)

int meshModel_GetNNodes ( MeshModel model  ) 

int meshElement_GetNNodes ( MeshModel model,
MeshElement  elem 
)

bool meshElement_IsCohesive ( MeshModel m,
MeshElement  e 
)

void meshNode_GetPosition ( MeshModel model,
MeshNode  node,
float x,
float y,
float z 
)

void meshNode_GetPosition ( MeshModel model,
MeshNode  node,
double *  x,
double *  y,
double *  z 
)

void mesh_retrieve_elem_data ( MeshModel m  ) 

void mesh_retrieve_node_data ( MeshModel m  ) 

void mesh_put_elem_data ( MeshModel m  ) 

void mesh_put_node_data ( MeshModel m  ) 

void mesh_retrieve_data ( MeshModel m  ) 

void mesh_put_data ( MeshModel m  ) 

int meshFacet_GetNNodes ( MeshModel m,
MeshFacet  f 
)

MeshNode meshFacet_GetNode ( MeshModel m,
MeshFacet  f,
int  i 
)

MeshElement meshFacet_GetElem ( MeshModel m,
MeshFacet  f,
int  i 
)

bool meshElement_IsValid ( MeshModel m,
MeshElement  e 
)

bool meshVertex_IsBoundary ( MeshModel m,
MeshVertex  v 
)

MeshVertex meshNode_GetVertex ( MeshModel m,
MeshNode  n 
)

MeshElement meshModel_InsertCohesiveAtFacet ( MeshModel m,
int  ElemType,
MeshFacet  f 
)

bool haveConfigurableCPUGPUMap (  ) 

bool isPartitionCPU ( int  partition  ) 

bool isPartitionGPU ( int  partition  ) 

int configurableCPUGPUMapNumNodes (  ) 

MeshNodeItr * meshModel_CreateNodeItr ( MeshModel model  )  [inline]

Create Iterator for nodes.

Definition at line 382 of file ParFUM_Iterators.h.

References MeshNodeItr::model.

void meshNodeItr_Destroy ( MeshNodeItr itr  )  [inline]

Destroy Iterator.

Definition at line 388 of file ParFUM_Iterators.h.

void meshNodeItr_Begin ( MeshNodeItr itr  )  [inline]

Initialize Iterator.

Definition at line 392 of file ParFUM_Iterators.h.

References FEM_Entity::ghost, FEM_Entity::is_valid_any_idx(), MeshModel::mesh, MeshNodeItr::model, FEM_Mesh::node, MeshNodeItr::parfum_index, and FEM_Entity::size().

Here is the call graph for this function:

bool meshNodeItr_IsValid ( MeshNodeItr itr  )  [inline]

Determine if Iterator is valid or if it has iterated past last Node.

Definition at line 414 of file ParFUM_Iterators.h.

References FEM_Entity::is_valid_any_idx(), MeshModel::mesh, MeshNodeItr::model, FEM_Mesh::node, and MeshNodeItr::parfum_index.

Referenced by meshNodeItr_GetCurr(), and meshNodeItr_Next().

Here is the call graph for this function:

Here is the caller graph for this function:

void meshNodeItr_Next ( MeshNodeItr itr  )  [inline]

Increment iterator.

Definition at line 418 of file ParFUM_Iterators.h.

References FEM_Entity::is_valid_any_idx(), MeshModel::mesh, meshNodeItr_IsValid(), MeshNodeItr::model, FEM_Mesh::node, MeshNodeItr::parfum_index, and FEM_Entity::size().

Here is the call graph for this function:

MeshNode meshNodeItr_GetCurr ( MeshNodeItr itr  )  [inline]

Get MeshNode associated with the iterator.

Definition at line 438 of file ParFUM_Iterators.h.

References meshNodeItr_IsValid(), and MeshNodeItr::parfum_index.

Here is the call graph for this function:

int meshModel_GetNElem ( MeshModel m  ) 

Get total number of elements.

MeshElemItr * meshModel_CreateElemItr ( MeshModel model  )  [inline]

Create Iterator for elements.

Definition at line 451 of file ParFUM_Iterators.h.

References MESH_ELEMENT_TET4, MeshElemItr::model, and MeshElemItr::type.

Referenced by meshFacetItr_Begin().

Here is the caller graph for this function:

void meshElemItr_Destroy ( MeshElemItr itr  )  [inline]

Destroy Iterator.

Definition at line 458 of file ParFUM_Iterators.h.

void meshElemItr_Begin ( MeshElemItr itr  )  [inline]

Initialize Iterator.

Definition at line 462 of file ParFUM_Iterators.h.

References MeshElemItr::done, FEM_Mesh::elem, MeshModel::mesh, MeshElemItr::model, MeshElemItr::parfum_index, FEM_Entity_Types< T >::size(), and MeshElemItr::type.

Referenced by meshFacetItr_Begin().

Here is the call graph for this function:

Here is the caller graph for this function:

bool meshElemItr_IsValid ( MeshElemItr itr  )  [inline]

Determine if Iterator is valid or if it has iterated past last Element.

Definition at line 487 of file ParFUM_Iterators.h.

References MeshElemItr::done.

Referenced by meshElemItr_GetCurr(), meshElemItr_Next(), meshFacetItr_IsValid(), and meshFacetItr_Next().

Here is the caller graph for this function:

void meshElemItr_Next ( MeshElemItr itr  )  [inline]

Increment iterator.

Definition at line 491 of file ParFUM_Iterators.h.

References MeshElemItr::done, FEM_Mesh::elem, MeshModel::mesh, MESH_ELEMENT_TET4, meshElemItr_IsValid(), MeshElemItr::model, MeshElemItr::parfum_index, and FEM_Entity_Types< T >::size().

Referenced by meshFacetItr_Next().

Here is the call graph for this function:

Here is the caller graph for this function:

MeshElement meshElemItr_GetCurr ( MeshElemItr itr  )  [inline]

Get MeshElement associated with the iterator.

Definition at line 513 of file ParFUM_Iterators.h.

References ElemID::id, meshElemItr_IsValid(), MeshElemItr::parfum_index, MeshElemItr::type, and ElemID::type.

Referenced by meshFacetItr_Begin(), meshFacetItr_GetCurr(), and meshFacetItr_Next().

Here is the call graph for this function:

Here is the caller graph for this function:

void meshModel_TestIterators ( MeshModel m  ) 

Perform sanity check on iterators.

This checks to make sure that the count of the itereated elements and nodes matches that returned by ParFUM's countValid()

MeshNodeElemItr * meshModel_CreateNodeElemItr ( MeshModel m,
MeshNode  n 
) [inline]

bool meshNodeElemItr_IsValid ( MeshNodeElemItr neitr  )  [inline]

Definition at line 547 of file ParFUM_Iterators.h.

References MeshNodeElemItr::current_index, and MeshNodeElemItr::numAdjElem.

Referenced by meshNodeElemItr_GetCurr().

Here is the caller graph for this function:

void meshNodeElemItr_Next ( MeshNodeElemItr neitr  )  [inline]

Definition at line 551 of file ParFUM_Iterators.h.

References MeshNodeElemItr::current_index.

MeshElement meshNodeElemItr_GetCurr ( MeshNodeElemItr neitr  )  [inline]

void meshNodeElemItr_Destroy ( MeshNodeElemItr neitr  )  [inline]

Definition at line 567 of file ParFUM_Iterators.h.

MeshFacetItr * meshModel_CreateFacetItr ( MeshModel m  )  [inline]

Definition at line 581 of file ParFUM_Iterators.h.

References MeshFacetItr::model.

void meshFacetItr_Begin ( MeshFacetItr itr  )  [inline]

bool meshFacetItr_IsValid ( MeshFacetItr itr  )  [inline]

Definition at line 637 of file ParFUM_Iterators.h.

References MeshFacetItr::elemItr, and meshElemItr_IsValid().

Here is the call graph for this function:

void meshFacetItr_Next ( MeshFacetItr itr  )  [inline]

Iterate to the next facet.

Definition at line 589 of file ParFUM_Iterators.h.

References FEM_Mesh::e2e_getElem(), MeshFacetItr::elemItr, ElemID::id, MeshModel::mesh, meshElemItr_GetCurr(), meshElemItr_IsValid(), meshElemItr_Next(), MeshFacetItr::model, ElemID::type, and MeshFacetItr::whichFacet.

Referenced by meshFacetItr_Begin().

Here is the call graph for this function:

Here is the caller graph for this function:

MeshFacet meshFacetItr_GetCurr ( MeshFacetItr itr  )  [inline]

void meshFacetItr_Destroy ( MeshFacetItr itr  )  [inline]

Definition at line 686 of file ParFUM_Iterators.h.

void setTableReferences ( MeshModel model,
bool  recomputeHash = false 
)


Generated on Mon Sep 21 08:10:32 2020 for Charm++ by  doxygen 1.5.5