]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Let DataOut vector wrappers report whether the data type is complex. 5333/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 26 Oct 2017 15:26:18 +0000 (09:26 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 26 Oct 2017 15:26:18 +0000 (09:26 -0600)
include/deal.II/numerics/data_out_dof_data.h
include/deal.II/numerics/data_out_dof_data.templates.h

index 646293443c4912aee4159d55c788efe8dfd14c12..4de8a3a6a8b2a7af59dc90de259fa8bc1099e35d 100644 (file)
@@ -255,6 +255,12 @@ namespace internal
       (const FEValuesBase<DoFHandlerType::dimension,DoFHandlerType::space_dimension> &fe_patch_values,
        std::vector<std::vector< Tensor<2,DoFHandlerType::space_dimension> > > &patch_hessians_system) const = 0;
 
+      /**
+       * Return whether the data represented by (a derived class of) this object
+       * represents a complex-valued (as opposed to real-valued) information.
+       */
+      virtual bool is_complex_valued () const = 0;
+
       /**
        * Clear all references to the vectors.
        */
index 83d0c7f391a30f15bdf69dfdc919a0e4f0c74e90..bf36a986ef5cba476804c0f0dd961d56c23769e5 100644 (file)
@@ -22,6 +22,7 @@
 #include <deal.II/base/std_cxx14/memory.h>
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/work_stream.h>
+#include <deal.II/base/numbers.h>
 
 #include <deal.II/dofs/dof_accessor.h>
 #include <deal.II/dofs/dof_handler.h>
@@ -471,6 +472,12 @@ namespace internal
       (const FEValuesBase<DoFHandlerType::dimension,DoFHandlerType::space_dimension> &fe_patch_values,
        std::vector<std::vector< Tensor<2,DoFHandlerType::space_dimension> > > &patch_hessians_system) const;
 
+      /**
+       * Return whether the data represented by (a derived class of) this object
+       * represents a complex-valued (as opposed to real-valued) information.
+       */
+      virtual bool is_complex_valued () const;
+
       /**
        * Clear all references to the vectors.
        */
@@ -808,6 +815,15 @@ namespace internal
 
 
 
+    template <typename DoFHandlerType, typename VectorType>
+    bool
+    DataEntry<DoFHandlerType,VectorType>::is_complex_valued() const
+    {
+      return numbers::NumberTraits<typename VectorType::value_type>::is_complex;
+    }
+
+
+
     template <typename DoFHandlerType, typename VectorType>
     std::size_t
     DataEntry<DoFHandlerType,VectorType>::memory_consumption () const

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.