stk::linsys::DofMapper Class Reference
[Sierra Toolkit Linear-System Assembly]

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

#include <DofMapper.hpp>

List of all members.

Public Member Functions

 DofMapper (MPI_Comm comm, bool create_reverse_mappings=true)
 Constructor that internally creates an fei::VectorSpace object.
virtual ~DofMapper ()
 Constructor that accepts an existing fei::VectorSpace object.
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)
 Given a mesh, an entity-type and a field, store the resulting DOF mappings.
void finalize ()
 This method internally calls fei::VectorSpace::initComplete(), which finalizes and synchronizes the DOF-mappings (ensures that indices for shared-entities are consistent, etc.
bool reverse_mappings_enabled () const
 Query whether reverse-DOF-mappings are enabled.
int get_field_id (const stk::mesh::FieldBase &field) const
 Return the integer id that the specified field is mapped to.
int 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.
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
 Given a global_index, return the specification for the DOF that it corresponds to.
const fei::SharedPtr
< fei::VectorSpace > 
get_fei_VectorSpace () const
 Return the underlying fei::VectorSpace object.
fei::SharedPtr< fei::VectorSpace > get_fei_VectorSpace ()
 Return the underlying fei::VectorSpace object.
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.


The documentation for this class was generated from the following files:
Generated on Wed Apr 13 10:05:50 2011 for Sierra Toolkit by  doxygen 1.6.3