MFEM v4.8.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::DenseTensor Class Reference

Rank 3 tensor (array of matrices) More...

#include <densemat.hpp>

Public Member Functions

 DenseTensor ()
 
 DenseTensor (int i, int j, int k)
 
 DenseTensor (real_t *d, int i, int j, int k)
 
 DenseTensor (int i, int j, int k, MemoryType mt)
 
 DenseTensor (const DenseTensor &other)
 Copy constructor: deep copy.
 
int SizeI () const
 
int SizeJ () const
 
int SizeK () const
 
int TotalSize () const
 
void SetSize (int i, int j, int k, MemoryType mt_=MemoryType::PRESERVE)
 
void UseExternalData (real_t *ext_data, int i, int j, int k)
 
void NewMemoryAndSize (const Memory< real_t > &mem, int i, int j, int k, bool own_mem)
 Reset the DenseTensor to use the given external Memory mem and dimensions i, j, and k.
 
DenseTensoroperator= (real_t c)
 Sets the tensor elements equal to constant c.
 
DenseTensoroperator= (const DenseTensor &other)
 Copy assignment operator (performs a deep copy)
 
DenseMatrixoperator() (int k)
 
const DenseMatrixoperator() (int k) const
 
real_toperator() (int i, int j, int k)
 
const real_toperator() (int i, int j, int k) const
 
real_tGetData (int k)
 
const real_tGetData (int k) const
 
real_tData ()
 
const real_tData () const
 
Memory< real_t > & GetMemory ()
 
const Memory< real_t > & GetMemory () const
 
void AddMult (const Table &elem_dof, const Vector &x, Vector &y) const
 
void Clear ()
 
std::size_t MemoryUsage () const
 
const real_tRead (bool on_dev=true) const
 Shortcut for mfem::Read( GetMemory(), TotalSize(), on_dev).
 
const real_tHostRead () const
 Shortcut for mfem::Read(GetMemory(), TotalSize(), false).
 
real_tWrite (bool on_dev=true)
 Shortcut for mfem::Write(GetMemory(), TotalSize(), on_dev).
 
real_tHostWrite ()
 Shortcut for mfem::Write(GetMemory(), TotalSize(), false).
 
real_tReadWrite (bool on_dev=true)
 Shortcut for mfem::ReadWrite(GetMemory(), TotalSize(), on_dev).
 
real_tHostReadWrite ()
 Shortcut for mfem::ReadWrite(GetMemory(), TotalSize(), false).
 
void Swap (DenseTensor &t)
 
 ~DenseTensor ()
 

Detailed Description

Rank 3 tensor (array of matrices)

Definition at line 1111 of file densemat.hpp.

Constructor & Destructor Documentation

◆ DenseTensor() [1/5]

mfem::DenseTensor::DenseTensor ( )
inline

Definition at line 1119 of file densemat.hpp.

◆ DenseTensor() [2/5]

mfem::DenseTensor::DenseTensor ( int i,
int j,
int k )
inline

Definition at line 1124 of file densemat.hpp.

◆ DenseTensor() [3/5]

mfem::DenseTensor::DenseTensor ( real_t * d,
int i,
int j,
int k )
inline

Definition at line 1131 of file densemat.hpp.

◆ DenseTensor() [4/5]

mfem::DenseTensor::DenseTensor ( int i,
int j,
int k,
MemoryType mt )
inline

Definition at line 1138 of file densemat.hpp.

◆ DenseTensor() [5/5]

mfem::DenseTensor::DenseTensor ( const DenseTensor & other)
inline

Copy constructor: deep copy.

Definition at line 1146 of file densemat.hpp.

◆ ~DenseTensor()

mfem::DenseTensor::~DenseTensor ( )
inline

Definition at line 1300 of file densemat.hpp.

Member Function Documentation

◆ AddMult()

void mfem::DenseTensor::AddMult ( const Table & elem_dof,
const Vector & x,
Vector & y ) const

Matrix-vector product from unassembled element matrices, assuming both 'x' and 'y' use the same elem_dof table.

Definition at line 4329 of file densemat.cpp.

◆ Clear()

void mfem::DenseTensor::Clear ( )
inline

Definition at line 1264 of file densemat.hpp.

◆ Data() [1/2]

real_t * mfem::DenseTensor::Data ( )
inline

Definition at line 1253 of file densemat.hpp.

◆ Data() [2/2]

const real_t * mfem::DenseTensor::Data ( ) const
inline

Definition at line 1255 of file densemat.hpp.

◆ GetData() [1/2]

real_t * mfem::DenseTensor::GetData ( int k)
inline

Definition at line 1241 of file densemat.hpp.

◆ GetData() [2/2]

const real_t * mfem::DenseTensor::GetData ( int k) const
inline

Definition at line 1247 of file densemat.hpp.

◆ GetMemory() [1/2]

Memory< real_t > & mfem::DenseTensor::GetMemory ( )
inline

Definition at line 1257 of file densemat.hpp.

◆ GetMemory() [2/2]

const Memory< real_t > & mfem::DenseTensor::GetMemory ( ) const
inline

Definition at line 1258 of file densemat.hpp.

◆ HostRead()

const real_t * mfem::DenseTensor::HostRead ( ) const
inline

Shortcut for mfem::Read(GetMemory(), TotalSize(), false).

Definition at line 1274 of file densemat.hpp.

◆ HostReadWrite()

real_t * mfem::DenseTensor::HostReadWrite ( )
inline

Shortcut for mfem::ReadWrite(GetMemory(), TotalSize(), false).

Definition at line 1290 of file densemat.hpp.

◆ HostWrite()

real_t * mfem::DenseTensor::HostWrite ( )
inline

Shortcut for mfem::Write(GetMemory(), TotalSize(), false).

Definition at line 1282 of file densemat.hpp.

◆ MemoryUsage()

std::size_t mfem::DenseTensor::MemoryUsage ( ) const
inline

Definition at line 1267 of file densemat.hpp.

◆ NewMemoryAndSize()

void mfem::DenseTensor::NewMemoryAndSize ( const Memory< real_t > & mem,
int i,
int j,
int k,
bool own_mem )
inline

Reset the DenseTensor to use the given external Memory mem and dimensions i, j, and k.

If own_mem is false, the DenseTensor will not own any of the pointers of mem.

Note that when own_mem is true, the mem object can be destroyed immediately by the caller but mem.Delete() should NOT be called since the DenseTensor object takes ownership of all pointers owned by mem.

Definition at line 1189 of file densemat.hpp.

◆ operator()() [1/4]

real_t & mfem::DenseTensor::operator() ( int i,
int j,
int k )
inline

Definition at line 1225 of file densemat.hpp.

◆ operator()() [2/4]

const real_t & mfem::DenseTensor::operator() ( int i,
int j,
int k ) const
inline

Definition at line 1233 of file densemat.hpp.

◆ operator()() [3/4]

DenseMatrix & mfem::DenseTensor::operator() ( int k)
inline

Definition at line 1211 of file densemat.hpp.

◆ operator()() [4/4]

const DenseMatrix & mfem::DenseTensor::operator() ( int k) const
inline

Definition at line 1217 of file densemat.hpp.

◆ operator=() [1/2]

DenseTensor & mfem::DenseTensor::operator= ( const DenseTensor & other)

Copy assignment operator (performs a deep copy)

Definition at line 4394 of file densemat.cpp.

◆ operator=() [2/2]

DenseTensor & mfem::DenseTensor::operator= ( real_t c)

Sets the tensor elements equal to constant c.

Definition at line 4384 of file densemat.cpp.

◆ Read()

const real_t * mfem::DenseTensor::Read ( bool on_dev = true) const
inline

Shortcut for mfem::Read( GetMemory(), TotalSize(), on_dev).

Definition at line 1270 of file densemat.hpp.

◆ ReadWrite()

real_t * mfem::DenseTensor::ReadWrite ( bool on_dev = true)
inline

Shortcut for mfem::ReadWrite(GetMemory(), TotalSize(), on_dev).

Definition at line 1286 of file densemat.hpp.

◆ SetSize()

void mfem::DenseTensor::SetSize ( int i,
int j,
int k,
MemoryType mt_ = MemoryType::PRESERVE )
inline

Definition at line 1163 of file densemat.hpp.

◆ SizeI()

int mfem::DenseTensor::SizeI ( ) const
inline

Definition at line 1157 of file densemat.hpp.

◆ SizeJ()

int mfem::DenseTensor::SizeJ ( ) const
inline

Definition at line 1158 of file densemat.hpp.

◆ SizeK()

int mfem::DenseTensor::SizeK ( ) const
inline

Definition at line 1159 of file densemat.hpp.

◆ Swap()

void mfem::DenseTensor::Swap ( DenseTensor & t)
inline

Definition at line 1293 of file densemat.hpp.

◆ TotalSize()

int mfem::DenseTensor::TotalSize ( ) const
inline

Definition at line 1161 of file densemat.hpp.

◆ UseExternalData()

void mfem::DenseTensor::UseExternalData ( real_t * ext_data,
int i,
int j,
int k )
inline

Definition at line 1172 of file densemat.hpp.

◆ Write()

real_t * mfem::DenseTensor::Write ( bool on_dev = true)
inline

Shortcut for mfem::Write(GetMemory(), TotalSize(), on_dev).

Definition at line 1278 of file densemat.hpp.


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