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 76 of file SundanceCellJacobianBatch.hpp.


Constructor & Destructor Documentation

CellJacobianBatch::CellJacobianBatch (  ) 

empty ctor

Definition at line 72 of file SundanceCellJacobianBatch.cpp.


Member Function Documentation

static void Sundance::CellJacobianBatch::addFlops ( const double &  flops  )  [inline, static]

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 137 of file SundanceCellJacobianBatch.hpp.

References applyInvJ().

Referenced by applyInvJ().

void CellJacobianBatch::applyInvJ ( int  cell,
int  q,
double *  rhs,
int  nRhs,
bool  trans 
) const

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

Definition at line 215 of file SundanceCellJacobianBatch.cpp.

References addFlops(), dgetrs_(), factor(), iPiv_, isFactored_, J_, numCells_, numQuad_, and spatialDim_.

Referenced by Sundance::CurveIntegralCalc::getCurveQuadPoints_line(), and Sundance::CurveIntegralCalc::getCurveQuadPoints_polygon().

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

void CellJacobianBatch::computeInverses (  )  const [private]

const Array<double>& Sundance::CellJacobianBatch::detJ (  )  const [inline]

get the vector of determinant values

Definition at line 123 of file SundanceCellJacobianBatch.hpp.

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

Referenced by factor().

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

void CellJacobianBatch::factor (  )  const [private]

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 151 of file SundanceCellJacobianBatch.hpp.

References getInvJ().

Referenced by getInvJ().

void CellJacobianBatch::getInvJ ( int  cell,
int  quad,
Array< double > &  invJ 
) const

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 116 of file SundanceCellJacobianBatch.hpp.

References J_, and jSize_.

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

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

Definition at line 112 of file SundanceCellJacobianBatch.hpp.

References J_, and jSize_.

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

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

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

get the number of quad points per cell

Definition at line 93 of file SundanceCellJacobianBatch.hpp.

References numQuad_.

void CellJacobianBatch::print ( std::ostream &  os  )  const

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 97 of file SundanceCellJacobianBatch.cpp.

References cellDim_, detJ_, hasInverses_, iPiv_, isFactored_, J_, jSize_, numCells_, numQuad_, and spatialDim_.

void CellJacobianBatch::resize ( int  numCells,
int  numQuad,
int  spatialDim,
int  cellDim 
)

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

get the spatial dimension

Definition at line 84 of file SundanceCellJacobianBatch.hpp.

References spatialDim_.

Referenced by detJ(), and Sundance::CurveEvalMediator::evalDiscreteFuncElement().

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

Definition at line 158 of file SundanceCellJacobianBatch.hpp.

Referenced by addFlops().


Member Data Documentation

Definition at line 171 of file SundanceCellJacobianBatch.hpp.

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

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

Definition at line 177 of file SundanceCellJacobianBatch.hpp.

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

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

Definition at line 181 of file SundanceCellJacobianBatch.hpp.

Definition at line 180 of file SundanceCellJacobianBatch.hpp.

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

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

Definition at line 178 of file SundanceCellJacobianBatch.hpp.

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

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

Definition at line 175 of file SundanceCellJacobianBatch.hpp.

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

Definition at line 179 of file SundanceCellJacobianBatch.hpp.

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

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

Definition at line 176 of file SundanceCellJacobianBatch.hpp.

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

Definition at line 172 of file SundanceCellJacobianBatch.hpp.

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

Site Contact