faunus
tensor.h
1 #pragma once
2 #include <Eigen/Core>
3 #include <nlohmann/json_fwd.hpp>
4 
5 namespace Faunus {
10 struct Tensor : public Eigen::Matrix3d
11 {
12  typedef Eigen::Matrix3d base;
13 
14  Tensor();
15 
20  Tensor(double, double, double, double, double, double);
21 
22  void rotate(const base&);
23 
24  [[maybe_unused]] [[maybe_unused]] void eye();
25 
26  template <typename T>
27  Tensor(const Eigen::MatrixBase<T>& other)
28  : base(other)
29  {
30  }
31 
32  template <typename T> Tensor& operator=(const Eigen::MatrixBase<T>& other)
33  {
34  base::operator=(other);
35  return *this;
36  }
37 };
38 
39 void to_json(nlohmann::json&, const Tensor&);
40 void from_json(const nlohmann::json&, Tensor&);
41 } // namespace Faunus
Tensor class Tensor class.
Definition: tensor.h:10
void rotate(const base &)
Rotate using rotation matrix.
Definition: tensor.cpp:20
Cell list class templates.
Definition: actions.cpp:11
Tensor()
Constructor, clear data.
Definition: tensor.cpp:10