Chombo + EB  3.2
Public Member Functions | Private Attributes | List of all members
ArSp::ArrayOfMatrixAlloc Class Reference

Allocator for an array of matrices contiguous in memory. More...

#include <CHArray.H>

Public Member Functions

 ArrayOfMatrixAlloc ()
 
void define (const USz_t a_m, const USz_t a_n)
 
CHMatrixallocate (const USz_t size)
 
void deallocate (CHMatrix *p, const USz_t size)
 

Private Attributes

RealmatrixData
 
USz_t m
 
USz_t n
 
bool defined
 

Detailed Description

Allocator for an array of matrices contiguous in memory.

Useful for allocating an array of matrices which can be easily passed to Fortran, etc.

Example - 1D Array of 2 3x3 matrices

*
*     CHArray<CHMatrix, 1, ArZeroRow, ArSp::ArrayOfMatrixAlloc> AM;
*     AM.getAllocator().define(3, 3);
*     AM.define(2);
*     AM(0) = 1.1;
*     AM(1) = 1.9;
*     std::cout << AM << std::endl;
*                                                        

Constructor & Destructor Documentation

◆ ArrayOfMatrixAlloc()

ArSp::ArrayOfMatrixAlloc::ArrayOfMatrixAlloc ( )
inline

Member Function Documentation

◆ define()

void ArSp::ArrayOfMatrixAlloc::define ( const USz_t  a_m,
const USz_t  a_n 
)
inline

◆ allocate()

CHMatrix* ArSp::ArrayOfMatrixAlloc::allocate ( const USz_t  size)
inline

◆ deallocate()

void ArSp::ArrayOfMatrixAlloc::deallocate ( CHMatrix p,
const USz_t  size 
)
inline

References IntVect::p().

Member Data Documentation

◆ matrixData

Real* ArSp::ArrayOfMatrixAlloc::matrixData
private

◆ m

USz_t ArSp::ArrayOfMatrixAlloc::m
private

◆ n

USz_t ArSp::ArrayOfMatrixAlloc::n
private

◆ defined

bool ArSp::ArrayOfMatrixAlloc::defined
private

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