Utils.h

class Utils

This class contains some methods commonly used by fmg.

Methods:

static void random_vector(dolfin::GenericVector& x)

Fill vector with [0,1] uniformly distributed random values.

Print a vector.

Print a vector.

Print a matrix.

Print a matrix and vector together.

Print mesh entities.

Print mesh entity.

Print mesh (vertices, edges, cells).

static bool is_symmetric(const dolfin::GenericMatrix& A, double eps=1e-16)

Check if matrix is symmetric.

static bool is_transpose(const dolfin::GenericMatrix& A, const dolfin::GenericMatrix& B, double eps=1e-16)

Check if matrices are transpose to each other.

static void extract_subspaces_recursive(const boost::shared_ptr<const dolfin::FunctionSpace>& space, std::vector<boost::shared_ptr<const dolfin::FunctionSpace>>& list)

Extract all subspaces of the given space and add them to list.

static void split_string(std::vector<std::string>& vec, const std::string& s, const std::string& delim=",; ")

Split a string.

static std::vector<double>& temp(uint n)

Returns a temporary vector of size >= n.

static const std::vector<double>& zero(uint n)

Returns a zero vector of size >= n.

static const std::vector<uint>& ints(uint n)

Returns the vector of integers 0 to size >= n.

static void debug_print(const std::string& fmt, ...)

Print some debug text.

Previous topic

Table.h

Next topic

FMG cycle module

This Page