Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
moab::ElemEvaluator Class Reference

Class facilitating local discretization-related functionsThis class implements discretization-related functionality operating on data in MOAB. A member of this class caches certain data about the element it's currently operating on, but is not meant to be instantiated one-per-element, but rather one-per-search (or other operation on a collection of elements). More...

#include <ElemEvaluator.hpp>

+ Collaboration diagram for moab::ElemEvaluator:

Public Member Functions

 ElemEvaluator (Interface *impl, EntityHandle ent=0, Tag tag=0, int tagged_ent_dim=-1)
 Constructor. More...
 
 ~ElemEvaluator ()
 
ErrorCode eval (const double *params, double *result, int num_tuples=-1) const
 Evaluate cached tag at a given parametric location within the cached entity If evaluating coordinates, call set_tag(0, 0), which indicates coords instead of a tag. More...
 
ErrorCode reverse_eval (const double *posn, double iter_tol, double inside_tol, double *params, int *is_inside=NULL) const
 Reverse-evaluate the cached entity at a given physical position. More...
 
ErrorCode get_normal (const int ientDim, const int facet, double normal[3]) const
 Evaluate the normal to a facet of an entity. More...
 
ErrorCode jacobian (const double *params, double *result) const
 Evaluate the jacobian of the cached entity at a given parametric location. More...
 
ErrorCode integrate (double *result) const
 Integrate the cached tag over the cached entity. More...
 
int inside (const double *params, const double tol) const
 Return whether a physical position is inside the cached entity to within a tolerance. More...
 
ErrorCode find_containing_entity (Range &entities, const double *point, const double iter_tol, const double inside_tol, EntityHandle &containing_ent, double *params, unsigned int *num_evals=NULL)
 Given a list of entities, return the entity the point is in, or none This function reverse-evaluates the entities, returning the first entity containing the point. If no entity contains the point, containing_ent is returned as 0 and params are unchanged. This function returns something other than MB_SUCCESS only when queries go wrong for some reason. num_evals, if non-NULL, is always incremented for each call to reverse_eval. This function calls set_ent_handle for each entity before calling reverse_eval, so the ElemEvaluator object is changed. More...
 
ErrorCode find_containing_entity (EntityHandle ent_set, const double *point, const double iter_tol, const double inside_tol, EntityHandle &containing_ent, double *params, unsigned int *num_evals=NULL)
 Given an entity set, return the contained entity the point is in, or none This function reverse-evaluates the entities, returning the first entity containing the point. If no entity contains the point, containing_ent is returned as 0 and params are unchanged. This function returns something other than MB_SUCCESS only when queries go wrong for some reason. num_evals, if non-NULL, is always incremented for each call to reverse_eval. This function calls set_ent_handle for each entity before calling reverse_eval, so the ElemEvaluator object is changed. More...
 
ErrorCode set_eval_set (EntityType tp, const EvalSet &eval_set)
 Set the eval set for a given type entity. More...
 
ErrorCode set_eval_set (const EntityHandle eh)
 Set the eval set using a given entity handle This function queries the entity type and number of vertices on the entity to decide which type of shape function to use. NOTE: this function should only be called after setting a valid MOAB instance on the evaluator. More...
 
EvalSet get_eval_set (EntityType tp)
 Get the eval set for a given type entity. More...
 
ErrorCode set_ent_handle (EntityHandle ent)
 Set entity handle & cache connectivty & vertex positions. More...
 
EntityHandle get_ent_handle () const
 Get entity handle for this ElemEval. More...
 
double * get_vert_pos ()
 
const EntityHandleget_vert_handles () const
 
int get_num_verts () const
 
Tag get_tag_handle () const
 
ErrorCode set_tag_handle (Tag tag, int tagged_ent_dim=-1)
 
ErrorCode set_tag (const char *tag_name, int tagged_ent_dim=-1)
 
int get_tagged_ent_dim () const
 
ErrorCode set_tagged_ent_dim (int dim)
 
double * get_work_space ()
 
Interfaceget_moab ()
 

Private Attributes

InterfacembImpl
 Interface. More...
 
EntityHandle entHandle
 Entity handle being evaluated. More...
 
EntityType entType
 Entity type. More...
 
int entDim
 Entity dimension. More...
 
int numVerts
 Number of vertices cached here. More...
 
const EntityHandlevertHandles
 Cached copy of vertex handle ptr. More...
 
CartVect vertPos [CN::MAX_NODES_PER_ELEMENT]
 Cached copy of vertex positions. More...
 
Tag tagHandle
 Tag being evaluated. More...
 
bool tagCoords
 Whether tag is coordinates or something else. More...
 
int numTuples
 Number of values in this tag. More...
 
int taggedEntDim
 Dimension of entities from which to grab tag. More...
 
std::vector< unsigned char > tagSpace
 Tag space. More...
 
EvalSet evalSets [MBMAXTYPE]
 Evaluation methods for elements of various topologies. More...
 
double * workSpace
 Work space for element-specific data. More...
 

Detailed Description

Class facilitating local discretization-related functions

This class implements discretization-related functionality operating on data in MOAB. A member of this class caches certain data about the element it's currently operating on, but is not meant to be instantiated one-per-element, but rather one-per-search (or other operation on a collection of elements).

Actual discretization functionality is accessed through function pointers, allowing applications to specialize the implementation of specific functions while still using this class.

This class depends on MOAB functionality for gathering entity-based data; the functions it calls through function pointers depend only on POD (plain old data, or intrinsic data types). This allows the use of other packages for serving these functions, without having to modify them to get data through MOAB. This should also promote efficiency, since in many cases they will be able to read data from its native storage locations.

Definition at line 177 of file ElemEvaluator.hpp.

Constructor & Destructor Documentation

◆ ElemEvaluator()

moab::ElemEvaluator::ElemEvaluator ( Interface impl,
EntityHandle  ent = 0,
Tag  tag = 0,
int  tagged_ent_dim = -1 
)
inline

Constructor.

Parameters
implMOAB instance
entEntity handle to cache on the evaluator; if non-zero, calls set_ent_handle, which does some other stuff.
tagTag to cache on the evaluator; if non-zero, calls set_tag_handle, which does some other stuff too.
tagged_ent_dimDimension of entities to be tagged to cache on the evaluator

Definition at line 422 of file ElemEvaluator.hpp.

423  : mbImpl( impl ), entHandle( 0 ), entType( MBMAXTYPE ), entDim( -1 ), numVerts( 0 ), vertHandles( NULL ),
424  tagHandle( 0 ), tagCoords( false ), numTuples( 0 ), taggedEntDim( 0 ), workSpace( NULL )
425 {
426  if( ent ) set_ent_handle( ent );
427  if( tag ) set_tag_handle( tag, tagged_ent_dim );
428 }

References set_ent_handle(), and set_tag_handle().

◆ ~ElemEvaluator()

moab::ElemEvaluator::~ElemEvaluator ( )
inline

Definition at line 430 of file ElemEvaluator.hpp.

431 {
432  if( workSpace ) delete[] workSpace;
433 }

References workSpace.

Member Function Documentation

◆ eval()

ErrorCode moab::ElemEvaluator::eval ( const double *  params,
double *  result,
int  num_tuples = -1 
) const
inline

Evaluate cached tag at a given parametric location within the cached entity If evaluating coordinates, call set_tag(0, 0), which indicates coords instead of a tag.

Parameters
paramsParameters at which to evaluate field
resultResult of evaluation
num_tuplesSize of evaluated field, in number of values

Definition at line 569 of file ElemEvaluator.hpp.

570 {
571  assert( entHandle && MBMAXTYPE != entType );
572  return ( *evalSets[entType].evalFcn )(
573  params, ( tagCoords ? (const double*)vertPos[0].array() : (const double*)&tagSpace[0] ), entDim,
574  ( -1 == num_tuples ? numTuples : num_tuples ), workSpace, result );
575 }

References entDim, entHandle, entType, evalSets, MBMAXTYPE, numTuples, tagCoords, tagSpace, vertPos, and workSpace.

Referenced by moab::DataCoupler::interpolate().

◆ find_containing_entity() [1/2]

ErrorCode moab::ElemEvaluator::find_containing_entity ( EntityHandle  ent_set,
const double *  point,
const double  iter_tol,
const double  inside_tol,
EntityHandle containing_ent,
double *  params,
unsigned int *  num_evals = NULL 
)
inline

Given an entity set, return the contained entity the point is in, or none This function reverse-evaluates the entities, returning the first entity containing the point. If no entity contains the point, containing_ent is returned as 0 and params are unchanged. This function returns something other than MB_SUCCESS only when queries go wrong for some reason. num_evals, if non-NULL, is always incremented for each call to reverse_eval. This function calls set_ent_handle for each entity before calling reverse_eval, so the ElemEvaluator object is changed.

Parameters
ent_setEntity set containing the entities to be tested
pointPoint tested, must have 3 dimensions, even for edge and face entities
iter_tolTolerance for non-linear reverse evaluation
inside_tolTolerance for is_inside test
containing_entEntity containing the point, returned 0 if no entity
paramsParameters of point in containing entity, unchanged if no containing entity
num_evalsIf non-NULL, incremented each time reverse_eval is called
Returns
Returns non-success only if evaulation failed for some reason (point not in element is NOT a reason for failure)

Definition at line 620 of file ElemEvaluator.hpp.

627 {
628  assert( mbImpl->type_from_handle( ent_set ) == MBENTITYSET );
629  Range entities;
630  ErrorCode rval = mbImpl->get_entities_by_handle( ent_set, entities );
631  if( MB_SUCCESS != rval )
632  return rval;
633  else
634  return find_containing_entity( entities, point, iter_tol, inside_tol, containing_ent, params, num_evals );
635 }

References entities, ErrorCode, find_containing_entity(), moab::Interface::get_entities_by_handle(), MB_SUCCESS, MBENTITYSET, mbImpl, and moab::Interface::type_from_handle().

◆ find_containing_entity() [2/2]

ErrorCode moab::ElemEvaluator::find_containing_entity ( Range entities,
const double *  point,
const double  iter_tol,
const double  inside_tol,
EntityHandle containing_ent,
double *  params,
unsigned int *  num_evals = NULL 
)

Given a list of entities, return the entity the point is in, or none This function reverse-evaluates the entities, returning the first entity containing the point. If no entity contains the point, containing_ent is returned as 0 and params are unchanged. This function returns something other than MB_SUCCESS only when queries go wrong for some reason. num_evals, if non-NULL, is always incremented for each call to reverse_eval. This function calls set_ent_handle for each entity before calling reverse_eval, so the ElemEvaluator object is changed.

Parameters
entitiesEntities tested
pointPoint tested, must have 3 dimensions, even for edge and face entities
iter_tolTolerance for non-linear reverse evaluation
inside_tolTolerance for is_inside test
containing_entEntity containing the point, returned 0 if no entity
paramsParameters of point in containing entity, unchanged if no containing entity
num_evalsIf non-NULL, incremented each time reverse_eval is called
Returns
Returns non-success only if evaulation failed for some reason (point not in element is NOT a reason for failure)

Definition at line 137 of file ElemEvaluator.cpp.

144 {
145  int is_inside;
146  ErrorCode rval = MB_SUCCESS;
147  unsigned int nevals = 0;
148  Range::iterator i;
149  for( i = entities.begin(); i != entities.end(); ++i )
150  {
151  nevals++;
152  set_ent_handle( *i );
153  rval = reverse_eval( point, iter_tol, inside_tol, params, &is_inside );
154  if( MB_SUCCESS != rval ) return rval;
155  if( is_inside ) break;
156  }
157  containing_ent = ( i == entities.end() ? 0 : *i );
158  if( num_evals ) *num_evals += nevals;
159  return MB_SUCCESS;
160 }

References entities, ErrorCode, MB_SUCCESS, reverse_eval(), and set_ent_handle().

Referenced by moab::BVHTree::bruteforce_find(), moab::AdaptiveKDTree::distance_search(), moab::BVHTree::distance_search(), find_containing_entity(), moab::AdaptiveKDTree::point_search(), and moab::BVHTree::point_search().

◆ get_ent_handle()

EntityHandle moab::ElemEvaluator::get_ent_handle ( ) const
inline

Get entity handle for this ElemEval.

Definition at line 307 of file ElemEvaluator.hpp.

308  {
309  return entHandle;
310  }

References entHandle.

◆ get_eval_set()

EvalSet moab::ElemEvaluator::get_eval_set ( EntityType  tp)
inline

Get the eval set for a given type entity.

Definition at line 298 of file ElemEvaluator.hpp.

299  {
300  return evalSets[tp];
301  }

References evalSets.

◆ get_moab()

Interface* moab::ElemEvaluator::get_moab ( )
inline

Definition at line 372 of file ElemEvaluator.hpp.

373  {
374  return mbImpl;
375  }

References mbImpl.

◆ get_normal()

ErrorCode moab::ElemEvaluator::get_normal ( const int  ientDim,
const int  facet,
double  normal[3] 
) const
inline

Evaluate the normal to a facet of an entity.

Evaluate the normal of the cached entity at a given facet.

Parameters
ientDimDimension of the facet. Should be (d-1) for d-dimensional entities
facetLocal id of the facet w.r.t the entity
normalReturns the normal.

Definition at line 590 of file ElemEvaluator.hpp.

591 {
592  assert( entHandle && MBMAXTYPE != entType );
593  return ( *evalSets[entType].normalFcn )( ientDim, facet, numVerts, vertPos[0].array(), normal );
594 }

References moab::CartVect::array(), entHandle, entType, evalSets, MBMAXTYPE, numVerts, and vertPos.

◆ get_num_verts()

int moab::ElemEvaluator::get_num_verts ( ) const
inline

Definition at line 326 of file ElemEvaluator.hpp.

327  {
328  return numVerts;
329  }

References numVerts.

◆ get_tag_handle()

Tag moab::ElemEvaluator::get_tag_handle ( ) const
inline

Definition at line 332 of file ElemEvaluator.hpp.

333  {
334  return tagHandle;
335  };

References tagHandle.

◆ get_tagged_ent_dim()

int moab::ElemEvaluator::get_tagged_ent_dim ( ) const
inline

Definition at line 354 of file ElemEvaluator.hpp.

355  {
356  return taggedEntDim;
357  };

References taggedEntDim.

◆ get_vert_handles()

const EntityHandle* moab::ElemEvaluator::get_vert_handles ( ) const
inline

Definition at line 320 of file ElemEvaluator.hpp.

321  {
322  return vertHandles;
323  }

References vertHandles.

◆ get_vert_pos()

double* moab::ElemEvaluator::get_vert_pos ( )
inline

Definition at line 314 of file ElemEvaluator.hpp.

315  {
316  return vertPos[0].array();
317  }

References moab::CartVect::array(), and vertPos.

◆ get_work_space()

double* moab::ElemEvaluator::get_work_space ( )
inline

Definition at line 366 of file ElemEvaluator.hpp.

367  {
368  return workSpace;
369  }

References workSpace.

◆ inside()

int moab::ElemEvaluator::inside ( const double *  params,
const double  tol 
) const
inline

Return whether a physical position is inside the cached entity to within a tolerance.

Parameters
paramsParameters at which to query the element
tolTolerance, usually 10^-6 or so

Definition at line 637 of file ElemEvaluator.hpp.

638 {
639  return ( *evalSets[entType].insideFcn )( params, entDim, tol );
640 }

References entDim, entType, and evalSets.

◆ integrate()

ErrorCode moab::ElemEvaluator::integrate ( double *  result) const
inline

Integrate the cached tag over the cached entity.

Parameters
resultResult of the integration

Definition at line 604 of file ElemEvaluator.hpp.

605 {
606  assert( entHandle && MBMAXTYPE != entType && ( tagCoords || tagHandle ) );
607  ErrorCode rval = MB_SUCCESS;
608  if( !tagCoords )
609  {
610  if( 0 == taggedEntDim )
611  rval = mbImpl->tag_get_data( tagHandle, vertHandles, numVerts, (void*)&tagSpace[0] );
612  else
613  rval = mbImpl->tag_get_data( tagHandle, &entHandle, 1, (void*)&tagSpace[0] );
614  if( MB_SUCCESS != rval ) return rval;
615  }
616  return ( *evalSets[entType].integrateFcn )( ( tagCoords ? vertPos[0].array() : (const double*)&tagSpace[0] ),
617  vertPos[0].array(), numVerts, entDim, numTuples, workSpace, result );
618 }

References moab::CartVect::array(), entDim, entHandle, entType, ErrorCode, evalSets, MB_SUCCESS, mbImpl, MBMAXTYPE, numTuples, numVerts, moab::Interface::tag_get_data(), tagCoords, taggedEntDim, tagHandle, tagSpace, vertHandles, vertPos, and workSpace.

◆ jacobian()

ErrorCode moab::ElemEvaluator::jacobian ( const double *  params,
double *  result 
) const
inline

Evaluate the jacobian of the cached entity at a given parametric location.

Parameters
paramsParameters at which to evaluate jacobian
resultResult of evaluation, in the form of a 3x3 matrix, stored in column-major order

Definition at line 597 of file ElemEvaluator.hpp.

598 {
599  assert( entHandle && MBMAXTYPE != entType );
600  return ( *evalSets[entType].jacobianFcn )( params, vertPos[0].array(), numVerts, entDim, workSpace, result );
601 }

References moab::CartVect::array(), entDim, entHandle, entType, evalSets, MBMAXTYPE, numVerts, vertPos, and workSpace.

◆ reverse_eval()

ErrorCode moab::ElemEvaluator::reverse_eval ( const double *  posn,
double  iter_tol,
double  inside_tol,
double *  params,
int *  is_inside = NULL 
) const
inline

Reverse-evaluate the cached entity at a given physical position.

Parameters
posnPosition at which to evaluate parameters
iter_tolTolerance of reverse evaluation non-linear iteration, usually 10^-10 or so
inside_tolTolerance of is_inside evaluation, usually 10^-6 or so
paramsResult of evaluation
is_insideIf non-NULL, returns true of resulting parameters place the point inside the element (in most cases, within [-1]*(dim)

Definition at line 577 of file ElemEvaluator.hpp.

582 {
583  assert( entHandle && MBMAXTYPE != entType );
584  return ( *evalSets[entType].reverseEvalFcn )( evalSets[entType].evalFcn, evalSets[entType].jacobianFcn,
586  entDim, iter_tol, inside_tol, workSpace, params, ins );
587 }

References moab::CartVect::array(), entDim, entHandle, entType, moab::EvalSet::evalFcn, evalSets, moab::EvalSet::insideFcn, moab::EvalSet::jacobianFcn, MBMAXTYPE, numVerts, vertPos, and workSpace.

Referenced by find_containing_entity(), and moab::BVHTree::find_point().

◆ set_ent_handle()

ErrorCode moab::ElemEvaluator::set_ent_handle ( EntityHandle  ent)
inline

Set entity handle & cache connectivty & vertex positions.

Definition at line 435 of file ElemEvaluator.hpp.

436 {
437  entHandle = ent;
438  if( workSpace )
439  {
440  delete[] workSpace;
441  workSpace = NULL;
442  }
443 
444  entType = mbImpl->type_from_handle( ent );
446 
447  std::vector< EntityHandle > dum_vec;
448  ErrorCode rval = mbImpl->get_connectivity( ent, vertHandles, numVerts, false, &dum_vec );
449  if( MB_SUCCESS != rval ) return rval;
450 
452 
453  rval = mbImpl->get_coords( vertHandles, numVerts, vertPos[0].array() );
454  if( MB_SUCCESS != rval ) return rval;
455 
456  if( tagHandle )
457  {
458  rval = set_tag_handle( tagHandle );
459  if( MB_SUCCESS != rval ) return rval;
460  }
461  if( evalSets[entType].initFcn ) return ( *evalSets[entType].initFcn )( vertPos[0].array(), numVerts, workSpace );
462  return MB_SUCCESS;
463 }

References moab::CartVect::array(), moab::Interface::dimension_from_handle(), entDim, entHandle, entType, ErrorCode, evalSets, moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::EvalSet::get_eval_set(), MB_SUCCESS, mbImpl, numVerts, set_tag_handle(), tagHandle, moab::Interface::type_from_handle(), vertHandles, vertPos, and workSpace.

Referenced by ElemEvaluator(), find_containing_entity(), moab::BVHTree::find_point(), and moab::DataCoupler::interpolate().

◆ set_eval_set() [1/2]

ErrorCode moab::ElemEvaluator::set_eval_set ( const EntityHandle  eh)
inline

Set the eval set using a given entity handle This function queries the entity type and number of vertices on the entity to decide which type of shape function to use. NOTE: this function should only be called after setting a valid MOAB instance on the evaluator.

Parameters
ehEntity handle whose type and #vertices are queried

Definition at line 642 of file ElemEvaluator.hpp.

643 {
644  EvalSet eset;
646  return rval;
647 }

References ErrorCode, evalSets, moab::EvalSet::get_eval_set(), mbImpl, and moab::Interface::type_from_handle().

◆ set_eval_set() [2/2]

ErrorCode moab::ElemEvaluator::set_eval_set ( EntityType  tp,
const EvalSet eval_set 
)
inline

Set the eval set for a given type entity.

Parameters
tpEntity type for which to set the eval set
eval_setEval set object to use

Definition at line 558 of file ElemEvaluator.hpp.

559 {
560  evalSets[tp] = eval_set;
561  if( entHandle && evalSets[entType].initFcn )
562  {
563  ErrorCode rval = ( *evalSets[entType].initFcn )( vertPos[0].array(), numVerts, workSpace );
564  if( MB_SUCCESS != rval ) return rval;
565  }
566  return MB_SUCCESS;
567 }

References entHandle, entType, ErrorCode, evalSets, moab::EvalSet::initFcn, MB_SUCCESS, numVerts, vertPos, and workSpace.

Referenced by moab::DataCoupler::DataCoupler().

◆ set_tag()

ErrorCode moab::ElemEvaluator::set_tag ( const char *  tag_name,
int  tagged_ent_dim = -1 
)
inline

Definition at line 507 of file ElemEvaluator.hpp.

508 {
509  ErrorCode rval = MB_SUCCESS;
510  if( !tag_name || strlen( tag_name ) == 0 ) return MB_FAILURE;
511  Tag tag;
512  if( !strcmp( tag_name, "COORDS" ) )
513  {
514  tagCoords = true;
515  taggedEntDim = 0;
516  numTuples = 3;
517  tagHandle = 0;
518  // can return here, because vertex coords already cached when entity handle set
519  return rval;
520  }
521  else
522  {
523  rval = mbImpl->tag_get_handle( tag_name, tag );
524  if( MB_SUCCESS != rval ) return rval;
525 
526  if( tagHandle != tag )
527  {
528  tagHandle = tag;
530  if( MB_SUCCESS != rval ) return rval;
531  int sz;
532  rval = mbImpl->tag_get_bytes( tag, sz );
533  if( MB_SUCCESS != rval ) return rval;
534  tagSpace.reserve( CN::MAX_NODES_PER_ELEMENT * sz );
535  tagCoords = false;
536  }
537 
538  taggedEntDim = ( -1 == tagged_ent_dim ? entDim : tagged_ent_dim );
539  }
540 
541  if( entHandle )
542  {
543  if( 0 == taggedEntDim )
544  {
546  if( MB_SUCCESS != rval ) return rval;
547  }
548  else if( taggedEntDim == entDim )
549  {
550  rval = mbImpl->tag_get_data( tagHandle, &entHandle, 1, &tagSpace[0] );
551  if( MB_SUCCESS != rval ) return rval;
552  }
553  }
554 
555  return rval;
556 }

References entDim, entHandle, ErrorCode, moab::CN::MAX_NODES_PER_ELEMENT, MB_SUCCESS, mbImpl, numTuples, numVerts, moab::Interface::tag_get_bytes(), moab::Interface::tag_get_data(), moab::Interface::tag_get_handle(), moab::Interface::tag_get_length(), tagCoords, taggedEntDim, tagHandle, tagSpace, and vertHandles.

◆ set_tag_handle()

ErrorCode moab::ElemEvaluator::set_tag_handle ( Tag  tag,
int  tagged_ent_dim = -1 
)
inline

Definition at line 465 of file ElemEvaluator.hpp.

466 {
467  ErrorCode rval = MB_SUCCESS;
468  if( !tag && !tagged_ent_dim )
469  {
470  tagCoords = true;
471  numTuples = 3;
472  taggedEntDim = 0;
473  tagHandle = 0;
474  return rval;
475  }
476  else if( tagHandle != tag )
477  {
478  tagHandle = tag;
480  if( MB_SUCCESS != rval ) return rval;
481  int sz;
482  rval = mbImpl->tag_get_bytes( tag, sz );
483  if( MB_SUCCESS != rval ) return rval;
484  tagSpace.resize( CN::MAX_NODES_PER_ELEMENT * sz );
485  tagCoords = false;
486  }
487 
488  taggedEntDim = ( -1 == tagged_ent_dim ? 0 : tagged_ent_dim );
489 
490  if( entHandle )
491  {
492  if( 0 == taggedEntDim )
493  {
495  if( MB_SUCCESS != rval ) return rval;
496  }
497  else if( taggedEntDim == entDim )
498  {
499  rval = mbImpl->tag_get_data( tagHandle, &entHandle, 1, &tagSpace[0] );
500  if( MB_SUCCESS != rval ) return rval;
501  }
502  }
503 
504  return rval;
505 }

References entDim, entHandle, ErrorCode, moab::CN::MAX_NODES_PER_ELEMENT, MB_SUCCESS, mbImpl, numTuples, numVerts, moab::Interface::tag_get_bytes(), moab::Interface::tag_get_data(), moab::Interface::tag_get_length(), tagCoords, taggedEntDim, tagHandle, tagSpace, and vertHandles.

Referenced by ElemEvaluator(), moab::DataCoupler::interpolate(), and set_ent_handle().

◆ set_tagged_ent_dim()

ErrorCode moab::ElemEvaluator::set_tagged_ent_dim ( int  dim)
inline

Member Data Documentation

◆ entDim

int moab::ElemEvaluator::entDim
private

Entity dimension.

Definition at line 388 of file ElemEvaluator.hpp.

Referenced by eval(), inside(), integrate(), jacobian(), reverse_eval(), set_ent_handle(), set_tag(), and set_tag_handle().

◆ entHandle

EntityHandle moab::ElemEvaluator::entHandle
private

Entity handle being evaluated.

Definition at line 382 of file ElemEvaluator.hpp.

Referenced by eval(), get_ent_handle(), get_normal(), integrate(), jacobian(), reverse_eval(), set_ent_handle(), set_eval_set(), set_tag(), and set_tag_handle().

◆ entType

EntityType moab::ElemEvaluator::entType
private

Entity type.

Definition at line 385 of file ElemEvaluator.hpp.

Referenced by eval(), get_normal(), inside(), integrate(), jacobian(), reverse_eval(), set_ent_handle(), and set_eval_set().

◆ evalSets

EvalSet moab::ElemEvaluator::evalSets[MBMAXTYPE]
private

Evaluation methods for elements of various topologies.

Definition at line 415 of file ElemEvaluator.hpp.

Referenced by eval(), get_eval_set(), get_normal(), inside(), integrate(), jacobian(), reverse_eval(), set_ent_handle(), and set_eval_set().

◆ mbImpl

Interface* moab::ElemEvaluator::mbImpl
private

◆ numTuples

int moab::ElemEvaluator::numTuples
private

Number of values in this tag.

Definition at line 406 of file ElemEvaluator.hpp.

Referenced by eval(), integrate(), set_tag(), and set_tag_handle().

◆ numVerts

int moab::ElemEvaluator::numVerts
private

Number of vertices cached here.

Definition at line 391 of file ElemEvaluator.hpp.

Referenced by get_normal(), get_num_verts(), integrate(), jacobian(), reverse_eval(), set_ent_handle(), set_eval_set(), set_tag(), and set_tag_handle().

◆ tagCoords

bool moab::ElemEvaluator::tagCoords
private

Whether tag is coordinates or something else.

Definition at line 403 of file ElemEvaluator.hpp.

Referenced by eval(), integrate(), set_tag(), and set_tag_handle().

◆ taggedEntDim

int moab::ElemEvaluator::taggedEntDim
private

Dimension of entities from which to grab tag.

Definition at line 409 of file ElemEvaluator.hpp.

Referenced by get_tagged_ent_dim(), integrate(), set_tag(), and set_tag_handle().

◆ tagHandle

Tag moab::ElemEvaluator::tagHandle
private

Tag being evaluated.

Definition at line 400 of file ElemEvaluator.hpp.

Referenced by get_tag_handle(), integrate(), set_ent_handle(), set_tag(), and set_tag_handle().

◆ tagSpace

std::vector< unsigned char > moab::ElemEvaluator::tagSpace
private

Tag space.

Definition at line 412 of file ElemEvaluator.hpp.

Referenced by eval(), integrate(), set_tag(), and set_tag_handle().

◆ vertHandles

const EntityHandle* moab::ElemEvaluator::vertHandles
private

Cached copy of vertex handle ptr.

Definition at line 394 of file ElemEvaluator.hpp.

Referenced by get_vert_handles(), integrate(), set_ent_handle(), set_tag(), and set_tag_handle().

◆ vertPos

CartVect moab::ElemEvaluator::vertPos[CN::MAX_NODES_PER_ELEMENT]
private

Cached copy of vertex positions.

Definition at line 397 of file ElemEvaluator.hpp.

Referenced by eval(), get_normal(), get_vert_pos(), integrate(), jacobian(), reverse_eval(), set_ent_handle(), and set_eval_set().

◆ workSpace

double* moab::ElemEvaluator::workSpace
private

Work space for element-specific data.

Definition at line 418 of file ElemEvaluator.hpp.

Referenced by eval(), get_work_space(), integrate(), jacobian(), reverse_eval(), set_ent_handle(), set_eval_set(), and ~ElemEvaluator().


The documentation for this class was generated from the following files: