MFEM v4.7.0
Finite element discretization library
|
#include <table.hpp>
Public Member Functions | |
Table () | |
Creates an empty table. | |
Table (const Table &) | |
Copy constructor. | |
Table & | operator= (const Table &rhs) |
Assignment operator: deep copy. | |
Table (int dim, int connections_per_row=3) | |
Create a table with an upper limit for the number of connections. | |
Table (int nrows, Array< Connection > &list) | |
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, const 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 |
Memory< int > & | GetIMemory () |
Memory< int > & | GetJMemory () |
const Memory< int > & | GetIMemory () const |
const Memory< int > & | GetJMemory () const |
const int * | ReadI (bool on_dev=true) const |
int * | WriteI (bool on_dev=true) |
int * | ReadWriteI (bool on_dev=true) |
const int * | HostReadI () const |
int * | HostWriteI () |
int * | HostReadWriteI () |
const int * | ReadJ (bool on_dev=true) const |
int * | WriteJ (bool on_dev=true) |
int * | ReadWriteJ (bool on_dev=true) |
const int * | HostReadJ () const |
int * | HostWriteJ () |
int * | HostReadWriteJ () |
void | SortRows () |
Sort the column (TYPE II) indices in each row. | |
void | SetIJ (int *newI, int *newJ, int newsize=-1) |
Replace the I and J arrays with the given newI and newJ arrays. | |
int | Push (int i, int j) |
void | Finalize () |
void | MakeFromList (int nrows, const Array< Connection > &list) |
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 (std::ostream &out=mfem::out, int width=4) const |
Prints the table to stream out. | |
void | PrintMatlab (std::ostream &out) const |
void | Save (std::ostream &out) const |
void | Load (std::istream &in) |
void | Copy (Table ©) const |
void | Swap (Table &other) |
void | Clear () |
std::size_t | MemoryUsage () const |
~Table () | |
Destroys Table. | |
Protected Attributes | |
int | size |
size is the number of TYPE I elements. | |
Memory< int > | I |
Memory< int > | J |
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.
mfem::Table::Table | ( | const Table & | table | ) |
|
explicit |
|
inline |
Create a table from a list of connections, see MakeFromList().
mfem::Table::Table | ( | int | nrows, |
int * | partitioning ) |
|
inline |
void mfem::Table::AddConnections | ( | int | r, |
const int * | c, | ||
int | nc ) |
void mfem::Table::Finalize | ( | ) |
Finalize the table initialization. The function may be called only once, after the table has been initialized, in order to compress 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().
|
inline |
|
inline |
void mfem::Table::GetRow | ( | int | i, |
Array< int > & | row ) const |
|
inline |
void mfem::Table::MakeFromList | ( | int | nrows, |
const Array< Connection > & | list ) |
Create the table from a list of connections {(from, to)}, where 'from' is a TYPE I index and 'to' is a TYPE II index. The list is assumed to be sorted and free of duplicities, i.e., you need to call Array::Sort and Array::Unique before calling this method.
void mfem::Table::MakeI | ( | int | nrows | ) |
int mfem::Table::operator() | ( | int | i, |
int | j ) const |
void mfem::Table::Print | ( | std::ostream & | out = mfem::out, |
int | width = 4 ) const |
int mfem::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().
|
inline |
|
inline |
|
inline |
|
inline |
void mfem::Table::SetDims | ( | int | rows, |
int | nnz ) |
void mfem::Table::SetIJ | ( | int * | newI, |
int * | newJ, | ||
int | newsize = -1 ) |
void mfem::Table::SetSize | ( | int | dim, |
int | connections_per_row ) |
|
inline |
|
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().
void mfem::Table::SortRows | ( | ) |
int mfem::Table::Width | ( | ) | const |
Returns the number of TYPE II elements (after Finalize() is called).
|
protected |
|
protected |