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

#include <DofMapper.hpp>

List of all members.


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.

Public Member Functions

 DofMapper (MPI_Comm comm, bool create_reverse_mappings=true)
 Constructor that internally creates an fei::VectorSpace object.
virtual ~DofMapper ()
 Destructor.
void add_dof_mappings (const stk::mesh::BulkData &mesh_bulk, const stk::mesh::PartVector &part_intersection, stk::mesh::EntityType 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::EntityType 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::EntityType &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 ()


Member Function Documentation

void stk::linsys::DofMapper::add_dof_mappings ( const stk::mesh::BulkData mesh_bulk,
const stk::mesh::PartVector part_intersection,
stk::mesh::EntityType  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 in the specified part-intersection, DOF-mappings are stored for each entity-id in the bucket.

Usage note: The specified part-intersection may be a single part such as mesh_bulk.mesh_meta_data().locally_used_part(), although some application scenarios will involve different parts...

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 125 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 93 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 137 of file DofMapper.cpp.

int stk::linsys::DofMapper::get_global_index ( stk::mesh::EntityType  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 143 of file DofMapper.cpp.

void stk::linsys::DofMapper::get_dof ( int  global_index,
stk::mesh::EntityType 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 170 of file DofMapper.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jul 13 09:27:33 2010 for Sierra Toolkit by  doxygen 1.4.7