Skip to content

Commit d622253

Browse files
committed
Implement some constructors, and mark as unimplemented the others
1 parent d32c0e2 commit d622253

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

include/numerics/type_n_tensor.h

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,31 @@ class TypeNTensor
5555

5656
TypeNTensor () : _coords(std::vector<T>(int_pow(LIBMESH_DIM, N))) {}
5757

58-
TypeNTensor (const T &) : _coords(std::vector<T>(int_pow(LIBMESH_DIM, N))) {}
58+
TypeNTensor(const T &) : _coords(std::vector<T>(int_pow(LIBMESH_DIM, N)))
59+
{
60+
libmesh_not_implemented();
61+
}
62+
63+
TypeNTensor(const TypeVector<T> &) : _coords(std::vector<T>(int_pow(LIBMESH_DIM, N)))
64+
{
65+
libmesh_not_implemented();
66+
}
5967

60-
TypeNTensor (const TypeVector<T> &) : _coords(std::vector<T>(int_pow(LIBMESH_DIM, N))) {}
68+
TypeNTensor(const TypeTensor<T> &) : _coords(std::vector<T>(int_pow(LIBMESH_DIM, N)))
69+
{
70+
libmesh_not_implemented();
71+
}
6172

62-
TypeNTensor (const TypeTensor<T> &) : _coords(std::vector<T>(int_pow(LIBMESH_DIM, N))) {}
73+
TypeNTensor(const TypeNTensor<N, T> & TN) : _coords(std::vector<T>(int_pow(LIBMESH_DIM, N)))
74+
{
75+
_coords = TN._coords;
76+
}
6377

64-
TypeNTensor (const TypeNTensor<N,T> &) : _coords(std::vector<T>(int_pow(LIBMESH_DIM, N))) {}
78+
TypeNTensor(const std::vector<T> & vec) : _coords(std::vector<T>(int_pow(LIBMESH_DIM, N)))
79+
{
80+
libmesh_assert(int_pow(LIBMESH_DIM, N) == vec.size());
81+
_coords = vec;
82+
}
6583

6684
TypeNTensor & operator=(const TypeNTensor<N, T> &) { return *this; }
6785

0 commit comments

Comments
 (0)