MFEM v2.0
Public Member Functions | Protected Attributes
Table Class Reference

#include <table.hpp>

Inheritance diagram for Table:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Table ()
 Creates an empty table.
 Table (int dim, int connections_per_row=3)
 Create a table with a fixed number of connections.
 Table (int nrows, int *partitioning)
void MakeI (int nrows)
 Next 7 methods are used together with the default constructor.
void AddAColumnInRow (int r)
void AddColumnsInRow (int r, int ncol)
void MakeJ ()
void AddConnection (int r, int c)
void AddConnections (int r, int *c, int nc)
void ShiftUpI ()
void SetSize (int dim, int connections_per_row)
 Set the size and the number of connections for the table.
void SetDims (int rows, int nnz)
int Size () const
 Returns the number of TYPE I elements.
int Size_of_connections () const
int operator() (int i, int j) const
void GetRow (int i, Array< int > &row) const
 Return row i in array row (the Table must be finalized)
int RowSize (int i) const
const int * GetRow (int i) const
int * GetRow (int i)
int * GetI ()
int * GetJ ()
const int * GetI () const
const int * GetJ () const
void SetIJ (int *newI, int *newJ, int newsize=-1)
int Push (int i, int j)
void Finalize ()
int Width () const
 Returns the number of TYPE II elements (after Finalize() is called).
void LoseData ()
 Call this if data has been stolen.
void Print (ostream &out=cout, int width=4) const
 Prints the table to stream out.
void Save (ostream &out) const
 ~Table ()
 Destroys Table.

Protected Attributes

int size
 size is the number of TYPE I elements.
int * I
int * J

Detailed Description

Data type Table. Table stores the connectivity of elements of TYPE I to elements of TYPE II, for example, it may be Element-To-Face connectivity table, etc.

Definition at line 22 of file table.hpp.


Constructor & Destructor Documentation

Table::Table ( ) [inline]

Creates an empty table.

Definition at line 36 of file table.hpp.

References I, J, and size.

Table::Table ( int  dim,
int  connections_per_row = 3 
) [explicit]

Create a table with a fixed number of connections.

Definition at line 21 of file table.cpp.

References I, J, and size.

Table::Table ( int  nrows,
int *  partitioning 
)

Create a table with one entry per row with column indices given by 'partitioning'.

Definition at line 37 of file table.cpp.

References I, J, and size.

Table::~Table ( )

Destroys Table.

Definition at line 257 of file table.cpp.

References I, and J.


Member Function Documentation

void Table::AddAColumnInRow ( int  r) [inline]

Definition at line 47 of file table.hpp.

References I.

Referenced by Mesh::GetVertexToElementTable(), and Transpose().

void Table::AddColumnsInRow ( int  r,
int  ncol 
) [inline]

Definition at line 48 of file table.hpp.

References I.

Referenced by ListOfIntegerSets::AsTable(), Mesh::GetElementArrayEdgeTable(), and Mesh::Load().

void Table::AddConnection ( int  r,
int  c 
) [inline]

Definition at line 50 of file table.hpp.

References I, and J.

Referenced by Mesh::GetElementArrayEdgeTable(), Mesh::GetVertexToElementTable(), and Transpose().

void Table::AddConnections ( int  r,
int *  c,
int  nc 
)

Definition at line 70 of file table.cpp.

References I, and J.

Referenced by ListOfIntegerSets::AsTable(), and Mesh::Load().

void Table::Finalize ( )

Finalize the table initialization. The function may be called only once, after the table has been initialized, in order to densen array J (by getting rid of -1's in array J). Calling this function will "freeze" the table and function Push will work no more. Note: The table is functional even without calling Finalize().

Definition at line 186 of file table.cpp.

References I, J, mfem_error(), and size.

Referenced by Mesh::ElementToElementTable(), Mesh::GetEdgeVertexTable(), and Mesh::GetElementToFaceTable().

int* Table::GetI ( ) [inline]
const int* Table::GetI ( ) const [inline]

Definition at line 85 of file table.hpp.

References I.

int* Table::GetJ ( ) [inline]
const int* Table::GetJ ( ) const [inline]

Definition at line 86 of file table.hpp.

References J.

int* Table::GetRow ( int  i) [inline]

Definition at line 81 of file table.hpp.

References I, and J.

void Table::GetRow ( int  i,
Array< int > &  row 
) const
const int* Table::GetRow ( int  i) const [inline]

Definition at line 80 of file table.hpp.

References I, and J.

void Table::LoseData ( ) [inline]

Call this if data has been stolen.

Definition at line 108 of file table.hpp.

References I, J, and size.

void Table::MakeI ( int  nrows)

Next 7 methods are used together with the default constructor.

Definition at line 52 of file table.cpp.

References I, and SetDims().

Referenced by ListOfIntegerSets::AsTable(), Mesh::GetElementArrayEdgeTable(), Mesh::GetVertexToElementTable(), Mesh::Load(), and Transpose().

void Table::MakeJ ( )
int Table::operator() ( int  i,
int  j 
) const

Returns index of the connection between element i of TYPE I and element j of TYPE II. If there is no connection between element i and element j established in the table, then the return value is -1.

Reimplemented in STable.

Definition at line 127 of file table.cpp.

References I, J, and size.

void Table::Print ( ostream &  out = cout,
int  width = 4 
) const

Prints the table to stream out.

Definition at line 227 of file table.cpp.

References I, J, and size.

int Table::Push ( int  i,
int  j 
)

Establish connection between element i and element j in the table. The return value is the index of the connection. It returns -1 if it fails to establish the connection. Possibilities are there is not enough memory on row i to establish connection to j, an attempt to establish new connection after calling Finalize().

Reimplemented in STable.

Definition at line 162 of file table.cpp.

References I, J, mfem_error(), and size.

Referenced by Mesh::ElementToElementTable(), Mesh::GetEdgeVertexTable(), and Mesh::GetElementToFaceTable().

int Table::RowSize ( int  i) const [inline]
void Table::Save ( ostream &  out) const

Definition at line 245 of file table.cpp.

References I, J, and size.

void Table::SetDims ( int  rows,
int  nnz 
)

Set the rows and the number of all connections for the table. Does NOT initialize the whole array I ! (I[0]=0 and I[rows]=nnz only)

Definition at line 102 of file table.cpp.

References I, J, and size.

Referenced by MakeI(), Mult(), SetSize(), and Transpose().

void Table::SetIJ ( int *  newI,
int *  newJ,
int  newsize = -1 
)

Definition at line 152 of file table.cpp.

References I, J, and size.

void Table::SetSize ( int  dim,
int  connections_per_row 
)

Set the size and the number of connections for the table.

Definition at line 86 of file table.cpp.

References I, J, SetDims(), and size.

void Table::ShiftUpI ( )
int Table::Size ( ) const [inline]
int Table::Size_of_connections ( ) const [inline]

Returns the number of connections in the table. If Finalize() is not called, it returns the number of possible connections established by the used constructor. Otherwise, it is exactly the number of established connections before calling Finalize().

Definition at line 68 of file table.hpp.

References I, and size.

Referenced by NURBSExtension::GenerateBdrElementDofTable(), and NURBSExtension::GenerateElementDofTable().

int Table::Width ( ) const

Returns the number of TYPE II elements (after Finalize() is called).

Definition at line 219 of file table.cpp.

References I, J, and size.

Referenced by Mult(), and Transpose().


Member Data Documentation

int* Table::I [protected]

Arrays for the connectivity information in the CSR storage. I is of size "size+1", J is of size the number of connections between TYPE I to TYPE II elements (actually stored I[size]).

Definition at line 32 of file table.hpp.

Referenced by AddAColumnInRow(), AddColumnsInRow(), AddConnection(), AddConnections(), Finalize(), GetI(), GetRow(), LoseData(), MakeI(), MakeJ(), operator()(), Print(), Push(), RowSize(), Save(), SetDims(), SetIJ(), SetSize(), ShiftUpI(), Size_of_connections(), Table(), Width(), and ~Table().

int * Table::J [protected]
int Table::size [protected]

size is the number of TYPE I elements.

Definition at line 27 of file table.hpp.

Referenced by Finalize(), LoseData(), MakeJ(), operator()(), Print(), Push(), Save(), SetDims(), SetIJ(), SetSize(), ShiftUpI(), Size(), Size_of_connections(), Table(), and Width().


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