escript  Revision_
Typedefs | Functions
finley::util Namespace Reference

Typedefs

typedef std::vector< std::pair
< int, int > > 
ValueAndIndexList

Functions

bool ValueAndIndexCompare (const std::pair< int, int > &i, const std::pair< int, int > &j)
 comparison function for sortValueAndIndex
void sortValueAndIndex (ValueAndIndexList &array)
 orders a ValueAndIndexList by value
void gather (int len, const int *index, int numData, const double *in, double *out)
void addScatter (const int len, const int *index, const int numData, const double *in, double *out, const int upperBound)
void smallMatMult (int A1, int A2, double *A, int B2, const std::vector< double > &B, const std::vector< double > &C)
 multiplies two matrices: A(1:A1,1:A2) := B(1:A1,1:B2)*C(1:B2,1:A2)
void smallMatSetMult1 (int len, int A1, int A2, double *A, int B2, const std::vector< double > &B, const std::vector< double > &C)
void invertSmallMat (int len, int dim, const double *A, double *invA, double *det)
void normalVector (int len, int dim, int dim1, const double *A, double *Normal)
int getMinInt (int dim, int N, const int *values)
 calculates the minimum value from a dim X N integer array
int getMaxInt (int dim, int N, const int *values)
 calculates the maximum value from a dim X N integer array
std::pair< int, int > getMinMaxInt (int dim, int N, const int *values)
std::pair< int, int > getFlaggedMinMaxInt (int N, const int *values, int ignore)
std::vector< int > packMask (const std::vector< short > &mask)
void setValuesInUse (const int *values, const int numValues, std::vector< int > &valuesInUse, Esys_MPIInfo *mpiinfo)
bool hasReducedIntegrationOrder (const escript::Data &in)
 returns true if the data object is defined on reduced element types

Typedef Documentation

typedef std::vector< std::pair<int,int> > finley::util::ValueAndIndexList

Function Documentation

void finley::util::addScatter ( const int  len,
const int *  index,
const int  numData,
const double *  in,
double *  out,
const int  upperBound 
)
void finley::util::gather ( int  len,
const int *  index,
int  numData,
const double *  in,
double *  out 
)

gathers values into vector out from vector in using index: out(1:numData, 1:len) := in(1:numData, index(1:len))

References INDEX2.

Referenced by finley::Assemble_getNormal(), finley::Assemble_getSize(), and finley::Mesh::findMatchingFaces().

std::pair< int, int > finley::util::getFlaggedMinMaxInt ( int  N,
const int *  values,
int  ignore 
)

calculates the minimum and maximum value from an integer array of length N disregarding the value 'ignore'

References paso::N.

Referenced by finley::NodeMapping::assign(), and finley::NodeFile::createDOFMappingAndCoupling().

int finley::util::getMaxInt ( int  dim,
int  N,
const int *  values 
)

calculates the maximum value from a dim X N integer array

References INDEX2, and paso::N.

Referenced by finley::Mesh_merge().

int finley::util::getMinInt ( int  dim,
int  N,
const int *  values 
)

calculates the minimum value from a dim X N integer array

References INDEX2, and paso::N.

std::pair< int, int > finley::util::getMinMaxInt ( int  dim,
int  N,
const int *  values 
)
void finley::util::invertSmallMat ( int  len,
int  dim,
const double *  A,
double *  invA,
double *  det 
)

inverts the set of dim x dim matrices A(:,:,1:len) with dim=1,2,3 the inverse and determinant are returned.

References ABS, INDEX3, finley::setError(), VALUE_ERROR, and ZERO_DIVISION_ERROR.

void finley::util::normalVector ( int  len,
int  dim,
int  dim1,
const double *  A,
double *  Normal 
)

returns the normalized vector Normal[dim,len] orthogonal to A(:,0,q) and A(:,1,q) in the case of dim=3, or the vector A(:,0,q) in the case of dim=2

References INDEX2, INDEX3, finley::setError(), and ZERO_DIVISION_ERROR.

Referenced by finley::Assemble_getNormal().

std::vector< int > finley::util::packMask ( const std::vector< short > &  mask)

determines the indices of the positive entries in mask returning the length of index.

Referenced by finley::Mesh::createMappings(), finley::NodeFile::createNodeMappings(), finley::Mesh::prepare(), and finley::Mesh::resolveNodeIds().

void finley::util::setValuesInUse ( const int *  values,
const int  numValues,
std::vector< int > &  valuesInUse,
Esys_MPIInfo mpiinfo 
)
void finley::util::smallMatMult ( int  A1,
int  A2,
double *  A,
int  B2,
const std::vector< double > &  B,
const std::vector< double > &  C 
)

multiplies two matrices: A(1:A1,1:A2) := B(1:A1,1:B2)*C(1:B2,1:A2)

References INDEX2.

Referenced by finley::Assemble_getNormal().

void finley::util::smallMatSetMult1 ( int  len,
int  A1,
int  A2,
double *  A,
int  B2,
const std::vector< double > &  B,
const std::vector< double > &  C 
)

multiplies a set of matrices with a single matrix: A(1:A1,1:A2,i)=B(1:A1,1:B2,i)*C(1:B2,1:A2) for i=1,len

References INDEX2, and INDEX3.

Referenced by finley::Assemble_interpolate().

void finley::util::sortValueAndIndex ( ValueAndIndexList &  array)

orders a ValueAndIndexList by value

sortValueAndIndex is used to sort items by a value. index points to the location of the original item array and can be used to reorder the array

References ValueAndIndexCompare().

Referenced by finley::ElementFile::optimizeOrdering().

bool finley::util::ValueAndIndexCompare ( const std::pair< int, int > &  i,
const std::pair< int, int > &  j 
)

comparison function for sortValueAndIndex

Referenced by sortValueAndIndex().