dudley/src/Util.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#ifndef __DUDLEY_UTIL_H__
#define __DUDLEY_UTIL_H__
#include "Dudley.h"
#include <escript/Data.h>
namespace dudley {
namespace util {
typedef std::pair<index_t,index_t> IndexPair;
typedef std::vector<IndexPair> ValueAndIndexList;
void sortValueAndIndex(ValueAndIndexList& array);
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);
void smallMatMult(int A1, int A2, double* A, int B2, const double* B,
const double* C);
template<typename Scalar>
void smallMatSetMult1(int len, int A1, int A2, Scalar* A, int B2,
const Scalar* 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);
} // namespace util
} // namespace dudley
#endif // __DUDLEY_UTIL_H__
Dudley.h
dudley::util::smallMatSetMult1
void smallMatSetMult1(int len, int A1, int A2, Scalar *A, int B2, const Scalar *B, const double *C)
Definition: dudley/src/Util.cpp:88
dudley::util::IndexPair
std::pair< index_t, index_t > IndexPair
Definition: dudley/src/Util.h:30
dudley::util::gather
void gather(int len, const index_t *index, int numData, const double *in, double *out)
Definition: dudley/src/Util.cpp:44
dudley::util::smallMatMult
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)
Definition: dudley/src/Util.cpp:74
dudley::util::setValuesInUse
void setValuesInUse(const int *values, dim_t numValues, std::vector< int > &valuesInUse, escript::JMPI mpiinfo)
Definition: dudley/src/Util.cpp:224
dudley::util::addScatter
void addScatter(int len, const index_t *index, int numData, const Scalar *in, Scalar *out, index_t upperBound)
Definition: dudley/src/Util.cpp:55
dudley::util::getFlaggedMinMaxInt
IndexPair getFlaggedMinMaxInt(dim_t N, const index_t *values, index_t ignore)
Definition: dudley/src/Util.cpp:186
dudley::util::ValueAndIndexList
std::vector< IndexPair > ValueAndIndexList
Definition: dudley/src/Util.h:31
dudley::util::getMinMaxInt
IndexPair getMinMaxInt(int dim, dim_t N, const index_t *values)
Definition: dudley/src/Util.cpp:159
dudley::util::packMask
std::vector< index_t > packMask(const std::vector< short > &mask)
Definition: dudley/src/Util.cpp:213
dudley::util::sortValueAndIndex
void sortValueAndIndex(ValueAndIndexList &array)
orders a ValueAndIndexList by value.
Definition: dudley/src/Util.cpp:39
dudley::util::normalVector
void normalVector(int len, int dim, int dim1, const double *A, double *Normal)
Definition: dudley/src/Util.cpp:110
dudley
A suite of factory methods for creating 2D and 3D dudley domains.
Definition: dudley/src/Assemble.h:32
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:66
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:61
escript::Scalar
Data Scalar(double value, const FunctionSpace &what, bool expanded)
A collection of factory functions for creating Data objects which contain data points of various shap...
Definition: DataFactory.cpp:49
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:74
paso::N
static dim_t N
Definition: SparseMatrix_saveHB.cpp:37