escript  Revision_
Typedefs | Functions
dudley::util Namespace Reference

Typedefs

typedef std::pair< index_t, index_t > IndexPair
 
typedef std::vector< IndexPairValueAndIndexList
 

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 (int len, const index_t *index, int numData, const double *in, double *out)
 
template<typename Scalar >
void addScatter (int len, const index_t *index, int numData, const Scalar *in, Scalar *out, index_t upperBound)
 
template void addScatter< real_t > (int len, const index_t *index, int numData, const real_t *in, real_t *out, index_t upperBound)
 
template void addScatter< cplx_t > (int len, const index_t *index, int numData, const cplx_t *in, cplx_t *out, index_t upperBound)
 
void smallMatMult (int A1, int A2, double *A, int B2, const double *B, const 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 double *B, const double *C)
 
void normalVector (int len, int dim, int dim1, const double *A, double *Normal)
 
IndexPair getMinMaxInt (int dim, dim_t N, const index_t *values)
 
IndexPair getFlaggedMinMaxInt (dim_t N, const index_t *values, index_t ignore)
 
std::vector< index_t > packMask (const std::vector< short > &mask)
 
void setValuesInUse (const int *values, dim_t numValues, std::vector< int > &valuesInUse, escript::JMPI mpiinfo)
 

Typedef Documentation

◆ IndexPair

typedef std::pair<index_t,index_t> dudley::util::IndexPair

◆ ValueAndIndexList

Function Documentation

◆ addScatter()

template<typename Scalar >
void dudley::util::addScatter ( int  len,
const index_t *  index,
int  numData,
const Scalar *  in,
Scalar *  out,
index_t  upperBound 
)

adds array in into out using an index: out(1:numData,index[p])+=in(1:numData,p) where p={k=1...len, index[k]<upperBound}

References addScatter< cplx_t >(), addScatter< real_t >(), and INDEX2.

Referenced by dudley::Assemble_LumpedSystem(), dudley::Assemble_PDE_Points(), dudley::Assemble_PDE_Single_2D(), dudley::Assemble_PDE_Single_3D(), dudley::Assemble_PDE_System_2D(), and dudley::Assemble_PDE_System_3D().

◆ addScatter< cplx_t >()

template void dudley::util::addScatter< cplx_t > ( int  len,
const index_t *  index,
int  numData,
const cplx_t *  in,
cplx_t *  out,
index_t  upperBound 
)

Referenced by addScatter().

◆ addScatter< real_t >()

template void dudley::util::addScatter< real_t > ( int  len,
const index_t *  index,
int  numData,
const real_t *  in,
real_t *  out,
index_t  upperBound 
)

Referenced by addScatter().

◆ gather()

void dudley::util::gather ( int  len,
const index_t *  index,
int  numData,
const double *  in,
double *  out 
)

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

References INDEX2.

Referenced by dudley::Assemble_getNormal(), and dudley::Assemble_getSize().

◆ getFlaggedMinMaxInt()

IndexPair dudley::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 escript::DataTypes::index_t_max(), escript::DataTypes::index_t_min(), and paso::N.

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

◆ getMinMaxInt()

IndexPair dudley::util::getMinMaxInt ( int  dim,
dim_t  N,
const index_t *  values 
)

◆ normalVector()

void dudley::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, and INDEX3.

Referenced by dudley::Assemble_getNormal().

◆ packMask()

std::vector< index_t > dudley::util::packMask ( const std::vector< short > &  mask)

extracts the positive entries in mask returning a contiguous vector of those entries

Referenced by dudley::DudleyDomain::resolveNodeIds().

◆ setValuesInUse()

void dudley::util::setValuesInUse ( const int *  values,
dim_t  numValues,
std::vector< int > &  valuesInUse,
escript::JMPI  mpiinfo 
)

◆ smallMatMult()

void dudley::util::smallMatMult ( int  A1,
int  A2,
double *  A,
int  B2,
const double *  B,
const double *  C 
)

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

References INDEX2.

Referenced by dudley::Assemble_getNormal().

◆ smallMatSetMult1()

void dudley::util::smallMatSetMult1 ( int  len,
int  A1,
int  A2,
double *  A,
int  B2,
const double *  B,
const 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 dudley::Assemble_interpolate().

◆ sortValueAndIndex()

void dudley::util::sortValueAndIndex ( ValueAndIndexList array)

orders a ValueAndIndexList by value.

References ValueAndIndexCompare().

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

◆ ValueAndIndexCompare()

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

comparison function for sortValueAndIndex

Referenced by sortValueAndIndex().