Matrix classes

The purpose of this small class system is to provide an easy way for users to design slip interaction matrices. These are square matrices constructed with certain typical block patterns.

FlatVector

This is just an interface to a standard, dense vector use to provide matrix-vector products using the Matrix classes

class FlatVector

Dense vector class.

Public Functions

FlatVector(size_t n)
FlatVector(size_t n, double *data)
FlatVector(const std::vector<double> input)
FlatVector(const FlatVector &other)
virtual ~FlatVector()
inline size_t n() const
inline bool owns_data() const
void copy(double *data)
inline double *data()
inline const double *data() const

Matrix

Generic superclass of all matrices, could be expanded to handle sparse matrices if required in the future.

class Matrix

Dense matrix class.

Subclassed by neml::SquareMatrix

Public Functions

Matrix(size_t m, size_t n)
virtual ~Matrix()
inline size_t m() const
inline size_t n() const
inline size_t size() const
FlatVector dot(const FlatVector &other)
void matvec(const FlatVector &other, FlatVector &res)
inline double *data()
const double &operator()(size_t i, size_t j) const
double &operator()(size_t i, size_t j)

SquareMatrix

Dense, square matrix with various helpers for setting up block structures. Initialization options are:

Option

Description

zero

The zero matrix

identity

The identity matrix

diagonal

Diagonal matrix where the user gives the diagonal entries

diagonal_blocks

Diagonal matrix where the entries are blocked

block

General block matrix

dense

Dense matrix, user gives all entries in row-major form

class SquareMatrix : public neml::NEMLObject, public neml::Matrix

Specialized square dense matrix.

Public Functions

SquareMatrix(ParameterSet &params)

Public Static Functions

static std::string type()

String type for the object system.

static std::unique_ptr<NEMLObject> initialize(ParameterSet &params)

Initialize from a parameter set.

static ParameterSet parameters()

Default parameters.