Jive reference manual
List of all members | Public Member Functions | Protected Member Functions
jive::util::DenseDofSpace Class Reference

#include <jive/util/DenseDofSpace.h>

Inheritance diagram for jive::util::DenseDofSpace:
Inheritance graph

Public Member Functions

 DenseDofSpace ()
 
 DenseDofSpace (const Ref< ItemSet > &items)
 
 DenseDofSpace (const Self &rhs)
 
virtual void resetEvents ()
 
virtual void readFrom (ObjectInput &in)
 
virtual void writeTo (ObjectOutput &out) const
 
virtual Ref< Objectclone () const
 
virtual idx_t typeCount () const
 Returns the number of dof types. More...
 
virtual idx_t dofCount () const
 Returns the total number of dofs. More...
 
virtual void clearDofs ()
 
virtual void clearAll ()
 
virtual void reserve (idx_t dofCount)
 
virtual void trimToSize ()
 
virtual idx_t addType (const String &name)
 
virtual idx_t findType (const String &name) const
 Searches for a dof type with a given name. More...
 
virtual String getTypeName (idx_t itype) const
 
virtual StringVector getTypeNames () const
 Returns a array containing all dof type names. More...
 
virtual idx_t addDof (idx_t iitem, idx_t itype)
 
virtual void addDofs (const IdxVector &iitems, const IdxVector &itypes)
 
virtual void reorderDofs (const Reordering &reord)
 
virtual idx_t findDofIndex (idx_t iitem, idx_t itype) const
 
virtual idx_t findDofIndices (const IdxVector &idofs, const IdxVector &iitems, const IdxVector &itypes) const
 
virtual idx_t collectDofIndices (const IdxVector &idofs, const IdxVector &iitems, const IdxVector &itypes) const
 
virtual idx_t getDofsForItem (const IdxVector &idofs, const IdxVector &itypes, idx_t iitem) const
 
virtual idx_t getDofsForType (const IdxVector &idofs, const IdxVector &iitems, idx_t itype) const
 
virtual void decodeDofIndex (idx_t &iitem, idx_t &itype, idx_t idof) const
 
virtual void decodeDofIndices (const IdxVector &iitems, const IdxVector &itypes, const IdxVector &idofs) const
 
virtual SparseIdxMatrix toMatrix () const
 Returns a matrix representation of this dof space. More...
 
virtual ItemSetgetItems () const
 Returns the item set associated with this dof space. More...
 
void setAllDofs (const IdxVector &iitems, const IdxVector &itypes)
 
void getAllDofs (const IdxVector &iitems, const IdxVector &itypes) const
 
- Public Member Functions inherited from jive::util::XDofSpace
virtual IdxVector addTypes (const StringVector &names)
 
void addDofs (idx_t iitem, const IdxVector &itypes)
 
void addDofs (const IdxVector &iitems, idx_t itype)
 
void eraseDofs (const IdxVector &idofs)
 
- Public Member Functions inherited from jive::util::DofSpace
int itemCount () const
 Returns the size of the item set associated with this dof space. More...
 
virtual String getTypeName (int itype) const =0
 Returns a name of a dof type with a given index. More...
 
virtual int findDofIndex (int iitem, int itype) const =0
 Searches for a dof attached to a given item. More...
 
int getDofIndex (int iitem, int itype) const
 Returns the index of a dof attached to a given item. More...
 
virtual int findDofIndices (const IntVector &idofs, const IntVector &iitems, const IntVector &itypes) const
 Searches for the dofs attached to a given set of items. More...
 
virtual int collectDofIndices (const IntVector &idofs, const IntVector &iitems, const IntVector &itypes) const
 Collects the indices of the dofs attached to a given set of items. More...
 
void getDofIndices (const IntVector &idofs, const IntVector &iitems, const IntVector &itypes) const
 Gets the indices of the dofs attached to a given set of items. More...
 
virtual int getDofsForItem (const IntVector &idofs, const IntVector &itypes, int iitem) const
 Returns all dofs attached to a given item. More...
 
virtual int getDofsForType (const IntVector &idofs, const IntVector &iitems, int itype) const
 Returns all dofs of a given type. More...
 
virtual void decodeDofIndex (int &iitem, int &itype, int idof) const =0
 Returns an item/type index pair given a dof index. More...
 
virtual void decodeDofIndices (const IntVector &iitems, const IntVector &itypes, const IntVector &idofs) const
 Returns item/type index pairs given a set of dof indices. More...
 
String getDofPath (int idof) const
 Returns an identification string for a given dof. More...
 
String getDofPath (int iitem, int itype) const
 Returns an identification string for a given dof. More...
 
String getContext () const
 Returns a context string. More...
 
void printTo (jem::io::TextOutput &out) const
 Writes the state of this dof space to a text output stream. More...
 
void store (const Properties &globdat) const
 Stores this dof space in a (global) data set. More...
 
virtual String toString () const
 Returns a short textual description of this object. More...
 
- Public Member Functions inherited from jem::Object
virtual ClassgetClass () const
 Returns the Class instance representing the runtime class of this object. More...
 
virtual long hashValue () const
 Returns a hash value for this object. More...
 
virtual bool equals (const Ref< Object > &obj) const
 Tests whether two objects are equal. More...
 
Ref< Objectclone () const
 Returns a copy of this object. More...
 

Protected Member Functions

virtual ~DenseDofSpace ()
 
void emitEvents_ (int events)
 
- Protected Member Functions inherited from jive::util::XDofSpace
virtual ~XDofSpace ()
 
- Protected Member Functions inherited from jive::util::DofSpace
virtual ~DofSpace ()
 
- Protected Member Functions inherited from jem::Collectable
 Collectable ()
 Creates an empty Collectable. More...
 
 ~Collectable ()
 Frees resources. More...
 
- Protected Member Functions inherited from jem::Clonable
virtual ~Clonable ()
 
virtual void emitVTable_ ()
 
- Protected Member Functions inherited from jem::Interface
virtual ~Interface ()
 Empty destructor. More...
 
- Protected Member Functions inherited from jem::io::Serializable
virtual ~Serializable ()
 
virtual void emitVtableFunc_ ()
 

Additional Inherited Members

- Public Types inherited from jive::util::DofSpace
typedef jem::String String
 Represents a string type. More...
 
typedef jem::numeric::SparseMatrix< int > SparseMatrix
 Represents a sparse integer matrix. More...
 
typedef jem::util::Properties Properties
 Represents a properties set. More...
 
- Static Public Member Functions inherited from jive::util::XDofSpace
static Ref< XDofSpacefind (const Properties &globdat)
 
static Ref< XDofSpacefind (const Ref< ItemSet > &items, const Properties &globdat)
 
static Ref< XDofSpaceget (const Properties &globdat, const String &context)
 
static Ref< XDofSpaceget (const Ref< ItemSet > &items, const Properties &globdat)
 
- Static Public Member Functions inherited from jive::util::DofSpace
static jem::Ref< DofSpacefind (const Properties &globdat)
 Searches for the primary dof space in a (global) data set. More...
 
static jem::Ref< DofSpacefind (const jem::Ref< ItemSet > &items, const Properties &globdat)
 Searches for an item-specific dof space in a (global) data set. More...
 
static jem::Ref< DofSpaceget (const Properties &globdat, const String &context)
 Returns the primary dof space in a (global) data set. More...
 
static jem::Ref< DofSpaceget (const jem::Ref< ItemSet > &items, const Properties &globdat, const String &context)
 Returns an item-specific dof space in a (global) data set. More...
 
- Static Public Member Functions inherited from jem::Object
static ClassgetType ()
 Returns the Class instance representing the Object class. More...
 
- Public Attributes inherited from jive::util::DofSpace
jem::util::Event< int, Self & > newSizeEvent
 Signals that the number of dofs has changed. More...
 
jem::util::Event< const IntVector &, Self & > newOrderEvent
 Signals that the dofs have been re-ordered. More...
 

Constructor & Destructor Documentation

jive::util::DenseDofSpace::DenseDofSpace ( )
jive::util::DenseDofSpace::DenseDofSpace ( const Ref< ItemSet > &  items)
explicit
jive::util::DenseDofSpace::DenseDofSpace ( const Self &  rhs)
virtual jive::util::DenseDofSpace::~DenseDofSpace ( )
protectedvirtual

Member Function Documentation

virtual void jive::util::DenseDofSpace::resetEvents ( )
virtual
virtual void jive::util::DenseDofSpace::readFrom ( ObjectInput in)
virtual

Implements jem::io::Serializable.

virtual void jive::util::DenseDofSpace::writeTo ( ObjectOutput out) const
virtual

Implements jem::io::Serializable.

virtual Ref<Object> jive::util::DenseDofSpace::clone ( ) const
virtual

Implements jem::Clonable.

virtual idx_t jive::util::DenseDofSpace::typeCount ( ) const
virtual

Returns the number of dof types known to this dof space.

Returns
The number of dof types.

Implements jive::util::DofSpace.

virtual idx_t jive::util::DenseDofSpace::dofCount ( ) const
virtual

Returns the number of dofs known to this dof space. This number is equal to the number of non-zeroes in the sparse matrix representation of this dof space.

Note that the number of dofs equals

itemCount() * typeCount()

when the matrix representation of this dof space is a dense matrix. That is, when typeCount() dofs are attached to each item.

Returns
The number of dofs.

Implements jive::util::DofSpace.

virtual void jive::util::DenseDofSpace::clearDofs ( )
virtual

Implements jive::util::XDofSpace.

virtual void jive::util::DenseDofSpace::clearAll ( )
virtual

Implements jive::util::XDofSpace.

virtual void jive::util::DenseDofSpace::reserve ( idx_t  dofCount)
virtual

Reimplemented from jive::util::XDofSpace.

virtual void jive::util::DenseDofSpace::trimToSize ( )
virtual

Reimplemented from jive::util::XDofSpace.

virtual idx_t jive::util::DenseDofSpace::addType ( const String name)
virtual

Implements jive::util::XDofSpace.

virtual idx_t jive::util::DenseDofSpace::findType ( const String name) const
virtual

Returns the index of the dof type named name, or a negative number if a dof type with that name is not known to this dof space.

The implementation of this function provided by the DofSpace class searches for the type index by repeatedly calling the getTypeName() function. Derived classes are encouraged to provide a more efficient implementation.

Parameters
name- the name of the dof type to be found.

return The index of the dof type named name, or a negative number.

Reimplemented from jive::util::DofSpace.

virtual String jive::util::DenseDofSpace::getTypeName ( idx_t  itype) const
virtual
virtual StringVector jive::util::DenseDofSpace::getTypeNames ( ) const
virtual

Returns an array containing the names of all dof types known to this dof space. The contents of this array should not be modified as the array may share its data with one of the private data members of this DofSpace object.

The implementation of this function provided by the DofSpace class creates the array by repeatedly calling the getTypeName() function.

Returns
An array containing all dof type names.

Reimplemented from jive::util::DofSpace.

virtual idx_t jive::util::DenseDofSpace::addDof ( idx_t  iitem,
idx_t  itype 
)
virtual

Implements jive::util::XDofSpace.

virtual void jive::util::DenseDofSpace::addDofs ( const IdxVector &  iitems,
const IdxVector &  itypes 
)
virtual

Reimplemented from jive::util::XDofSpace.

virtual void jive::util::DenseDofSpace::reorderDofs ( const Reordering reord)
virtual

Implements jive::util::XDofSpace.

virtual idx_t jive::util::DenseDofSpace::findDofIndex ( idx_t  iitem,
idx_t  itype 
) const
virtual
virtual idx_t jive::util::DenseDofSpace::findDofIndices ( const IdxVector &  idofs,
const IdxVector &  iitems,
const IdxVector &  itypes 
) const
virtual
virtual idx_t jive::util::DenseDofSpace::collectDofIndices ( const IdxVector &  idofs,
const IdxVector &  iitems,
const IdxVector &  itypes 
) const
virtual
virtual idx_t jive::util::DenseDofSpace::getDofsForItem ( const IdxVector &  idofs,
const IdxVector &  itypes,
idx_t  iitem 
) const
virtual
virtual idx_t jive::util::DenseDofSpace::getDofsForType ( const IdxVector &  idofs,
const IdxVector &  iitems,
idx_t  itype 
) const
virtual
virtual void jive::util::DenseDofSpace::decodeDofIndex ( idx_t &  iitem,
idx_t &  itype,
idx_t  idof 
) const
virtual
virtual void jive::util::DenseDofSpace::decodeDofIndices ( const IdxVector &  iitems,
const IdxVector &  itypes,
const IdxVector &  idofs 
) const
virtual
virtual SparseIdxMatrix jive::util::DenseDofSpace::toMatrix ( ) const
virtual

Returns a sparse matrix representation of this dof space. Each row in the matrix is associated with an item and each column is associated with a dof type. The value of a matrix element (i,j) is the global index, or equation number, of the dof that is attached to item i and has type j.

Returns
A sparse matrix representation of this dof space.

Implements jive::util::DofSpace.

virtual ItemSet* jive::util::DenseDofSpace::getItems ( ) const
virtual

Returns a pointer to the item set containing the items to which the dofs in this dof space are attached. The pointer is guaranteed not to be NULL and to remain valid throughout the entire lifetime of this DofSpace object.

Returns
A pointer to the item set associated with this dof space.

Implements jive::util::DofSpace.

void jive::util::DenseDofSpace::setAllDofs ( const IdxVector &  iitems,
const IdxVector &  itypes 
)
void jive::util::DenseDofSpace::getAllDofs ( const IdxVector &  iitems,
const IdxVector &  itypes 
) const
void jive::util::DenseDofSpace::emitEvents_ ( int  events)
protected