Reference documentation for deal.II version 8.1.0
point_value_history.h
1 // ---------------------------------------------------------------------
2 // @f$Id: point_value_history.h 30036 2013-07-18 16:55:32Z maier @f$
3 //
4 // Copyright (C) 2009 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 
18 #ifndef __dealii__point_value_history_h
19 #define __dealii__point_value_history_h
20 
21 #include <deal.II/base/point.h>
22 #include <deal.II/base/smartpointer.h>
23 #include <deal.II/base/utilities.h>
25 #include <deal.II/base/quadrature_lib.h>
26 #include <deal.II/lac/vector.h>
27 #include <deal.II/grid/grid_tools.h>
28 #include <deal.II/dofs/dof_accessor.h>
29 #include <deal.II/dofs/dof_handler.h>
30 #include <deal.II/fe/fe_q.h>
31 #include <deal.II/fe/mapping.h>
32 #include <deal.II/fe/mapping_q1.h>
33 #include <deal.II/fe/fe_values.h>
34 #include <deal.II/fe/component_mask.h>
35 #include <deal.II/numerics/data_postprocessor.h>
36 
37 #include <vector>
38 #include <iostream>
39 #include <fstream>
40 #include <sstream>
41 #include <string>
42 #include <map>
43 
45 
46 namespace internal
47 {
48  namespace PointValueHistory
49  {
50  template <int dim> class PointGeometryData;
51  }
52 }
53 
54 
55 
56 namespace internal
57 {
58  namespace PointValueHistory
59  {
65  template <int dim>
66  class PointGeometryData
67  {
68  public:
69  PointGeometryData(const Point <dim> &new_requested_location, const std::vector <Point <dim> > &new_locations,
70  const std::vector <types::global_dof_index> &new_sol_indices);
71  Point <dim> requested_location;
72  std::vector <Point <dim> > support_point_locations;
73  std::vector <types::global_dof_index> solution_indices;
74  };
75  }
76 }
77 
78 
79 
207 template <int dim>
209 {
210 public:
219  PointValueHistory (const unsigned int n_independent_variables = 0);
220 
248  PointValueHistory (const DoFHandler<dim> &dof_handler,
249  const unsigned int n_independent_variables = 0);
250 
258  PointValueHistory (const PointValueHistory &point_value_history);
259 
272  PointValueHistory &operator=(const PointValueHistory &point_value_history);
273 
277  ~PointValueHistory ();
278 
290  void add_point(const Point <dim> &location);
291 
310  void add_points (const std::vector <Point <dim> > &locations);
311 
312 
313 
325  void add_field_name(const std::string &vector_name,
326  const ComponentMask &component_mask = ComponentMask());
327 
341  void add_field_name(const std::string &vector_name,
342  const unsigned int n_components);
343 
350  void add_component_names(const std::string &vector_name,
351  const std::vector <std::string> &component_names);
352 
359  void add_independent_names(const std::vector <std::string> &independent_names);
360 
361 
362 
377  template <class VECTOR>
378  void evaluate_field(const std::string &name,
379  const VECTOR &solution);
380 
381 
410  template <class VECTOR>
411  void evaluate_field(const std::vector <std::string> &names,
412  const VECTOR &solution,
413  const DataPostprocessor<dim> &data_postprocessor,
414  const Quadrature<dim> &quadrature);
415 
423  template <class VECTOR>
424  void evaluate_field(const std::string &name,
425  const VECTOR &solution,
426  const DataPostprocessor<dim> &data_postprocessor,
427  const Quadrature<dim> &quadrature);
428 
429 
451  template <class VECTOR>
452  void evaluate_field_at_requested_location(const std::string &name,
453  const VECTOR &solution);
454 
455 
469  void start_new_dataset (const double key);
470 
481  void push_back_independent (const std::vector <double> &independent_values);
482 
483 
515  void write_gnuplot (const std::string &base_name,
516  const std::vector <Point <dim> > postprocessor_locations = std::vector <Point <dim> > ());
517 
518 
547  Vector<double> mark_support_locations();
548 
549 
562  Vector<double> mark_locations() DEAL_II_DEPRECATED;
563 
564 
576  void get_support_locations (std::vector <std::vector<Point <dim> > > &locations);
577 
588  void get_points (std::vector <std::vector<Point <dim> > > &locations);
589 
606  void get_postprocessor_locations (const Quadrature<dim> &quadrature,
607  std::vector<Point <dim> > &locations);
608 
629  void close();
630 
631 
647  void clear();
648 
656  void status(std::ostream &out);
657 
658 
671  bool deep_check (const bool strict);
672 
678  DeclException0(ExcNoIndependent);
679 
694  DeclException0(ExcDataLostSync);
695 
696 
706  DeclException0(ExcDoFHandlerRequired);
707 
714  DeclException0(ExcDoFHandlerChanged);
715 
716 private:
722  std::vector <double> dataset_key;
723 
728  std::vector <std::vector <double> > independent_values;
729 
736  std::vector<std::string> indep_names;
737 
749  std::map <std::string, std::vector <std::vector <double> > > data_store;
750 
755  std::map <std::string, ComponentMask> component_mask;
756 
757 
764  std::map <std::string, std::vector<std::string> > component_names_map;
765 
770  std::vector <internal::PointValueHistory::PointGeometryData <dim> >
772 
773 
778  bool closed;
779 
784  bool cleared;
785 
786 
793 
794 
802 
808 
812  boost::signals2::connection tria_listener;
813 
818  unsigned int n_indep;
819 
820 
830  void tria_change_listener ();
831 };
832 
833 
834 DEAL_II_NAMESPACE_CLOSE
835 #endif /* __dealii__point_value_history_h */
std::map< std::string, std::vector< std::vector< double > > > data_store
std::vector< double > dataset_key
std::vector< std::string > indep_names
std::vector< internal::PointValueHistory::PointGeometryData< dim > > point_geometry_data
boost::signals2::connection tria_listener
std::vector< std::vector< double > > independent_values
#define DeclException0(Exception0)
Definition: exceptions.h:505
SmartPointer< const DoFHandler< dim >, PointValueHistory< dim > > dof_handler
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
std::map< std::string, ComponentMask > component_mask
std::map< std::string, std::vector< std::string > > component_names_map