21 std::ostream& operator<< (std::ostream& os, const Vector<T, 2>& vec)
23 os << vec.x << std::endl << vec.y;
34 std::ostream& operator<< (std::ostream& os, const Scalar<T>& scalar)
46 template <
typename T,
unsigned Dim>
47 std::ostream& operator<< (std::ostream& os, const Tensor<T, Dim>& tensor)
50 std::tie(nx, ny) = tensor.Size();
52 for (
unsigned i = 0; i < nx; ++i)
53 for (
unsigned j = 0; j < ny; ++j)
54 os << tensor(i, j) << std::endl;
64 template <
typename T,
unsigned Dim,
unsigned Size>
65 std::ostream& operator<< (std::ostream& os, const Field<T, Dim, Size>& field)
106 template <
typename T,
unsigned Dim>
110 std::tie(nx, ny) = tensor.
Size();
112 for (
unsigned i = 0; i < nx; ++i)
113 for (
unsigned j = 0; j < ny; ++j)
124 template <
typename T,
unsigned Dim,
unsigned Size>
T y
Definition: basic.hpp:104
T x
Definition: basic.hpp:103
T value
Definition: basic.hpp:173
Class for tensors.
Definition: basic.hpp:183
auto & GetAll() const
Definition: field.hpp:47
Class for general physical fields.
Definition: field.hpp:35
Vector with one element.
Definition: basic.hpp:163
auto Size() const
Definition: basic.hpp:299
std::istream & operator>>(std::istream &is, Vector< T, 2 > &vec)
Definition: io.hpp:80
Struct for vectors.
Definition: basic.hpp:92