Sierra Toolkit Version of the Day
stk::linsys::DofMapper Class Reference

#include <DofMapper.hpp>

List of all members.

Public Member Functions

 DofMapper (MPI_Comm comm, bool create_reverse_mappings=true)
virtual ~DofMapper ()
void add_dof_mappings (const stk::mesh::BulkData &mesh_bulk, const stk::mesh::Selector &selector, stk::mesh::EntityRank ent_type, const stk::mesh::FieldBase &field)
void finalize ()
bool reverse_mappings_enabled () const
int get_field_id (const stk::mesh::FieldBase &field) const
int get_global_index (stk::mesh::EntityRank ent_type, stk::mesh::EntityId ent_id, stk::mesh::FieldBase &field, int offset_into_field=0)
void get_dof (int global_index, stk::mesh::EntityRank &ent_type, stk::mesh::EntityId &ent_id, const stk::mesh::FieldBase *&field, int &offset_into_field) const
const fei::SharedPtr
< fei::VectorSpace > 
get_fei_VectorSpace () const
fei::SharedPtr< fei::VectorSpace > get_fei_VectorSpace ()
const FieldIdMapget_FieldIdMap () const
FieldIdMapget_FieldIdMap ()

Detailed Description

Perform mappings between degrees-of-freedom and equation-indices.

A degree-of-freedom is specified by four things: (entity-type,entity-id,field,offset-into-field)

An equation-index is a member of a globally contiguous, zero-based index space.

A DOF-mapping allows the caller to provide a degree-of-freedom and obtain an equation-index. A reverse DOF-mapping allows the caller to provide an equation-index and obtain a degree-of-freedom.

By default this DofMapper class provides DOF-mappings and reverse-DOF-mappings. Providing reverse DOF-mappings consumes extra memory since it requires constructing an additional FEI object to do the reverse lookups. If this is not desired, reverse-mappings can be disabled using DofMapper's second constructor argument.

The FEI library is utilized for accumulating and storing the mappings. (fei::VectorSpace provides DOF-mappings, and fei::ReverseMapper provides reverse-DOF-mappings.)

Since the FEI works entirely with primitive data types (e.g., int) and has no knowledge of stk::mesh types, this DofMapper class essentially acts as a translation bridge between stk::mesh and the FEI library.

Definition at line 52 of file DofMapper.hpp.

Constructor & Destructor Documentation

stk::linsys::DofMapper::DofMapper ( MPI_Comm  comm,
bool  create_reverse_mappings = true 

Constructor that internally creates an fei::VectorSpace object.

Definition at line 24 of file DofMapper.cpp.

stk::linsys::DofMapper::~DofMapper ( ) [virtual]

Constructor that accepts an existing fei::VectorSpace object. Destructor

Definition at line 32 of file DofMapper.cpp.

Member Function Documentation

void stk::linsys::DofMapper::add_dof_mappings ( const stk::mesh::BulkData mesh_bulk,
const stk::mesh::Selector selector,
stk::mesh::EntityRank  ent_type,
const stk::mesh::FieldBase field 

Given a mesh, an entity-type and a field, store the resulting DOF mappings. This method iterates the buckets for the specified entity-type, and for each bucket that has the given field and is selected by the specified selector. DOF-mappings are stored for each entity-id in the bucket.

This method may be called repeatedly, to add dof mappings for different parts, different entity-types, different fields, etc.

Definition at line 50 of file DofMapper.cpp.

void stk::linsys::DofMapper::finalize ( )

This method internally calls fei::VectorSpace::initComplete(), which finalizes and synchronizes the DOF-mappings (ensures that indices for shared-entities are consistent, etc.). Also, if reverse-mappings are not disabled, this method creates the reverse-mappings object. (The get_dof() method is not available until after this has happened.)

This is a collective method, must be called on all processors.

Definition at line 124 of file DofMapper.cpp.

bool stk::linsys::DofMapper::reverse_mappings_enabled ( ) const [inline]

Query whether reverse-DOF-mappings are enabled. (See second constructor argument above.)

Definition at line 89 of file DofMapper.hpp.

int stk::linsys::DofMapper::get_field_id ( const stk::mesh::FieldBase field) const

Return the integer id that the specified field is mapped to. The integer id is the FEI's representation of the field.

Definition at line 136 of file DofMapper.cpp.

int stk::linsys::DofMapper::get_global_index ( stk::mesh::EntityRank  ent_type,
stk::mesh::EntityId  ent_id,
stk::mesh::FieldBase field,
int  offset_into_field = 0 

Return a global equation index for the specified entity type/id pair and field.

Note: this method should be const, but it calls an fei query that is not const. When the fei method is corrected, this method will be made const.

Note2: this method may not work correctly until after 'finalize()' has been called.

Definition at line 142 of file DofMapper.cpp.

void stk::linsys::DofMapper::get_dof ( int  global_index,
stk::mesh::EntityRank &  ent_type,
stk::mesh::EntityId &  ent_id,
const stk::mesh::FieldBase *&  field,
int &  offset_into_field 
) const

Given a global_index, return the specification for the DOF that it corresponds to. Throw an exception if the global_index is not found, or if DofMapper::finalize() has not been called. Note: this method will be const after the corresponding fei query is corrected for constness.

Definition at line 169 of file DofMapper.cpp.

const fei::SharedPtr<fei::VectorSpace> stk::linsys::DofMapper::get_fei_VectorSpace ( ) const [inline]

Return the underlying fei::VectorSpace object.

Definition at line 121 of file DofMapper.hpp.

fei::SharedPtr<fei::VectorSpace> stk::linsys::DofMapper::get_fei_VectorSpace ( ) [inline]

Return the underlying fei::VectorSpace object.

Definition at line 125 of file DofMapper.hpp.

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