DOpE
elementdatacontainer.h
Go to the documentation of this file.
1 
24 #ifndef ELEMENTDATACONTAINER_H_
25 #define ELEMENTDATACONTAINER_H_
26 
27 #include "spacetimehandler.h"
28 #include "statespacetimehandler.h"
29 #include "fevalues_wrapper.h"
30 #include "dopeexception.h"
32 
33 #include <sstream>
34 
35 #include <deal.II/dofs/dof_handler.h>
36 //#include <deal.II/multigrid/mg_dof_handler.h>
37 #include <deal.II/hp/dof_handler.h>
38 
39 using namespace dealii;
40 
41 namespace DOpE
42 {
57  template<template<int, int> class DH, typename VECTOR, int dim>
59  VECTOR, dim>
60  {
61  public:
63  {
64  throw(DOpE::DOpEException(
65  "Dummy class, this constructor should never get called.",
66  "ElementDataContainer<dealii::DoFHandler<dim> , VECTOR, dim>::ElementDataContainer"));
67  }
68  ;
69  };
70 
80  template<typename VECTOR, int dim>
81  class ElementDataContainer<dealii::DoFHandler, VECTOR, dim> : public edcinternal::ElementDataContainerInternal<
82  VECTOR, dim>
83  {
84 
85  public:
106  template<template<int, int> class FE, typename SPARSITYPATTERN, int dopedim, int dealdim>
107  ElementDataContainer(const Quadrature<dim>& quad,
108  UpdateFlags update_flags,
109  SpaceTimeHandler<FE, dealii::DoFHandler, SPARSITYPATTERN, VECTOR,
110  dopedim, dealdim>& sth,
111  const std::vector<
112  typename dealii::DoFHandler<dim>::active_cell_iterator>& element,
113  const std::map<std::string, const Vector<double>*> &param_values,
114  const std::map<std::string, const VECTOR*> &domain_values) :
115  edcinternal::ElementDataContainerInternal<VECTOR, dim>(param_values,
116  domain_values), element_(element), state_fe_values_(
117  sth.GetMapping(), (sth.GetFESystem("state")), quad,
118  update_flags), control_fe_values_(sth.GetMapping(),
119  (sth.GetFESystem("control")), quad, update_flags)
120  {
121  state_index_ = sth.GetStateIndex();
122  if (state_index_ == 1)
123  control_index_ = 0;
124  else
125  control_index_ = 1;
126  n_q_points_per_element_ = quad.size();
127  n_dofs_per_element_ = element[0]->get_fe().dofs_per_cell;
128  }
129 
148  template<template<int, int> class FE, typename SPARSITYPATTERN>
149  ElementDataContainer(const Quadrature<dim>& quad,
150  UpdateFlags update_flags,
151  StateSpaceTimeHandler<FE, dealii::DoFHandler, SPARSITYPATTERN,
152  VECTOR, dim>& sth,
153  const std::vector<
154  typename dealii::DoFHandler<dim>::active_cell_iterator>& element,
155  const std::map<std::string, const Vector<double>*> &param_values,
156  const std::map<std::string, const VECTOR*> &domain_values) :
157  edcinternal::ElementDataContainerInternal<VECTOR, dim>(param_values,
158  domain_values), element_(element), state_fe_values_(
159  sth.GetMapping(), (sth.GetFESystem("state")), quad,
160  update_flags), control_fe_values_(sth.GetMapping(),
161  (sth.GetFESystem("state")), quad, update_flags)
162  {
163  state_index_ = sth.GetStateIndex();
164  control_index_ = element.size(); //Make sure they are never used ...
165  n_q_points_per_element_ = quad.size();
166  n_dofs_per_element_ = element[0]->get_fe().dofs_per_cell;
167  }
169  {
170  }
171  /*********************************************/
172  /*
173  * This function reinits the FEValues on the actual element. Should
174  * be called prior to any of the get-functions.
175  */
176  inline void
177  ReInit();
178 
179  /*********************************************/
184  inline unsigned int
185  GetNDoFsPerElement() const;
186  inline unsigned int
187  GetNQPoints() const;
188  inline unsigned int
189  GetMaterialId() const;
190  inline unsigned int
191  GetNbrMaterialId(unsigned int face) const;
192  inline unsigned int
193  GetFaceBoundaryIndicator(unsigned int face) const;
194  inline bool
195  GetIsAtBoundary() const;
196  inline double
197  GetElementDiameter() const;
198  inline Point<dim>
199  GetCenter() const;
200  inline const DOpEWrapper::FEValues<dim>&
201  GetFEValuesState() const;
202  inline const DOpEWrapper::FEValues<dim>&
203  GetFEValuesControl() const;
204  private:
205  /*
206  * Helper Functions
207  */
208  unsigned int
209  GetStateIndex() const;
210  unsigned int
211  GetControlIndex() const;
212 
213  /***********************************************************/
214  //"global" member data, part of every instantiation
215  unsigned int state_index_;
216  unsigned int control_index_;
217 
218  const std::vector<typename dealii::DoFHandler<dim>::active_cell_iterator> & element_;
219  DOpEWrapper::FEValues<dim> state_fe_values_;
220  DOpEWrapper::FEValues<dim> control_fe_values_;
221 
222  unsigned int n_q_points_per_element_;
223  unsigned int n_dofs_per_element_;
224  };
225 
226  /*****************************************************************/
227  /* MGDofHandler */
228 //
229 //
230 // /**
231 // * This two classes hold all the information we need in the integrator to
232 // * integrate something over a element (could be a functional, a PDE, etc.).
233 // * Of particular importance: This class holds the FEValues objects.
234 // *
235 // * @template VECTOR Type of the vector we use in our computations (i.e. Vector<double> or BlockVector<double>)
236 // * @template dim The dimension of the integral we are actually interested in.
237 // */
238 //
239 // template<typename VECTOR, int dim>
240 // class ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim> : public edcinternal::ElementDataContainerInternal<
241 // VECTOR, dim>
242 // {
243 //
244 // public:
245 // /**
246 // * Constructor. Initializes the FEValues objects.
247 // *
248 // * @template FE Type of the finite element in use. Must be compatible with dealii::DofHandler. //TODO Should we fix this?
249 // * @template SPARSITYPATTERN The corresponding Sparsitypattern to the class-template VECTOR.
250 // * @template dopedim The dimension of the control variable.
251 // * @template dealdim The dimension of the state variable.
252 // *
253 // * @param quad Reference to the quadrature-rule which we use at the moment.
254 // * @param update_flags The update flags we need to initialize the FEValues obejcts
255 // * @param sth A reference to the SpaceTimeHandler in use.
256 // * @param element A vector of element iterators through which we gain most of the needed information (like
257 // * material_ids, n_dfos, etc.)
258 // * @param param_values A std::map containing parameter data (e.g. non space dependent data). If the control
259 // * is done by parameters, it is contained in this map at the position "control".
260 // * @param domain_values A std::map containing domain data (e.g. nodal vectors for FE-Functions). If the control
261 // * is distributed, it is contained in this map at the position "control". The state may always
262 // * be found in this map at the position "state"
263 // *
264 // */
265 // template<template<int, int> class FE, typename SPARSITYPATTERN, int dopedim, int dealdim>
266 // ElementDataContainer(
267 // const Quadrature<dim>& quad,
268 // UpdateFlags update_flags,
269 // SpaceTimeHandler<FE, dealii::MGDoFHandler, SPARSITYPATTERN,
270 // VECTOR, dopedim, dealdim>& sth
271 // ,
272 // const std::vector<
273 // typename dealii::MGDoFHandler<dim>::active_cell_iterator>& element,
274 // const std::map<std::string, const Vector<double>*> &param_values,
275 // const std::map<std::string, const VECTOR*> &domain_values)
276 // : edcinternal::ElementDataContainerInternal<VECTOR, dim>(
277 // param_values, domain_values), element_(element), state_fe_values_(
278 // sth.GetMapping(), (sth.GetFESystem("state")), quad,
279 // update_flags), control_fe_values_(sth.GetMapping(),
280 // (sth.GetFESystem("control")), quad, update_flags)
281 // {
282 // state_index_ = sth.GetStateIndex();
283 // if (state_index_ == 1)
284 // control_index_ = 0;
285 // else
286 // control_index_ = 1;
287 // n_q_points_per_element_ = quad.size();
288 // n_dofs_per_element_ = element[0]->get_fe().dofs_per_cell;
289 // }
290 //
291 //
292 //
293 //
294 //
295 // /**
296 // * Constructor. Initializes the FEValues objects. When only a PDE is used.
297 // *
298 // * @template FE Type of the finite element in use.
299 // * @template SPARSITYPATTERN The corresponding Sparsitypattern to the class-template VECTOR.
300 // *
301 // * @param quad Reference to the quadrature-rule which we use at the moment.
302 // * @param update_flags The update flags we need to initialize the FEValues obejcts
303 // * @param sth A reference to the SpaceTimeHandler in use.
304 // * @param element A vector of element iterators through which we gain most of the needed information (like
305 // * material_ids, n_dfos, etc.)
306 // * @param param_values A std::map containing parameter data (e.g. non space dependent data). If the control
307 // * is done by parameters, it is contained in this map at the position "control".
308 // * @param domain_values A std::map containing domain data (e.g. nodal vectors for FE-Functions). If the control
309 // * is distributed, it is contained in this map at the position "control". The state may always
310 // * be found in this map at the position "state"
311 // *
312 // */
313 // template<template<int, int> class FE, typename SPARSITYPATTERN>
314 // ElementDataContainer(const Quadrature<dim>& quad,
315 // UpdateFlags update_flags,
316 // StateSpaceTimeHandler<FE, dealii::MGDoFHandler,
317 // SPARSITYPATTERN, VECTOR, dim>& sth,
318 // const std::vector<
319 // typename dealii::MGDoFHandler<dim>::active_cell_iterator>& element,
320 // const std::map<std::string, const Vector<double>*> &param_values,
321 // const std::map<std::string, const VECTOR*> &domain_values)
322 // : edcinternal::ElementDataContainerInternal<VECTOR, dim>(
323 // param_values, domain_values), element_(element), state_fe_values_(
324 // sth.GetMapping(), (sth.GetFESystem("state")), quad,
325 // update_flags), control_fe_values_(sth.GetMapping(),
326 // (sth.GetFESystem("state")), quad, update_flags)
327 // {
328 // state_index_ = sth.GetStateIndex();
329 // control_index_ = element.size(); //Make sure they are never used ...
330 // n_q_points_per_element_ = quad.size();
331 // n_dofs_per_element_ = element[0]->get_fe().dofs_per_cell;
332 // }
333 //
334 //
335 // ~ElementDataContainer()
336 // {
337 // }
338 // /*********************************************/
339 // /*
340 // * This function reinits the FEValues on the actual element. Should
341 // * be called prior to any of the get-functions.
342 // */
343 // inline void
344 // ReInit();
345 //
346 // /*********************************************/
347 // /**
348 // * Get functions to extract data. They all assume that ReInit
349 // * is executed before calling them. Self explanatory.
350 // */
351 // inline unsigned int
352 // GetNDoFsPerElement() const;
353 // inline unsigned int
354 // GetNQPoints() const;
355 // inline unsigned int
356 // GetMaterialId() const;
357 // inline unsigned int
358 // GetNbrMaterialId(unsigned int face) const;
359 // inline unsigned int
360 // GetFaceBoundaryIndicator(unsigned int face) const;
361 // inline bool
362 // GetIsAtBoundary() const;
363 // inline double
364 // GetElementDiameter() const;
365 // inline Point<dim> GetCenter() const;
366 // inline const DOpEWrapper::FEValues<dim>&
367 // GetFEValuesState() const;
368 // inline const DOpEWrapper::FEValues<dim>&
369 // GetFEValuesControl() const;
370 // private:
371 // /*
372 // * Helper Functions
373 // */
374 // unsigned int
375 // GetStateIndex() const;
376 // unsigned int
377 // GetControlIndex() const;
378 //
379 // /***********************************************************/
380 // //"global" member data, part of every instantiation
381 // unsigned int state_index_;
382 // unsigned int control_index_;
383 //
384 // const std::vector<typename dealii::MGDoFHandler<dim>::active_cell_iterator> & element_;
385 // DOpEWrapper::FEValues<dim> state_fe_values_;
386 // DOpEWrapper::FEValues<dim> control_fe_values_;
387 //
388 // unsigned int n_q_points_per_element_;
389 // unsigned int n_dofs_per_element_;
390 // };
391 //
392  /* end MGDofHandler */
393  /*************************************************************************/
394 
395 
396  template<typename VECTOR, int dim>
397  class ElementDataContainer<dealii::hp::DoFHandler, VECTOR, dim> : public edcinternal::ElementDataContainerInternal<
398  VECTOR, dim>
399  {
400 
401  public:
422  template<template<int, int> class FE, typename SPARSITYPATTERN, int dopedim, int dealdim>
423  ElementDataContainer(const hp::QCollection<dim>& q_collection,
424  UpdateFlags update_flags,
425  SpaceTimeHandler<FE, dealii::hp::DoFHandler, SPARSITYPATTERN,
426  VECTOR, dopedim, dealdim>& sth,
427  const std::vector<
429  const std::map<std::string, const Vector<double>*> &param_values,
430  const std::map<std::string, const VECTOR*> &domain_values) :
431  edcinternal::ElementDataContainerInternal<VECTOR, dim>(param_values,
432  domain_values), element_(element), state_hp_fe_values_(
433  sth.GetMapping(), (sth.GetFESystem("state")), q_collection,
434  update_flags), control_hp_fe_values_(sth.GetMapping(),
435  (sth.GetFESystem("control")), q_collection, update_flags), q_collection_(
436  q_collection)
437  {
438  state_index_ = sth.GetStateIndex();
439  if (state_index_ == 1)
440  control_index_ = 0;
441  else
442  control_index_ = 1;
443  }
444 
462  template<template<int, int> class FE, typename SPARSITYPATTERN>
463  ElementDataContainer(const hp::QCollection<dim>& q_collection,
464  UpdateFlags update_flags,
465  StateSpaceTimeHandler<FE, dealii::hp::DoFHandler, SPARSITYPATTERN,
466  VECTOR, dim>& sth,
467  const std::vector<
469  const std::map<std::string, const Vector<double>*> &param_values,
470  const std::map<std::string, const VECTOR*> &domain_values) :
471  edcinternal::ElementDataContainerInternal<VECTOR, dim>(param_values,
472  domain_values), element_(element), state_hp_fe_values_(
473  sth.GetMapping(), (sth.GetFESystem("state")), q_collection,
474  update_flags), control_hp_fe_values_(sth.GetMapping(),
475  (sth.GetFESystem("state")), q_collection, update_flags), q_collection_(
476  q_collection)
477  {
478  state_index_ = sth.GetStateIndex();
479  control_index_ = element.size(); //Make sure they are never used ...
480  }
482  {
483  }
484 
485  /*****************************************************************/
486  /*
487  * This function reinits the hp::FEValues on the actual element. Should
488  * be called prior to any of the get-functions.
489  */
490  inline void
491  ReInit();
492  /*********************************************/
498  inline unsigned int
499  GetNDoFsPerElement() const;
500  inline unsigned int
501  GetNQPoints() const;
502  inline unsigned int
503  GetMaterialId() const;
504  inline unsigned int
505  GetNbrMaterialId(unsigned int face) const;
506  inline unsigned int
507  GetFaceBoundaryIndicator(unsigned int face) const;
508  inline bool
509  GetIsAtBoundary() const;
510  inline double
511  GetElementDiameter() const;
512  inline Point<dim>
513  GetCenter() const;
514 
515  inline const DOpEWrapper::FEValues<dim>&
516  GetFEValuesState() const;
517  inline const DOpEWrapper::FEValues<dim>&
518  GetFEValuesControl() const;
519 
520  private:
521  unsigned int
522  GetStateIndex() const;
523  unsigned int
524  GetControlIndex() const;
525  const std::map<std::string, const VECTOR*> &
526  GetDomainValues() const;
527  /***********************************************************/
532  inline void
533  GetValues(const DOpEWrapper::FEValues<dim>& fe_values, std::string name,
534  std::vector<double>& values) const;
535  /***********************************************************/
539  inline void
540  GetValues(const DOpEWrapper::FEValues<dim>& fe_values, std::string name,
541  std::vector<Vector<double> >& values) const;
542 
543  /***********************************************************/
547  template<int targetdim>
548  inline void
549  GetGrads(const DOpEWrapper::FEValues<dim>& fe_values,
550  std::string name,
551  std::vector<Tensor<1, targetdim> >& values) const;
552  /***********************************************************/
556  template<int targetdim>
557  inline void
558  GetGrads(const DOpEWrapper::FEValues<dim>& fe_values,
559  std::string name,
560  std::vector<std::vector<Tensor<1, targetdim> > >& values) const;
561 
562  /***********************************************************/
563  //"global" member data, part of every instantiation
564  unsigned int state_index_;
565  unsigned int control_index_;
566 
567  const std::vector<
568  typename dealii::hp::DoFHandler<dim>::active_cell_iterator> & element_;
569  DOpEWrapper::HpFEValues<dim> state_hp_fe_values_;
570  DOpEWrapper::HpFEValues<dim> control_hp_fe_values_;
571 
572  const hp::QCollection<dim>& q_collection_;
573  };
574 
575  /***********************************************************************/
576  /************************IMPLEMENTATION for DoFHandler*********************************/
577  /***********************************************************************/
578 
579  template<typename VECTOR, int dim>
580  void
582  {
583  state_fe_values_.reinit(element_[this->GetStateIndex()]);
584  //Make sure that the Control must be initialized.
585  if (this->GetControlIndex() < element_.size())
586  control_fe_values_.reinit(element_[this->GetControlIndex()]);
587  }
588 
589  /***********************************************************************/
590  template<typename VECTOR, int dim>
591  unsigned int
593  {
594  return n_dofs_per_element_;
595  }
596 
597  /**********************************************/
598  template<typename VECTOR, int dim>
599  unsigned int
601  {
602  return n_q_points_per_element_;
603  }
604 
605  /**********************************************/
606  template<typename VECTOR, int dim>
607  unsigned int
609  {
610  return element_[0]->material_id();
611  }
612 
613  /**********************************************/
614  template<typename VECTOR, int dim>
615  unsigned int
617  unsigned int face) const
618  {
619  if (element_[0]->neighbor_index(face) != -1)
620  return element_[0]->neighbor(face)->material_id();
621  else
622  {
623  std::stringstream out;
624  out << "There is no neighbor with number " << face;
625  throw DOpEException(out.str(),
626  "ElementDataContainer::GetNbrMaterialId");
627  }
628  }
629 
630  /**********************************************/
631  template<typename VECTOR, int dim>
632  unsigned int
634  unsigned int face) const
635  {
636  return element_[0]->face(face)->boundary_indicator();
637  }
638 
639  /**********************************************/
640  template<typename VECTOR, int dim>
641  bool
643  {
644  return element_[0]->at_boundary();
645  }
646  /**********************************************/
647  template<typename VECTOR, int dim>
648  double
650  {
651  return element_[0]->diameter();
652  }
653  /**********************************************/
654  template<typename VECTOR, int dim>
655  Point<dim>
657  {
658  return element_[0]->center();
659  }
660 
661  /**********************************************/
662  template<typename VECTOR, int dim>
665  {
666  return state_fe_values_;
667  }
668 
669  /**********************************************/
670  template<typename VECTOR, int dim>
673  {
674  return control_fe_values_;
675  }
676 
677  /***********************************************************************/
678 
679  template<typename VECTOR, int dim>
680  unsigned int
682  {
683  return state_index_;
684  }
685 
686  /***********************************************************************/
687 
688  template<typename VECTOR, int dim>
689  unsigned int
690  ElementDataContainer<dealii::DoFHandler, VECTOR, dim>::GetControlIndex() const
691  {
692  return control_index_;
693  }
694 
695  /***********************************************************************/
696  /************************END*OF*IMPLEMENTATION**************************/
697  /***********************************************************************/
698  /***********************************************************************/
699  /************************IMPLEMENTATION*********************************/
700  /***********************************************************************/
701 
702 
703 
704 // /***********************************************************************/
705 // /************************IMPLEMENTATION for MGDoFHandler*********************************/
706 // /***********************************************************************/
707 //
708 // template<typename VECTOR, int dim>
709 // void
710 // DOpE::ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::ReInit()
711 // {
712 // state_fe_values_.reinit(element_[this->GetStateIndex()]);
713 // //Make sure that the Control must be initialized.
714 // if (this->GetControlIndex() < element_.size())
715 // control_fe_values_.reinit(element_[this->GetControlIndex()]);
716 // }
717 //
718 // /***********************************************************************/
719 // template<typename VECTOR, int dim>
720 // unsigned int
721 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetNDoFsPerElement() const
722 // {
723 // return n_dofs_per_element_;
724 // }
725 //
726 // /**********************************************/
727 // template<typename VECTOR, int dim>
728 // unsigned int
729 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetNQPoints() const
730 // {
731 // return n_q_points_per_element_;
732 // }
733 //
734 // /**********************************************/
735 // template<typename VECTOR, int dim>
736 // unsigned int
737 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetMaterialId() const
738 // {
739 // return element_[0]->material_id();
740 // }
741 //
742 // /**********************************************/
743 // template<typename VECTOR, int dim>
744 // unsigned int
745 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetNbrMaterialId(
746 // unsigned int face) const
747 // {
748 // if (element_[0]->neighbor_index(face) != -1)
749 // return element_[0]->neighbor(face)->material_id();
750 // else
751 // {
752 // std::stringstream out;
753 // out << "There is no neighbor with number " << face;
754 // throw DOpEException(out.str(),
755 // "ElementDataContainer::GetNbrMaterialId");
756 // }
757 // }
758 //
759 // /**********************************************/
760 // template<typename VECTOR, int dim>
761 // unsigned int
762 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetFaceBoundaryIndicator(
763 // unsigned int face) const
764 // {
765 // return element_[0]->face(face)->boundary_indicator();
766 // }
767 //
768 // /**********************************************/
769 // template<typename VECTOR, int dim>
770 // bool
771 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetIsAtBoundary() const
772 // {
773 // return element_[0]->at_boundary();
774 // }
775 // /**********************************************/
776 // template<typename VECTOR, int dim>
777 // double
778 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetElementDiameter() const
779 // {
780 // return element_[0]->diameter();
781 // }
782 // /**********************************************/
783 // template<typename VECTOR, int dim>
784 // Point<dim>
785 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetCenter() const
786 // {
787 // return element_[0]->center();
788 // }
789 //
790 // /**********************************************/
791 // template<typename VECTOR, int dim>
792 // const DOpEWrapper::FEValues<dim>&
793 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetFEValuesState() const
794 // {
795 // return state_fe_values_;
796 // }
797 //
798 // /**********************************************/
799 // template<typename VECTOR, int dim>
800 // const DOpEWrapper::FEValues<dim>&
801 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetFEValuesControl() const
802 // {
803 // return control_fe_values_;
804 // }
805 //
806 // /***********************************************************************/
807 //
808 // template<typename VECTOR, int dim>
809 // unsigned int
810 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetStateIndex() const
811 // {
812 // return state_index_;
813 // }
814 //
815 // /***********************************************************************/
816 //
817 // template<typename VECTOR, int dim>
818 // unsigned int
819 // ElementDataContainer<dealii::MGDoFHandler, VECTOR, dim>::GetControlIndex() const
820 // {
821 // return control_index_;
822 // }
823 //
824  /***********************************************************************/
825  /************************END*OF*IMPLEMENTATION**************************/
826  /***********************************************************************/
827  /***********************************************************************/
828  /************************IMPLEMENTATION*********************************/
829  /***********************************************************************/
830 
831 
832 
833 
834  template<typename VECTOR, int dim>
835  void
837  {
838  state_hp_fe_values_.reinit(element_[this->GetStateIndex()]);
839  //Make sure that the Control must be initialized.
840  if (this->GetControlIndex() < element_.size())
841  control_hp_fe_values_.reinit(element_[this->GetControlIndex()]);
842  }
843  /*********************************************/
844 
845  template<typename VECTOR, int dim>
846  unsigned int
848  {
849  return element_[0]->get_fe().dofs_per_cell;
850  }
851  /*********************************************/
852  template<typename VECTOR, int dim>
853  unsigned int
855  {
856  return (q_collection_[element_[0]->active_fe_index()]).size();
857  }
858  /*********************************************/
859 
860  template<typename VECTOR, int dim>
861  unsigned int
863  {
864  return element_[0]->material_id();
865  }
866  /*********************************************/
867 
868  template<typename VECTOR, int dim>
869  unsigned int
871  unsigned int face) const
872  {
873  if (element_[0]->neighbor_index(face) != -1)
874  return element_[0]->neighbor(face)->material_id();
875  else
876  {
877  std::stringstream out;
878  out << "There is no neighbor with number " << face;
879  throw DOpEException(out.str(),
880  "HpElementDataContainer::GetNbrMaterialId");
881  }
882  }
883 
884  /**********************************************/
885  template<typename VECTOR, int dim>
886  unsigned int
888  unsigned int face) const
889  {
890  return element_[0]->face(face)->boundary_indicator();
891  }
892 
893  /*********************************************/
894 
895  template<typename VECTOR, int dim>
896  bool
898  {
899  return element_[0]->at_boundary();
900  }
901 
902  /*********************************************/
903 
904  template<typename VECTOR, int dim>
905  double
907  {
908  return element_[0]->diameter();
909  }
910 
911  /**********************************************/
912  template<typename VECTOR, int dim>
913  Point<dim>
915  {
916  return element_[0]->center();
917  }
918 
919  /*********************************************/
920  template<typename VECTOR, int dim>
923  {
924  return static_cast<const DOpEWrapper::FEValues<dim>&>(state_hp_fe_values_.get_present_fe_values());
925  }
926  /*********************************************/
927  template<typename VECTOR, int dim>
930  {
931  return static_cast<const DOpEWrapper::FEValues<dim>&>(control_hp_fe_values_.get_present_fe_values());
932  }
933  /*********************************************/
934 
935  template<typename VECTOR, int dim>
936  unsigned int
938  {
939  return state_index_;
940  }
941  /*********************************************/
942  template<typename VECTOR, int dim>
943  unsigned int
944  ElementDataContainer<dealii::hp::DoFHandler, VECTOR, dim>::GetControlIndex() const
945  {
946  return control_index_;
947  }
948 } //end of namespace
949 
950 #endif /* WORKINGTITLE_H_ */
ElementDataContainer()
Definition: elementdatacontainer.h:62
ElementDataContainer(const hp::QCollection< dim > &q_collection, UpdateFlags update_flags, SpaceTimeHandler< FE, dealii::hp::DoFHandler, SPARSITYPATTERN, VECTOR, dopedim, dealdim > &sth, const std::vector< typename DOpEWrapper::DoFHandler< dim, dealii::hp::DoFHandler >::active_cell_iterator > &element, const std::map< std::string, const Vector< double > * > &param_values, const std::map< std::string, const VECTOR * > &domain_values)
Definition: elementdatacontainer.h:423
Definition: elementdatacontainer.h:58
~ElementDataContainer()
Definition: elementdatacontainer.h:168
ElementDataContainer(const Quadrature< dim > &quad, UpdateFlags update_flags, StateSpaceTimeHandler< FE, dealii::DoFHandler, SPARSITYPATTERN, VECTOR, dim > &sth, const std::vector< typename dealii::DoFHandler< dim >::active_cell_iterator > &element, const std::map< std::string, const Vector< double > * > &param_values, const std::map< std::string, const VECTOR * > &domain_values)
Definition: elementdatacontainer.h:149
ElementDataContainer(const Quadrature< dim > &quad, UpdateFlags update_flags, SpaceTimeHandler< FE, dealii::DoFHandler, SPARSITYPATTERN, VECTOR, dopedim, dealdim > &sth, const std::vector< typename dealii::DoFHandler< dim >::active_cell_iterator > &element, const std::map< std::string, const Vector< double > * > &param_values, const std::map< std::string, const VECTOR * > &domain_values)
Definition: elementdatacontainer.h:107
Definition: elementdatacontainer_internal.h:46
Definition: dofhandler_wrapper.h:51
Definition: statespacetimehandler.h:59
~ElementDataContainer()
Definition: elementdatacontainer.h:481
Definition: spacetimehandler.h:71
ElementDataContainer(const hp::QCollection< dim > &q_collection, UpdateFlags update_flags, StateSpaceTimeHandler< FE, dealii::hp::DoFHandler, SPARSITYPATTERN, VECTOR, dim > &sth, const std::vector< typename DOpEWrapper::DoFHandler< dim, dealii::hp::DoFHandler >::active_cell_iterator > &element, const std::map< std::string, const Vector< double > * > &param_values, const std::map< std::string, const VECTOR * > &domain_values)
Definition: elementdatacontainer.h:463
Definition: fevalues_wrapper.h:43
Definition: dopeexception.h:35
Definition: fevalues_wrapper.h:186