Chombo + EB  3.0
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

ArSp::ArrayOfMatrixAlloc::ArrayOfMatrixAlloc ( )
inline

Member Function Documentation

void ArSp::ArrayOfMatrixAlloc::define ( const USz_t  a_m,
const USz_t  a_n 
)
inline
CHMatrix* ArSp::ArrayOfMatrixAlloc::allocate ( const USz_t  size)
inline
void ArSp::ArrayOfMatrixAlloc::deallocate ( CHMatrix p,
const USz_t  size 
)
inline

References IntVect::p().

Member Data Documentation

Real* ArSp::ArrayOfMatrixAlloc::matrixData
private
USz_t ArSp::ArrayOfMatrixAlloc::m
private
USz_t ArSp::ArrayOfMatrixAlloc::n
private
bool ArSp::ArrayOfMatrixAlloc::defined
private

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