* A class whose specialization is used to define what type the curl of a
* vector valued function corresponds to.
*/
- template <int dim>
+ template <int dim, class NumberType=double>
struct CurlType;
/**
*
* In 1d, the curl is a scalar.
*/
- template <>
- struct CurlType<1>
+ template <class NumberType>
+ struct CurlType<1, NumberType>
{
- typedef Tensor<1,1> type;
+ typedef Tensor<1,1,NumberType> type;
};
/**
*
* In 2d, the curl is a scalar.
*/
- template <>
- struct CurlType<2>
+ template <class NumberType>
+ struct CurlType<2,NumberType>
{
- typedef Tensor<1,1> type;
+ typedef Tensor<1,1,NumberType> type;
};
/**
*
* In 3d, the curl is a vector.
*/
- template <>
- struct CurlType<3>
+ template <class NumberType>
+ struct CurlType<3,NumberType>
{
- typedef Tensor<1,3> type;
+ typedef Tensor<1,3,NumberType> type;
};
}
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2007 - 2016 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// Check that we get the right type of CurlType with Custom number type.
+
+#include "../tests.h"
+#include <deal.II/fe/fe_values.h>
+
+#include <fstream>
+
+
+
+template <typename Number>
+void test ()
+{
+ if (typeid(typename internal::CurlType<1, Number>::type) != typeid(Tensor<1,1,Number>) )
+ deallog << "NOT OK!" << std::endl;
+ if (typeid(typename internal::CurlType<2, Number>::type) != typeid(Tensor<1,1,Number>) )
+ deallog << "NOT OK!" << std::endl;
+ if (typeid(typename internal::CurlType<3, Number>::type) != typeid(Tensor<1,3,Number>) )
+ deallog << "NOT OK!" << std::endl;
+ deallog << "OK" << std::endl;
+}
+
+
+int main()
+{
+ initlog();
+ test<double>();
+ test<float>();
+}