Flow123d  JS_before_hm-1873-g0cc6cc928
generic_assembly.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 generic_assembly.hh
15  * @brief
16  */
17 
18 #ifndef GENERIC_ASSEMBLY_HH_
19 #define GENERIC_ASSEMBLY_HH_
20 
22 #include "fields/eval_subset.hh"
23 #include "fields/eval_points.hh"
25 #include "tools/revertable_list.hh"
26 
27 
28 
29 /// Allow set mask of active integrals.
31  none = 0,
32  bulk = 0x0001,
33  edge = 0x0002,
34  coupling = 0x0004,
35  boundary = 0x0008
36 };
37 
38 
39 /// Set of all used integral necessary in assemblation
41  std::array<std::shared_ptr<BulkIntegral>, 3> bulk_; ///< Bulk integrals of elements of dimensions 1, 2, 3
42  std::array<std::shared_ptr<EdgeIntegral>, 3> edge_; ///< Edge integrals between elements of dimensions 1, 2, 3
43  std::array<std::shared_ptr<CouplingIntegral>, 2> coupling_; ///< Coupling integrals between elements of dimensions 1-2, 2-3
44  std::array<std::shared_ptr<BoundaryIntegral>, 3> boundary_; ///< Boundary integrals betwwen elements of dimensions 1, 2, 3 and boundaries
45 };
46 
47 
48 /**
49  * Common interface class for all Assembly classes.
50  */
52 {
53 public:
56  virtual void assemble(std::shared_ptr<DOFHandlerMultiDim> dh) = 0;
57 };
58 
59 
60 /**
61  * @brief Generic class of assemblation.
62  *
63  * Class
64  * - holds assemblation structures (EvalPoints, Integral objects, Integral data table).
65  * - associates assemblation objects specified by dimension
66  * - provides general assemble method
67  * - provides methods that allow construction of element patches
68  */
69 template < template<IntDim...> class DimAssembly>
71 {
72 private:
73  /**
74  * Helper structzre holds data of cell (bulk) integral
75  *
76  * Data is specified by cell and subset index in EvalPoint object
77  */
79  /// Default constructor
81 
82  /// Constructor with data mebers initialization
83  BulkIntegralData(DHCellAccessor dhcell, unsigned int subset_idx)
84  : cell(dhcell), subset_index(subset_idx) {}
85 
86  /// Copy constructor
88  : cell(other.cell), subset_index(other.subset_index) {}
89 
90  DHCellAccessor cell; ///< Specified cell (element)
91  unsigned int subset_index; ///< Index (order) of subset in EvalPoints object
92  };
93 
94  /**
95  * Helper structzre holds data of edge integral
96  *
97  * Data is specified by side and subset index in EvalPoint object
98  */
100  /// Default constructor
103 
104  /// Copy constructor
107 
108  /// Constructor with data mebers initialization
110  : edge_side_range(range), subset_index(subset_idx) {}
111 
112  RangeConvert<DHEdgeSide, DHCellSide> edge_side_range; ///< Specified cell side (element)
113  unsigned int subset_index; ///< Index (order) of subset in EvalPoints object
114  };
115 
116  /**
117  * Helper structzre holds data of neighbour (coupling) integral
118  *
119  * Data is specified by cell, side and their subset indices in EvalPoint object
120  */
122  /// Default constructor
124 
125  /// Constructor with data mebers initialization
126  CouplingIntegralData(DHCellAccessor dhcell, unsigned int bulk_idx, DHCellSide dhside, unsigned int side_idx)
127  : cell(dhcell), bulk_subset_index(bulk_idx), side(dhside), side_subset_index(side_idx) {}
128 
129  /// Copy constructor
132 
134  unsigned int bulk_subset_index; ///< Index (order) of lower dim subset in EvalPoints object
135  DHCellSide side; ///< Specified cell side (higher dim element)
136  unsigned int side_subset_index; ///< Index (order) of higher dim subset in EvalPoints object
137  };
138 
139  /**
140  * Helper structzre holds data of boundary integral
141  *
142  * Data is specified by side and subset indices of side and appropriate boundary element in EvalPoint object
143  */
145  /// Default constructor
147 
148  /// Constructor with data mebers initialization
149  BoundaryIntegralData(unsigned int bdr_idx, DHCellSide dhside, unsigned int side_idx)
150  : bdr_subset_index(bdr_idx), side(dhside), side_subset_index(side_idx) {}
151 
152  /// Copy constructor
155 
156  // We don't need hold ElementAccessor of boundary element, side.cond().element_accessor() provides it.
157  unsigned int bdr_subset_index; ///< Index (order) of subset on boundary element in EvalPoints object
158  DHCellSide side; ///< Specified cell side (bulk element)
159  unsigned int side_subset_index; ///< Index (order) of subset on side of bulk element in EvalPoints object
160  };
161 
162 public:
163 
164  /// Constructor
165  GenericAssembly( typename DimAssembly<1>::EqFields *eq_fields, typename DimAssembly<1>::EqData *eq_data)
166  : multidim_assembly_(eq_fields, eq_data),
167  bulk_integral_data_(20, 10),
168  edge_integral_data_(12, 6),
171  {
172  eval_points_ = std::make_shared<EvalPoints>();
173  // first step - create integrals, then - initialize cache and initialize subobject of dimensions
174  multidim_assembly_[1_d]->create_integrals(eval_points_, integrals_);
175  multidim_assembly_[2_d]->create_integrals(eval_points_, integrals_);
176  multidim_assembly_[3_d]->create_integrals(eval_points_, integrals_);
178  multidim_assembly_[1_d]->initialize(&element_cache_map_);
179  multidim_assembly_[2_d]->initialize(&element_cache_map_);
180  multidim_assembly_[3_d]->initialize(&element_cache_map_);
181  active_integrals_ = multidim_assembly_[1_d]->n_active_integrals();
182  }
183 
184  /// Getter to set of assembly objects
186  return multidim_assembly_;
187  }
188 
189  /// Geter to EvalPoints object
190  inline std::shared_ptr<EvalPoints> eval_points() const {
191  return eval_points_;
192  }
193 
194  /**
195  * @brief General assemble methods.
196  *
197  * Loops through local cells and calls assemble methods of assembly
198  * object of each cells over space dimension.
199  */
200  void assemble(std::shared_ptr<DOFHandlerMultiDim> dh) override {
201  START_TIMER( DimAssembly<1>::name() );
202  this->reallocate_cache();
203  multidim_assembly_[1_d]->begin();
204 
205  bool add_into_patch = false; // control variable
206  for(auto cell_it = dh->local_range().begin(); cell_it != dh->local_range().end(); )
207  {
208 
209  if (!add_into_patch) {
211  add_into_patch = true;
212  }
213 
214  //START_TIMER("add_integrals_to_patch");
215  this->add_integrals_of_computing_step(*cell_it);
216  //END_TIMER("add_integrals_to_patch");
217 
219  bulk_integral_data_.revert_temporary();
220  edge_integral_data_.revert_temporary();
221  coupling_integral_data_.revert_temporary();
222  boundary_integral_data_.revert_temporary();
224  this->assemble_integrals();
225  add_into_patch = false;
226  } else {
227  bulk_integral_data_.make_permanent();
228  edge_integral_data_.make_permanent();
229  coupling_integral_data_.make_permanent();
230  boundary_integral_data_.make_permanent();
233  this->assemble_integrals();
234  add_into_patch = false;
235  }
236  ++cell_it;
237  }
238  }
239  if (add_into_patch) {
240  this->assemble_integrals();
241  }
242 
243  multidim_assembly_[1_d]->end();
244  END_TIMER( DimAssembly<1>::name() );
245  }
246 
247  /// Return ElementCacheMap
248  inline const ElementCacheMap &cache_map() const {
249  return element_cache_map_;
250  }
251 
252 private:
253  /// Assembles the cell integrals for the given dimension.
254  template<unsigned int dim>
255  inline void assemble_cell_integrals() {
256  for (unsigned int i=0; i<bulk_integral_data_.permanent_size(); ++i) {
257  if (bulk_integral_data_[i].cell.dim() != dim) continue;
258  multidim_assembly_[Dim<dim>{}]->cell_integral(bulk_integral_data_[i].cell, element_cache_map_.position_in_cache(bulk_integral_data_[i].cell.elm().mesh_idx()));
259  }
260  // Possibly optimization but not so fast as we would assume (needs change interface of cell_integral)
261  /*for (unsigned int i=0; i<element_cache_map_.n_elements(); ++i) {
262  unsigned int elm_start = element_cache_map_.element_chunk_begin(i);
263  if (element_cache_map_.eval_point_data(elm_start).i_eval_point_ != 0) continue;
264  multidim_assembly_[Dim<dim>{}]->cell_integral(i, element_cache_map_.eval_point_data(elm_start).dh_loc_idx_);
265  }*/
266  }
267 
268  /// Assembles the boundary side integrals for the given dimension.
269  template<unsigned int dim>
271  for (unsigned int i=0; i<boundary_integral_data_.permanent_size(); ++i) {
272  if (boundary_integral_data_[i].side.dim() != dim) continue;
273  multidim_assembly_[Dim<dim>{}]->boundary_side_integral(boundary_integral_data_[i].side);
274  }
275  }
276 
277  /// Assembles the edge integrals for the given dimension.
278  template<unsigned int dim>
279  inline void assemble_edge_integrals() {
280  for (unsigned int i=0; i<edge_integral_data_.permanent_size(); ++i) {
281  auto range = edge_integral_data_[i].edge_side_range;
282  if (range.begin()->dim() != dim) continue;
283  multidim_assembly_[Dim<dim>{}]->edge_integral(edge_integral_data_[i].edge_side_range);
284  }
285  }
286 
287  /// Assembles the neighbours integrals for the given dimension.
288  template<unsigned int dim>
290  for (unsigned int i=0; i<coupling_integral_data_.permanent_size(); ++i) {
291  if (coupling_integral_data_[i].side.dim() != dim) continue;
292  multidim_assembly_[Dim<dim>{}]->dimjoin_intergral(coupling_integral_data_[i].cell, coupling_integral_data_[i].side);
293  }
294  }
295 
296  /// Call assemblations when patch is filled
298  START_TIMER("create_patch");
300  END_TIMER("create_patch");
301  START_TIMER("cache_update");
302  multidim_assembly_[1_d]->eq_fields_->cache_update(element_cache_map_); // TODO replace with sub FieldSet
303  END_TIMER("cache_update");
305 
306  {
307  START_TIMER("assemble_volume_integrals");
308  this->assemble_cell_integrals<1>();
309  this->assemble_cell_integrals<2>();
310  this->assemble_cell_integrals<3>();
311  END_TIMER("assemble_volume_integrals");
312  }
313 
314  {
315  START_TIMER("assemble_fluxes_boundary");
316  this->assemble_boundary_side_integrals<1>();
317  this->assemble_boundary_side_integrals<2>();
318  this->assemble_boundary_side_integrals<3>();
319  END_TIMER("assemble_fluxes_boundary");
320  }
321 
322  {
323  START_TIMER("assemble_fluxes_elem_elem");
324  this->assemble_edge_integrals<1>();
325  this->assemble_edge_integrals<2>();
326  this->assemble_edge_integrals<3>();
327  END_TIMER("assemble_fluxes_elem_elem");
328  }
329 
330  {
331  START_TIMER("assemble_fluxes_elem_side");
332  this->assemble_neighbour_integrals<2>();
333  this->assemble_neighbour_integrals<3>();
334  END_TIMER("assemble_fluxes_elem_side");
335  }
336  // clean integral data
337  bulk_integral_data_.reset();
338  edge_integral_data_.reset();
339  coupling_integral_data_.reset();
340  boundary_integral_data_.reset();
342  }
343 
344  /**
345  * Add data of integrals to appropriate structure and register elements to ElementCacheMap.
346  *
347  * Types of used integrals must be set in data member \p active_integrals_.
348  */
351  if (cell.is_own()) { // Not ghost
352  this->add_volume_integral(cell);
353  }
354 
355  for( DHCellSide cell_side : cell.side_range() ) {
357  if (cell.is_own()) // Not ghost
358  if ( (cell_side.side().edge().n_sides() == 1) && (cell_side.side().is_boundary()) ) {
359  this->add_boundary_integral(cell_side);
360  continue;
361  }
363  if ( (cell_side.n_edge_sides() >= 2) && (cell_side.edge_sides().begin()->element().idx() == cell.elm_idx())) {
364  this->add_edge_integral(cell_side);
365  }
366  }
367 
369  bool add_low = true;
370  for( DHCellSide neighb_side : cell.neighb_sides() ) { // cell -> elm lower dim, neighb_side -> elm higher dim
371  if (cell.dim() != neighb_side.dim()-1) continue;
372  this->add_coupling_integral(cell, neighb_side, add_low);
373  add_low = false;
374  }
375  }
376  }
377 
378  /// Add data of volume integral to appropriate data structure.
379  inline void add_volume_integral(const DHCellAccessor &cell) {
380  uint subset_idx = integrals_.bulk_[cell.dim()-1]->get_subset_idx();
381  bulk_integral_data_.emplace_back(cell, subset_idx);
382 
383  unsigned int reg_idx = cell.elm().region_idx().idx();
384  // Different access than in other integrals: We can't use range method CellIntegral::points
385  // because it passes element_patch_idx as argument that is not known during patch construction.
386  for (uint i=uint( eval_points_->subset_begin(cell.dim(), subset_idx) );
387  i<uint( eval_points_->subset_end(cell.dim(), subset_idx) ); ++i) {
389  }
390  }
391 
392  /// Add data of edge integral to appropriate data structure.
393  inline void add_edge_integral(const DHCellSide &cell_side) {
394  auto range = cell_side.edge_sides();
395  edge_integral_data_.emplace_back(range, integrals_.edge_[range.begin()->dim()-1]->get_subset_idx());
396 
397  for( DHCellSide edge_side : range ) {
398  unsigned int reg_idx = edge_side.element().region_idx().idx();
399  for (auto p : integrals_.edge_[range.begin()->dim()-1]->points(edge_side, &element_cache_map_) ) {
400  element_cache_map_.eval_point_data_.emplace_back(reg_idx, edge_side.elem_idx(), p.eval_point_idx(), edge_side.cell().local_idx());
401  }
402  }
403  }
404 
405  /// Add data of coupling integral to appropriate data structure.
406  inline void add_coupling_integral(const DHCellAccessor &cell, const DHCellSide &ngh_side, bool add_low) {
407  coupling_integral_data_.emplace_back(cell, integrals_.coupling_[cell.dim()-1]->get_subset_low_idx(), ngh_side,
408  integrals_.coupling_[cell.dim()-1]->get_subset_high_idx());
409 
410  unsigned int reg_idx_low = cell.elm().region_idx().idx();
411  unsigned int reg_idx_high = ngh_side.element().region_idx().idx();
412  for (auto p : integrals_.coupling_[cell.dim()-1]->points(ngh_side, &element_cache_map_) ) {
413  element_cache_map_.eval_point_data_.emplace_back(reg_idx_high, ngh_side.elem_idx(), p.eval_point_idx(), ngh_side.cell().local_idx());
414 
415  if (add_low) {
416  auto p_low = p.lower_dim(cell); // equivalent point on low dim cell
417  element_cache_map_.eval_point_data_.emplace_back(reg_idx_low, cell.elm_idx(), p_low.eval_point_idx(), cell.local_idx());
418  }
419  }
420  }
421 
422  /// Add data of boundary integral to appropriate data structure.
423  inline void add_boundary_integral(const DHCellSide &bdr_side) {
424  boundary_integral_data_.emplace_back(integrals_.boundary_[bdr_side.dim()-1]->get_subset_low_idx(), bdr_side,
425  integrals_.boundary_[bdr_side.dim()-1]->get_subset_high_idx());
426 
427  unsigned int reg_idx = bdr_side.element().region_idx().idx();
428  for (auto p : integrals_.boundary_[bdr_side.dim()-1]->points(bdr_side, &element_cache_map_) ) {
429  element_cache_map_.eval_point_data_.emplace_back(reg_idx, bdr_side.elem_idx(), p.eval_point_idx(), bdr_side.cell().local_idx());
430 
431  BulkPoint p_bdr = p.point_bdr(bdr_side.cond().element_accessor()); // equivalent point on boundary element
432  unsigned int bdr_reg = bdr_side.cond().element_accessor().region_idx().idx();
433  // invalid local_idx value, DHCellAccessor of boundary element doesn't exist
435  }
436  }
437 
438  /// Calls cache_reallocate method on
439  inline void reallocate_cache() {
440  multidim_assembly_[1_d]->eq_fields_->cache_reallocate(this->element_cache_map_, multidim_assembly_[1_d]->used_fields_);
441  // DebugOut() << "Order of evaluated fields (" << DimAssembly<1>::name() << "):" << multidim_assembly_[1_d]->eq_fields_->print_dependency();
442  }
443 
444 
445  /// Assembly object
447 
448  /// Holds mask of active integrals.
450 
451  AssemblyIntegrals integrals_; ///< Holds integral objects.
452  std::shared_ptr<EvalPoints> eval_points_; ///< EvalPoints object shared by all integrals
453  ElementCacheMap element_cache_map_; ///< ElementCacheMap according to EvalPoints
454 
455  // Following variables hold data of all integrals depending of actual computed element.
456  // TODO sizes of arrays should be set dynamically, depend on number of elements in ElementCacheMap,
457  RevertableList<BulkIntegralData> bulk_integral_data_; ///< Holds data for computing bulk integrals.
458  RevertableList<EdgeIntegralData> edge_integral_data_; ///< Holds data for computing edge integrals.
459  RevertableList<CouplingIntegralData> coupling_integral_data_; ///< Holds data for computing couplings integrals.
460  RevertableList<BoundaryIntegralData> boundary_integral_data_; ///< Holds data for computing boundary integrals.
461 };
462 
463 
464 #endif /* GENERIC_ASSEMBLY_HH_ */
GenericAssembly::bulk_integral_data_
RevertableList< BulkIntegralData > bulk_integral_data_
Holds data for computing bulk integrals.
Definition: generic_assembly.hh:457
GenericAssembly::add_boundary_integral
void add_boundary_integral(const DHCellSide &bdr_side)
Add data of boundary integral to appropriate data structure.
Definition: generic_assembly.hh:423
CacheMapElementNumber::get
static unsigned int get()
Return number of stored elements.
Definition: field_value_cache.hh:93
AssemblyIntegrals::coupling_
std::array< std::shared_ptr< CouplingIntegral >, 2 > coupling_
Coupling integrals between elements of dimensions 1-2, 2-3.
Definition: generic_assembly.hh:43
eval_subset.hh
none
@ none
Definition: generic_assembly.hh:31
GenericAssembly::add_integrals_of_computing_step
void add_integrals_of_computing_step(DHCellAccessor cell)
Definition: generic_assembly.hh:349
GenericAssembly::CouplingIntegralData
Definition: generic_assembly.hh:121
GenericAssembly::eval_points_
std::shared_ptr< EvalPoints > eval_points_
EvalPoints object shared by all integrals.
Definition: generic_assembly.hh:452
AssemblyIntegrals
Set of all used integral necessary in assemblation.
Definition: generic_assembly.hh:40
ElementCacheMap::create_patch
void create_patch()
Create patch of cached elements before reading data to cache.
Definition: field_value_cache.cc:60
RevertableList::make_permanent
std::size_t make_permanent()
Finalize temporary part of data.
Definition: revertable_list.hh:126
GenericAssembly::CouplingIntegralData::CouplingIntegralData
CouplingIntegralData()
Default constructor.
Definition: generic_assembly.hh:123
GenericAssemblyBase
Definition: generic_assembly.hh:51
RevertableList::emplace_back
std::size_t emplace_back(Args &&... args)
Definition: revertable_list.hh:114
GenericAssembly::EdgeIntegralData::edge_side_range
RangeConvert< DHEdgeSide, DHCellSide > edge_side_range
Specified cell side (element)
Definition: generic_assembly.hh:112
DHCellSide::edge_sides
RangeConvert< DHEdgeSide, DHCellSide > edge_sides() const
Returns range of all sides looped over common Edge.
Definition: dh_cell_accessor.hh:473
GenericAssembly::CouplingIntegralData::cell
DHCellAccessor cell
Definition: generic_assembly.hh:133
GenericAssembly::EdgeIntegralData::EdgeIntegralData
EdgeIntegralData()
Default constructor.
Definition: generic_assembly.hh:101
GenericAssembly::CouplingIntegralData::side_subset_index
unsigned int side_subset_index
Index (order) of higher dim subset in EvalPoints object.
Definition: generic_assembly.hh:136
DHCellSide::cond
Boundary cond() const
Definition: dh_cell_accessor.hh:231
GenericAssembly::CouplingIntegralData::side
DHCellSide side
Specified cell side (higher dim element)
Definition: generic_assembly.hh:135
GenericAssembly::edge_integral_data_
RevertableList< EdgeIntegralData > edge_integral_data_
Holds data for computing edge integrals.
Definition: generic_assembly.hh:458
ElementCacheMap
Directing class of FieldValueCache.
Definition: field_value_cache.hh:151
eval_points.hh
DHCellAccessor::is_own
bool is_own() const
Return true if accessor represents own element (false for ghost element)
Definition: dh_cell_accessor.hh:130
GenericAssembly::BoundaryIntegralData::BoundaryIntegralData
BoundaryIntegralData()
Default constructor.
Definition: generic_assembly.hh:146
AssemblyIntegrals::edge_
std::array< std::shared_ptr< EdgeIntegral >, 3 > edge_
Edge integrals between elements of dimensions 1, 2, 3.
Definition: generic_assembly.hh:42
BulkPoint
Base point accessor class.
Definition: eval_subset.hh:55
GenericAssembly::reallocate_cache
void reallocate_cache()
Calls cache_reallocate method on.
Definition: generic_assembly.hh:439
GenericAssembly::BoundaryIntegralData::BoundaryIntegralData
BoundaryIntegralData(const BoundaryIntegralData &other)
Copy constructor.
Definition: generic_assembly.hh:153
GenericAssembly::BoundaryIntegralData::side_subset_index
unsigned int side_subset_index
Index (order) of subset on side of bulk element in EvalPoints object.
Definition: generic_assembly.hh:159
DHCellAccessor::dim
unsigned int dim() const
Return dimension of element appropriate to cell.
Definition: dh_cell_accessor.hh:101
uint
unsigned int uint
Definition: mh_dofhandler.hh:101
RegionIdx::idx
unsigned int idx() const
Returns a global index of the region.
Definition: region.hh:82
DHCellSide::dim
unsigned int dim() const
Return dimension of element appropriate to the side.
Definition: dh_cell_accessor.hh:214
GenericAssembly::GenericAssembly
GenericAssembly(typename DimAssembly< 1 >::EqFields *eq_fields, typename DimAssembly< 1 >::EqData *eq_data)
Constructor.
Definition: generic_assembly.hh:165
ElementCacheMap::position_in_cache
unsigned int position_in_cache(unsigned mesh_elm_idx) const
Return position of element stored in ElementCacheMap.
Definition: field_value_cache.hh:215
GenericAssemblyBase::GenericAssemblyBase
GenericAssemblyBase()
Definition: generic_assembly.hh:54
ElementCacheMap::eval_point_data_
RevertableList< EvalPointData > eval_point_data_
Definition: field_value_cache.hh:330
GenericAssembly::assemble_cell_integrals
void assemble_cell_integrals()
Assembles the cell integrals for the given dimension.
Definition: generic_assembly.hh:255
GenericAssemblyBase::assemble
virtual void assemble(std::shared_ptr< DOFHandlerMultiDim > dh)=0
GenericAssembly::assemble
void assemble(std::shared_ptr< DOFHandlerMultiDim > dh) override
General assemble methods.
Definition: generic_assembly.hh:200
GenericAssembly::add_edge_integral
void add_edge_integral(const DHCellSide &cell_side)
Add data of edge integral to appropriate data structure.
Definition: generic_assembly.hh:393
Dim
Definition: mixed.hh:25
ElementCacheMap::init
void init(std::shared_ptr< EvalPoints > eval_points)
Init cache.
Definition: field_value_cache.cc:50
RevertableList::temporary_size
std::size_t temporary_size() const
Return temporary size of list (full size of stored data).
Definition: revertable_list.hh:77
GenericAssembly::BulkIntegralData::cell
DHCellAccessor cell
Specified cell (element)
Definition: generic_assembly.hh:90
GenericAssembly::boundary_integral_data_
RevertableList< BoundaryIntegralData > boundary_integral_data_
Holds data for computing boundary integrals.
Definition: generic_assembly.hh:460
GenericAssembly::CouplingIntegralData::bulk_subset_index
unsigned int bulk_subset_index
Index (order) of lower dim subset in EvalPoints object.
Definition: generic_assembly.hh:134
Boundary::bc_ele_idx
uint bc_ele_idx()
Definition: accessors.hh:388
GenericAssembly::CouplingIntegralData::CouplingIntegralData
CouplingIntegralData(const CouplingIntegralData &other)
Copy constructor.
Definition: generic_assembly.hh:130
GenericAssembly::EdgeIntegralData
Definition: generic_assembly.hh:99
GenericAssembly::EdgeIntegralData::EdgeIntegralData
EdgeIntegralData(RangeConvert< DHEdgeSide, DHCellSide > range, unsigned int subset_idx)
Constructor with data mebers initialization.
Definition: generic_assembly.hh:109
DHCellSide
Side accessor allows to iterate over sides of DOF handler cell.
Definition: dh_cell_accessor.hh:176
GenericAssembly::BulkIntegralData::BulkIntegralData
BulkIntegralData()
Default constructor.
Definition: generic_assembly.hh:80
GenericAssembly::EdgeIntegralData::EdgeIntegralData
EdgeIntegralData(const EdgeIntegralData &other)
Copy constructor.
Definition: generic_assembly.hh:105
RangeConvert< DHEdgeSide, DHCellSide >
GenericAssembly::BoundaryIntegralData::bdr_subset_index
unsigned int bdr_subset_index
Index (order) of subset on boundary element in EvalPoints object.
Definition: generic_assembly.hh:157
GenericAssembly::BulkIntegralData::BulkIntegralData
BulkIntegralData(DHCellAccessor dhcell, unsigned int subset_idx)
Constructor with data mebers initialization.
Definition: generic_assembly.hh:83
DHCellAccessor::side_range
Range< DHCellSide > side_range() const
Returns range of cell sides.
Definition: dh_cell_accessor.hh:458
GenericAssembly::active_integrals_
int active_integrals_
Holds mask of active integrals.
Definition: generic_assembly.hh:449
DHCellSide::cell
const DHCellAccessor & cell() const
Return DHCellAccessor appropriate to the side.
Definition: dh_cell_accessor.hh:204
DHCellAccessor::neighb_sides
RangeConvert< DHNeighbSide, DHCellSide > neighb_sides() const
Returns range of neighbour cell of lower dimension corresponding to cell of higher dimension.
Definition: dh_cell_accessor.hh:465
AssemblyIntegrals::bulk_
std::array< std::shared_ptr< BulkIntegral >, 3 > bulk_
Bulk integrals of elements of dimensions 1, 2, 3.
Definition: generic_assembly.hh:41
quadrature_lib.hh
Definitions of particular quadrature rules on simplices.
ElementCacheMap::clear_element_eval_points_map
void clear_element_eval_points_map()
Reset all items of elements_eval_points_map.
Definition: field_value_cache.hh:173
DHCellAccessor::local_idx
unsigned int local_idx() const
Return local index to element (index of DOF handler).
Definition: dh_cell_accessor.hh:58
GenericAssembly::multidim_assembly
MixedPtr< DimAssembly, 1 > multidim_assembly() const
Getter to set of assembly objects.
Definition: generic_assembly.hh:185
GenericAssembly::integrals_
AssemblyIntegrals integrals_
Holds integral objects.
Definition: generic_assembly.hh:451
DHCellAccessor::elm
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
Definition: dh_cell_accessor.hh:71
GenericAssembly::add_coupling_integral
void add_coupling_integral(const DHCellAccessor &cell, const DHCellSide &ngh_side, bool add_low)
Add data of coupling integral to appropriate data structure.
Definition: generic_assembly.hh:406
GenericAssembly::add_volume_integral
void add_volume_integral(const DHCellAccessor &cell)
Add data of volume integral to appropriate data structure.
Definition: generic_assembly.hh:379
GenericAssembly::assemble_neighbour_integrals
void assemble_neighbour_integrals()
Assembles the neighbours integrals for the given dimension.
Definition: generic_assembly.hh:289
ActiveIntegrals
ActiveIntegrals
Allow set mask of active integrals.
Definition: generic_assembly.hh:30
GenericAssembly::coupling_integral_data_
RevertableList< CouplingIntegralData > coupling_integral_data_
Holds data for computing couplings integrals.
Definition: generic_assembly.hh:459
GenericAssembly::assemble_boundary_side_integrals
void assemble_boundary_side_integrals()
Assembles the boundary side integrals for the given dimension.
Definition: generic_assembly.hh:270
BulkPoint::eval_point_idx
unsigned int eval_point_idx() const
Return index in EvalPoints object.
Definition: eval_subset.hh:84
Boundary::element_accessor
ElementAccessor< 3 > element_accessor()
Definition: accessors_impl.hh:253
GenericAssembly::assemble_edge_integrals
void assemble_edge_integrals()
Assembles the edge integrals for the given dimension.
Definition: generic_assembly.hh:279
RevertableList
Struct is a container that encapsulates variable size arrays.
Definition: revertable_list.hh:43
DHCellAccessor::elm_idx
unsigned int elm_idx() const
Return serial idx to element of loc_ele_idx_.
Definition: dh_cell_accessor.hh:64
coupling
@ coupling
Definition: generic_assembly.hh:34
GenericAssembly::CouplingIntegralData::CouplingIntegralData
CouplingIntegralData(DHCellAccessor dhcell, unsigned int bulk_idx, DHCellSide dhside, unsigned int side_idx)
Constructor with data mebers initialization.
Definition: generic_assembly.hh:126
ElementCacheMap::finish_elements_update
void finish_elements_update()
Finish update after reading data to cache.
Definition: field_value_cache.cc:114
DHCellSide::element
ElementAccessor< 3 > element() const
Definition: dh_cell_accessor.hh:223
DHCellSide::elem_idx
unsigned int elem_idx() const
Definition: dh_cell_accessor.hh:227
GenericAssembly::cache_map
const ElementCacheMap & cache_map() const
Return ElementCacheMap.
Definition: generic_assembly.hh:248
GenericAssembly::assemble_integrals
void assemble_integrals()
Call assemblations when patch is filled.
Definition: generic_assembly.hh:297
bulk
@ bulk
Definition: generic_assembly.hh:32
DHCellAccessor
Cell accessor allow iterate over DOF handler cells.
Definition: dh_cell_accessor.hh:43
GenericAssembly::EdgeIntegralData::subset_index
unsigned int subset_index
Index (order) of subset in EvalPoints object.
Definition: generic_assembly.hh:113
revertable_list.hh
field_value_cache.hh
MixedPtr< DimAssembly, 1 >
GenericAssembly::BoundaryIntegralData
Definition: generic_assembly.hh:144
RevertableList::revert_temporary
std::size_t revert_temporary()
Erase temporary part of data.
Definition: revertable_list.hh:133
DHEdgeSide
Class allows to iterate over sides of edge.
Definition: dh_cell_accessor.hh:293
GenericAssembly::BoundaryIntegralData::BoundaryIntegralData
BoundaryIntegralData(unsigned int bdr_idx, DHCellSide dhside, unsigned int side_idx)
Constructor with data mebers initialization.
Definition: generic_assembly.hh:149
make_iter
Iter< Object > make_iter(Object obj)
Definition: general_iterator.hh:85
GenericAssembly::eval_points
std::shared_ptr< EvalPoints > eval_points() const
Geter to EvalPoints object.
Definition: generic_assembly.hh:190
GenericAssembly::element_cache_map_
ElementCacheMap element_cache_map_
ElementCacheMap according to EvalPoints.
Definition: generic_assembly.hh:453
edge
@ edge
Definition: generic_assembly.hh:33
ElementCacheMap::start_elements_update
void start_elements_update()
Start update of cache.
Definition: field_value_cache.cc:110
GenericAssembly::BulkIntegralData
Definition: generic_assembly.hh:78
boundary
@ boundary
Definition: generic_assembly.hh:35
GenericAssemblyBase::~GenericAssemblyBase
virtual ~GenericAssemblyBase()
Definition: generic_assembly.hh:55
START_TIMER
#define START_TIMER(tag)
Starts a timer with specified tag.
Definition: sys_profiler.hh:115
GenericAssembly
Generic class of assemblation.
Definition: generic_assembly.hh:70
GenericAssembly::BulkIntegralData::subset_index
unsigned int subset_index
Index (order) of subset in EvalPoints object.
Definition: generic_assembly.hh:91
GenericAssembly::BoundaryIntegralData::side
DHCellSide side
Specified cell side (bulk element)
Definition: generic_assembly.hh:158
END_TIMER
#define END_TIMER(tag)
Ends a timer with specified tag.
Definition: sys_profiler.hh:149
GenericAssembly::BulkIntegralData::BulkIntegralData
BulkIntegralData(const BulkIntegralData &other)
Copy constructor.
Definition: generic_assembly.hh:87
ElementAccessor::region_idx
RegionIdx region_idx() const
Definition: accessors.hh:204
GenericAssembly::multidim_assembly_
MixedPtr< DimAssembly, 1 > multidim_assembly_
Assembly object.
Definition: generic_assembly.hh:446
AssemblyIntegrals::boundary_
std::array< std::shared_ptr< BoundaryIntegral >, 3 > boundary_
Boundary integrals betwwen elements of dimensions 1, 2, 3 and boundaries.
Definition: generic_assembly.hh:44
IntDim
unsigned int IntDim
A dimension index type.
Definition: mixed.hh:19