MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::STable Class Reference

#include <table.hpp>

Inheritance diagram for mfem::STable:
[legend]
Collaboration diagram for mfem::STable:
[legend]

Public Member Functions

 STable (int dim, int connections_per_row=3)
 Creates table with fixed number of connections.
 
int operator() (int i, int j) const
 
int Push (int i, int j)
 
 ~STable ()
 Destroys STable.
 
- Public Member Functions inherited from mfem::Table
 Table ()
 Creates an empty table.
 
 Table (const Table &)
 Copy constructor.
 
Tableoperator= (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 &copy) const
 
void Swap (Table &other)
 
void Clear ()
 
std::size_t MemoryUsage () const
 
 ~Table ()
 Destroys Table.
 

Additional Inherited Members

- Protected Attributes inherited from mfem::Table
int size
 size is the number of TYPE I elements.
 
Memory< int > I
 
Memory< int > J
 

Detailed Description

Data type STable. STable is similar to Table, but it's for symmetric connectivity, i.e. TYPE I is equivalent to TYPE II. In the first dimension we put the elements with smaller index.

Definition at line 226 of file table.hpp.

Constructor & Destructor Documentation

◆ STable()

mfem::STable::STable ( int dim,
int connections_per_row = 3 )

Creates table with fixed number of connections.

Definition at line 554 of file table.cpp.

◆ ~STable()

mfem::STable::~STable ( )
inline

Destroys STable.

Definition at line 245 of file table.hpp.

Member Function Documentation

◆ operator()()

int mfem::STable::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.

Definition at line 558 of file table.cpp.

◆ Push()

int mfem::STable::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().

Definition at line 570 of file table.cpp.


The documentation for this class was generated from the following files: