Flow123d  DF_patch_fe_darcy_complete-579fe1e
integral_acc.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file integral_acc.hh
15  * @brief
16  * @author David Flanderka
17  */
18 
19 #ifndef INTEGRAL_ACC_HH_
20 #define INTEGRAL_ACC_HH_
21 
22 #include <memory>
23 #include <armadillo>
24 #include "fem/eval_points.hh"
25 #include "fem/integral_points.hh"
26 #include "fem/element_cache_map.hh"
27 #include "mesh/range_wrapper.hh"
28 #include "mesh/accessors.hh"
29 #include "fem/dh_cell_accessor.hh"
30 #include "fem/patch_fe_values.hh"
31 #include "fem/op_function.hh"
32 #include "fem/op_accessors_impl.hh"
33 
34 
35 class BulkIntegral;
36 class EdgeIntegral;
37 class CouplingIntegral;
38 class BoundaryIntegral;
39 template <unsigned int qdim> class BulkIntegralAcc;
40 template <unsigned int qdim> class EdgeIntegralAcc;
41 template <unsigned int qdim> class CouplingIntegralAcc;
42 template <unsigned int qdim> class BoundaryIntegralAcc;
43 
44 
45 namespace internal {
46 
47 /**
48  * Base integral class holds common data members and methods.
49  */
50 class BaseIntegral {
51 public:
52  /// Default constructor
53  BaseIntegral() : eval_points_(nullptr), dim_(0) {}
54 
55  /// Constructor of bulk or side subset
56  BaseIntegral(std::shared_ptr<EvalPoints> eval_points, unsigned int dim)
58 
59  /// Destructor
60  virtual ~BaseIntegral();
61 
62  /// Getter of eval_points
63  std::shared_ptr<EvalPoints> eval_points() const {
64  return eval_points_;
65  }
66 
67  /// Returns dimension.
68  unsigned int dim() const {
69  return dim_;
70  }
71 protected:
72  /// Pointer to EvalPoints
73  std::shared_ptr<EvalPoints> eval_points_;
74  /// Dimension of the cell on which points are placed
75  unsigned int dim_;
76 };
77 
78 /**
79  * Provides methods that allows construction of operations..
80  */
81 template<unsigned int dim>
83 {
84 public:
85  // Default constructor
86  IntegralFactory() : patch_fe_values_(nullptr), element_cache_map_(nullptr), quad_(nullptr)
87  {}
88 
89  // Constructor
90  IntegralFactory(PatchFEValues<3> *pfev, ElementCacheMap *element_cache_map, std::shared_ptr< FiniteElement<dim> > fe, Quadrature *quad)
91  : patch_fe_values_(pfev), element_cache_map_(element_cache_map), fe_(fe), quad_(quad)
92  {}
93 
94  /// Factory method. Creates operation of given OpType.
95  template<class OpType>
97  return patch_fe_values_->get< OpType, dim >(quad_);
98  }
99 
100  /// Factory method. Creates element / side operation of given OpType.
101  template<class OpType>
103  return patch_fe_values_->get_for_elem_quad< OpType, dim >();
104  }
105 
106  /// Factory method. Same as previous but creates FE operation.
107  template<class ValueType, template<unsigned int, class, unsigned int> class OpType, class Domain>
108  FeQArray<ValueType> make_qarray(uint component_idx = 0) {
109  std::shared_ptr<FiniteElement<dim>> fe_component = patch_fe_values_->fe_comp(fe_, component_idx);
110  return FeQArray<ValueType>(patch_fe_values_->template get< OpType<dim, Domain, 3>, dim >(quad_, fe_component));
111  }
112 
115  std::shared_ptr< FiniteElement<dim> > fe_;
117 
118 };
119 
120 } // end of namespace internal
121 
122 
123 namespace internal_integrals {
124 
125 class Base {
126 public:
127  /// Default constructor
128  Base() : dim_(0), quad_(nullptr) {}
129 
130  /// Constructor of bulk or side subset
131  Base(Quadrature *quad, unsigned int dim)
132  : dim_(dim), quad_(quad) {}
133 
134  /// Destructor
135  virtual ~Base()
136  {}
137 
138  /// Returns dimension.
139  unsigned int dim() const {
140  return dim_;
141  }
142 
143  /// Returns quadrature.
144  Quadrature *quad() const {
145  return quad_;
146  }
147 
148  /// Comparison operator
149  bool operator==(const Base& other) const {
150  return (dim_ == other.dim_) && (quad()->size() == other.quad()->size());
151  }
152 protected:
153  /// Dimension of the cell on which points are placed
154  unsigned int dim_;
155  /// Pointer to Quadrature that represents quadrature points of integral.
157 };
158 
159 class Bulk : public Base {
160 public:
162  typedef unsigned int MeshItem;
163 
164  /// Default constructor
165  Bulk() : Base() {}
166 
167  /// Constructor of bulk integral- obsolete constructor
168  Bulk(Quadrature *quad, unsigned int dim, std::shared_ptr<EvalPoints> eval_points, unsigned int subset_idx)
169  : Base(quad, dim) {
170  subset_index_ = subset_idx;
171  begin_idx_ = eval_points->subset_begin(dim_, subset_index_);
172  end_idx_ = eval_points->subset_end(dim_, subset_index_);
173  }
174 
175  /// Destructor
177  {}
178 
179  /// Getter of bulk_begin
180  uint begin_idx() const {
181  return begin_idx_;
182  }
183 
184 private:
185  unsigned int subset_index_; ///< Index of data block according to subset in EvalPoints object.
186  uint begin_idx_; ///< Begin index of quadrature points in EvalPoinnts
187  uint end_idx_; ///< Begin index of quadrature points in EvalPoinnts
188 
189  friend class ::BulkIntegral;
190  friend class ::CouplingIntegral;
191  friend class ::BoundaryIntegral;
192  template <unsigned int qdim>
193  friend class ::BulkIntegralAcc;
194  template <unsigned int qdim>
195  friend class ::CouplingIntegralAcc;
196  template <unsigned int qdim>
197  friend class ::BoundaryIntegralAcc;
198 };
199 
200 class Edge : public Base {
201 public:
204 
205  /// Default constructor
206  Edge() : Base() {}
207 
208  /// Constructor of edge integral
209  Edge(Quadrature *quad, unsigned int dim, std::shared_ptr<EvalPoints> eval_points, unsigned int subset_idx)
210  : Base(quad, dim) {
211  subset_index_ = subset_idx;
212 
213  begin_idx_ = eval_points->subset_begin(dim_, subset_index_);
214  uint end_idx = eval_points->subset_end(dim_, subset_index_);
215  n_sides_ = dim_ + 1;
216  //DebugOut() << "begin: " << begin_idx_ << "end: " << end_idx;
217  n_points_per_side_ = (end_idx - begin_idx_) / n_sides_;
218  //DebugOut() << "points per side: " << n_points_per_side_;
219  }
220 
221  /// Destructor
223  {}
224 
225  inline uint side_begin(const DHCellSide &cell_side) const {
226  return begin_idx_ + cell_side.side_idx() * n_points_per_side_;
227  }
228 
229 private:
230  unsigned int subset_index_;
232 
233  /// Number of sides (value 0 indicates bulk set)
234  unsigned int n_sides_;
235  /// Number of points. TODO: pass this to the constructor, avoid extraction from the eval_points
237 
238  friend class ::EdgeIntegral;
239  friend class ::CouplingIntegral;
240  friend class ::BoundaryIntegral;
241  template <unsigned int qdim>
242  friend class ::EdgeIntegralAcc;
243  template <unsigned int qdim>
244  friend class ::CouplingIntegralAcc;
245  template <unsigned int qdim>
246  friend class ::BoundaryIntegralAcc;
247 };
248 
249 }
250 
251 
252 /**
253  * Integral class of bulk points, allows assemblation of volume integrals.
254  */
256 public:
257  /// Default constructor
259 
260  /// Constructor of bulk integral
261  BulkIntegral(std::shared_ptr<EvalPoints> eval_points, Quadrature *quad, unsigned int dim)
263  {
264  switch (dim) {
265  case 1:
266  internal_bulk_ = eval_points->add_bulk_internal<1>(quad);
267  break;
268  case 2:
269  internal_bulk_ = eval_points->add_bulk_internal<2>(quad);
270  break;
271  case 3:
272  internal_bulk_ = eval_points->add_bulk_internal<3>(quad);
273  break;
274  default:
275  ASSERT_PERMANENT(false);
276  }
277  }
278 
279  /// Destructor
280  ~BulkIntegral();
281 
282  /// Return index of data block according to subset in EvalPoints object
283  inline int get_subset_idx() const {
284  return internal_bulk_->subset_index_;
285  }
286 
287 
288  /// Returns range of bulk local points for appropriate cell accessor - obsolete method
289  inline Range< BulkPoint > points(unsigned int element_patch_idx, const ElementCacheMap *elm_cache_map) const {
290  auto bgn_it = make_iter<BulkPoint>( BulkPoint(elm_cache_map, element_patch_idx, internal_bulk_->begin_idx_));
291  auto end_it = make_iter<BulkPoint>( BulkPoint(elm_cache_map, element_patch_idx, internal_bulk_->end_idx_));
292  return Range<BulkPoint>(bgn_it, end_it);
293  }
294 
295 protected:
296  /// Internal integral object
297  std::shared_ptr<internal_integrals::Bulk> internal_bulk_;
298 };
299 
300 /**
301  * New Integral accessor class, replace of BulkIntegral, will be merged with BulkIntegral
302  *
303  * IN DEVELOPMENT
304  */
305 template<unsigned int qdim>
307 public:
308  /// Default constructor
310 
311  /// Constructor of bulk integral
312  BulkIntegralAcc(std::shared_ptr<EvalPoints> eval_points, Quadrature *quad, PatchFEValues<3> *pfev, ElementCacheMap *element_cache_map)
313  : BulkIntegral(eval_points, quad, qdim), factory_(pfev, element_cache_map, pfev->fe_dim<qdim>(), quad)
314  {
315  ASSERT_EQ(quad->dim(), qdim);
317  }
318 
319  /// Destructor
321  {}
322 
323  /// Returns range of bulk local points for appropriate cell accessor
324  inline Range< BulkPoint > points(unsigned int element_patch_idx) const {
325  auto bgn_it = make_iter<BulkPoint>( BulkPoint(factory_.element_cache_map_, element_patch_idx, internal_bulk_->begin_idx_));
326  auto end_it = make_iter<BulkPoint>( BulkPoint(factory_.element_cache_map_, element_patch_idx, internal_bulk_->end_idx_));
327  return Range<BulkPoint>(bgn_it, end_it);
328  }
329 
330  /**
331  * @brief Register the product of Jacobian determinant and the quadrature
332  * weight at bulk quadrature points.
333  *
334  * @param quad Quadrature.
335  */
336  inline FeQ<Scalar> JxW()
337  {
338  return FeQ<Scalar>(factory_.template make_patch_op< Op::JxW<qdim, Op::BulkDomain, 3> >());
339  }
340 
341  /// Create bulk accessor of coords entity
343  {
344  return FeQ<Vector>(factory_.template make_patch_op< Op::PtCoords<qdim, Op::BulkDomain, 3> >());
345  }
346 
347 // inline ElQ<Tensor> jacobian(std::initializer_list<Quadrature *> quad_list)
348 // {}
349 
350  /// Create bulk accessor of jac determinant entity
352  {
353  return ElQ<Scalar>( factory_.template make_elem_patch_op< Op::JacDet<qdim, Op::BulkDomain, 3> >() );
354  }
355 
356  /**
357  * @brief Return the value of the @p function_no-th shape function at
358  * the @p p bulk quadrature point.
359  *
360  * @param component_idx Number of the shape function.
361  */
362  inline FeQArray<Scalar> scalar_shape(uint component_idx = 0)
363  {
364  return factory_.template make_qarray<Scalar, Op::ScalarShape, Op::BulkDomain>(component_idx);
365  }
366 
367  /**
368  * @brief Return the value of the @p function_no-th vector shape function at
369  * the @p p bulk quadrature point.
370  *
371  * @param component_idx Number of the shape function.
372  */
373  inline FeQArray<Vector> vector_shape(uint component_idx = 0)
374  {
375  return factory_.template make_qarray<Vector, Op::DispatchVectorShape, Op::BulkDomain>(component_idx);
376  }
377 
378 // inline FeQArray<Tensor> tensor_shape(uint component_idx = 0)
379 // {}
380 
381  /**
382  * @brief Return the value of the @p function_no-th gradient shape function at
383  * the @p p bulk quadrature point.
384  *
385  * @param component_idx Number of the shape function.
386  */
387  inline FeQArray<Vector> grad_scalar_shape(uint component_idx=0)
388  {
389  return factory_.template make_qarray<Vector, Op::GradScalarShape, Op::BulkDomain>(component_idx);
390  }
391 
392  /**
393  * @brief Return the value of the @p function_no-th gradient vector shape function
394  * at the @p p bulk quadrature point.
395  *
396  * @param component_idx Number of the shape function.
397  */
398  inline FeQArray<Tensor> grad_vector_shape(uint component_idx=0)
399  {
400  return factory_.template make_qarray<Tensor, Op::DispatchGradVectorShape, Op::BulkDomain>(component_idx);
401  }
402 
403  /**
404  * @brief Return the value of the @p function_no-th vector symmetric gradient
405  * at the @p p bulk quadrature point.
406  *
407  * @param component_idx Number of the shape function.
408  */
409  inline FeQArray<Tensor> vector_sym_grad(uint component_idx=0)
410  {
411  return factory_.template make_qarray<Tensor, Op::VectorSymGrad, Op::BulkDomain>(component_idx);
412  }
413 
414  /**
415  * @brief Return the value of the @p function_no-th vector divergence at
416  * the @p p bulk quadrature point.
417  *
418  * @param component_idx Number of the shape function.
419  */
420  inline FeQArray<Scalar> vector_divergence(uint component_idx=0)
421  {
422  return factory_.template make_qarray<Scalar, Op::VectorDivergence, Op::BulkDomain>(component_idx);
423  }
424 
425 private:
426  /// Defines interface of operation accessors declaration
428 };
429 
430 /**
431  * Integral class of side points, allows assemblation of element - element fluxes.
432  */
434 public:
435  /// Default constructor
437  {
438  ASSERT_PERMANENT(false);
439  }
440 
441  /// Constructor of edge integral
442  EdgeIntegral(std::shared_ptr<EvalPoints> eval_points, Quadrature *quad, unsigned int dim)
444  {
445  switch (dim) {
446  case 1:
447  internal_edge_ = eval_points->add_edge_internal<1>(quad);
448  break;
449  case 2:
450  internal_edge_ = eval_points->add_edge_internal<2>(quad);
451  break;
452  case 3:
453  internal_edge_ = eval_points->add_edge_internal<3>(quad);
454  break;
455  default:
456  ASSERT(false).error("Should not happen!\n");
457  }
458  }
459 
460  /// Destructor
461  ~EdgeIntegral();
462 
463  /// Getter of n_sides
464  inline unsigned int n_sides() const {
465  return internal_edge_->n_sides_;
466  }
467 
468  /// Return index of data block according to subset in EvalPoints object
469  inline int get_subset_idx() const {
470  return internal_edge_->subset_index_;
471  }
472 
473  inline uint side_begin(const DHCellSide &cell_side) const {
474  return internal_edge_->side_begin(cell_side);
475  }
476 
477  /// Returns range of side local points for appropriate cell side accessor - obsolete method
478  inline Range< EdgePoint > points(const DHCellSide &cell_side, const ElementCacheMap *elm_cache_map) const {
479  ASSERT_EQ(cell_side.dim(), dim_);
480 
481  //DebugOut() << "points per side: " << internal_edge_->n_points_per_side_;
482  uint element_patch_idx = elm_cache_map->position_in_cache(cell_side.element().idx());
483  uint begin_idx = internal_edge_->side_begin(cell_side);
484  auto bgn_it = make_iter<EdgePoint>( EdgePoint(
485  BulkPoint(elm_cache_map, element_patch_idx, 0), internal_edge_, begin_idx));
486  auto end_it = make_iter<EdgePoint>( EdgePoint(
487  BulkPoint(elm_cache_map, element_patch_idx, internal_edge_->n_points_per_side_), internal_edge_, begin_idx));
488  return Range<EdgePoint>(bgn_it, end_it);
489  }
490 
491 
492 protected:
493  /// Internal integral object
494  std::shared_ptr<internal_integrals::Edge> internal_edge_;
495 
496  friend class EvalPoints;
497  friend class EdgePoint;
498  friend class CouplingPoint;
499  friend class BoundaryPoint;
500  friend class CouplingIntegral;
501  friend class BoundaryIntegral;
502  template<unsigned int qdim>
503  friend class CouplingIntegralAcc;
504  template<unsigned int qdim>
505  friend class BoundaryIntegralAcc;
506 };
507 
508 /**
509  * New Integral accessor class, replace of EdgeIntegral, will be merged with EdgeIntegral
510  *
511  * IN DEVELOPMENT
512  */
513 template<unsigned int qdim>
515 public:
516  /// Default constructor
518 
519  /// Constructor of edge integral
520  EdgeIntegralAcc(std::shared_ptr<EvalPoints> eval_points, Quadrature *quad, PatchFEValues<3> *pfev, ElementCacheMap *element_cache_map)
521  : EdgeIntegral(eval_points, quad, qdim), factory_(pfev, element_cache_map, pfev->fe_dim<qdim>(), quad)
522  {
523  ASSERT_EQ(quad->dim()+1, qdim);
525  }
526 
527 
528  /// Destructor
530  {}
531 
532  /// Returns range of side local points for appropriate cell side accessor
533  inline Range< EdgePoint > points(const DHCellSide &cell_side) const {
534  ASSERT_EQ(cell_side.dim(), dim_);
535 
536  //DebugOut() << "points per side: " << internal_edge_->n_points_per_side_;
537  uint element_patch_idx = factory_.element_cache_map_->position_in_cache(cell_side.element().idx());
538  uint begin_idx = internal_edge_->side_begin(cell_side);
539  auto bgn_it = make_iter<EdgePoint>( EdgePoint(
540  BulkPoint(factory_.element_cache_map_, element_patch_idx, 0), this->internal_edge_, begin_idx));
541  auto end_it = make_iter<EdgePoint>( EdgePoint(
542  BulkPoint(factory_.element_cache_map_, element_patch_idx, internal_edge_->n_points_per_side_), this->internal_edge_, begin_idx));
543  return Range<EdgePoint>(bgn_it, end_it);
544  }
545 
546  /// Same as BulkValues::JxW but register at side quadrature points.
547  inline FeQ<Scalar> JxW()
548  {
549  return FeQ<Scalar>(factory_.template make_patch_op< Op::JxW<qdim, Op::SideDomain, 3> >());
550  }
551 
552  /**
553  * @brief Register the normal vector to a side at side quadrature points.
554  *
555  * @param quad Quadrature.
556  */
558  {
559  return ElQ<Vector>(factory_.template make_elem_patch_op< Op::NormalVec<qdim, 3> >());
560  }
561 
562  /// Create side accessor of coords entity
564  {
565  return FeQ<Vector>(factory_.template make_patch_op< Op::PtCoords<qdim, Op::SideDomain, 3> >());
566  }
567 
568  /// Create bulk accessor of jac determinant entity
570  {
571  return ElQ<Scalar>(factory_.template make_patch_op< Op::JacDet<qdim, Op::SideDomain, 3> >());
572  }
573 
574  /// Same as BulkValues::scalar_shape but register at side quadrature points.
575  inline FeQArray<Scalar> scalar_shape(uint component_idx = 0)
576  {
577  return factory_.template make_qarray<Scalar, Op::ScalarShape, Op::SideDomain>(component_idx);
578  }
579 
580  /// Same as BulkValues::vector_shape but register at side quadrature points.
581  inline FeQArray<Vector> vector_shape(uint component_idx = 0)
582  {
583  return factory_.template make_qarray<Vector, Op::DispatchVectorShape, Op::SideDomain>(component_idx);
584  }
585 
586  /// Same as BulkValues::grad_scalar_shape but register at side quadrature points.
587  inline FeQArray<Vector> grad_scalar_shape(uint component_idx=0)
588  {
589  return factory_.template make_qarray<Vector, Op::GradScalarShape, Op::SideDomain>(component_idx);
590  }
591 
592  /**
593  * @brief Return the value of the @p function_no-th gradient vector shape function
594  * at the @p p bulk quadrature point.
595  *
596  * @param component_idx Number of the shape function.
597  */
598  inline FeQArray<Tensor> grad_vector_shape(uint component_idx=0)
599  {
600  return factory_.template make_qarray<Tensor, Op::DispatchGradVectorShape, Op::SideDomain>(component_idx);
601  }
602 
603  /**
604  * @brief Return the value of the @p function_no-th vector symmetric gradient
605  * at the @p p side quadrature point.
606  *
607  * @param component_idx Number of the shape function.
608  */
609  inline FeQArray<Tensor> vector_sym_grad(uint component_idx=0)
610  {
611  return factory_.template make_qarray<Tensor, Op::VectorSymGrad, Op::SideDomain>(component_idx);
612  }
613 
614  /**
615  * @brief Return the value of the @p function_no-th vector divergence at
616  * the @p p side quadrature point.
617  *
618  * @param component_idx Number of the shape function.
619  */
620  inline FeQArray<Scalar> vector_divergence(uint component_idx=0)
621  {
622  return factory_.template make_qarray<Scalar, Op::VectorDivergence, Op::SideDomain>(component_idx);
623  }
624 
625 private:
626  /// Defines interface of operation accessors declaration
628 
629  friend class EvalPoints;
630  friend class EdgePoint;
631  friend class CouplingPoint;
632  friend class BoundaryPoint;
633  template <unsigned int quaddim>
634  friend class CouplingIntegralAcc;
635  template <unsigned int quaddim>
636  friend class BoundaryIntegralAcc;
637 };
638 
639 
640 /**
641  * Integral class of neighbour points, allows assemblation of element - side fluxes.
642  *
643  * Dimension corresponds with element of higher dim.
644  */
646 public:
647  /// Default constructor
649 
650  /// Constructor of ngh integral
651  CouplingIntegral(std::shared_ptr<EvalPoints> eval_points, Quadrature *quad, unsigned int dim)
653  {
654  switch (dim) {
655  case 1:
656  internal_bulk_ = eval_points->add_bulk_internal<1>(quad);
657  internal_edge_ = eval_points->add_edge_internal<2>(quad);
658  break;
659  case 2:
660  internal_bulk_ = eval_points->add_bulk_internal<2>(quad);
661  internal_edge_ = eval_points->add_edge_internal<3>(quad);
662  break;
663  default:
664  ASSERT(false)(dim).error("Should not happen!\n");
665  }
666  }
667 
668  /// Destructor
670 
671  /// Return index of data block according to subset of higher dim in EvalPoints object
672  inline int get_subset_high_idx() const {
673  return internal_edge_->subset_index_;
674  }
675 
676  /// Return index of data block according to subset of lower dim in EvalPoints object
677  inline int get_subset_low_idx() const {
678  return internal_bulk_->subset_index_;
679  }
680 
681  inline uint bulk_begin() const {
682  return eval_points_->subset_begin(dim_-1, internal_bulk_->subset_index_);
683  }
684 
685  /// Returns range of side local points for appropriate cell side accessor - obsolete method
686  inline Range< CouplingPoint > points(const DHCellSide &cell_side, const ElementCacheMap *elm_cache_map) const {
687  ASSERT_EQ(cell_side.dim(), dim_+1);
688  uint element_patch_idx = elm_cache_map->position_in_cache(cell_side.element().idx());
689  uint side_begin = internal_edge_->side_begin(cell_side);
690  auto bgn_it = make_iter<CouplingPoint>( CouplingPoint(
691  BulkPoint(elm_cache_map, element_patch_idx, 0), internal_bulk_, side_begin) );
692  auto end_it = make_iter<CouplingPoint>( CouplingPoint(
693  BulkPoint(elm_cache_map, element_patch_idx, internal_edge_->n_points_per_side_), internal_bulk_, side_begin) );;
694  return Range<CouplingPoint>(bgn_it, end_it);
695  }
696 
697 protected:
698  /// Integral according to bulk subset part (element of lower dim) in EvalPoints object.
699  std::shared_ptr<internal_integrals::Bulk> internal_bulk_;
700  /// Integral according to side subset part (element of higher dim) in EvalPoints object.
701  std::shared_ptr<internal_integrals::Edge> internal_edge_;
702 
703  friend class CouplingPoint;
704 };
705 
706 template<unsigned int qdim>
708 public:
709  /// Default constructor
711 
712  /// Constructor of ngh integral
713  CouplingIntegralAcc(std::shared_ptr<EvalPoints> eval_points, Quadrature *quad, PatchFEValues<3> *pfev, ElementCacheMap *element_cache_map)
714  : CouplingIntegral(eval_points, quad, qdim),
715  factory_(pfev, element_cache_map, pfev->fe_dim<qdim>(), quad),
716  factory_high_(pfev, element_cache_map, pfev->fe_dim<qdim+1>(), quad)
717  {
718  ASSERT_EQ(quad->dim(), qdim);
721  }
722 
723  /// Destructor
725  {
726  internal_bulk_.reset();
727  internal_edge_.reset();
728  }
729 
730  /// Return index of data block according to subset of higher dim in EvalPoints object
731  inline int get_subset_high_idx() const {
732  return internal_edge_->subset_index_;
733  }
734 
735  /// Return index of data block according to subset of lower dim in EvalPoints object
736  inline int get_subset_low_idx() const {
737  return internal_bulk_->subset_index_;
738  }
739 
740  inline uint bulk_begin() const {
741  return internal_bulk_->begin_idx_;
742  }
743 
744  /// Returns range of side local points for appropriate cell side accessor
745  inline Range< CouplingPoint > points(const DHCellSide &cell_side) const {
746  ASSERT_EQ(cell_side.dim(), dim_+1);
747 
748  uint element_patch_idx = factory_.element_cache_map_->position_in_cache(cell_side.element().idx());
749  uint side_begin = internal_edge_->side_begin(cell_side);
750  auto bgn_it = make_iter<CouplingPoint>( CouplingPoint(
751  BulkPoint(factory_.element_cache_map_, element_patch_idx, 0), internal_bulk_, side_begin) );
752  auto end_it = make_iter<CouplingPoint>( CouplingPoint(
753  BulkPoint(factory_.element_cache_map_, element_patch_idx, internal_edge_->n_points_per_side_), internal_bulk_, side_begin) );;
754  return Range<CouplingPoint>(bgn_it, end_it);
755  }
756 
757  /// Factory method. Same as previous but creates FE operation.
758  template<class ValueType, template<unsigned int, class, unsigned int> class OpType>
759  FeQJoin<ValueType> make_qjoin(uint component_idx = 0) {
760  // element of lower dim (bulk points)
761  auto fe_component_low = factory_.patch_fe_values_->fe_comp(factory_.fe_, component_idx);
762  auto *low_dim_op = factory_.patch_fe_values_->template get< OpType<qdim, Op::BulkDomain, 3>, qdim >(factory_.quad_, fe_component_low);
763  auto *low_dim_zero_op = factory_.patch_fe_values_->template get< Op::OpZero<qdim, Op::BulkDomain, 3>, qdim >(factory_.quad_, fe_component_low);
764 
765  // element of higher dim (side points)
766  auto fe_component_high = factory_.patch_fe_values_->fe_comp(factory_high_.fe_, component_idx);
767  auto *high_dim_op = factory_.patch_fe_values_->template get< OpType<qdim+1, Op::SideDomain, 3>, qdim+1 >(factory_.quad_, fe_component_high);
768  auto *high_dim_zero_op = factory_.patch_fe_values_->template get< Op::OpZero<qdim+1, Op::SideDomain, 3>, qdim+1 >(factory_.quad_, fe_component_high);
769 
770  ASSERT_EQ(fe_component_high->fe_type(), fe_component_low->fe_type()).error("Type of FiniteElement of low and high element must be same!\n");
771  return FeQJoin<ValueType>(low_dim_op, high_dim_op, low_dim_zero_op, high_dim_zero_op);
772  }
773 
774  /// Same as BulkValues::JxW but register at side quadrature points.
775  inline FeQ<Scalar> JxW()
776  {
777  return FeQ<Scalar>(factory_high_.template make_patch_op< Op::JxW<qdim+1, Op::SideDomain, 3> >());
778  }
779 
780  /**
781  * @brief Register the normal vector to a side at side quadrature points.
782  *
783  * @param quad Quadrature.
784  */
786  {
787  return ElQ<Vector>(factory_high_.template make_elem_patch_op< Op::NormalVec<qdim+1, 3> >());
788  }
789 
790  inline FeQArray<Vector> vector_shape(uint component_idx = 0)
791  {
792  return factory_high_.template make_qarray<Vector, Op::DispatchVectorShape, Op::SideDomain>(component_idx); // error
793  }
794 
795  inline FeQJoin<Scalar> scalar_join_shape(uint component_idx = 0)
796  {
797  return this->template make_qjoin<Scalar, Op::ScalarShape>(component_idx);
798  }
799 
800  inline FeQJoin<Vector> vector_join_shape(uint component_idx = 0)
801  {
802  return this->template make_qjoin<Vector, Op::DispatchVectorShape>(component_idx);
803  }
804 
806  {
807  return this->template make_qjoin<Tensor, Op::DispatchGradVectorShape>(component_idx);
808  }
809 
810 
811 private:
812  /// Defines interface of operation accessors declaration
814 
815  /// Same as prefious but for element of higher dim
817 
818  friend class CouplingPoint;
819 };
820 
821 /// Template specialization of previous class
822 template<>
824 public:
825  /// Default constructor
827 
828  /// Constructor of ngh integral
829  CouplingIntegralAcc(std::shared_ptr<EvalPoints> eval_points, Quadrature *quad, PatchFEValues<3> *pfev, ElementCacheMap *element_cache_map)
830  : CouplingIntegral(),
831  factory_(pfev, element_cache_map, pfev->fe_dim<3>(), quad)
832  {
833  ASSERT_EQ(quad->dim(), 3);
834  this->eval_points_ = eval_points;
835  this->dim_ = 3;
836  }
837 
838  /// Destructor
840  {}
841 
842  /// Returns empty point range
843  inline Range< CouplingPoint > points(FMT_UNUSED const DHCellSide &cell_side) const {
844  auto iter = make_iter<CouplingPoint>( CouplingPoint() );
845  return Range<CouplingPoint>(iter, iter);
846  }
847 
848  /// Define empty operations
849  inline FeQ<Scalar> JxW()
850  {
851  return FeQ<Scalar>();
852  }
853 
855  {
856  return ElQ<Vector>();
857  }
858 
859  inline FeQArray<Vector> vector_shape(FMT_UNUSED uint component_idx = 0)
860  {
861  return FeQArray<Vector>();
862  }
863 
865  {
866  return FeQJoin<Scalar>();
867  }
868 
870  {
871  return FeQJoin<Vector>();
872  }
873 
875  {
876  return FeQJoin<Tensor>();
877  }
878 
879 private:
880  /// Defines interface of operation accessors declaration
882 };
883 
884 
885 /**
886  * Integral class of boundary points, allows assemblation of fluxes between sides and neighbouring boundary elements.
887  */
889 public:
890  /// Default constructor
891  BoundaryIntegral() : internal::BaseIntegral() {}
892 
893  /// Constructor of bulk subset
894  BoundaryIntegral(std::shared_ptr<EvalPoints> eval_points, Quadrature *quad, unsigned int dim);
895 
896  /// Destructor
897  ~BoundaryIntegral();
898 
899  /// Return index of data block according to subset of higher dim in EvalPoints object
900  inline int get_subset_high_idx() const {
901  return internal_edge_->subset_index_;
902  }
903 
904  /// Return index of data block according to subset of lower dim (boundary) in EvalPoints object
905  inline int get_subset_low_idx() const {
906  return internal_bulk_->subset_index_;
907  }
908 
909  inline uint bulk_begin() const {
910  // DebugOut().fmt("edge_begin: {} bdr_begin: {}",
911  // internal_bulk_->get_begin_idx(),
912  // internal_bulk_->get_begin_idx());
913  return internal_bulk_->begin_idx_;
914  }
915 
916  /// Returns range of bulk local points for appropriate cell accessor - obsolete method
917  inline Range< BoundaryPoint > points(const DHCellSide &cell_side, const ElementCacheMap *elm_cache_map) const {
918  ASSERT_EQ(cell_side.dim(), dim_);
919  uint element_patch_idx = elm_cache_map->position_in_cache(cell_side.element().idx());
920  uint side_begin = internal_edge_->side_begin(cell_side);
921  auto bgn_it = make_iter<BoundaryPoint>( BoundaryPoint(
922  BulkPoint(elm_cache_map, element_patch_idx, 0), internal_bulk_, side_begin) );
923  auto end_it = make_iter<BoundaryPoint>( BoundaryPoint(
924  BulkPoint(elm_cache_map, element_patch_idx, internal_edge_->n_points_per_side_), internal_bulk_, side_begin) );;
925  return Range<BoundaryPoint>(bgn_it, end_it);
926  }
927 
928 protected:
929  /// Integral according to kower dim (boundary) element subset part in EvalPoints object.
930  std::shared_ptr<internal_integrals::Bulk> internal_bulk_;
931  /// Integral according to higher dim (bulk) element subset part in EvalPoints object.
932  std::shared_ptr<internal_integrals::Edge> internal_edge_;
933 
934  friend class BoundaryPoint;
935 };
936 
937 
938 template<unsigned int qdim>
940 public:
941  /// Default constructor
943 
944  BoundaryIntegralAcc(std::shared_ptr<EvalPoints> eval_points, Quadrature *quad, PatchFEValues<3> *pfev, ElementCacheMap *element_cache_map)
945  : BoundaryIntegral(eval_points, quad, qdim), factory_(pfev, element_cache_map, pfev->fe_dim<qdim>(), quad)
946  {
947  ASSERT_EQ(quad->dim()+1, qdim);
949  }
950 
951  /// Destructor
953  {}
954 
955  /// Returns range of bulk local points for appropriate cell accessor
956  inline Range< BoundaryPoint > points(const DHCellSide &cell_side) const {
957  ASSERT_EQ(cell_side.dim(), dim_);
958 
959  uint element_patch_idx = factory_.element_cache_map_->position_in_cache(cell_side.element().idx());
960  uint side_begin = internal_edge_->side_begin(cell_side);
961  auto bgn_it = make_iter<BoundaryPoint>( BoundaryPoint(
962  BulkPoint(factory_.element_cache_map_, element_patch_idx, 0), internal_bulk_, side_begin) );
963  auto end_it = make_iter<BoundaryPoint>( BoundaryPoint(
964  BulkPoint(factory_.element_cache_map_, element_patch_idx, internal_edge_->n_points_per_side_), internal_bulk_, side_begin) );;
965  return Range<BoundaryPoint>(bgn_it, end_it);
966  }
967 
968  /// Same as BulkValues::JxW but register at side quadrature points.
969  inline FeQ<Scalar> JxW()
970  {
971  return FeQ<Scalar>(factory_.template make_patch_op< Op::JxW<qdim, Op::SideDomain, 3> >());
972  }
973 
974  /**
975  * @brief Register the normal vector to a side at side quadrature points.
976  *
977  * @param quad Quadrature.
978  */
980  {
981  return ElQ<Vector>(factory_.template make_elem_patch_op< Op::NormalVec<qdim, 3> >());
982  }
983 
984  /// Create side accessor of coords entity
986  {
987  return FeQ<Vector>(factory_.template make_patch_op< Op::PtCoords<qdim, Op::SideDomain, 3> >());
988  }
989 
990  /// Create bulk accessor of jac determinant entity
992  {
993  return ElQ<Scalar>(factory_.template make_patch_op< Op::JacDet<qdim, Op::SideDomain, 3> >());
994  }
995 
996  /// Same as BulkValues::scalar_shape but register at side quadrature points.
997  inline FeQArray<Scalar> scalar_shape(uint component_idx = 0)
998  {
999  return factory_.template make_qarray<Scalar, Op::ScalarShape, Op::SideDomain>(component_idx);
1000  }
1001 
1002  /// Same as BulkValues::vector_shape but register at side quadrature points.
1003  inline FeQArray<Vector> vector_shape(uint component_idx = 0)
1004  {
1005  return factory_.template make_qarray<Vector, Op::DispatchVectorShape, Op::SideDomain>(component_idx);
1006  }
1007 
1008  /// Same as BulkValues::grad_scalar_shape but register at side quadrature points.
1009  inline FeQArray<Vector> grad_scalar_shape(uint component_idx=0)
1010  {
1011  return factory_.template make_qarray<Vector, Op::GradScalarShape, Op::SideDomain>(component_idx);
1012  }
1013 
1014  /**
1015  * @brief Return the value of the @p function_no-th gradient vector shape function
1016  * at the @p p bulk quadrature point.
1017  *
1018  * @param component_idx Number of the shape function.
1019  */
1020  inline FeQArray<Tensor> grad_vector_shape(uint component_idx=0)
1021  {
1022  return factory_.template make_qarray<Tensor, Op::DispatchGradVectorShape, Op::SideDomain>(component_idx);
1023  }
1024 
1025  /**
1026  * @brief Return the value of the @p function_no-th vector symmetric gradient
1027  * at the @p p side quadrature point.
1028  *
1029  * @param component_idx Number of the shape function.
1030  */
1031  inline FeQArray<Tensor> vector_sym_grad(uint component_idx=0)
1032  {
1033  return factory_.template make_qarray<Tensor, Op::VectorSymGrad, Op::SideDomain>(component_idx);
1034  }
1035 
1036  /**
1037  * @brief Return the value of the @p function_no-th vector divergence at
1038  * the @p p side quadrature point.
1039  *
1040  * @param component_idx Number of the shape function.
1041  */
1042  inline FeQArray<Scalar> vector_divergence(uint component_idx=0)
1043  {
1044  return factory_.template make_qarray<Scalar, Op::VectorDivergence, Op::SideDomain>(component_idx);
1045  }
1046 
1047 private:
1048  /// Defines interface of operation accessors declaration
1050 
1051  friend class BoundaryPoint;
1052 };
1053 
1054 
1055 #endif /* INTEGRAL_ACC_HH_ */
#define ASSERT(expr)
Definition: asserts.hh:351
#define ASSERT_PERMANENT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
Definition: asserts.hh:348
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:333
FeQArray< Vector > grad_scalar_shape(uint component_idx=0)
Same as BulkValues::grad_scalar_shape but register at side quadrature points.
internal::IntegralFactory< qdim > factory_
Defines interface of operation accessors declaration.
Range< BoundaryPoint > points(const DHCellSide &cell_side) const
Returns range of bulk local points for appropriate cell accessor.
BoundaryIntegralAcc()
Default constructor.
FeQArray< Tensor > grad_vector_shape(uint component_idx=0)
Return the value of the function_no-th gradient vector shape function at the p bulk quadrature point.
~BoundaryIntegralAcc()
Destructor.
FeQ< Vector > coords()
Create side accessor of coords entity.
FeQArray< Tensor > vector_sym_grad(uint component_idx=0)
Return the value of the function_no-th vector symmetric gradient at the p side quadrature point.
FeQArray< Vector > vector_shape(uint component_idx=0)
Same as BulkValues::vector_shape but register at side quadrature points.
FeQArray< Scalar > scalar_shape(uint component_idx=0)
Same as BulkValues::scalar_shape but register at side quadrature points.
FeQ< Scalar > JxW()
Same as BulkValues::JxW but register at side quadrature points.
FeQArray< Scalar > vector_divergence(uint component_idx=0)
Return the value of the function_no-th vector divergence at the p side quadrature point.
friend class BoundaryPoint
ElQ< Scalar > determinant()
Create bulk accessor of jac determinant entity.
ElQ< Vector > normal_vector()
Register the normal vector to a side at side quadrature points.
BoundaryIntegralAcc(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map)
Range< BoundaryPoint > points(const DHCellSide &cell_side, const ElementCacheMap *elm_cache_map) const
Returns range of bulk local points for appropriate cell accessor - obsolete method.
int get_subset_low_idx() const
Return index of data block according to subset of lower dim (boundary) in EvalPoints object.
BoundaryIntegral()
Default constructor.
std::shared_ptr< internal_integrals::Bulk > internal_bulk_
Integral according to kower dim (boundary) element subset part in EvalPoints object.
friend class BoundaryPoint
int get_subset_high_idx() const
Return index of data block according to subset of higher dim in EvalPoints object.
std::shared_ptr< internal_integrals::Edge > internal_edge_
Integral according to higher dim (bulk) element subset part in EvalPoints object.
uint bulk_begin() const
Point accessor allow iterate over quadrature points of given side defined in local element coordinate...
BulkIntegralAcc(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map)
Constructor of bulk integral.
FeQArray< Scalar > scalar_shape(uint component_idx=0)
Return the value of the function_no-th shape function at the p bulk quadrature point.
FeQArray< Vector > grad_scalar_shape(uint component_idx=0)
Return the value of the function_no-th gradient shape function at the p bulk quadrature point.
FeQ< Scalar > JxW()
Register the product of Jacobian determinant and the quadrature weight at bulk quadrature points.
ElQ< Scalar > determinant()
Create bulk accessor of jac determinant entity.
FeQArray< Tensor > grad_vector_shape(uint component_idx=0)
Return the value of the function_no-th gradient vector shape function at the p bulk quadrature point.
FeQArray< Tensor > vector_sym_grad(uint component_idx=0)
Return the value of the function_no-th vector symmetric gradient at the p bulk quadrature point.
FeQ< Vector > coords()
Create bulk accessor of coords entity.
Range< BulkPoint > points(unsigned int element_patch_idx) const
Returns range of bulk local points for appropriate cell accessor.
FeQArray< Vector > vector_shape(uint component_idx=0)
Return the value of the function_no-th vector shape function at the p bulk quadrature point.
BulkIntegralAcc()
Default constructor.
internal::IntegralFactory< qdim > factory_
Defines interface of operation accessors declaration.
~BulkIntegralAcc()
Destructor.
FeQArray< Scalar > vector_divergence(uint component_idx=0)
Return the value of the function_no-th vector divergence at the p bulk quadrature point.
int get_subset_idx() const
Return index of data block according to subset in EvalPoints object.
~BulkIntegral()
Destructor.
Definition: integral_acc.cc:38
Range< BulkPoint > points(unsigned int element_patch_idx, const ElementCacheMap *elm_cache_map) const
Returns range of bulk local points for appropriate cell accessor - obsolete method.
BulkIntegral()
Default constructor.
BulkIntegral(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, unsigned int dim)
Constructor of bulk integral.
std::shared_ptr< internal_integrals::Bulk > internal_bulk_
Internal integral object.
Base point accessor class.
Template specialization of previous class.
CouplingIntegralAcc()
Default constructor.
ElQ< Vector > normal_vector()
FeQJoin< Scalar > scalar_join_shape(FMT_UNUSED uint component_idx=0)
CouplingIntegralAcc(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map)
Constructor of ngh integral.
FeQArray< Vector > vector_shape(FMT_UNUSED uint component_idx=0)
FeQJoin< Vector > vector_join_shape(FMT_UNUSED uint component_idx=0)
~CouplingIntegralAcc()
Destructor.
FeQ< Scalar > JxW()
Define empty operations.
FeQJoin< Tensor > gradient_vector_join_shape(FMT_UNUSED uint component_idx=0)
Range< CouplingPoint > points(FMT_UNUSED const DHCellSide &cell_side) const
Returns empty point range.
internal::IntegralFactory< 3 > factory_
Defines interface of operation accessors declaration.
FeQJoin< Scalar > scalar_join_shape(uint component_idx=0)
FeQJoin< Tensor > gradient_vector_join_shape(uint component_idx=0)
CouplingIntegralAcc(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map)
Constructor of ngh integral.
~CouplingIntegralAcc()
Destructor.
int get_subset_low_idx() const
Return index of data block according to subset of lower dim in EvalPoints object.
FeQJoin< ValueType > make_qjoin(uint component_idx=0)
Factory method. Same as previous but creates FE operation.
FeQ< Scalar > JxW()
Same as BulkValues::JxW but register at side quadrature points.
ElQ< Vector > normal_vector()
Register the normal vector to a side at side quadrature points.
internal::IntegralFactory< qdim+1 > factory_high_
Same as prefious but for element of higher dim.
uint bulk_begin() const
Range< CouplingPoint > points(const DHCellSide &cell_side) const
Returns range of side local points for appropriate cell side accessor.
FeQJoin< Vector > vector_join_shape(uint component_idx=0)
CouplingIntegralAcc()
Default constructor.
internal::IntegralFactory< qdim > factory_
Defines interface of operation accessors declaration.
int get_subset_high_idx() const
Return index of data block according to subset of higher dim in EvalPoints object.
friend class CouplingPoint
FeQArray< Vector > vector_shape(uint component_idx=0)
Range< CouplingPoint > points(const DHCellSide &cell_side, const ElementCacheMap *elm_cache_map) const
Returns range of side local points for appropriate cell side accessor - obsolete method.
int get_subset_high_idx() const
Return index of data block according to subset of higher dim in EvalPoints object.
uint bulk_begin() const
int get_subset_low_idx() const
Return index of data block according to subset of lower dim in EvalPoints object.
CouplingIntegral()
Default constructor.
std::shared_ptr< internal_integrals::Edge > internal_edge_
Integral according to side subset part (element of higher dim) in EvalPoints object.
std::shared_ptr< internal_integrals::Bulk > internal_bulk_
Integral according to bulk subset part (element of lower dim) in EvalPoints object.
~CouplingIntegral()
Destructor.
Definition: integral_acc.cc:55
CouplingIntegral(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, unsigned int dim)
Constructor of ngh integral.
friend class CouplingPoint
Point accessor allow iterate over quadrature points of given side defined in local element coordinate...
Side accessor allows to iterate over sides of DOF handler cell.
unsigned int dim() const
Return dimension of element appropriate to the side.
ElementAccessor< 3 > element() const
unsigned int side_idx() const
FeQArray< Scalar > scalar_shape(uint component_idx=0)
Same as BulkValues::scalar_shape but register at side quadrature points.
internal::IntegralFactory< qdim > factory_
Defines interface of operation accessors declaration.
EdgeIntegralAcc(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map)
Constructor of edge integral.
ElQ< Vector > normal_vector()
Register the normal vector to a side at side quadrature points.
FeQArray< Vector > grad_scalar_shape(uint component_idx=0)
Same as BulkValues::grad_scalar_shape but register at side quadrature points.
~EdgeIntegralAcc()
Destructor.
Range< EdgePoint > points(const DHCellSide &cell_side) const
Returns range of side local points for appropriate cell side accessor.
ElQ< Scalar > determinant()
Create bulk accessor of jac determinant entity.
FeQArray< Scalar > vector_divergence(uint component_idx=0)
Return the value of the function_no-th vector divergence at the p side quadrature point.
EdgeIntegralAcc()
Default constructor.
FeQ< Scalar > JxW()
Same as BulkValues::JxW but register at side quadrature points.
FeQArray< Vector > vector_shape(uint component_idx=0)
Same as BulkValues::vector_shape but register at side quadrature points.
FeQArray< Tensor > grad_vector_shape(uint component_idx=0)
Return the value of the function_no-th gradient vector shape function at the p bulk quadrature point.
FeQ< Vector > coords()
Create side accessor of coords entity.
friend class EdgePoint
FeQArray< Tensor > vector_sym_grad(uint component_idx=0)
Return the value of the function_no-th vector symmetric gradient at the p side quadrature point.
int get_subset_idx() const
Return index of data block according to subset in EvalPoints object.
EdgeIntegral()
Default constructor.
std::shared_ptr< internal_integrals::Edge > internal_edge_
Internal integral object.
EdgeIntegral(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, unsigned int dim)
Constructor of edge integral.
unsigned int n_sides() const
Getter of n_sides.
~EdgeIntegral()
Destructor.
Definition: integral_acc.cc:47
Range< EdgePoint > points(const DHCellSide &cell_side, const ElementCacheMap *elm_cache_map) const
Returns range of side local points for appropriate cell side accessor - obsolete method.
friend class EdgePoint
uint side_begin(const DHCellSide &cell_side) const
Point accessor allow iterate over quadrature points of given side defined in local element coordinate...
unsigned int idx() const
We need this method after replacing Region by RegionIdx, and movinf RegionDB instance into particular...
Definition: accessors.hh:215
Directing class of FieldValueCache.
unsigned int position_in_cache(unsigned mesh_elm_idx, bool bdr=false) const
Return position of element stored in ElementCacheMap.
Class holds local coordinations of evaluating points (bulk and sides) specified by element dimension.
Definition: eval_points.hh:54
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
Evaluates Jacobian determinants on Bulk (Element) / Side.
Definition: op_function.hh:130
Evaluates normal vector on side quadrature points.
Definition: op_function.hh:355
Evaluates coordinates of quadrature points - not implemented yet.
Definition: op_function.hh:236
PatchOp< spacedim > * get_for_elem_quad()
Returns operation of given dim and OpType, creates it if doesn't exist.
PatchOp< spacedim > * get(const Quadrature *quad)
Returns operation of given dim and OpType, creates it if doesn't exist.
void set_used_domain(fem_domain domain)
Mark domain (bulk or side) as used in assembly class.
std::shared_ptr< FiniteElement< dim > > fe_comp(std::shared_ptr< FiniteElement< dim > > fe, uint component_idx)
Returnd FiniteElement of component_idx for FESystem or fe for other types.
Base class for quadrature rules on simplices in arbitrary dimensions.
Definition: quadrature.hh:48
unsigned int size() const
Returns number of quadrature points.
Definition: quadrature.hh:86
unsigned int dim() const
Definition: quadrature.hh:72
Range helper class.
BaseIntegral(std::shared_ptr< EvalPoints > eval_points, unsigned int dim)
Constructor of bulk or side subset.
Definition: integral_acc.hh:56
std::shared_ptr< EvalPoints > eval_points() const
Getter of eval_points.
Definition: integral_acc.hh:63
unsigned int dim_
Dimension of the cell on which points are placed.
Definition: integral_acc.hh:75
BaseIntegral()
Default constructor.
Definition: integral_acc.hh:53
std::shared_ptr< EvalPoints > eval_points_
Pointer to EvalPoints.
Definition: integral_acc.hh:73
unsigned int dim() const
Returns dimension.
Definition: integral_acc.hh:68
virtual ~BaseIntegral()
Destructor.
Definition: integral_acc.cc:29
FeQArray< ValueType > make_qarray(uint component_idx=0)
Factory method. Same as previous but creates FE operation.
ElementCacheMap * element_cache_map_
PatchOp< 3 > * make_patch_op()
Factory method. Creates operation of given OpType.
Definition: integral_acc.hh:96
IntegralFactory(PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map, std::shared_ptr< FiniteElement< dim > > fe, Quadrature *quad)
Definition: integral_acc.hh:90
PatchOp< 3 > * make_elem_patch_op()
Factory method. Creates element / side operation of given OpType.
std::shared_ptr< FiniteElement< dim > > fe_
PatchFEValues< 3 > * patch_fe_values_
Quadrature * quad_
Pointer to Quadrature that represents quadrature points of integral.
unsigned int dim_
Dimension of the cell on which points are placed.
unsigned int dim() const
Returns dimension.
Base()
Default constructor.
virtual ~Base()
Destructor.
bool operator==(const Base &other) const
Comparison operator.
Quadrature * quad() const
Returns quadrature.
Base(Quadrature *quad, unsigned int dim)
Constructor of bulk or side subset.
unsigned int subset_index_
Index of data block according to subset in EvalPoints object.
Bulk(Quadrature *quad, unsigned int dim, std::shared_ptr< EvalPoints > eval_points, unsigned int subset_idx)
Constructor of bulk integral- obsolete constructor.
uint begin_idx_
Begin index of quadrature points in EvalPoinnts.
uint end_idx_
Begin index of quadrature points in EvalPoinnts.
Bulk()
Default constructor.
uint begin_idx() const
Getter of bulk_begin.
uint n_points_per_side_
Number of points. TODO: pass this to the constructor, avoid extraction from the eval_points.
Edge()
Default constructor.
uint side_begin(const DHCellSide &cell_side) const
unsigned int n_sides_
Number of sides (value 0 indicates bulk set)
Edge(Quadrature *quad, unsigned int dim, std::shared_ptr< EvalPoints > eval_points, unsigned int subset_idx)
Constructor of edge integral.
unsigned int uint
Store finite element reinit functions.
Class FEValues calculates finite element data on the actual cells such as shape function values,...
@ bulk_domain
@ side_domain
#define FMT_UNUSED
Definition: posix.h:75
Implementation of range helper class.