DOpE
integratormixeddims.h
Go to the documentation of this file.
1 
24 #ifndef _IntegratorMixed_H_
25 #define _IntegratorMixed_H_
26 
27 #include <lac/vector.h>
28 #include <lac/block_sparsity_pattern.h>
29 #include <lac/block_sparse_matrix.h>
30 
31 #include <numerics/matrix_tools.h>
32 #include <numerics/vector_tools.h>
33 
34 #include <base/function.h>
35 
36 #include <dofs/dof_tools.h>
37 
38 #include <fe/mapping_q1.h>
39 
40 #include <vector>
41 
42 #include "elementdatacontainer.h"
43 #include "facedatacontainer.h"
44 #include "optproblemcontainer.h"
45 #if DEAL_II_VERSION_GTE(7,3)
46  #include <base/types.h>
47  #endif
48 
49 namespace DOpE
50 {
68 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
69  int dimhigh>
71 {
72  public:
73  IntegratorMixedDimensions(INTEGRATORDATACONT& idc);
74 
76 
77  void ReInit();
78 
79  template<typename PROBLEM>
80  void ComputeNonlinearResidual(PROBLEM& pde, VECTOR &residual, bool apply_boundary_values = true);
81  template<typename PROBLEM, typename MATRIX>
82  void ComputeMatrix(PROBLEM& pde, MATRIX &matrix);
83  template<typename PROBLEM>
84  void
85  ComputeNonlinearRhs(PROBLEM& pde, VECTOR &residual, bool apply_boundary_values = true);
86 
87  template<typename PROBLEM>
88  void ComputeLocalControlConstraints (PROBLEM& pde, VECTOR &constraints);
89  template<typename PROBLEM>
90  SCALAR ComputeDomainScalar(PROBLEM& pde);
91  template<typename PROBLEM>
92  SCALAR ComputePointScalar(PROBLEM& pde);
93  template<typename PROBLEM>
94  SCALAR ComputeBoundaryScalar(PROBLEM& pde);
95  template<typename PROBLEM>
96  SCALAR ComputeFaceScalar(PROBLEM& pde);
97  template<typename PROBLEM>
98  SCALAR ComputeAlgebraicScalar(PROBLEM& pde);
99 
100  template<typename PROBLEM>
101  void ApplyInitialBoundaryValues(PROBLEM& pde, VECTOR &u);
102  template<typename PROBLEM>
103  void ApplyTransposedInitialBoundaryValues(PROBLEM& pde, VECTOR &u, SCALAR scale);
104  template<typename PROBLEM>
105  void ApplyNewtonBoundaryValues(PROBLEM& pde, VECTOR &u);
106  template<typename PROBLEM, typename MATRIX>
107  void ApplyNewtonBoundaryValues(PROBLEM& pde, MATRIX &matrix, VECTOR &rhs, VECTOR &sol);
108 
109  inline void AddDomainData(std::string name, const VECTOR* new_data);
110  inline void DeleteDomainData(std::string name);
111 
112  inline void AddParamData(std::string name, const dealii::Vector<SCALAR>* new_data);
113  inline void DeleteParamData(std::string name);
114 
115  inline const INTEGRATORDATACONT& GetIntegratorDataContainer() const;
116 
117  protected:
118  inline const std::map<std::string, const VECTOR*>& GetDomainData() const;
119  inline const std::map<std::string, const dealii::Vector<SCALAR>*>& GetParamData() const;
120 
121  private:
122  INTEGRATORDATACONT & _idc;
123 
124  std::map<std::string, const VECTOR*> _domain_data;
125  std::map<std::string, const dealii::Vector<SCALAR>*> _param_data;
126 };
127 
128 /**********************************Implementation*******************************************/
129 
130  template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR,
131  int dimlow, int dimhigh>
132  IntegratorMixedDimensions<INTEGRATORDATACONT, VECTOR, SCALAR, dimlow,
133  dimhigh>::IntegratorMixedDimensions(INTEGRATORDATACONT& idc) :
134  _idc(idc)
135  {
136  }
137 
138 /**********************************Implementation*******************************************/
139 
140 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
141  int dimhigh>
143 {
144 
145 }
146 
147 /*******************************************************************************************/
148 
149 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
150  int dimhigh>
152 {
153 
154 }
155 
156 /*******************************************************************************************/
157 
158 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
159  int dimhigh>
160 template<typename PROBLEM>
162  VECTOR &residual,
163  bool apply_boundary_values)
164 {
165  {
166  residual = 0.;
167  // Begin integration
168  const unsigned int dofs =
169  pde.GetBaseProblem().GetSpaceTimeHandler()->GetControlNDoFs();
170 
171  dealii::Vector<SCALAR> local_vector(dofs);
172  const auto& dof_handler =
173  pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandler();
174  auto element = pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandlerBeginActive();
175  auto endc = pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandlerEnd();
176 
177  // Initialize the data containers.
178  _idc.InitializeEDC(pde.GetUpdateFlags(),
179  *(pde.GetBaseProblem().GetSpaceTimeHandler()), element,
180  this->GetParamData(), this->GetDomainData());
181  auto& edc = _idc.GetElementDataContainer();
182 
183  bool need_faces = pde.HasFaces();
184  std::vector<unsigned int> boundary_equation_colors = pde.GetBoundaryEquationColors();
185  bool need_boundary_integrals = (boundary_equation_colors.size() > 0);
186  _idc.InitializeFDC(pde.GetFaceUpdateFlags(),
187  *(pde.GetBaseProblem().GetSpaceTimeHandler()),
188  element,
189  this->GetParamData(),
190  this->GetDomainData());
191  auto & fdc = _idc.GetFaceDataContainer();
192 
193  for (; element[0] != endc[0]; element[0]++)
194  {
195  for (unsigned int dh = 1; dh < dof_handler.size(); dh++)
196  {
197  if (element[dh] == endc[dh])
198  {
199  throw DOpEException("Elementnumbers in DoFHandlers are not matching!",
200  "IntegratorMixedDimensions::ComputeNonlinearResidual");
201  }
202  }
203 
204  local_vector = 0;
205  edc.ReInit();
206 
207  pde.ElementRhs(edc,local_vector, -1.);
208 
209  if(need_boundary_integrals)
210  {
211  for (unsigned int face=0; face < dealii::GeometryInfo<dimhigh>::faces_per_cell; ++face)
212  {
213  if (element[0]->face(face)->at_boundary()
214  &&
215  (find(boundary_equation_colors.begin(),boundary_equation_colors.end(),element[0]->face(face)->boundary_indicator()) != boundary_equation_colors.end()))
216  {
217  fdc.ReInit(face);
218  pde.BoundaryRhs(fdc,local_vector,-1.);
219  }
220  }
221  }
222  if(need_faces)
223  {
224  for (unsigned int face=0; face < dealii::GeometryInfo<dimhigh>::faces_per_cell; ++face)
225  {
226  if (element[0]->neighbor_index(face) != -1)
227  {
228  fdc.ReInit(face);
229  pde.FaceRhs(fdc,local_vector,-1.);
230  }
231  }
232  }
233  //LocalToGlobal
234  for (unsigned int i = 0; i < dofs; ++i)
235  {
236  residual(i) += local_vector(i);
237  }
238 
239  for (unsigned int dh = 1; dh < dof_handler.size(); dh++)
240  {
241  element[dh]++;
242  }
243  }
244  //The Equation should not be space dependend.
245  local_vector = 0;
246  pde.ElementEquation(edc, local_vector, 1., 1.);
247 
248  for (unsigned int i = 0; i < dofs; ++i)
249  {
250  residual(i) += local_vector(i);
251  }
252 
253  if (pde.HasControlInDirichletData())
254  {
255  ApplyTransposedInitialBoundaryValues(pde,residual, -1.);
256  }
257 
258  if (apply_boundary_values)
259  {
260  ApplyNewtonBoundaryValues(pde,residual);
261  }
262  }
263 }
264 /*******************************************************************************************/
265 
266 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
267  int dimhigh>
268 template<typename PROBLEM>
270  VECTOR &residual,
271  bool apply_boundary_values)
272 {
273  {
274  residual = 0.;
275  // Begin integration
276  const unsigned int dofs =
277  pde.GetBaseProblem().GetSpaceTimeHandler()->GetControlNDoFs();
278 
279  dealii::Vector<SCALAR> local_vector(dofs);
280  const auto& dof_handler =
281  pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandler();
282  auto element = pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandlerBeginActive();
283  auto endc = pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandlerEnd();
284 
285  // Initialize the data containers.
286  _idc.InitializeEDC(pde.GetUpdateFlags(),
287  *(pde.GetBaseProblem().GetSpaceTimeHandler()), element,
288  this->GetParamData(), this->GetDomainData());
289  auto& edc = _idc.GetElementDataContainer();
290 
291  bool need_faces = pde.HasFaces();
292  std::vector<unsigned int> boundary_equation_colors = pde.GetBoundaryEquationColors();
293  bool need_boundary_integrals = (boundary_equation_colors.size() > 0);
294  _idc.InitializeFDC(pde.GetFaceUpdateFlags(),
295  *(pde.GetBaseProblem().GetSpaceTimeHandler()),
296  element,
297  this->GetParamData(),
298  this->GetDomainData());
299  auto & fdc = _idc.GetFaceDataContainer();
300 
301  for (; element[0] != endc[0]; element[0]++)
302  {
303  for (unsigned int dh = 1; dh < dof_handler.size(); dh++)
304  {
305  if (element[dh] == endc[dh])
306  {
307  throw DOpEException("Elementnumbers in DoFHandlers are not matching!",
308  "IntegratorMixedDimensions::ComputeNonlinearResidual");
309  }
310  }
311 
312  local_vector = 0;
313  edc.ReInit();
314 
315  pde.ElementRhs(edc,local_vector, 1.);
316 
317  if(need_boundary_integrals)
318  {
319  for (unsigned int face=0; face < dealii::GeometryInfo<dimhigh>::faces_per_cell; ++face)
320  {
321  if (element[0]->face(face)->at_boundary()
322  &&
323  (find(boundary_equation_colors.begin(),boundary_equation_colors.end(),element[0]->face(face)->boundary_indicator()) != boundary_equation_colors.end()))
324  {
325  fdc.ReInit(face);
326  pde.BoundaryRhs(fdc,local_vector,1.);
327  }
328  }
329  }
330  if(need_faces)
331  {
332  for (unsigned int face=0; face < dealii::GeometryInfo<dimhigh>::faces_per_cell; ++face)
333  {
334  if (element[0]->neighbor_index(face) != -1)
335  {
336  fdc.ReInit(face);
337  pde.FaceRhs(fdc,local_vector,1.);
338  }
339  }
340  }
341  //LocalToGlobal
342  for (unsigned int i = 0; i < dofs; ++i)
343  {
344  residual(i) += local_vector(i);
345  }
346 
347  for (unsigned int dh = 1; dh < dof_handler.size(); dh++)
348  {
349  element[dh]++;
350  }
351  }
352 
353  if (pde.HasControlInDirichletData())
354  {
355  ApplyTransposedInitialBoundaryValues(pde,residual, -1.);
356  }
357 
358  if (apply_boundary_values)
359  {
360  ApplyNewtonBoundaryValues(pde,residual);
361  }
362  }
363 }
364 
365 /*******************************************************************************************/
366 
367 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
368  int dimhigh>
369 template<typename PROBLEM, typename MATRIX>
371 {
372  throw DOpEException("You should not use this function, try VoidLinearSolver instead.",
373  "IntegratorMixedDimensions::ComputeMatrix");
374 }
375 
376 /*******************************************************************************************/
377 
378 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
379  int dimhigh>
380 template<typename PROBLEM>
382 {
383  constraints = 0.;
384  pde.ComputeLocalControlConstraints(constraints,this->GetParamData(),this->GetDomainData());
385 }
386 /*******************************************************************************************/
387 
388  template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR,
389  int dimlow, int dimhigh>
390  template<typename PROBLEM>
391  SCALAR
392  IntegratorMixedDimensions<INTEGRATORDATACONT, VECTOR, SCALAR, dimlow,
393  dimhigh>::ComputeDomainScalar(PROBLEM& pde)
394  {
395  {
396  SCALAR ret = 0.;
397  const unsigned int n_q_points = this->GetQuadratureFormula()->size();
398 
399  const auto& dof_handler =
400  pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandler();
401  auto element = pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandlerBeginActive();
402  auto endc = pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandlerEnd();
403 
404  _idc.InitializeEDC(pde.GetUpdateFlags(),
405  *(pde.GetBaseProblem().GetSpaceTimeHandler()), element,
406  this->GetParamData(), this->GetDomainData());
407  auto& edc = _idc.GetElementDataContainer();
408 
409 
410  bool need_faces = pde.HasFaces();
411 
412  for (; element[0] != endc[0]; element[0]++)
413  {
414  for (unsigned int dh = 1; dh < dof_handler.size(); dh++)
415  {
416  if (element[dh] == endc[dh])
417  {
418  throw DOpEException("Elementnumbers in DoFHandlers are not matching!",
419  "IntegratorMixedDimensions::ComputeDomainScalar");
420  }
421  }
422 
423  ret += pde.ElementFunctional(edc);
424 
425  if (need_faces)
426  {
427  throw DOpEException("Face Integrals not Implemented!",
428  "IntegratorMixedDimensions::ComputeDomainScalar");
429  }
430 
431  for (unsigned int dh = 1; dh < dof_handler.size(); dh++)
432  {
433  element[dh]++;
434  }
435  }
436  return ret;
437  }
438 }
439 /*******************************************************************************************/
440 
441 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
442  int dimhigh>
443 template<typename PROBLEM>
445 {
446  if (pde.GetFEValuesNeededToBeInitialized())
447  {
448  this->InitializeFEValues();
449  }
450 
451  {
452  SCALAR ret = 0.;
453 
454  ret += pde.PointFunctional(this->GetParamData(), this->GetDomainData());
455 
456  return ret;
457  }
458 }
459 /*******************************************************************************************/
460 
461 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
462  int dimhigh>
463 template<typename PROBLEM>
465 {
466 
467  {
468  SCALAR ret = 0.;
469  // Begin integration
470 
471  const std::vector<const DOpEWrapper::DoFHandler<dimhigh, dealii::DoFHandler >*>& dof_handler =
472  pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandler();
473  std::vector<typename DOpEWrapper::DoFHandler<dimhigh, dealii::DoFHandler >::active_element_iterator>
474  element(dof_handler.size());
475  std::vector<typename DOpEWrapper::DoFHandler<dimhigh, dealii::DoFHandler>::active_element_iterator>
476  endc(dof_handler.size());
477 
478  for (unsigned int dh = 0; dh < dof_handler.size(); dh++)
479  {
480  element[dh] = dof_handler[dh]->begin_active();
481  endc[dh] = dof_handler[dh]->end();
482  }
483 
484  // Generate the data containers.
485  FaceDataContainer<dealii::DoFHandler, VECTOR, dimhigh> fdc(*(this->GetFaceQuadratureFormula()),
486  pde.GetFaceUpdateFlags(),
487  *(pde.GetBaseProblem().GetSpaceTimeHandler()), element,
488  this->GetParamData(), this->GetDomainData());
489 
490  std::vector<unsigned int> boundary_functional_colors =
491  pde.GetBoundaryFunctionalColors();
492  bool need_boundary_integrals = (boundary_functional_colors.size() > 0);
493  if (!need_boundary_integrals)
494  {
495  throw DOpEException("No boundary colors given!",
496  "IntegratorMixedDimensions::ComputeBoundaryScalar");
497  }
498 
499  for (; element[0] != endc[0]; element[0]++)
500  {
501  for (unsigned int dh = 1; dh < dof_handler.size(); dh++)
502  {
503  if (element[dh] == endc[dh])
504  {
505  throw DOpEException("Elementnumbers in DoFHandlers are not matching!",
506  "IntegratorMixedDimensions::ComputeBoundaryScalar");
507  }
508  }
509 
510  if(need_boundary_integrals)
511  {
512  for (unsigned int face=0; face < dealii::GeometryInfo<dimhigh>::faces_per_cell; ++face)
513  {
514  if (element[0]->face(face)->at_boundary()
515  &&
516  (find(boundary_functional_colors.begin(),boundary_functional_colors.end(),
517  element[0]->face(face)->boundary_indicator()) != boundary_functional_colors.end()))
518  {
519 // pde.GetBaseProblem().GetSpaceTimeHandler()->ComputeFaceFEValues(element, face, pde.GetType());
520  fdc.ReInit(face);
521  ret += pde.BoundaryFunctional(fdc);
522  }
523  }
524  }
525  for (unsigned int dh = 1; dh < dof_handler.size(); dh++)
526  {
527  element[dh]++;
528  }
529  }
530  return ret;
531  }
532 }
533 /*******************************************************************************************/
534 
535 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
536  int dimhigh>
537 template<typename PROBLEM>
539 {
540  {
541  SCALAR ret = 0.;
542 
543  // Begin integration
544  const std::vector<const DOpEWrapper::DoFHandler<dimhigh, dealii::DoFHandler >*>& dof_handler =
545  pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandler();
546  std::vector<typename DOpEWrapper::DoFHandler<dimhigh, dealii::DoFHandler>::active_element_iterator>
547  element(dof_handler.size());
548  std::vector<typename DOpEWrapper::DoFHandler<dimhigh, dealii::DoFHandler>::active_element_iterator>
549  endc(dof_handler.size());
550 
551  for (unsigned int dh = 0; dh < dof_handler.size(); dh++)
552  {
553  element[dh] = dof_handler[dh]->begin_active();
554  endc[dh] = dof_handler[dh]->end();
555  }
556  // Generate the data containers.
557  FaceDataContainer<dealii::DoFHandler, VECTOR, dimhigh> fdc(*(this->GetFaceQuadratureFormula()),
558  pde.GetFaceUpdateFlags(),
559  *(pde.GetBaseProblem().GetSpaceTimeHandler()), element,
560  this->GetParamData(), this->GetDomainData());
561 
562  bool need_faces = pde.HasFaces();
563  if (!need_faces)
564  {
565  throw DOpEException("No faces required!", "IntegratorMixedDimensions::ComputeFaceScalar");
566  }
567 
568  for (; element[0] != endc[0]; element[0]++)
569  {
570  for (unsigned int dh = 1; dh < dof_handler.size(); dh++)
571  {
572  if (element[dh] == endc[dh])
573  {
574  throw DOpEException("Elementnumbers in DoFHandlers are not matching!",
575  "IntegratorMixedDimensions::ComputeFaceScalar");
576  }
577  }
578 
579  if(need_faces)
580  {
581  for (unsigned int face=0; face < dealii::GeometryInfo<dimhigh>::faces_per_cell; ++face)
582  {
583  fdc.ReInit(face);
584  ret +=pde.FaceFunctional(fdc);
585  }
586  }
587  for (unsigned int dh = 1; dh < dof_handler.size(); dh++)
588  {
589  element[dh]++;
590  }
591  }
592  return ret;
593  }
594 }
595 
596 /*******************************************************************************************/
597 
598 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
599  int dimhigh>
600 template<typename PROBLEM>
602 {
603  SCALAR ret = 0.;
604  ret = pde.AlgebraicFunctional(this->GetParamData(), this->GetDomainData());
605  return ret;
606 }
607 /*******************************************************************************************/
608 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
609  int dimhigh>
610 template<typename PROBLEM>
612  VECTOR &/*u*/)
613 {
614 }
615 /*******************************************************************************************/
616 
617 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
618  int dimhigh>
619 template<typename PROBLEM>
622  VECTOR &u,
623  SCALAR scale)
624 {
625  //Das macht nur sinn, wenn es um "Transponierte Dirichletdaten geht.
626  unsigned int dofs =
627  pde.GetBaseProblem().GetSpaceTimeHandler()->GetControlNDoFs();
628  dealii::Vector<SCALAR> local_vector(dofs);
629 
630  std::vector<unsigned int> dirichlet_colors = pde.GetTransposedDirichletColors();
631  std::vector<bool> selected_components;
632  if (dirichlet_colors.size() > 0)
633  {
634  selected_components.resize(
635  pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandler()[0]->n_dofs());
636  const std::vector<Point<dimhigh> >& support_points =
637  pde.GetBaseProblem().GetSpaceTimeHandler()->GetMapDoFToSupportPoints();
638 
639  for (unsigned int i = 0; i < dirichlet_colors.size(); i++)
640  {
641  unsigned int color = dirichlet_colors[i];
642  std::vector<bool> comp_mask = pde.GetTransposedDirichletCompMask(color);
643  std::vector<bool> current_comp(comp_mask.size(), false);
644 #if DEAL_II_VERSION_GTE(7,3)
645  std::set<types::boundary_id> boundary_indicators;
646 #else
647  std::set<unsigned char> boundary_indicators;
648 #endif
649  boundary_indicators.insert(color);
650  for (unsigned int j = 0; j < comp_mask.size(); j++)
651  {
652  if (j > 0)
653  current_comp[j - 1] = false;
654  if (comp_mask[j])
655  {
656  current_comp[j] = true;
657  //Hole eine Liste der DoFs auf dem Rand und die zugehoerigen Knoten
658  DoFTools::extract_boundary_dofs(pde.GetBaseProblem().GetSpaceTimeHandler()->GetDoFHandler()[0]->GetDEALDoFHandler(),
659  current_comp, selected_components, boundary_indicators);
660  }
662  pde.GetTransposedDirichletValues(color,
663  this->GetParamData(),
664  this->GetDomainData());
665  for (unsigned int k = 0; k < selected_components.size(); k++)
666  {
667  if (selected_components[k])
668  {
669  local_vector = 0.;
670  DD.value(support_points[k], j, k, local_vector);
671  for (unsigned int l = 0; l < dofs; ++l)
672  {
673  u(l) += scale * local_vector(l);
674  }
675  }
676  }
677  }
678  //end loop over components
679  }
680  }
681 }
682 
683 /*******************************************************************************************/
684 
685 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
686  int dimhigh>
687 template<typename PROBLEM>
689  VECTOR &/*u*/)
690 {
691  //We don't need those in the mixed case...
692 }
693 /*******************************************************************************************/
694 
695 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
696  int dimhigh>
697 template<typename PROBLEM, typename MATRIX>
699  MATRIX &/*matrix*/,
700  VECTOR &/*rhs*/,
701  VECTOR &/*sol*/)
702 {
703  //We don't need those in the mixed case...
704 }
705 
706 /*******************************************************************************************/
707 
708 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
709  int dimhigh>
711  std::string name,
712  const VECTOR* new_data)
713 {
714  if (_domain_data.find(name) != _domain_data.end())
715  {
716  throw DOpEException("Adding multiple Data with name " + name + " is prohibited!",
717  "IntegratorMixedDimensions::AddDomainData");
718  }
719  _domain_data.insert(std::pair<std::string, const VECTOR*>(name, new_data));
720 }
721 
722 /*******************************************************************************************/
723 
724 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
725  int dimhigh>
727  std::string name)
728 {
729  typename std::map<std::string, const VECTOR *>::iterator it = _domain_data.find(name);
730  if (it == _domain_data.end())
731  {
732  throw DOpEException("Deleting Data " + name + " is impossible! Data not found",
733  "IntegratorMixedDimensions::DeleteDomainData");
734  }
735  _domain_data.erase(it);
736 }
737 
738 /*******************************************************************************************/
739 
740 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
741  int dimhigh>
742 const std::map<std::string, const VECTOR*>& IntegratorMixedDimensions<INTEGRATORDATACONT, VECTOR,
743  SCALAR, dimlow, dimhigh>::GetDomainData() const
744 {
745  return _domain_data;
746 }
747 
748 /*******************************************************************************************/
749 
750 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
751  int dimhigh>
753  std::string name,
754  const dealii::Vector<
755  SCALAR>* new_data)
756 {
757  if (_param_data.find(name) != _param_data.end())
758  {
759  throw DOpEException("Adding multiple Data with name " + name + " is prohibited!",
760  "IntegratorMixedDimensions::AddParamData");
761  }
762  _param_data.insert(std::pair<std::string, const dealii::Vector<SCALAR>*>(name, new_data));
763 }
764 
765 /*******************************************************************************************/
766 
767 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
768  int dimhigh>
770  std::string name)
771 {
772  typename std::map<std::string, const dealii::Vector<SCALAR>*>::iterator it =
773  _param_data.find(name);
774  if (it == _param_data.end())
775  {
776  throw DOpEException("Deleting Data " + name + " is impossible! Data not found",
777  "IntegratorMixedDimensions::DeleteParamData");
778  }
779  _param_data.erase(it);
780 }
781 
782 /*******************************************************************************************/
783 
784 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR, int dimlow,
785  int dimhigh>
786 const std::map<std::string, const dealii::Vector<SCALAR>*>& IntegratorMixedDimensions<
787  INTEGRATORDATACONT, VECTOR, SCALAR, dimlow, dimhigh>::GetParamData() const
788 {
789  return _param_data;
790 }
791 /*******************************************************************************************/
792 
793 template<typename INTEGRATORDATACONT, typename VECTOR, typename SCALAR,
794  int dimlow, int dimhigh>
795  const INTEGRATORDATACONT&
797  {
798  return _idc;
799  }
800 
801 /*******************************************************************************************/
802 }
803 #endif
804 
void ComputeMatrix(PROBLEM &pde, MATRIX &matrix)
Definition: integratormixeddims.h:370
const std::map< std::string, const VECTOR * > & GetDomainData() const
Definition: integratormixeddims.h:743
IntegratorMixedDimensions(INTEGRATORDATACONT &idc)
Definition: integratormixeddims.h:133
const INTEGRATORDATACONT & GetIntegratorDataContainer() const
Definition: integratormixeddims.h:796
~IntegratorMixedDimensions()
Definition: integratormixeddims.h:142
const std::map< std::string, const dealii::Vector< SCALAR > * > & GetParamData() const
Definition: integratormixeddims.h:787
void ApplyNewtonBoundaryValues(PROBLEM &pde, VECTOR &u)
Definition: integratormixeddims.h:688
void ComputeNonlinearRhs(PROBLEM &pde, VECTOR &residual, bool apply_boundary_values=true)
Definition: integratormixeddims.h:269
virtual void value(const dealii::Point< dealdim > &p, const unsigned int component, const unsigned int dof_number, dealii::Vector< double > &local_vector) const =0
void ReInit()
Definition: integratormixeddims.h:151
void DeleteDomainData(std::string name)
Definition: integratormixeddims.h:726
void ComputeLocalControlConstraints(PROBLEM &pde, VECTOR &constraints)
Definition: integratormixeddims.h:381
Definition: facedatacontainer.h:48
SCALAR ComputeAlgebraicScalar(PROBLEM &pde)
Definition: integratormixeddims.h:601
SCALAR ComputeDomainScalar(PROBLEM &pde)
Definition: integratormixeddims.h:393
void DeleteParamData(std::string name)
Definition: integratormixeddims.h:769
void ApplyInitialBoundaryValues(PROBLEM &pde, VECTOR &u)
Definition: integratormixeddims.h:611
Definition: integratormixeddims.h:70
void ApplyTransposedInitialBoundaryValues(PROBLEM &pde, VECTOR &u, SCALAR scale)
Definition: integratormixeddims.h:621
void ComputeNonlinearResidual(PROBLEM &pde, VECTOR &residual, bool apply_boundary_values=true)
Definition: integratormixeddims.h:161
SCALAR ComputeFaceScalar(PROBLEM &pde)
Definition: integratormixeddims.h:538
Definition: transposeddirichletdatainterface.h:37
void AddDomainData(std::string name, const VECTOR *new_data)
Definition: integratormixeddims.h:710
Definition: dopeexception.h:35
SCALAR ComputeBoundaryScalar(PROBLEM &pde)
Definition: integratormixeddims.h:464
SCALAR ComputePointScalar(PROBLEM &pde)
Definition: integratormixeddims.h:444
void AddParamData(std::string name, const dealii::Vector< SCALAR > *new_data)
Definition: integratormixeddims.h:752