Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
Sundance::CellJacobianBatch Class Reference
Inheritance diagram for Sundance::CellJacobianBatch:
Sundance::ObjectWithClassVerbosity< CellJacobianBatch > Playa::ObjectWithVerbosity

List of all members.

Public Member Functions

 CellJacobianBatch ()
int spatialDim () const
int cellDim () const
int numCells () const
int numQuadPoints () const
void resize (int numCells, int numQuad, int spatialDim, int cellDim)
void resize (int numCells, int spatialDim, int cellDim)
double * jVals (int c, int q)
double * jVals (int c)
const double * jVals (int c) const
double * detJ (int c)
const Array< double > & detJ () const
void applyInvJ (int cell, int q, double *rhs, int nRhs, bool trans) const
void applyInvJ (int cell, double *rhs, int nRhs, bool trans) const
void getInvJ (int cell, int quad, Array< double > &invJ) const
void getInvJ (int cell, Array< double > &invJ) const
void print (std::ostream &os) const

Static Public Member Functions

static double & totalFlops ()
static void addFlops (const double &flops)

Private Member Functions

void factor () const
void computeInverses () const

Private Attributes

int spatialDim_
int cellDim_
int jSize_
int numCells_
int numQuad_
Array< int > iPiv_
Array< double > J_
Array< double > detJ_
Array< double > invJ_
bool isFactored_
bool hasInverses_
bool hasDetJ_

Detailed Description

A CellJacobianBatch is a collection of Jacobian matrices for many quadrature points distributed over batch of cells. All cells must have the same dimension and number of quadrature points. Affine cells have constant Jacobians, so in that case the quadrature point index can be ignored. See the ReferenceCellBase documentation for definitions of the coordinate systems used.

Data layout

All Jacobian elements for all points and cells are packed into a single vector. The length of the vector is $ N_{cell} \times N_{quad} \times D^2, $ where $D$ is the spatial dimension. The indices into the vector cycle in the following order (from slowest to fastest)

  1. cell number
  2. quadrature point number
  3. physical coordinate direction
  4. reference coordinate direction

Thus, the jacobian values for the $q$-th quadrature point on the $c$-th cell are the $D^2$ entries following the $(q + cN_{quad})D^2$-th element.

Definition at line 87 of file SundanceCellJacobianBatch.hpp.


Constructor & Destructor Documentation

empty ctor

Definition at line 83 of file SundanceCellJacobianBatch.cpp.


Member Function Documentation

static void Sundance::CellJacobianBatch::addFlops ( const double &  flops) [inline, static]
void CellJacobianBatch::applyInvJ ( int  cell,
int  q,
double *  rhs,
int  nRhs,
bool  trans 
) const
void Sundance::CellJacobianBatch::applyInvJ ( int  cell,
double *  rhs,
int  nRhs,
bool  trans 
) const [inline]

Apply an affine cell's inverse Jacobian to (possibly) multiple rhs stored in column-major order.

Definition at line 148 of file SundanceCellJacobianBatch.hpp.

References applyInvJ().

Referenced by applyInvJ().

int Sundance::CellJacobianBatch::cellDim ( ) const [inline]
void CellJacobianBatch::computeInverses ( ) const [private]
double* Sundance::CellJacobianBatch::detJ ( int  c) [inline]
const Array<double>& Sundance::CellJacobianBatch::detJ ( ) const [inline]

get the vector of determinant values

Definition at line 134 of file SundanceCellJacobianBatch.hpp.

References cellDim(), detJ_, factor(), isFactored_, and spatialDim().

Referenced by factor().

void CellJacobianBatch::factor ( ) const [private]
void CellJacobianBatch::getInvJ ( int  cell,
int  quad,
Array< double > &  invJ 
) const
void Sundance::CellJacobianBatch::getInvJ ( int  cell,
Array< double > &  invJ 
) const [inline]

Get the explicit inverse of the Jacobian for the given affine cell.

Definition at line 162 of file SundanceCellJacobianBatch.hpp.

References getInvJ().

Referenced by getInvJ().

double* Sundance::CellJacobianBatch::jVals ( int  c,
int  q 
)
double* Sundance::CellJacobianBatch::jVals ( int  c) [inline]

Get a pointer to the start of the c-th Jacobian in the batch.

Definition at line 123 of file SundanceCellJacobianBatch.hpp.

References J_, and jSize_.

const double* Sundance::CellJacobianBatch::jVals ( int  c) const [inline]

Get a constant pointer to start of c-th Jacobian in the batch

Definition at line 127 of file SundanceCellJacobianBatch.hpp.

References J_, and jSize_.

int Sundance::CellJacobianBatch::numCells ( ) const [inline]

get the number of quad points per cell

Definition at line 104 of file SundanceCellJacobianBatch.hpp.

References numQuad_.

void CellJacobianBatch::print ( std::ostream &  os) const
void CellJacobianBatch::resize ( int  numCells,
int  numQuad,
int  spatialDim,
int  cellDim 
)
void CellJacobianBatch::resize ( int  numCells,
int  spatialDim,
int  cellDim 
)

resize the batch, using one quadrature point per cell (appropriate for affine elements)

Definition at line 108 of file SundanceCellJacobianBatch.cpp.

References cellDim(), cellDim_, detJ_, hasInverses_, iPiv_, isFactored_, J_, jSize_, numCells(), numCells_, numQuad_, spatialDim(), and spatialDim_.

static double& Sundance::CellJacobianBatch::totalFlops ( ) [inline, static]

Member Data Documentation

Definition at line 182 of file SundanceCellJacobianBatch.hpp.

Referenced by cellDim(), factor(), and resize().

Array<double> Sundance::CellJacobianBatch::detJ_ [mutable, private]

Definition at line 188 of file SundanceCellJacobianBatch.hpp.

Referenced by detJ(), factor(), and resize().

bool Sundance::CellJacobianBatch::hasDetJ_ [mutable, private]

Definition at line 192 of file SundanceCellJacobianBatch.hpp.

Definition at line 191 of file SundanceCellJacobianBatch.hpp.

Referenced by computeInverses(), getInvJ(), print(), and resize().

Array<double> Sundance::CellJacobianBatch::invJ_ [mutable, private]

Definition at line 189 of file SundanceCellJacobianBatch.hpp.

Referenced by computeInverses(), getInvJ(), and print().

Array<int> Sundance::CellJacobianBatch::iPiv_ [mutable, private]

Definition at line 186 of file SundanceCellJacobianBatch.hpp.

Referenced by applyInvJ(), computeInverses(), factor(), and resize().

Definition at line 190 of file SundanceCellJacobianBatch.hpp.

Referenced by applyInvJ(), computeInverses(), detJ(), factor(), and resize().

Array<double> Sundance::CellJacobianBatch::J_ [mutable, private]

Definition at line 187 of file SundanceCellJacobianBatch.hpp.

Referenced by applyInvJ(), computeInverses(), factor(), jVals(), and resize().

Definition at line 183 of file SundanceCellJacobianBatch.hpp.

Referenced by computeInverses(), factor(), getInvJ(), jVals(), print(), and resize().

Site Contact