escript Revision_
dudley/src/Util.h
Go to the documentation of this file.
1
2/*****************************************************************************
3*
4* Copyright (c) 2003-2020 by The University of Queensland
5* http://www.uq.edu.au
6*
7* Primary Business: Queensland, Australia
8* Licensed under the Apache License, version 2.0
9* http://www.apache.org/licenses/LICENSE-2.0
10*
11* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12* Development 2012-2013 by School of Earth Sciences
13* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
14* Development from 2019 by School of Earth and Environmental Sciences
15**
16*****************************************************************************/
17
19
20#ifndef __DUDLEY_UTIL_H__
21#define __DUDLEY_UTIL_H__
22
23#include "Dudley.h"
24
25#include <escript/Data.h>
26
27namespace dudley {
28namespace util {
29
30typedef std::pair<index_t,index_t> IndexPair;
31typedef std::vector<IndexPair> ValueAndIndexList;
32
35
38void gather(int len, const index_t* index, int numData, const double* in,
39 double* out);
40
44template<typename Scalar>
45void addScatter(int len, const index_t* index, int numData,
46 const Scalar* in, Scalar* out, index_t upperBound);
47
49void smallMatMult(int A1, int A2, double* A, int B2, const double* B,
50 const double* C);
51
54template<typename Scalar>
55void smallMatSetMult1(int len, int A1, int A2, Scalar* A, int B2,
56 const Scalar* B, const double* C);
57
60void normalVector(int len, int dim, int dim1, const double* A, double* normal);
61
64IndexPair getMinMaxInt(int dim, dim_t N, const index_t* values);
65
68IndexPair getFlaggedMinMaxInt(dim_t N, const index_t* values, index_t ignore);
69
72std::vector<index_t> packMask(const std::vector<short>& mask);
73
74void setValuesInUse(const int* values, dim_t numValues,
75 std::vector<int>& valuesInUse, escript::JMPI mpiInfo);
76
77} // namespace util
78} // namespace dudley
79
80#endif // __DUDLEY_UTIL_H__
81
void smallMatSetMult1(int len, int A1, int A2, Scalar *A, int B2, const Scalar *B, const double *C)
Definition dudley/src/Util.cpp:88
std::pair< index_t, index_t > IndexPair
Definition dudley/src/Util.h:30
void gather(int len, const index_t *index, int numData, const double *in, double *out)
Definition dudley/src/Util.cpp:44
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
void setValuesInUse(const int *values, dim_t numValues, std::vector< int > &valuesInUse, escript::JMPI mpiinfo)
Definition dudley/src/Util.cpp:224
void addScatter(int len, const index_t *index, int numData, const Scalar *in, Scalar *out, index_t upperBound)
Definition dudley/src/Util.cpp:55
IndexPair getFlaggedMinMaxInt(dim_t N, const index_t *values, index_t ignore)
Definition dudley/src/Util.cpp:186
std::vector< IndexPair > ValueAndIndexList
Definition dudley/src/Util.h:31
IndexPair getMinMaxInt(int dim, dim_t N, const index_t *values)
Definition dudley/src/Util.cpp:159
std::vector< index_t > packMask(const std::vector< short > &mask)
Definition dudley/src/Util.cpp:213
void sortValueAndIndex(ValueAndIndexList &array)
orders a ValueAndIndexList by value.
Definition dudley/src/Util.cpp:39
void normalVector(int len, int dim, int dim1, const double *A, double *Normal)
Definition dudley/src/Util.cpp:110
A suite of factory methods for creating 2D and 3D dudley domains.
Definition dudley/src/Assemble.h:32
boost::shared_ptr< JMPI_ > JMPI
Definition EsysMPI.h:76