finley::util Namespace Reference

## Typedefs

typedef std::pair< index_t, index_t > | IndexPair
typedef std::vector< IndexPair > | 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 (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 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...
template<typename Scalar >
void | smallMatSetMult1 (int len, int A1, int A2, Scalar *A, int B2, const std::vector< Scalar > &B, const std::vector< real_t > &C)
template void | smallMatSetMult1< real_t > (int len, int A1, int A2, real_t *A, int B2, const std::vector< real_t > &B, const std::vector< real_t > &C)
template void | smallMatSetMult1< cplx_t > (int len, int A1, int A2, cplx_t *A, int B2, const std::vector< cplx_t > &B, const std::vector< real_t > &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...
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)
bool | hasReducedIntegrationOrder (const escript::Data &in)
| returns true if the data object is defined on reduced element types More...
template<typename Scalar >
void | smallMatSetMult1 (int len, int A1, int A2, Scalar *A, int B2, const std::vector< Scalar > &B, const std::vector< double > &C)

## Typedef Documentation

## IndexPair

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

## ValueAndIndexList

typedef std::vector<IndexPair> finley::util::ValueAndIndexList

## Function Documentation

## addScatter()

template<typename Scalar >

void finley::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 finley::Assemble_LumpedSystem(), finley::Assemble_PDE_Points(), finley::Assemble_PDE_Single_1D(), finley::Assemble_PDE_Single_2D(), finley::Assemble_PDE_Single_3D(), finley::Assemble_PDE_Single_C(), finley::Assemble_PDE_System_1D(), finley::Assemble_PDE_System_2D(), finley::Assemble_PDE_System_3D(), finley::Assemble_PDE_System_C(), and hasReducedIntegrationOrder().

## addScatter< cplx_t >()

template void finley::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 finley::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 finley::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 finley::Assemble_getNormal(), finley::Assemble_getSize(), finley::FinleyDomain::findMatchingFaces(), and hasReducedIntegrationOrder().

## getFlaggedMinMaxInt()

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

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

## getMaxInt()

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::FinleyDomain::merge().

## getMinInt()

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

## getMinMaxInt()

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

calculates the minimum and maximum value from an integer array of length N x dim

References INDEX2, escript::DataTypes::index_t_max(), escript::DataTypes::index_t_min(), and paso::N.

Referenced by finley::ElementFile::createColoring(), finley::NodeFile::getDOFRange(), finley::getGlobalRange(), finley::ElementFile::getNodeRange(), and hasReducedIntegrationOrder().

## hasReducedIntegrationOrder()

bool finley::util::hasReducedIntegrationOrder | ( | const escript::Data & | in | ) |

inline

returns true if the data object is defined on reduced element types

References addScatter(), FINLEY_REDUCED_CONTACT_ELEMENTS_1, FINLEY_REDUCED_CONTACT_ELEMENTS_2, FINLEY_REDUCED_ELEMENTS, FINLEY_REDUCED_FACE_ELEMENTS, gather(), getFlaggedMinMaxInt(), escript::Data::getFunctionSpace(), getMaxInt(), getMinInt(), getMinMaxInt(), escript::FunctionSpace::getTypeCode(), invertSmallMat(), paso::N, normalVector(), packMask(), escript::Scalar(), setValuesInUse(), smallMatMult(), and smallMatSetMult1().

Referenced by finley::Assemble_AverageElementData(), finley::Assemble_CopyElementData(), finley::Assemble_getNormal(), finley::Assemble_getSize(), finley::Assemble_gradient(), finley::Assemble_integrate(), finley::Assemble_interpolate(), and finley::ElementFile::setTags().

## invertSmallMat()

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 INDEX3.

Referenced by hasReducedIntegrationOrder().

## normalVector()

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

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

## packMask()

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

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

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

## setValuesInUse()

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

References MPI_INT, and MPI_MIN.

Referenced by hasReducedIntegrationOrder(), and finley::ElementFile::updateTagList().

## smallMatMult()

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

## smallMatSetMult1() [1/2]

template<typename Scalar >

void finley::util::smallMatSetMult1 | ( | int | len,
|  | int | A1,
|  | int | A2,
|  | Scalar * | A,
|  | int | B2,
|  | const std::vector< Scalar > & | 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

## smallMatSetMult1() [2/2]

template<typename Scalar >

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

References INDEX2, INDEX3, escript::Scalar(), smallMatSetMult1< cplx_t >(), and smallMatSetMult1< real_t >().

Referenced by hasReducedIntegrationOrder().

## smallMatSetMult1< cplx_t >()

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

Referenced by smallMatSetMult1().

## smallMatSetMult1< real_t >()

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

Referenced by smallMatSetMult1().

## sortValueAndIndex()

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

orders a ValueAndIndexList by value.

References ValueAndIndexCompare().

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

## ValueAndIndexCompare()

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

comparison function for sortValueAndIndex

Referenced by sortValueAndIndex().