escript  Revision_Unversioneddirectory
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 More...
 
void sortValueAndIndex (ValueAndIndexList &array)
 orders a ValueAndIndexList by value More...
 
void gather (dim_t len, const index_t *index, dim_t numData, const double *in, double *out)
 
void addScatter (dim_t len, const index_t *index, dim_t numData, const double *in, double *out, index_t 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) More...
 
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)
 
index_t getMinInt (int dim, dim_t N, const index_t *values)
 calculates the minimum value from a dim X N integer array More...
 
index_t getMaxInt (int dim, dim_t N, const index_t *values)
 calculates the maximum value from a dim X N integer array More...
 
std::pair< index_t, index_tgetMinMaxInt (int dim, dim_t N, const index_t *values)
 
std::pair< index_t, index_tgetFlaggedMinMaxInt (dim_t N, const index_t *values, index_t ignore)
 
std::vector< index_tpackMask (const std::vector< short > &mask)
 
void setValuesInUse (const int *values, const int numValues, std::vector< int > &valuesInUse, esysUtils::JMPI &mpiinfo)
 
bool hasReducedIntegrationOrder (const escript::Data &in)
 returns true if the data object is defined on reduced element types More...
 

Typedef Documentation

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

Function Documentation

void finley::util::addScatter ( dim_t  len,
const index_t index,
dim_t  numData,
const double *  in,
double *  out,
index_t  upperBound 
)
void finley::util::gather ( dim_t  len,
const index_t index,
dim_t  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(), finley::Mesh::findMatchingFaces(), and hasReducedIntegrationOrder().

std::pair< index_t, index_t > finley::util::getFlaggedMinMaxInt ( dim_t  N,
const index_t values,
index_t  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(), finley::NodeFile::createDOFMappingAndCoupling(), and hasReducedIntegrationOrder().

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

calculates the maximum value from a dim X N integer array

References INDEX2, and paso::N.

Referenced by hasReducedIntegrationOrder(), and finley::Mesh_merge().

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

calculates the minimum value from a dim X N integer array

References INDEX2, and paso::N.

Referenced by hasReducedIntegrationOrder().

std::pair< index_t, index_t > finley::util::getMinMaxInt ( int  dim,
dim_t  N,
const index_t values 
)
bool finley::util::hasReducedIntegrationOrder ( const escript::Data in)
inline
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.

Referenced by hasReducedIntegrationOrder().

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(), and hasReducedIntegrationOrder().

std::vector< index_t > 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(), hasReducedIntegrationOrder(), finley::Mesh::prepare(), and finley::Mesh::resolveNodeIds().

void finley::util::setValuesInUse ( const int *  values,
const int  numValues,
std::vector< int > &  valuesInUse,
esysUtils::JMPI 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(), and hasReducedIntegrationOrder().

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(), and hasReducedIntegrationOrder().

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().