Sierra Toolkit Version of the Day
stk::mesh::FieldRelation Struct Reference

A defined entity-relationship between a field of a pointer type and the field that it should point to. An internal class that should never need to be directly used within application code. More...

#include <FieldRelation.hpp>

Collaboration diagram for stk::mesh::FieldRelation:

List of all members.

Public Attributes

FieldBasem_root
 relation domain part
FieldBasem_target
 relation range part
relation_stencil_ptr m_function
 relation stencil

Detailed Description

A defined entity-relationship between a field of a pointer type and the field that it should point to. An internal class that should never need to be directly used within application code.

Let

If

  • field m_root has a pointer scalar type 'T *' AND
  • field m_target has a scalar type 'T' AND
  • field_data( *m_root , e1 ) exists AND
  • field_data( *m_target , e2 ) exists AND
  • relation rel is in the domain of relation stencil m_function

then

    index = (*m_function)( e1.entity_rank() ,
                           e2.entity_rank() ,
                           rel.identifier() ,
                           rel.kind() );
    field_data(*m_root,e1)[index] == field_data(*m_target,e2)
  

A common use case is, given an element, process a certain field that is on its nodes. This can be done by iterating over the element's node relations and getting the field data off the nodes directly, but it can be cleaner and faster to set up a field relation instead. A field relation formally defines a relationship between a field on the element and a field on it's nodes (or some other lower-than-element entity rank). The API for setting up a field relation is in MetaData.hpp. See Field.hpp for a full discussion of Fields.

  • Example: // Declare nodal field typedef Field<double,Cartesian> VectorFieldType; // Cartesian ArrayDimTag comes from CoordinateSystems.hpp VectorFieldType& coord_field = meta.declare_field<VectorFieldType>("coordinates");

// Declare element field, ElementNodePointerField is a typedef from TopologyDimensions.hpp ElementNodePointerField elem_node_coord_field = meta.declare_field<ElementNodePointerField>("elem_node_coord_field");

// Add field restriction for nodal field put_field( coord_field, <node_rank>, <part> );

// Declare field relation! Stencil defines order in which nodal fields are accessed meta.declare_field_relation(elem_node_coord_field, fem::get_element_node_stencil(3), coord_field);

// Add field restriction for element field put_field( elem_node_coord_field, <elem_rank>, <part>);

Definition at line 74 of file FieldRelation.hpp.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines