Speckley.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 __SPECKLEY_SPECKLEY_H__
#define __SPECKLEY_SPECKLEY_H__
/*****************************************************************************
* Speckley is a spectral element domain library with regular
* hexagonal/rectangular elements and high order quadrature points
****************************************************************************/
#include <speckley/system_dep.h>
#include <escript/EsysMPI.h>
#include <boost/shared_ptr.hpp>
#include <list>
#include <map>
#include <string>
#include <vector>
namespace speckley {
using escript::DataTypes::dim_t;
using escript::DataTypes::index_t;
using escript::DataTypes::real_t;
using escript::DataTypes::cplx_t;
typedef std::pair<index_t,index_t> IndexPair;
typedef std::vector<index_t> IndexVector;
typedef std::vector<real_t> DoubleVector;
typedef std::map<std::string,int> TagMap;
#define SPECKLEY_DEGREES_OF_FREEDOM 1
#define SPECKLEY_NODES 3
#define SPECKLEY_ELEMENTS 4
#define SPECKLEY_FACE_ELEMENTS 5
#define SPECKLEY_POINTS 6
#define SPECKLEY_REDUCED_DEGREES_OF_FREEDOM 2
#define SPECKLEY_REDUCED_NODES 14
#define SPECKLEY_REDUCED_ELEMENTS 10
#define SPECKLEY_REDUCED_FACE_ELEMENTS 11
enum {
DegreesOfFreedom=SPECKLEY_DEGREES_OF_FREEDOM,
ReducedDegreesOfFreedom=SPECKLEY_REDUCED_DEGREES_OF_FREEDOM,
Nodes=SPECKLEY_NODES,
ReducedNodes=SPECKLEY_REDUCED_NODES,
Elements=SPECKLEY_ELEMENTS,
ReducedElements=SPECKLEY_REDUCED_ELEMENTS,
FaceElements=SPECKLEY_FACE_ELEMENTS,
ReducedFaceElements=SPECKLEY_REDUCED_FACE_ELEMENTS,
Points=SPECKLEY_POINTS
};
//quadrature point locations
const double point_locations[][11] = {
{0.0, 0.5, 1.0},
{0.0, 0.27639320225, 0.72360679775, 1.0},
{0.0, 0.172673164646, 0.5, 0.827326835354, 1.0},
{0.0, 0.117472338035, 0.35738424176, 0.64261575824, 0.882527661965, 1.0},
{0.0, 0.0848880518607, 0.265575603265, 0.5, 0.734424396735, 0.915111948139, 1.0},
{0.0, 0.0641299257452, 0.204149909283, 0.395350391049, 0.604649608951, 0.795850090717, 0.935870074255, 1.0},
{0.0, 0.0501210022943, 0.161406860245, 0.318441268087, 0.5, 0.681558731913, 0.838593139755, 0.949878997706, 1.0},
{0.0, 0.0402330459168, 0.130613067447, 0.261037525095, 0.417360521167, 0.582639478833, 0.738962474905, 0.869386932553, 0.959766954083, 1.0},
{0.0, 0.032999284796, 0.107758263168, 0.217382336502, 0.352120932207, 0.5, 0.647879067793, 0.782617663498, 0.892241736832, 0.967000715204, 1.0}};
} // namespace speckley
#endif /* __SPECKLEY_SPECKLEY_H__ */
BlockOps.h
MATRIX_FORMAT_BLK1
#define MATRIX_FORMAT_BLK1
Definition: Paso.h:64
paso::SparseMatrix_MatrixVector_CSC_OFFSET1
void SparseMatrix_MatrixVector_CSC_OFFSET1(const double alpha, const_SparseMatrix_ptr A, const double *in, const double beta, double *out)
Definition: SparseMatrix_MatrixVector.cpp:138
speckley::TagMap
std::map< std::string, int > TagMap
Definition: Speckley.h:63
paso::SparseMatrix::nullifyRowsAndCols_CSR_BLK1
void nullifyRowsAndCols_CSR_BLK1(const double *mask_row, const double *mask_col, double main_diagonal_value)
Definition: SparseMatrix_nullifyRowsAndCols.cpp:73
SPECKLEY_POINTS
#define SPECKLEY_POINTS
Definition: Speckley.h:69
paso::N
static dim_t N
Definition: SparseMatrix_saveHB.cpp:52
paso::SparseMatrix::numCols
dim_t numCols
Definition: SparseMatrix.h:179
paso::SparseMatrix_MatrixVector_CSR_OFFSET0_stripe
void SparseMatrix_MatrixVector_CSR_OFFSET0_stripe(double alpha, dim_t nRows, dim_t row_block_size, dim_t col_block_size, const index_t *ptr, const index_t *index, const double *val, const double *in, double beta, double *out)
Definition: SparseMatrix_MatrixVector.cpp:350
escript::DataTypes::real_t
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:79
speckley::DoubleVector
std::vector< real_t > DoubleVector
Definition: Speckley.h:62
paso::SparseMatrix_MatrixMatrix_DD
void SparseMatrix_MatrixMatrix_DD(SparseMatrix_ptr C, const_SparseMatrix_ptr A, const_SparseMatrix_ptr B)
Definition: SparseMatrix_MatrixMatrix.cpp:896
paso::SparseMatrix::block_size
dim_t block_size
Definition: SparseMatrix.h:177
paso::SparseMatrix::row_block_size
dim_t row_block_size
Definition: SparseMatrix.h:175
MATRIX_FORMAT_CSC
#define MATRIX_FORMAT_CSC
Definition: Paso.h:63
speckley::ReducedDegreesOfFreedom
@ ReducedDegreesOfFreedom
Definition: Speckley.h:77
paso::SparseMatrix::pattern
Pattern_ptr pattern
Definition: SparseMatrix.h:180
speckley::ReducedFaceElements
@ ReducedFaceElements
Definition: Speckley.h:83
paso::SparseMatrix::nullifyRowsAndCols_CSR
void nullifyRowsAndCols_CSR(const double *mask_row, const double *mask_col, double main_diagonal_value)
Definition: SparseMatrix_nullifyRowsAndCols.cpp:115
paso::SparseMatrix::getBlock
SparseMatrix_ptr getBlock(int blockid) const
Definition: SparseMatrix_getSubmatrix.cpp:94
paso::SparseMatrix::SparseMatrix
SparseMatrix(SparseMatrixType type, Pattern_ptr pattern, dim_t rowBlockSize, dim_t colBlockSize, bool patternIsUnrolled)
Definition: SparseMatrix.cpp:122
SPECKLEY_ELEMENTS
#define SPECKLEY_ELEMENTS
Definition: Speckley.h:67
paso::SparseMatrix_MatrixVector_CSR_OFFSET1
void SparseMatrix_MatrixVector_CSR_OFFSET1(const double alpha, const_SparseMatrix_ptr A, const double *in, const double beta, double *out)
Definition: SparseMatrix_MatrixVector.cpp:210
MATRIX_FORMAT_OFFSET1
#define MATRIX_FORMAT_OFFSET1
Definition: Paso.h:65
SparseMatrix.h
speckley
Definition: AbstractAssembler.cpp:19
paso::SparseMatrix_MatrixVector_CSR_OFFSET0_DIAG
void SparseMatrix_MatrixVector_CSR_OFFSET0_DIAG(const double alpha, const_SparseMatrix_ptr A, const double *in, const double beta, double *out)
Definition: SparseMatrix_MatrixVector.cpp:445
paso::SparseMatrix_MatrixMatrixTranspose_DB
void SparseMatrix_MatrixMatrixTranspose_DB(SparseMatrix_ptr C, const_SparseMatrix_ptr A, const_SparseMatrix_ptr B, const_SparseMatrix_ptr T)
Definition: SparseMatrix_MatrixMatrixTranspose.cpp:472
paso::SparseMatrix::type
SparseMatrixType type
Definition: SparseMatrix.h:174
paso::nz
static dim_t nz
Definition: SparseMatrix_saveHB.cpp:52
paso::util::comparIndex
int comparIndex(const void *index1, const void *index2)
this int-comparison function is used by qsort/bsearch in various places
Definition: PasoUtil.cpp:54
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:93
paso::const_SparseMatrix_ptr
boost::shared_ptr< const SparseMatrix > const_SparseMatrix_ptr
Definition: SparseMatrix.h:52
paso::SparseMatrix_MatrixMatrixTranspose_DD
void SparseMatrix_MatrixMatrixTranspose_DD(SparseMatrix_ptr C, const_SparseMatrix_ptr A, const_SparseMatrix_ptr B, const_SparseMatrix_ptr T)
Definition: SparseMatrix_MatrixMatrixTranspose.cpp:1034
paso::SparseMatrix::nullifyRows_CSR_BLK1
void nullifyRows_CSR_BLK1(const double *mask_row, double main_diagonal_value)
Definition: SparseMatrix_nullifyRowsAndCols.cpp:139
paso::SparseMatrix_MatrixMatrix_DB
void SparseMatrix_MatrixMatrix_DB(SparseMatrix_ptr C, const_SparseMatrix_ptr A, const_SparseMatrix_ptr B)
Definition: SparseMatrix_MatrixMatrix.cpp:427
speckley::IndexPair
std::pair< index_t, index_t > IndexPair
Definition: Speckley.h:60
speckley::ReducedElements
@ ReducedElements
Definition: Speckley.h:81
paso::SparseMatrix::nullifyRowsAndCols_CSC_BLK1
void nullifyRowsAndCols_CSC_BLK1(const double *mask_row, const double *mask_col, double main_diagonal_value)
Definition: SparseMatrix_nullifyRowsAndCols.cpp:55
paso::SparseMatrixType
int SparseMatrixType
Definition: SparseMatrix.h:54
speckley::FaceElements
@ FaceElements
Definition: Speckley.h:82
paso::SparseMatrix::nullifyRows_CSR
void nullifyRows_CSR(const double *mask_row, double main_diagonal_value)
Definition: SparseMatrix_nullifyRowsAndCols.cpp:156
paso::SparseMatrix::saveHB_CSC
void saveHB_CSC(const char *filename) const
Definition: SparseMatrix_saveHB.cpp:194
paso::SparseMatrix_MatrixMatrix_BD
void SparseMatrix_MatrixMatrix_BD(SparseMatrix_ptr C, const_SparseMatrix_ptr A, const_SparseMatrix_ptr B)
Definition: SparseMatrix_MatrixMatrix.cpp:663
paso::SparseMatrix_MatrixMatrixTranspose
SparseMatrix_ptr SparseMatrix_MatrixMatrixTranspose(const_SparseMatrix_ptr A, const_SparseMatrix_ptr B, const_SparseMatrix_ptr T)
Definition: SparseMatrix_MatrixMatrixTranspose.cpp:76
paso::SparseMatrix::len
dim_t len
Definition: SparseMatrix.h:181
SPECKLEY_REDUCED_ELEMENTS
#define SPECKLEY_REDUCED_ELEMENTS
Definition: Speckley.h:72
SPECKLEY_REDUCED_FACE_ELEMENTS
#define SPECKLEY_REDUCED_FACE_ELEMENTS
Definition: Speckley.h:73
SPECKLEY_NODES
#define SPECKLEY_NODES
Definition: Speckley.h:66
speckley::DegreesOfFreedom
@ DegreesOfFreedom
Definition: Speckley.h:76
SPECKLEY_REDUCED_NODES
#define SPECKLEY_REDUCED_NODES
Definition: Speckley.h:71
speckley::Elements
@ Elements
Definition: Speckley.h:80
paso::SparseMatrix_ptr
boost::shared_ptr< SparseMatrix > SparseMatrix_ptr
Definition: SparseMatrix.h:50
paso::SparseMatrix_MatrixMatrixTranspose_BB
void SparseMatrix_MatrixMatrixTranspose_BB(SparseMatrix_ptr C, const_SparseMatrix_ptr A, const_SparseMatrix_ptr B, const_SparseMatrix_ptr T)
Definition: SparseMatrix_MatrixMatrixTranspose.cpp:128
paso::generate_HB
static void generate_HB(std::ofstream &, dim_t *, dim_t *, const double *)
Definition: SparseMatrix_saveHB.cpp:147
speckley::ReducedNodes
@ ReducedNodes
Definition: Speckley.h:79
paso::calc_digits
static int calc_digits(int)
Definition: SparseMatrix_saveHB.cpp:60
paso::BlockOps_Cpy_N
void BlockOps_Cpy_N(dim_t N, double *R, const double *V)
Definition: BlockOps.h:54
paso::PasoException
PasoException exception class.
Definition: PasoException.h:47
paso::SparseMatrix::val
double * val
this is used for classical CSR or CSC
Definition: SparseMatrix.h:184
paso::print_data
static void print_data(std::ofstream &, int, int, int, char *, const void *, int, int)
Definition: SparseMatrix_saveHB.cpp:101
SPECKLEY_FACE_ELEMENTS
#define SPECKLEY_FACE_ELEMENTS
Definition: Speckley.h:68
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:88
SPECKLEY_DEGREES_OF_FREEDOM
#define SPECKLEY_DEGREES_OF_FREEDOM
Definition: Speckley.h:65
paso::SparseMatrix_MatrixVector_CSR_OFFSET0
void SparseMatrix_MatrixVector_CSR_OFFSET0(const double alpha, const_SparseMatrix_ptr A, const double *in, const double beta, double *out)
Definition: SparseMatrix_MatrixVector.cpp:298
PasoUtil.h
paso::SparseMatrix::getSubmatrix
SparseMatrix_ptr getSubmatrix(dim_t n_row_sub, dim_t n_col_sub, const index_t *row_list, const index_t *new_col_index) const
Definition: SparseMatrix_getSubmatrix.cpp:58
paso::SparseMatrix::nullifyRowsAndCols_CSC
void nullifyRowsAndCols_CSC(const double *mask_row, const double *mask_col, double main_diagonal_value)
Definition: SparseMatrix_nullifyRowsAndCols.cpp:91
paso::M
static dim_t M
Definition: SparseMatrix_saveHB.cpp:52
paso::SparseMatrix::numRows
dim_t numRows
Definition: SparseMatrix.h:178
paso::SparseMatrix_MatrixMatrix_BB
void SparseMatrix_MatrixMatrix_BB(SparseMatrix_ptr C, const_SparseMatrix_ptr A, const_SparseMatrix_ptr B)
Definition: SparseMatrix_MatrixMatrix.cpp:121
PasoException.h
speckley::Points
@ Points
Definition: Speckley.h:84
paso::SparseMatrix_MatrixMatrixTranspose_BD
void SparseMatrix_MatrixMatrixTranspose_BD(SparseMatrix_ptr C, const_SparseMatrix_ptr A, const_SparseMatrix_ptr B, const_SparseMatrix_ptr T)
Definition: SparseMatrix_MatrixMatrixTranspose.cpp:753
paso::Pattern_ptr
boost::shared_ptr< Pattern > Pattern_ptr
Definition: Pattern.h:52
paso::SparseMatrix_MatrixVector_CSC_OFFSET0
void SparseMatrix_MatrixVector_CSC_OFFSET0(const double alpha, const_SparseMatrix_ptr A, const double *in, const double beta, double *out)
Definition: SparseMatrix_MatrixVector.cpp:62
speckley::IndexVector
std::vector< index_t > IndexVector
Definition: Speckley.h:61
paso::fmt_str
static void fmt_str(int, int, int *, int *, int *, char *, char *)
Definition: SparseMatrix_saveHB.cpp:74
SPECKLEY_REDUCED_DEGREES_OF_FREEDOM
#define SPECKLEY_REDUCED_DEGREES_OF_FREEDOM
Definition: Speckley.h:70
paso::SparseMatrix_MatrixMatrix
SparseMatrix_ptr SparseMatrix_MatrixMatrix(const_SparseMatrix_ptr A, const_SparseMatrix_ptr B)
Definition: SparseMatrix_MatrixMatrix.cpp:67
paso
Definition: BiCGStab.cpp:26
escript::DataTypes::cplx_t
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:82
speckley::point_locations
const double point_locations[][11]
Definition: Speckley.h:88
MATRIX_FORMAT_DEFAULT
#define MATRIX_FORMAT_DEFAULT
Definition: Paso.h:62
MATRIX_FORMAT_DIAGONAL_BLOCK
#define MATRIX_FORMAT_DIAGONAL_BLOCK
Definition: Paso.h:66
paso::SparseMatrix::col_block_size
dim_t col_block_size
Definition: SparseMatrix.h:176
speckley::Nodes
@ Nodes
Definition: Speckley.h:78