Flow123d  DF_patch_fe_darcy_complete-579fe1e
assembly_convection.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 assembly_convection.hh
15  * @brief
16  */
17 
18 #ifndef ASSEMBLY_CONVECTION_HH_
19 #define ASSEMBLY_CONVECTION_HH_
20 
23 #include "transport/transport.h"
24 #include "fem/fe_p.hh"
25 #include "fem/fe_values.hh"
27 #include "coupling/balance.hh"
28 #include "fem/element_cache_map.hh"
29 
30 
31 /**
32  * Auxiliary container class for Finite element and related objects of given dimension.
33  */
34 template <unsigned int dim, class TEqData>
36 {
37 public:
38  typedef typename TEqData::EqFields EqFields;
39  typedef TEqData EqData;
40 
41  static constexpr const char * name() { return "Convection_Mass_Assembly"; }
42 
43  /// Constructor.
45  : AssemblyBase<dim>(0, asm_internals), eq_fields_(eq_data->eq_fields_.get()), eq_data_(eq_data),
46  mass_integral_( this->create_bulk_integral(this->quad_) ) {
47  this->used_fields_ += eq_fields_->cross_section;
48  this->used_fields_ += eq_fields_->water_content;
49  }
50 
51  /// Destructor.
53 
54  /// Initialize auxiliary vectors and other data members
55  void initialize() {}
56 
57 
58  /// Assemble integral over element
59  inline void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
60  {
61  ASSERT_EQ(cell.dim(), dim).error("Dimension of element mismatch!");
62 
63  ElementAccessor<3> elm = cell.elm();
64  // we have currently zero order P_Disc FE
65  ASSERT(cell.get_loc_dof_indices().size() == 1);
66  IntIdx local_p0_dof = cell.get_loc_dof_indices()[0];
67 
68  auto p = *( mass_integral_->points(element_patch_idx).begin() );
69  for (unsigned int sbi=0; sbi<eq_data_->n_substances(); ++sbi)
70  eq_data_->balance_->add_mass_values(eq_data_->subst_idx[sbi], cell, {local_p0_dof},
71  {eq_fields_->cross_section(p)*eq_fields_->water_content(p)*elm.measure()}, 0);
72 
73  VecSetValue(eq_data_->mass_diag, eq_data_->dh_->get_local_to_global_map()[local_p0_dof],
74  eq_fields_->cross_section(p)*eq_fields_->water_content(p), INSERT_VALUES);
75  }
76 
77  /// Implements @p AssemblyBase::begin.
78  void begin() override
79  {
80  VecZeroEntries(eq_data_->mass_diag);
81  eq_data_->balance_->start_mass_assembly(eq_data_->subst_idx);
82  }
83 
84  /// Implements @p AssemblyBase::end.
85  void end() override
86  {
87  eq_data_->balance_->finish_mass_assembly(eq_data_->subst_idx);
88 
89  VecAssemblyBegin(eq_data_->mass_diag);
90  VecAssemblyEnd(eq_data_->mass_diag);
91 
92  eq_data_->is_mass_diag_changed = true;
93  }
94 
95  private:
96  shared_ptr<FiniteElement<dim>> fe_; ///< Finite element for the solution of the advection-diffusion equation.
97 
98  /// Data objects shared with TransportDG
101 
102  /// Sub field set contains fields used in calculation.
104 
105  /// Bulk integral of assembly class
106  std::shared_ptr<BulkIntegralAcc<dim>> mass_integral_;
107 
108  template < template<IntDim...> class DimAssembly>
109  friend class GenericAssembly;
110 
111 };
112 
113 
114 
115 /**
116  * Auxiliary container class for Finite element and related objects of given dimension.
117  */
118 template <unsigned int dim, class TEqData>
120 {
121 public:
122  typedef typename TEqData::EqFields EqFields;
123  typedef TEqData EqData;
124 
125  static constexpr const char * name() { return "Convection_InitCond_Assembly"; }
126 
127  /// Constructor.
129  : AssemblyBase<dim>(0, asm_internals), eq_fields_(eq_data->eq_fields_.get()), eq_data_(eq_data),
130  bulk_integral_( this->create_bulk_integral(this->quad_) ) {
131  this->used_fields_ += eq_fields_->init_conc;
132  }
133 
134  /// Destructor.
136 
137  /// Initialize auxiliary vectors and other data members
138  void initialize() {
139  for (unsigned int sbi=0; sbi<eq_data_->n_substances(); sbi++) {
140  vecs_.push_back(eq_fields_->conc_mobile_fe[sbi]->vec());
141  }
142  }
143 
144 
145  /// Assemble integral over element
146  inline void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
147  {
148  ASSERT_EQ(cell.dim(), dim).error("Dimension of element mismatch!");
149 
150  LongIdx index = cell.local_idx();
151  auto p = *( bulk_integral_->points(element_patch_idx).begin() );
152 
153  for (unsigned int sbi=0; sbi<eq_data_->n_substances(); sbi++) {
154  vecs_[sbi].set( index, eq_fields_->init_conc[sbi](p) );
155  }
156  }
157 
158 private:
159  shared_ptr<FiniteElement<dim>> fe_; ///< Finite element for the solution of the advection-diffusion equation.
160 
161  /// Data objects shared with TransportDG
164 
165  std::vector<VectorMPI> vecs_; ///< Set of data vectors of conc_mobile_fe objects.
166 
167  /// Sub field set contains fields used in calculation.
169 
170  /// Bulk integral of assembly class
171  std::shared_ptr<BulkIntegralAcc<dim>> bulk_integral_;
172 
173  template < template<IntDim...> class DimAssembly>
174  friend class GenericAssembly;
175 
176 };
177 
178 
179 /**
180  * Auxiliary container class for Finite element and related objects of given dimension.
181  *
182  * Assembles concentration sources for each substance and set boundary conditions.
183  * note: the source of concentration is multiplied by time interval (gives the mass, not the flow like before)
184  */
185 template <unsigned int dim, class TEqData>
187 {
188 public:
189  typedef typename TEqData::EqFields EqFields;
190  typedef TEqData EqData;
191 
192  static constexpr const char * name() { return "Convection_ConcSourcesBdr_Assembly"; }
193 
194  /// Constructor.
196  : AssemblyBase<dim>(0, asm_internals), eq_fields_(eq_data->eq_fields_.get()), eq_data_(eq_data),
199  this->used_fields_ += eq_fields_->cross_section;
200  this->used_fields_ += eq_fields_->sources_sigma;
201  this->used_fields_ += eq_fields_->sources_density;
202  this->used_fields_ += eq_fields_->sources_conc;
203  this->used_fields_ += eq_fields_->flow_flux;
204  this->used_fields_ += eq_fields_->bc_conc;
205  }
206 
207  /// Destructor.
209 
210  /// Initialize auxiliary vectors and other data members
211  void initialize() {
212  fe_ = std::make_shared< FE_P_disc<dim> >(0);
215  }
216 
217 
218  /// Assemble integral over element
219  inline void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
220  {
221  ASSERT_EQ(cell.dim(), dim).error("Dimension of element mismatch!");
222  if (!eq_data_->sources_changed_) return;
223 
224  // read for all substances
225  double max_cfl=0;
226  double source, diag;
227  ElementAccessor<3> elm = cell.elm();
228  // we have currently zero order P_Disc FE
229  ASSERT(cell.get_loc_dof_indices().size() == 1);
230  IntIdx local_p0_dof = cell.get_loc_dof_indices()[0];
231 
232  auto p = *( bulk_integral_->points(element_patch_idx).begin() );
233  for (unsigned int sbi = 0; sbi < eq_data_->n_substances(); sbi++)
234  {
235  source = eq_fields_->cross_section(p) * (eq_fields_->sources_density[sbi](p)
236  + eq_fields_->sources_sigma[sbi](p) * eq_fields_->sources_conc[sbi](p));
237  // addition to RHS
238  eq_data_->corr_vec[sbi].set(local_p0_dof, source);
239  // addition to diagonal of the transport matrix
240  diag = eq_fields_->sources_sigma[sbi](p) * eq_fields_->cross_section(p);
241  eq_data_->tm_diag[sbi].set(local_p0_dof, - diag);
242 
243  // compute maximal cfl condition over all substances
244  max_cfl = std::max(max_cfl, fabs(diag));
245 
246  eq_data_->balance_->add_source_values(sbi, elm.region().bulk_idx(), {local_p0_dof},
247  {- eq_fields_->sources_sigma[sbi](p) * elm.measure() * eq_fields_->cross_section(p)},
248  {source * elm.measure()});
249  }
250 
251  eq_data_->cfl_source_.set(local_p0_dof, max_cfl);
252  }
253 
254  /// Assembles the fluxes on the boundary.
255  inline void boundary_side_integral(DHCellSide cell_side)
256  {
257  ASSERT_EQ(cell_side.dim(), dim).error("Dimension of element mismatch!");
258  if (!cell_side.cell().is_own()) return;
259 
260  // we have currently zero order P_Disc FE
261  ASSERT(cell_side.cell().get_loc_dof_indices().size() == 1);
262  IntIdx local_p0_dof = cell_side.cell().get_loc_dof_indices()[0];
263  LongIdx glob_p0_dof = eq_data_->dh_->get_local_to_global_map()[local_p0_dof];
264 
265  fe_values_side_.reinit(cell_side.side());
266 
267  unsigned int sbi;
268  auto p_side = *( bdr_integral_->points(cell_side).begin() );
269  auto p_bdr = p_side.point_bdr(cell_side.cond().element_accessor() );
270  double flux = eq_fields_->side_flux(p_side, fe_values_side_);
271  if (flux < 0.0) {
272  double aij = -(flux / cell_side.element().measure() );
273 
274  for (sbi=0; sbi<eq_data_->n_substances(); sbi++)
275  {
276  double value = eq_fields_->bc_conc[sbi](p_bdr);
277 
278  VecSetValue(eq_data_->bcvcorr[sbi], glob_p0_dof, value * aij, ADD_VALUES);
279 
280  // CAUTION: It seems that PETSc possibly optimize allocated space during assembly.
281  // So we have to add also values that may be non-zero in future due to changing velocity field.
282  eq_data_->balance_->add_flux_values(eq_data_->subst_idx[sbi], cell_side,
283  {local_p0_dof}, {0.0}, flux*value);
284  }
285  } else {
286  for (sbi=0; sbi<eq_data_->n_substances(); sbi++)
287  VecSetValue(eq_data_->bcvcorr[sbi], glob_p0_dof, 0, ADD_VALUES);
288 
289  for (sbi=0; sbi<eq_data_->n_substances(); sbi++)
290  eq_data_->balance_->add_flux_values(eq_data_->subst_idx[sbi], cell_side,
291  {local_p0_dof}, {flux}, 0.0);
292  }
293  }
294 
295  /// Implements @p AssemblyBase::begin.
296  void begin() override
297  {
298  eq_data_->sources_changed_ = ( (eq_fields_->sources_density.changed() )
299  || (eq_fields_->sources_conc.changed() )
300  || (eq_fields_->sources_sigma.changed() )
301  || (eq_fields_->cross_section.changed()));
302 
303  //TODO: would it be possible to check the change in data for chosen substance? (may be in multifields?)
304 
305  if (eq_data_->sources_changed_) eq_data_->balance_->start_source_assembly(eq_data_->subst_idx);
306  // Assembly bcvcorr vector
307  for(unsigned int sbi=0; sbi < eq_data_->n_substances(); sbi++) VecZeroEntries(eq_data_->bcvcorr[sbi]);
308 
309  eq_data_->balance_->start_flux_assembly(eq_data_->subst_idx);
310  }
311 
312  /// Implements @p AssemblyBase::end.
313  void end() override
314  {
315  eq_data_->balance_->finish_flux_assembly(eq_data_->subst_idx);
316  if (eq_data_->sources_changed_) eq_data_->balance_->finish_source_assembly(eq_data_->subst_idx);
317 
318  for (unsigned int sbi=0; sbi<eq_data_->n_substances(); sbi++) VecAssemblyBegin(eq_data_->bcvcorr[sbi]);
319  for (unsigned int sbi=0; sbi<eq_data_->n_substances(); sbi++) VecAssemblyEnd(eq_data_->bcvcorr[sbi]);
320 
321  // we are calling set_boundary_conditions() after next_time() and
322  // we are using data from t() before, so we need to set corresponding bc time
323  eq_data_->transport_bc_time = eq_data_->time_->last_t();
324  }
325 
326  private:
327  shared_ptr<FiniteElement<dim>> fe_; ///< Finite element for the solution of the advection-diffusion equation.
328 
329  /// Data objects shared with ConvectionTransport
332 
333  /// Sub field set contains fields used in calculation.
335 
336  FEValues<3> fe_values_side_; ///< FEValues of object (of P disc finite element type)
337 
338  std::shared_ptr<BulkIntegralAcc<dim>> bulk_integral_; ///< Bulk integral of assembly class
339  std::shared_ptr<BoundaryIntegralAcc<dim>> bdr_integral_; ///< Boundary integral of assembly class
340 
341  template < template<IntDim...> class DimAssembly>
342  friend class GenericAssembly;
343 
344 };
345 
346 
347 /**
348  * Auxiliary container class for Finite element and related objects of given dimension.
349  *
350  *
351  * Assembly convection term part of the matrix and boundary matrix for application of boundary conditions.
352  *
353  * Discretization of the convection term use explicit time scheme and finite volumes with full upwinding.
354  * We count on with exchange between dimensions and mixing on edges where more then two elements connect (can happen for 2D and 1D elements in
355  * 3D embedding space)
356  *
357  * In order to get multiplication matrix for explicit transport one have to scale the convection part by the acctual time step and
358  * add time term, i. e. unit matrix (see. transport_matrix_step_mpi)
359  *
360  * Updates CFL time step constrain.
361  */
362 template <unsigned int dim, class TEqData>
364 {
365 public:
366  typedef typename TEqData::EqFields EqFields;
367  typedef TEqData EqData;
368 
369  static constexpr const char * name() { return "Convection_MatrixMpi_Assembly"; }
370 
371  /// Constructor.
373  : AssemblyBase<dim>(0, asm_internals), eq_fields_(eq_data->eq_fields_.get()), eq_data_(eq_data),
376  this->used_fields_ += eq_fields_->flow_flux;
377  }
378 
379  /// Destructor.
381 
382  /// Initialize auxiliary vectors and other data members
383  void initialize() {
384  fe_ = std::make_shared< FE_P_disc<dim> >(0);
386  if (dim < 3) { // temporary solution until fe_values removal
387  fe_high_ = std::make_shared< FE_P_disc<dim+1> >(0);
389  }
390  fe_values_vec_.resize(eq_data_->max_edg_sides);
391  for (unsigned int sid=0; sid<eq_data_->max_edg_sides; sid++)
392  {
393  fe_values_vec_[sid].initialize(*this->quad_low_, *fe_, u);
394  }
395  side_dofs_.resize(eq_data_->max_edg_sides);
396  side_flux_.resize(eq_data_->max_edg_sides);
397  elm_meassures_.resize(eq_data_->max_edg_sides);
398  all_elem_dofs_.resize(eq_data_->max_edg_sides-1);
399  row_values_.resize(eq_data_->max_edg_sides-1);
400  dof_indices_i_.resize(1);
401  dof_indices_j_.resize(1);
402  }
403 
404  /// Assembles the fluxes between sides of elements of the same dimension.
406  ASSERT_EQ(edge_side_range.begin()->element().dim(), dim).error("Dimension of element mismatch!");
407 
408  unsigned int sid=0, s1, s2, i_col;
409  edg_flux = 0.0;
410  for( DHCellSide edge_side : edge_side_range )
411  {
412  fe_values_vec_[sid].reinit(edge_side.side());
413  edge_side.cell().get_dof_indices(dof_indices_i_);
414  side_dofs_[sid] = dof_indices_i_[0];
415  elm_meassures_[sid] = edge_side.element().measure();
416  auto p = *( edge_integral_->points(edge_side).begin() );
417  side_flux_[sid] = eq_fields_->side_flux(p, fe_values_vec_[sid]);
418  if (side_flux_[sid] > 0.0) {
419  eq_data_->cfl_flow_.add_global(side_dofs_[sid], -(side_flux_[sid] / edge_side.element().measure()) );
420  edg_flux += side_flux_[sid];
421  }
422  ++sid;
423  }
424 
425  unsigned int n_edge_sides = edge_side_range.begin()->n_edge_sides();
426  if (n_edge_sides<2) return; // following loop has no effect if edge contains only 1 side
427  for( s1=0; s1<n_edge_sides; s1++ )
428  {
429  for( s2=0, i_col=0; s2<n_edge_sides; s2++ )
430  {
431  if (s2==s1) continue;
432 
433  if (side_flux_[s2] > 0.0 && side_flux_[s1] < 0.0)
434  row_values_[i_col] = -(side_flux_[s1] * side_flux_[s2] / ( edg_flux * elm_meassures_[s1] ) );
435  else row_values_[i_col] = 0;
436  all_elem_dofs_[i_col++] = side_dofs_[s2];
437  }
438  MatSetValues(eq_data_->tm, 1, &(side_dofs_[s1]), n_edge_sides-1, &(all_elem_dofs_[0]), &(row_values_[0]), INSERT_VALUES);
439  }
440  }
441 
442 
443  /// Assembles the fluxes between elements of different dimensions.
444  inline void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side) {
445  if (dim == 3) return;
446  ASSERT_EQ(cell_lower_dim.dim(), dim).error("Dimension of element mismatch!");
447 
448  auto p_high = *( coupling_integral_->points(neighb_side).begin() );
449  fe_values_side_.reinit(neighb_side.side());
450 
451  cell_lower_dim.get_dof_indices(dof_indices_i_);
452  neighb_side.cell().get_dof_indices(dof_indices_j_);
453  flux = eq_fields_->side_flux(p_high, fe_values_side_);
454 
455  // volume source - out-flow from higher dimension
456  if (flux > 0.0) aij = flux / cell_lower_dim.elm().measure();
457  else aij=0;
458  MatSetValue(eq_data_->tm, dof_indices_i_[0], dof_indices_j_[0], aij, INSERT_VALUES);
459  // out flow from higher dim. already accounted
460 
461  // volume drain - in-flow to higher dimension
462  if (flux < 0.0) {
463  eq_data_->cfl_flow_.add_global( dof_indices_i_[0], (flux / cell_lower_dim.elm().measure()) ); // diagonal drain
464  aij = (-flux) / neighb_side.element().measure();
465  } else aij=0;
466  MatSetValue(eq_data_->tm, dof_indices_j_[0], dof_indices_i_[0], aij, INSERT_VALUES);
467  }
468 
469 
470  /// Implements @p AssemblyBase::begin.
471  void begin() override
472  {
473  MatZeroEntries(eq_data_->tm);
474  eq_data_->cfl_flow_.zero_entries();
475  }
476 
477  /// Implements @p AssemblyBase::end.
478  void end() override
479  {
480  for ( DHCellAccessor dh_cell : eq_data_->dh_->own_range() ) {
481  dh_cell.get_dof_indices(dof_indices_i_);
482  MatSetValue(eq_data_->tm, dof_indices_i_[0], dof_indices_i_[0], eq_data_->cfl_flow_.get(dh_cell.local_idx()), INSERT_VALUES);
483 
484  eq_data_->cfl_flow_.set(dh_cell.local_idx(), fabs(eq_data_->cfl_flow_.get(dh_cell.local_idx())) );
485  }
486 
487  MatAssemblyBegin(eq_data_->tm, MAT_FINAL_ASSEMBLY);
488  MatAssemblyEnd(eq_data_->tm, MAT_FINAL_ASSEMBLY);
489  VecAssemblyBegin(eq_data_->cfl_flow_.petsc_vec());
490  VecAssemblyEnd(eq_data_->cfl_flow_.petsc_vec());
491 
492  eq_data_->is_convection_matrix_scaled = false;
493  eq_data_->transport_matrix_time = eq_data_->time_->t();
494  }
495 
496 private:
497  shared_ptr<FiniteElement<dim>> fe_; ///< Finite element for the solution of the advection-diffusion equation.
498  shared_ptr<FiniteElement<dim+1>> fe_high_; ///< Same as previous but represents finite element of higher dim of join integral
499 
500  /// Data objects shared with ConvectionTransport
503 
504  /// Sub field set contains fields used in calculation.
506 
507  FEValues<3> fe_values_side_; ///< FEValues of object (of P disc finite element type)
508  vector<FEValues<3>> fe_values_vec_; ///< Vector of FEValues of object (of P disc finite element types)
509  vector<LongIdx> dof_indices_i_, dof_indices_j_; ///< Global DOF indices.
510 
516  double aij;
517  double edg_flux, flux;
518 
519  std::shared_ptr<EdgeIntegralAcc<dim>> edge_integral_; ///< Edge integral of assembly class
520  std::shared_ptr<CouplingIntegralAcc<dim>> coupling_integral_; ///< Coupling integral of assembly class
521 
522  template < template<IntDim...> class DimAssembly>
523  friend class GenericAssembly;
524 
525 };
526 
527 
528 #endif /* ASSEMBLY_CONVECTION_HH_ */
#define ASSERT(expr)
Definition: asserts.hh:351
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:333
Quadrature * quad_
Quadrature used in assembling methods.
std::shared_ptr< CouplingIntegralAcc< dim > > create_coupling_integral(Quadrature *quad)
std::shared_ptr< EdgeIntegralAcc< dim > > create_edge_integral(Quadrature *quad)
std::shared_ptr< BoundaryIntegralAcc< dim > > create_boundary_integral(Quadrature *quad)
std::shared_ptr< BulkIntegralAcc< dim > > create_bulk_integral(Quadrature *quad)
Quadrature * quad_low_
Quadrature used in assembling methods (dim-1).
ElementAccessor< 3 > element_accessor()
ConcSourcesBdrAssemblyConvection(EqData *eq_data, AssemblyInternals *asm_internals)
Constructor.
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
std::shared_ptr< BulkIntegralAcc< dim > > bulk_integral_
Bulk integral of assembly class.
static constexpr const char * name()
void initialize()
Initialize auxiliary vectors and other data members.
FieldSet used_fields_
Sub field set contains fields used in calculation.
void boundary_side_integral(DHCellSide cell_side)
Assembles the fluxes on the boundary.
std::shared_ptr< BoundaryIntegralAcc< dim > > bdr_integral_
Boundary integral of assembly class.
void end() override
Implements AssemblyBase::end.
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
EqFields * eq_fields_
Data objects shared with ConvectionTransport.
FEValues< 3 > fe_values_side_
FEValues of object (of P disc finite element type)
void begin() override
Implements AssemblyBase::begin.
Cell accessor allow iterate over DOF handler cells.
bool is_own() const
Return true if accessor represents own element (false for ghost element)
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
unsigned int get_dof_indices(std::vector< LongIdx > &indices) const
Fill vector of the global indices of dofs associated to the cell.
unsigned int dim() const
Return dimension of element appropriate to cell.
ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
unsigned int local_idx() const
Return local index to element (index of DOF handler).
Side accessor allows to iterate over sides of DOF handler cell.
Side side() const
Return Side of given cell and side_idx.
Boundary cond() const
const DHCellAccessor & cell() const
Return DHCellAccessor appropriate to the side.
unsigned int dim() const
Return dimension of element appropriate to the side.
ElementAccessor< 3 > element() const
double measure() const
Computes the measure of the element.
Region region() const
Definition: accessors.hh:198
void initialize(Quadrature &_quadrature, FiniteElement< DIM > &_fe, UpdateFlags _flags)
Initialize structures and calculates cell-independent data.
Definition: fe_values.cc:137
void reinit(const ElementAccessor< spacedim > &cell)
Update cell-dependent data (gradients, Jacobians etc.)
Definition: fe_values.cc:537
Container for various descendants of FieldCommonBase.
Definition: field_set.hh:159
Generic class of assemblation.
FieldSet used_fields_
Sub field set contains fields used in calculation.
void initialize()
Initialize auxiliary vectors and other data members.
std::vector< VectorMPI > vecs_
Set of data vectors of conc_mobile_fe objects.
std::shared_ptr< BulkIntegralAcc< dim > > bulk_integral_
Bulk integral of assembly class.
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
EqFields * eq_fields_
Data objects shared with TransportDG.
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
static constexpr const char * name()
InitCondAssemblyConvection(EqData *eq_data, AssemblyInternals *asm_internals)
Constructor.
MassAssemblyConvection(EqData *eq_data, AssemblyInternals *asm_internals)
Constructor.
FieldSet used_fields_
Sub field set contains fields used in calculation.
~MassAssemblyConvection()
Destructor.
std::shared_ptr< BulkIntegralAcc< dim > > mass_integral_
Bulk integral of assembly class.
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
TEqData::EqFields EqFields
void begin() override
Implements AssemblyBase::begin.
static constexpr const char * name()
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
void initialize()
Initialize auxiliary vectors and other data members.
void end() override
Implements AssemblyBase::end.
EqFields * eq_fields_
Data objects shared with TransportDG.
vector< FEValues< 3 > > fe_values_vec_
Vector of FEValues of object (of P disc finite element types)
std::vector< double > elm_meassures_
shared_ptr< FiniteElement< dim+1 > > fe_high_
Same as previous but represents finite element of higher dim of join integral.
void initialize()
Initialize auxiliary vectors and other data members.
std::vector< LongIdx > all_elem_dofs_
std::shared_ptr< EdgeIntegralAcc< dim > > edge_integral_
Edge integral of assembly class.
void end() override
Implements AssemblyBase::end.
static constexpr const char * name()
void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side)
Assembles the fluxes between elements of different dimensions.
EqFields * eq_fields_
Data objects shared with ConvectionTransport.
FieldSet used_fields_
Sub field set contains fields used in calculation.
FEValues< 3 > fe_values_side_
FEValues of object (of P disc finite element type)
std::vector< double > side_flux_
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
std::shared_ptr< CouplingIntegralAcc< dim > > coupling_integral_
Coupling integral of assembly class.
std::vector< LongIdx > side_dofs_
void begin() override
Implements AssemblyBase::begin.
vector< LongIdx > dof_indices_j_
Global DOF indices.
std::vector< double > row_values_
MatrixMpiAssemblyConvection(EqData *eq_data, AssemblyInternals *asm_internals)
Constructor.
void edge_integral(RangeConvert< DHEdgeSide, DHCellSide > edge_side_range)
Assembles the fluxes between sides of elements of the same dimension.
IterConvert< ObjectIn, ObjectOut > begin()
Iterator to begin item of range.
unsigned int bulk_idx() const
Returns index of the region in the bulk set.
Definition: region.hh:90
Definitions of basic Lagrangean finite elements with polynomial shape functions.
Class FEValues calculates finite element data on the actual cells such as shape function values,...
int IntIdx
Definition: index_types.hh:25
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
Definition: index_types.hh:24
static constexpr bool value
Definition: json.hpp:87
unsigned int IntDim
A dimension index type.
Definition: mixed.hh:19
Definitions of particular quadrature rules on simplices.
Holds common data shared between GenericAssemblz and Assembly<dim> classes.
UpdateFlags
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell.
Definition: update_flags.hh:68
@ update_values
Shape function values.
Definition: update_flags.hh:87
@ update_normal_vectors
Normal vectors.
@ update_side_JxW_values
Transformed quadrature weight for cell sides.
@ update_quadrature_points
Transformed quadrature points.