Medusa  1.1
Coordinate Free Mehless Method implementation
Types

Defines custom types, for working with vectors, scalar and vector fields and general containers. More...

Classes

class  mm::Range< T, Allocator >
 An extension of std::vector<T> to support additional useful operations. More...
 
class  mm::ScalarField< Scalar >
 Represents a discretization of a scalar field, a finite collection of scalars. More...
 
class  mm::VectorField< Scalar, dimension >
 Represents a discretization of a vector field, a finite collection of vectors. More...
 

Typedefs

template<class scalar_t , int dim>
using mm::Vec = Eigen::Matrix< scalar_t, dim, 1, Eigen::ColMajor|Eigen::AutoAlign, dim, 1 >
 Fixed size vector type, representing a mathematical 1d/2d/3d vector. More...
 

Detailed Description

Defines custom types, for working with vectors, scalar and vector fields and general containers.

We define 4 custom types, Range, Vec, ScalarField and VectorField.

Range is a general purpose container with some convenience methods added to std::vector.

Vec is intended to be used for small vector, i.e. for a 3D vector quantity such as velocity or displacement. It is a typedef for Eigen vector with a few methods added via their plugin system.

ScalarField is an array of scalars, usually one for each point in the domain. Under the hood, this is Eigen's VectorXd with some additional methods.

VectorField is an array of vectors. Accessing it at one point gives a Vec, while accessing one component gives a ScalarField. Under the hood it extends Eigen's Matrix type so all operations are kept efficient.

These last three types are compatible with all Eigen expression and can interchangeably be used with Eigen's Matrix types.

Typedef Documentation

◆ Vec

template<class scalar_t , int dim>
using mm::Vec = typedef Eigen::Matrix<scalar_t, dim, 1, Eigen::ColMajor|Eigen::AutoAlign, dim, 1>

Fixed size vector type, representing a mathematical 1d/2d/3d vector.

This is a special case of fixed size Eigen type. See our Matrix and MatrixBase add-ons for more functionality.

See also
MatrixAddons.hpp
MatrixBaseAddons.hpp

Usage example:

Vec3d a(4.0);
a = {3, -4.3, 2};
a = 12.3;
a /= 23.4;
Vec3d b(12.3, 34.5, -2.1);
b -= a;
std::cout << a << std::endl;

Definition at line 31 of file Vec_fwd.hpp.

mm::Vec3d
Vec< double, 3 > Vec3d
Convenience typedef for 3d vector of doubles.
Definition: Vec_fwd.hpp:35