PPL Logo

libs/ck-libs/ParFUM-Tops/ParFUM_TOPS.h File Reference

A ParFUM "Tops" compatibility layer API Definition. More...

Go to the source code of this file.

Data Structures

struct  TopModel
 A tops model is roughly equivalent to a ParFUM FEM_Mesh object. More...
class  TopNodeItr
 Node Iterator. More...
class  TopElemItr
 Element Iterator. More...
class  TopNodeElemItr
 Node->Element adjacency Iterator. More...
class  TopFacetItr
 Facet Iterator. More...

Functions

int tops_lib_FP_Type_Size ()
 Return the size of the FP Type the PTops library was compiled with, in bytes.
void top_set_device (TopModel *m, TopDevice d)
 Select the device kernels should be run on.
TopDevice top_target_device (TopModel *m)
 Return the device kernels should be run on.
TopModeltopModel_Create_Init ()
 Create and access a Tops model.
TopModeltopModel_Create_Driver (TopDevice target_device, int elem_attr_sz, int node_attr_sz, int model_attr_sz, void *mAtt)
 Create and access a Tops model.
void topModel_Destroy (TopModel *m)
 Cleanup a model.
TopNode topModel_InsertNode (TopModel *, float x, float y, float z)
 Insert a node.
TopNode topModel_InsertNode (TopModel *, double x, double y, double z)
void topModel_SuggestInitialSize (TopModel *m, unsigned numNodes, unsigned numElements)
void topNode_SetId (TopModel *, TopNode, TopID id)
 Set id of a node.
void topNode_SetAttrib (TopModel *, TopNode, void *)
 Set attribute of a node.
TopElement topModel_InsertElem (TopModel *, TopElemType, TopNode *)
 Insert an element.
void topElement_SetId (TopModel *, TopElement, TopID id)
 Set id of an element.
int topElement_GetId (TopModel *m, TopElement e)
 Get id of an element.
void topElement_SetAttrib (TopModel *, TopElement, void *)
 Set attribute of an element.
TopNode topModel_GetNodeAtId (TopModel *, TopID)
 Get node via id.
void * topNode_GetAttrib (TopModel *, TopNode)
 Get nodal attribute.
void * topElement_GetAttrib (TopModel *, TopElement)
 Get element attribute.
TopNode topElement_GetNode (TopModel *, TopElement, int idx)
 Get node via id.
TopElement topModel_GetElemAtId (TopModel *m, TopID id)
 Get element via id.
int topNode_GetId (TopModel *m, TopNode n)
int topModel_GetNNodes (TopModel *model)
int topElement_GetNNodes (TopModel *model, TopElement elem)
bool topElement_IsCohesive (TopModel *m, TopElement e)
void topNode_GetPosition (TopModel *model, TopNode node, float *x, float *y, float *z)
void topNode_GetPosition (TopModel *model, TopNode node, double *x, double *y, double *z)
void top_retrieve_elem_data (TopModel *m)
void top_retrieve_node_data (TopModel *m)
void top_put_elem_data (TopModel *m)
void top_put_node_data (TopModel *m)
void top_retrieve_data (TopModel *m)
void top_put_data (TopModel *m)
int topFacet_GetNNodes (TopModel *m, TopFacet f)
TopNode topFacet_GetNode (TopModel *m, TopFacet f, int i)
TopElement topFacet_GetElem (TopModel *m, TopFacet f, int i)
bool topElement_IsValid (TopModel *m, TopElement e)
bool topVertex_IsBoundary (TopModel *m, TopVertex v)
TopVertex topNode_GetVertex (TopModel *m, TopNode n)
TopElement topModel_InsertCohesiveAtFacet (TopModel *m, int ElemType, TopFacet f)
bool haveConfigurableCPUGPUMap ()
bool isPartitionCPU (int partition)
bool isPartitionGPU (int partition)
int configurableCPUGPUMapNumNodes ()
TopNodeItrtopModel_CreateNodeItr (TopModel *)
 Create Iterator for nodes.
void topNodeItr_Destroy (TopNodeItr *)
 Destroy Iterator.
void topNodeItr_Begin (TopNodeItr *)
 Initialize Iterator.
bool topNodeItr_IsValid (TopNodeItr *)
 Determine if Iterator is valid or if it has iterated past last Node.
void topNodeItr_Next (TopNodeItr *)
 Increment iterator.
TopNode topNodeItr_GetCurr (TopNodeItr *)
 Get TopNode associated with the iterator.
int topModel_GetNElem (TopModel *m)
 Get total number of elements.
TopElemItrtopModel_CreateElemItr (TopModel *)
 Create Iterator for elements.
void topElemItr_Destroy (TopElemItr *)
 Destroy Iterator.
void topElemItr_Begin (TopElemItr *)
 Initialize Iterator.
bool topElemItr_IsValid (TopElemItr *)
 Determine if Iterator is valid or if it has iterated past last Element.
void topElemItr_Next (TopElemItr *)
 Increment iterator.
TopElement topElemItr_GetCurr (TopElemItr *)
 Get TopElement associated with the iterator.
void topModel_TestIterators (TopModel *m)
 Perform sanity check on iterators.
TopNodeElemItrtopModel_CreateNodeElemItr (TopModel *m, TopNode n)
bool topNodeElemItr_IsValid (TopNodeElemItr *neitr)
void topNodeElemItr_Next (TopNodeElemItr *neitr)
TopElement topNodeElemItr_GetCurr (TopNodeElemItr *neitr)
void topNodeElemItr_Destroy (TopNodeElemItr *neitr)
TopFacetItrtopModel_CreateFacetItr (TopModel *m)
void topFacetItr_Begin (TopFacetItr *itr)
bool topFacetItr_IsValid (TopFacetItr *itr)
void topFacetItr_Next (TopFacetItr *itr)
 Iterate to the next facet.
TopFacet topFacetItr_GetCurr (TopFacetItr *itr)
void topFacetItr_Destroy (TopFacetItr *itr)


Detailed Description

A ParFUM "Tops" compatibility layer API Definition.

Author:
Isaac Dooley
ParFUM-TOPS provides a Tops-like API for ParFUM.

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

Definition in file ParFUM_TOPS.h.


Function Documentation

int tops_lib_FP_Type_Size (  ) 

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

void top_set_device ( TopModel m,
TopDevice  d 
)

Select the device kernels should be run on.

TopDevice top_target_device ( TopModel m  ) 

Return the device kernels should be run on.

TopModel* topModel_Create_Init (  ) 

Create and access a Tops model.

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

TopModel* topModel_Create_Driver ( TopDevice  target_device,
int  elem_attr_sz,
int  node_attr_sz,
int  model_attr_sz,
void *  mAtt 
)

Create and access a Tops model.

Only call from Driver

void topModel_Destroy ( TopModel m  ) 

Cleanup a model.

Currently does nothing

TopNode topModel_InsertNode ( TopModel ,
float  x,
float  y,
float  z 
)

Insert a node.

TopNode topModel_InsertNode ( TopModel ,
double  x,
double  y,
double  z 
)

void topModel_SuggestInitialSize ( TopModel m,
unsigned  numNodes,
unsigned  numElements 
)

void topNode_SetId ( TopModel ,
TopNode  ,
TopID  id 
)

Set id of a node.

void topNode_SetAttrib ( TopModel ,
TopNode  ,
void *   
)

Set attribute of a node.

TopElement topModel_InsertElem ( TopModel ,
TopElemType  ,
TopNode  
)

Insert an element.

void topElement_SetId ( TopModel ,
TopElement  ,
TopID  id 
)

Set id of an element.

int topElement_GetId ( TopModel m,
TopElement  e 
)

Get id of an element.

void topElement_SetAttrib ( TopModel ,
TopElement  ,
void *   
)

Set attribute of an element.

TopNode topModel_GetNodeAtId ( TopModel ,
TopID   
)

Get node via id.

void* topNode_GetAttrib ( TopModel ,
TopNode   
)

Get nodal attribute.

void* topElement_GetAttrib ( TopModel ,
TopElement   
)

Get element attribute.

TopNode topElement_GetNode ( TopModel ,
TopElement  ,
int  idx 
)

Get node via id.

TopElement topModel_GetElemAtId ( TopModel m,
TopID  id 
) [inline]

Get element via id.

Definition at line 195 of file ParFUM_TOPS.h.

References elem, TopModel::elemIDHash, CkHashtableT< KEY, OBJ >::get(), TopModel::mesh, BasicTable2d< T >::size(), TOP_ELEMENT_TET4, and TopElement::type.

Here is the call graph for this function:

int topNode_GetId ( TopModel m,
TopNode  n 
)

int topModel_GetNNodes ( TopModel model  ) 

int topElement_GetNNodes ( TopModel model,
TopElement  elem 
)

bool topElement_IsCohesive ( TopModel m,
TopElement  e 
)

void topNode_GetPosition ( TopModel model,
TopNode  node,
float x,
float y,
float z 
)

void topNode_GetPosition ( TopModel model,
TopNode  node,
double *  x,
double *  y,
double *  z 
)

void top_retrieve_elem_data ( TopModel m  ) 

void top_retrieve_node_data ( TopModel m  ) 

void top_put_elem_data ( TopModel m  ) 

void top_put_node_data ( TopModel m  ) 

void top_retrieve_data ( TopModel m  ) 

void top_put_data ( TopModel m  ) 

int topFacet_GetNNodes ( TopModel m,
TopFacet  f 
)

TopNode topFacet_GetNode ( TopModel m,
TopFacet  f,
int  i 
)

TopElement topFacet_GetElem ( TopModel m,
TopFacet  f,
int  i 
)

bool topElement_IsValid ( TopModel m,
TopElement  e 
)

bool topVertex_IsBoundary ( TopModel m,
TopVertex  v 
)

TopVertex topNode_GetVertex ( TopModel m,
TopNode  n 
)

TopElement topModel_InsertCohesiveAtFacet ( TopModel m,
int  ElemType,
TopFacet  f 
)

bool haveConfigurableCPUGPUMap (  ) 

bool isPartitionCPU ( int  partition  ) 

bool isPartitionGPU ( int  partition  ) 

int configurableCPUGPUMapNumNodes (  ) 

TopNodeItr * topModel_CreateNodeItr ( TopModel model  )  [inline]

Create Iterator for nodes.

Definition at line 352 of file ParFUM_TOPS.h.

References TopNodeItr::model.

void topNodeItr_Destroy ( TopNodeItr itr  )  [inline]

Destroy Iterator.

Definition at line 358 of file ParFUM_TOPS.h.

void topNodeItr_Begin ( TopNodeItr itr  )  [inline]

Initialize Iterator.

Definition at line 362 of file ParFUM_TOPS.h.

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

Here is the call graph for this function:

bool topNodeItr_IsValid ( TopNodeItr itr  )  [inline]

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

Definition at line 384 of file ParFUM_TOPS.h.

References FEM_Entity::is_valid_any_idx(), TopModel::mesh, TopNodeItr::model, FEM_Mesh::node, and TopNodeItr::parfum_index.

Referenced by topNodeItr_GetCurr(), and topNodeItr_Next().

Here is the call graph for this function:

Here is the caller graph for this function:

void topNodeItr_Next ( TopNodeItr itr  )  [inline]

Increment iterator.

Definition at line 388 of file ParFUM_TOPS.h.

References FEM_Entity::is_valid_any_idx(), TopModel::mesh, TopNodeItr::model, FEM_Mesh::node, TopNodeItr::parfum_index, FEM_Entity::size(), and topNodeItr_IsValid().

Here is the call graph for this function:

TopNode topNodeItr_GetCurr ( TopNodeItr itr  )  [inline]

Get TopNode associated with the iterator.

Definition at line 408 of file ParFUM_TOPS.h.

References TopNodeItr::parfum_index, and topNodeItr_IsValid().

Here is the call graph for this function:

int topModel_GetNElem ( TopModel m  ) 

Get total number of elements.

TopElemItr * topModel_CreateElemItr ( TopModel model  )  [inline]

Create Iterator for elements.

Definition at line 421 of file ParFUM_TOPS.h.

References TopElemItr::model, TOP_ELEMENT_TET4, and TopElemItr::type.

Referenced by topFacetItr_Begin().

Here is the caller graph for this function:

void topElemItr_Destroy ( TopElemItr itr  )  [inline]

Destroy Iterator.

Definition at line 428 of file ParFUM_TOPS.h.

void topElemItr_Begin ( TopElemItr itr  )  [inline]

Initialize Iterator.

Definition at line 432 of file ParFUM_TOPS.h.

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

Referenced by topFacetItr_Begin().

Here is the call graph for this function:

Here is the caller graph for this function:

bool topElemItr_IsValid ( TopElemItr itr  )  [inline]

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

Definition at line 457 of file ParFUM_TOPS.h.

References TopElemItr::done.

Referenced by topElemItr_GetCurr(), topElemItr_Next(), topFacetItr_IsValid(), and topFacetItr_Next().

Here is the caller graph for this function:

void topElemItr_Next ( TopElemItr itr  )  [inline]

Increment iterator.

Definition at line 461 of file ParFUM_TOPS.h.

References TopElemItr::done, FEM_Mesh::elem, TopModel::mesh, TopElemItr::model, TopElemItr::parfum_index, FEM_Entity_Types< T >::size(), TOP_ELEMENT_TET4, and topElemItr_IsValid().

Referenced by topFacetItr_Next().

Here is the call graph for this function:

Here is the caller graph for this function:

TopElement topElemItr_GetCurr ( TopElemItr itr  )  [inline]

Get TopElement associated with the iterator.

Definition at line 482 of file ParFUM_TOPS.h.

References TopElemItr::parfum_index, topElemItr_IsValid(), TopElemItr::type, and TopElement::type.

Referenced by topFacetItr_Begin(), topFacetItr_GetCurr(), and topFacetItr_Next().

Here is the call graph for this function:

Here is the caller graph for this function:

void topModel_TestIterators ( TopModel 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()

TopNodeElemItr * topModel_CreateNodeElemItr ( TopModel m,
TopNode  n 
) [inline]

bool topNodeElemItr_IsValid ( TopNodeElemItr neitr  )  [inline]

Definition at line 516 of file ParFUM_TOPS.h.

References TopNodeElemItr::current_index, and TopNodeElemItr::numAdjElem.

Referenced by topNodeElemItr_GetCurr().

Here is the caller graph for this function:

void topNodeElemItr_Next ( TopNodeElemItr neitr  )  [inline]

Definition at line 520 of file ParFUM_TOPS.h.

References TopNodeElemItr::current_index.

TopElement topNodeElemItr_GetCurr ( TopNodeElemItr neitr  )  [inline]

void topNodeElemItr_Destroy ( TopNodeElemItr neitr  )  [inline]

Definition at line 536 of file ParFUM_TOPS.h.

TopFacetItr * topModel_CreateFacetItr ( TopModel m  )  [inline]

Definition at line 550 of file ParFUM_TOPS.h.

References TopFacetItr::model.

void topFacetItr_Begin ( TopFacetItr itr  )  [inline]

bool topFacetItr_IsValid ( TopFacetItr itr  )  [inline]

Definition at line 606 of file ParFUM_TOPS.h.

References TopFacetItr::elemItr, and topElemItr_IsValid().

Here is the call graph for this function:

void topFacetItr_Next ( TopFacetItr itr  )  [inline]

Iterate to the next facet.

Definition at line 558 of file ParFUM_TOPS.h.

References FEM_Mesh::e2e_getElem(), TopFacetItr::elemItr, TopModel::mesh, TopFacetItr::model, topElemItr_GetCurr(), topElemItr_IsValid(), topElemItr_Next(), TopElement::type, and TopFacetItr::whichFacet.

Referenced by topFacetItr_Begin().

Here is the call graph for this function:

Here is the caller graph for this function:

TopFacet topFacetItr_GetCurr ( TopFacetItr itr  )  [inline]

void topFacetItr_Destroy ( TopFacetItr itr  )  [inline]

Definition at line 659 of file ParFUM_TOPS.h.


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