Skip to content
yantsant edited this page Jul 22, 2022 · 19 revisions

The main idea

As known any Tensor object has a components and basis. Components are square matrix for Tensor and N array for Vector. There is assumed that there is only one global rigid and fixed orthonormal basis e[j] named GLOBAL_DEFAULT_BASIS.

there is used Einstein notation for blind indexes

  • Basis is a square orthogonal matrix B NxN dimensions that provides transformation p[i] = B[i,j]e[j] from GLOBAL_DEFAULT_BASIS to the basis p[i];
  • One or many objects can be linked to the one basis;
  • Influencing on a basis leads to change in linked objects;
  • One object are linking to the only one basis at the same time;
  • Object may be changed by the three ways:
    • changing components themselves (any operation that saves rank of the object),
    • changing basis itself as matrix (any orthogonal transformations),
    • changing basis to another one.

Basis handler

Basis object is an object of the template class shared_handler_basis. An example of a creation of indent 3x3 matrix of double:

auto new_basis = shared_handler_basis<double, 3>(matrix_base<double, 3>(MATRIXINITTYPE::INDENT));

after that any matrix operations (implemented in the class matrix_base) are available via .as_matrix() method. At the same time no one object has access to matrix_base container via calling .as_matrix() (it will cause an error).

There is no way to create another basis handler via copy constructor to prevent multiply owning. So for one matrix we have only one shared_handler_basis object that has access to changing handling matrix. We can create a few shared_handler_basis objects from the one matrix, but they will be handling different objects copied from source matrix (from matrix will be made different shared_ptr's).

Clone this wiki locally