Flow123d  JS_before_hm-2088-g1c00063e5
assembly_mh_old.hh
Go to the documentation of this file.
1 /*
2  * assembly_mh_old.hh
3  *
4  * Created on: Apr 21, 2016
5  * Author: jb
6  */
7 
8 #ifndef SRC_FLOW_DARCY_FLOW_ASSEMBLY_HH_
9 #define SRC_FLOW_DARCY_FLOW_ASSEMBLY_HH_
10 
11 #include "system/index_types.hh"
12 #include "mesh/mesh.h"
13 #include "mesh/accessors.hh"
14 #include "mesh/neighbours.h"
15 #include "fem/fe_p.hh"
16 #include "fem/fe_values.hh"
17 #include "fem/fe_rt.hh"
18 #include "fem/fe_values_views.hh"
20 
21 #include "la/linsys.hh"
22 #include "la/linsys_PETSC.hh"
23 #include "la/linsys_BDDC.hh"
24 #include "la/schur.hh"
25 
26 #include "la/local_system.hh"
27 
28 #include "coupling/balance.hh"
29 #include "flow/darcy_flow_mh.hh"
30 #include "flow/mortar_assembly.hh"
31 
32 
33 /** Common abstract class for the assembly routines in Darcy flow.
34  * Is implemented in DarcyMH, DarcyLMH and RichardsLMH assembly classes,
35  * which are independent of each other.
36  */
38 {
39 public:
40  DECLARE_EXCEPTION( ExcBCNotSupported, << "BC type not supported.\n" );
41 
42  virtual void fix_velocity(const DHCellAccessor& dh_cell) = 0;
43  virtual void assemble(const DHCellAccessor& dh_cell) = 0;
44  virtual void assemble_reconstruct(const DHCellAccessor& dh_cell) = 0;
45 
46  /// Updates water content in Richards.
47  virtual void update_water_content(const DHCellAccessor& dh_cell) = 0;
48 
49  /**
50  * Generic creator of multidimensional assembly, i.e. vector of
51  * particular assembly objects.
52  */
53  template< template<int dim> class Impl, class Fields, class Data>
54  static MultidimAssembly create(Fields eq_fields, Data eq_data) {
55  return { std::make_shared<Impl<1> >(eq_fields, eq_data),
56  std::make_shared<Impl<2> >(eq_fields, eq_data),
57  std::make_shared<Impl<3> >(eq_fields, eq_data) };
58  }
59 
60  virtual ~AssemblyFlowBase() {}
61 };
62 
63 
64 template <int dim>
66 private:
67  // assembly face integrals (BC)
70 public:
72  : side_quad_(dim, 1),
73  fe_p_disc_(0)
74  {
76  }
78 
79 };
80 
81 
82 /** MH version of Darcy flow assembly. It is supposed not to be improved anymore,
83  * however it is kept functioning aside of the LMH lumped version until
84  * the LMH version is stable and optimized.
85  */
86 template<int dim>
88 {
89 public:
90  typedef std::shared_ptr<DarcyMH::EqFields> AssemblyFieldsPtrMH;
91  typedef std::shared_ptr<DarcyMH::EqData> AssemblyDataPtrMH;
92 
94  : quad_(dim, 2),
95  velocity_interpolation_quad_(dim, 0), // veloctiy values in barycenter
96  af_(eq_fields),
97  ad_(eq_data),
98  loc_system_(size(), size()),
99  loc_system_vb_(2,2)
100 
101  {
105 
106  // local numbering of dofs for MH system
107  unsigned int nsides = dim+1;
108  loc_side_dofs.resize(nsides);
109  loc_ele_dof = nsides;
110  loc_edge_dofs.resize(nsides);
111  for(unsigned int i = 0; i < nsides; i++){
112  loc_side_dofs[i] = i;
113  loc_edge_dofs[i] = nsides + i + 1;
114  }
115  //DebugOut() << print_var(this) << print_var(side_quad_.size());
116 
117  // create local sparsity pattern
118  arma::umat sp(size(),size());
119  sp.zeros();
120  sp.submat(0, 0, nsides, nsides).ones();
121  sp.diag().ones();
122  // armadillo 8.4.3 bug with negative sub diagonal index
123  // sp.diag(nsides+1).ones();
124  // sp.diag(-nsides-1).ones();
125  // sp.print();
126 
127  sp.submat(0, nsides+1, nsides-1, size()-1).diag().ones();
128  sp.submat(nsides+1, 0, size()-1, nsides-1).diag().ones();
129 
131 
132  // local system 2x2 for vb neighbourings is full matrix
133  // this matrix cannot be influenced by any BC (no elimination can take place)
134  sp.ones(2,2);
136 
137  if (ad_->mortar_method_ == DarcyFlowInterface::MortarP0) {
138  mortar_assembly = std::make_shared<P0_CouplingAssembler>(af_, ad_);
139  } else if (ad_->mortar_method_ == DarcyFlowInterface::MortarP1) {
140  mortar_assembly = std::make_shared<P1_CouplingAssembler>(af_, ad_);
141  }
142 
143  }
144 
145  void assemble_reconstruct(const DHCellAccessor&) override
146  {};
147  void update_water_content(const DHCellAccessor&) override
148  {};
149 
150  ~AssemblyMH<dim>() override
151  {}
152 
153 // LocalSystem& get_local_system() override
154 // { return loc_system_;}
155 
156  void fix_velocity(const DHCellAccessor& dh_cell) override
157  {
158  if (mortar_assembly)
159  mortar_assembly->fix_velocity(dh_cell);
160  }
161 
162  void assemble(const DHCellAccessor& dh_cell) override
163  {
164  ASSERT_EQ_DBG(dh_cell.dim(), dim);
165  loc_system_.reset();
166 
167  set_dofs_and_bc(dh_cell);
168 
169  assemble_sides(dh_cell);
170  assemble_element(dh_cell);
171 
173  ad_->lin_sys->set_local_system(loc_system_);
174 
175  assembly_dim_connections(dh_cell);
176 
177  if (ad_->balance != nullptr)
179 
180  if (mortar_assembly)
181  mortar_assembly->assembly(dh_cell);
182  }
183 
184  void assembly_local_vb(ElementAccessor<3> ele, DHCellSide neighb_side) //override
185  {
186  ASSERT_LT_DBG(ele->dim(), 3);
187  //DebugOut() << "alv " << print_var(this);
188  //START_TIMER("Assembly<dim>::assembly_local_vb");
189  // compute normal vector to side
190  arma::vec3 nv;
191  ElementAccessor<3> ele_higher = ad_->mesh->element_accessor( neighb_side.element().idx() );
192  ngh_values_.fe_side_values_.reinit(neighb_side.side());
194 
195  double value = af_->sigma.value( ele.centre(), ele) *
196  2*af_->conductivity.value( ele.centre(), ele) *
197  arma::dot(af_->anisotropy.value( ele.centre(), ele)*nv, nv) *
198  af_->cross_section.value( neighb_side.centre(), ele_higher ) * // cross-section of higher dim. (2d)
199  af_->cross_section.value( neighb_side.centre(), ele_higher ) /
200  af_->cross_section.value( ele.centre(), ele ) * // crossection of lower dim.
201  neighb_side.measure();
202 
207  }
208 
209 protected:
210  static unsigned int size()
211  {
212  // dofs: velocity, pressure, edge pressure
214  }
215 
216  void set_dofs_and_bc(const DHCellAccessor& dh_cell){
217 
218  local_dofs_ = dh_cell.get_loc_dof_indices();
219  global_dofs_.resize(dh_cell.n_dofs());
220  dh_cell.get_dof_indices(global_dofs_);
221 
222  const ElementAccessor<3> ele = dh_cell.elm();
223 
224  //set global dof for element (pressure)
226 
227  //shortcuts
228  const unsigned int nsides = ele->n_sides();
229  LinSys *ls = ad_->lin_sys;
230 
231  unsigned int side_row, edge_row;
232 
233  dirichlet_edge.resize(nsides);
234  for (unsigned int i = 0; i < nsides; i++) {
235 
236  side_row = loc_side_dofs[i]; //local
237  edge_row = loc_edge_dofs[i]; //local
238  loc_system_.row_dofs[side_row] = loc_system_.col_dofs[side_row] = global_dofs_[side_row]; //global
239  loc_system_.row_dofs[edge_row] = loc_system_.col_dofs[edge_row] = global_dofs_[edge_row]; //global
240 
241  dirichlet_edge[i] = 0;
242  Side side = *dh_cell.elm().side(i);
243  if (side.is_boundary()) {
244  Boundary bcd = side.cond();
245  ElementAccessor<3> b_ele = bcd.element_accessor();
246  DarcyMH::EqFields::BC_Type type = (DarcyMH::EqFields::BC_Type)af_->bc_type.value(b_ele.centre(), b_ele);
247 
248  double cross_section = af_->cross_section.value(ele.centre(), ele);
249 
250  if ( type == DarcyMH::EqFields::none) {
251  // homogeneous neumann
252  } else if ( type == DarcyMH::EqFields::dirichlet ) {
253  double bc_pressure = af_->bc_pressure.value(b_ele.centre(), b_ele);
254  loc_system_.set_solution(loc_edge_dofs[i],bc_pressure,-1);
255  dirichlet_edge[i] = 1;
256 
257  } else if ( type == DarcyMH::EqFields::total_flux) {
258  // internally we work with outward flux
259  double bc_flux = -af_->bc_flux.value(b_ele.centre(), b_ele);
260  double bc_pressure = af_->bc_pressure.value(b_ele.centre(), b_ele);
261  double bc_sigma = af_->bc_robin_sigma.value(b_ele.centre(), b_ele);
262 
263  dirichlet_edge[i] = 2; // to be skipped in LMH source assembly
264  loc_system_.add_value(edge_row, edge_row,
265  -b_ele.measure() * bc_sigma * cross_section,
266  (bc_flux - bc_sigma * bc_pressure) * b_ele.measure() * cross_section);
267  }
268  else if (type == DarcyMH::EqFields::seepage) {
269  ad_->is_linear=false;
270 
271  unsigned int loc_edge_idx = bcd.bc_ele_idx();
272  char & switch_dirichlet = ad_->bc_switch_dirichlet[loc_edge_idx];
273  double bc_pressure = af_->bc_switch_pressure.value(b_ele.centre(), b_ele);
274  double bc_flux = -af_->bc_flux.value(b_ele.centre(), b_ele);
275  double side_flux = bc_flux * b_ele.measure() * cross_section;
276 
277  // ** Update BC type. **
278  if (switch_dirichlet) {
279  // check and possibly switch to flux BC
280  // The switch raise error on the corresponding edge row.
281  // Magnitude of the error is abs(solution_flux - side_flux).
282  ASSERT_DBG(ad_->dh_->distr()->is_local(global_dofs_[side_row]))(global_dofs_[side_row]);
283  unsigned int loc_side_row = local_dofs_[side_row];
284  double & solution_flux = ls->get_solution_array()[loc_side_row];
285 
286  if ( solution_flux < side_flux) {
287  //DebugOut().fmt("x: {}, to neum, p: {} f: {} -> f: {}\n", b_ele.centre()[0], bc_pressure, solution_flux, side_flux);
288  solution_flux = side_flux;
289  switch_dirichlet=0;
290  }
291  } else {
292  // check and possibly switch to pressure BC
293  // TODO: What is the appropriate DOF in not local?
294  // The switch raise error on the corresponding side row.
295  // Magnitude of the error is abs(solution_head - bc_pressure)
296  // Since usually K is very large, this error would be much
297  // higher then error caused by the inverse switch, this
298  // cause that a solution with the flux violating the
299  // flux inequality leading may be accepted, while the error
300  // in pressure inequality is always satisfied.
301  ASSERT_DBG(ad_->dh_->distr()->is_local(global_dofs_[edge_row]))(global_dofs_[edge_row]);
302  unsigned int loc_edge_row = local_dofs_[edge_row];
303  double & solution_head = ls->get_solution_array()[loc_edge_row];
304 
305  if ( solution_head > bc_pressure) {
306  //DebugOut().fmt("x: {}, to dirich, p: {} -> p: {} f: {}\n",b_ele.centre()[0], solution_head, bc_pressure, bc_flux);
307  solution_head = bc_pressure;
308  switch_dirichlet=1;
309  }
310  }
311 
312  // ** Apply BCUpdate BC type. **
313  // Force Dirichlet type during the first iteration of the unsteady case.
314  if (switch_dirichlet || ad_->force_no_neumann_bc ) {
315  //DebugOut().fmt("x: {}, dirich, bcp: {}\n", b_ele.centre()[0], bc_pressure);
316  loc_system_.set_solution(loc_edge_dofs[i],bc_pressure, -1);
317  dirichlet_edge[i] = 1;
318  } else {
319  //DebugOut()("x: {}, neuman, q: {} bcq: {}\n", b_ele.centre()[0], side_flux, bc_flux);
320  loc_system_.add_value(edge_row, side_flux);
321  }
322 
323  } else if (type == DarcyMH::EqFields::river) {
324  ad_->is_linear=false;
325 
326  double bc_pressure = af_->bc_pressure.value(b_ele.centre(), b_ele);
327  double bc_switch_pressure = af_->bc_switch_pressure.value(b_ele.centre(), b_ele);
328  double bc_flux = -af_->bc_flux.value(b_ele.centre(), b_ele);
329  double bc_sigma = af_->bc_robin_sigma.value(b_ele.centre(), b_ele);
330  ASSERT_DBG(ad_->dh_->distr()->is_local(global_dofs_[edge_row]))(global_dofs_[edge_row]);
331  unsigned int loc_edge_row = local_dofs_[edge_row];
332  double & solution_head = ls->get_solution_array()[loc_edge_row];
333 
334  // Force Robin type during the first iteration of the unsteady case.
335  if (solution_head > bc_switch_pressure || ad_->force_no_neumann_bc) {
336  // Robin BC
337  //DebugOut().fmt("x: {}, robin, bcp: {}\n", b_ele.centre()[0], bc_pressure);
338  loc_system_.add_value(edge_row, edge_row,
339  -b_ele.measure() * bc_sigma * cross_section,
340  b_ele.measure() * cross_section * (bc_flux - bc_sigma * bc_pressure) );
341  } else {
342  // Neumann BC
343  //DebugOut().fmt("x: {}, neuman, q: {} bcq: {}\n", b_ele.centre()[0], bc_switch_pressure, bc_pressure);
344  double bc_total_flux = bc_flux + bc_sigma*(bc_switch_pressure - bc_pressure);
345 
346  loc_system_.add_value(edge_row, bc_total_flux * b_ele.measure() * cross_section);
347  }
348  }
349  else {
350  THROW( ExcBCNotSupported() );
351  }
352  }
353  loc_system_.add_value(side_row, edge_row, 1.0);
354  loc_system_.add_value(edge_row, side_row, 1.0);
355  }
356  }
357 
358  void assemble_sides(const DHCellAccessor& dh_cell)
359  {
360  const ElementAccessor<3> ele = dh_cell.elm();
361  double cs = af_->cross_section.value(ele.centre(), ele);
362  double conduct = af_->conductivity.value(ele.centre(), ele);
363  double scale = 1 / cs /conduct;
364 
365  assemble_sides_scale(dh_cell, scale);
366  }
367 
368  void assemble_sides_scale(const DHCellAccessor& dh_cell, double scale)
369  {
370  arma::vec3 &gravity_vec = ad_->gravity_vec_;
371  const ElementAccessor<3> ele = dh_cell.elm();
372 
373  fe_values_.reinit(ele);
374  unsigned int ndofs = fe_values_.n_dofs();
375  unsigned int qsize = fe_values_.n_points();
376  auto velocity = fe_values_.vector_view(0);
377 
378  for (unsigned int k=0; k<qsize; k++)
379  for (unsigned int i=0; i<ndofs; i++){
380  double rhs_val =
381  arma::dot(gravity_vec,velocity.value(i,k))
382  * fe_values_.JxW(k);
383  loc_system_.add_value(i, rhs_val);
384 
385  for (unsigned int j=0; j<ndofs; j++){
386  double mat_val =
387  arma::dot(velocity.value(i,k), //TODO: compute anisotropy before
388  (af_->anisotropy.value(ele.centre(), ele )).i()
389  * velocity.value(j,k))
390  * scale * fe_values_.JxW(k);
391 
392  loc_system_.add_value(i, j, mat_val);
393  }
394  }
395 
396  // assemble matrix for weights in BDDCML
397  // approximation to diagonal of
398  // S = -C - B*inv(A)*B'
399  // as
400  // diag(S) ~ - diag(C) - 1./diag(A)
401  // the weights form a partition of unity to average a discontinuous solution from neighbouring subdomains
402  // to a continuous one
403  // it is important to scale the effect - if conductivity is low for one subdomain and high for the other,
404  // trust more the one with low conductivity - it will be closer to the truth than an arithmetic average
405  if ( typeid(*ad_->lin_sys) == typeid(LinSys_BDDC) ) {
406  const arma::mat& local_matrix = loc_system_.get_matrix();
407  for(unsigned int i=0; i < ndofs; i++) {
408  double val_side = local_matrix(i,i);
409  double val_edge = -1./local_matrix(i,i);
410 
411  unsigned int side_row = loc_system_.row_dofs[loc_side_dofs[i]];
412  unsigned int edge_row = loc_system_.row_dofs[loc_edge_dofs[i]];
413  static_cast<LinSys_BDDC*>(ad_->lin_sys)->diagonal_weights_set_value( side_row, val_side );
414  static_cast<LinSys_BDDC*>(ad_->lin_sys)->diagonal_weights_set_value( edge_row, val_edge );
415  }
416  }
417  }
418 
419 
421  // set block B, B': element-side, side-element
422 
423  for(unsigned int side = 0; side < loc_side_dofs.size(); side++){
426  }
427 
428  if ( typeid(*ad_->lin_sys) == typeid(LinSys_BDDC) ) {
429  double val_ele = 1.;
430  static_cast<LinSys_BDDC*>(ad_->lin_sys)->
431  diagonal_weights_set_value( loc_system_.row_dofs[loc_ele_dof], val_ele );
432  }
433  }
434 
435 
437  //D, E',E block: compatible connections: element-edge
438  auto ele = dh_cell.elm(); //ElementAccessor<3>
439 
440  // no Neighbours => nothing to asssemble here
441  if(dh_cell.elm()->n_neighs_vb() == 0) return;
442 
443  std::vector<LongIdx> higher_dim_dofs;
444  //DebugOut() << "adc " << print_var(this) << print_var(side_quad_.size());
445  unsigned int i = 0;
446  for ( DHCellSide neighb_side : dh_cell.neighb_sides() ) {
447  // every compatible connection adds a 2x2 matrix involving
448  // current element pressure and a connected edge pressure
449 
452 
453  // // read neighbor dofs (dh dofhandler)
454  // // neighbor cell owning neighb_side
455  DHCellAccessor dh_neighb_cell = neighb_side.cell();
456 
457  higher_dim_dofs.resize(dh_neighb_cell.n_dofs());
458  dh_neighb_cell.get_dof_indices(higher_dim_dofs);
459 
460  // local index of pedge dof on neighboring cell
461  // (dim+2) is number of edges of higher dim element
462  // TODO: replace with DHCell getter when available for FESystem component
463  const unsigned int t = dh_neighb_cell.n_dofs() - (dim+2) + neighb_side.side().side_idx();
464  loc_system_vb_.row_dofs[1] = loc_system_vb_.col_dofs[1] = higher_dim_dofs[t];
465 
466  assembly_local_vb(ele, neighb_side);
467 
469  ad_->lin_sys->set_local_system(loc_system_vb_);
470 
471  // update matrix for weights in BDDCML
472  if ( typeid(*ad_->lin_sys) == typeid(LinSys_BDDC) ) {
473  int ind = loc_system_vb_.row_dofs[1];
474  // there is -value on diagonal in block C!
475  double new_val = loc_system_vb_.get_matrix()(0,0);
476  static_cast<LinSys_BDDC*>(ad_->lin_sys)->diagonal_weights_set_value( ind, new_val );
477  }
478  ++i;
479  }
480  }
481 
483 
484  for(DHCellSide dh_side : dh_cell.side_range()){
485  unsigned int sidx = dh_side.side_idx();
486  if (dh_side.side().is_boundary()) {
487  ad_->balance->add_flux_values(ad_->water_balance_idx, dh_side,
488  {local_dofs_[loc_side_dofs[sidx]]},
489  {1}, 0);
490  }
491  }
492  }
493 
494 
495 
496  // assembly volume integrals
500 
501  NeighSideValues< (dim<3) ? dim : 2> ngh_values_;
502 
503  // Interpolation of velocity into barycenters
506 
507  // data shared by assemblers of different dimension
511 
516  unsigned int loc_ele_dof;
517 
518  std::shared_ptr<MortarAssemblyBase> mortar_assembly;
519 
522 };
523 
524 
525 #endif /* SRC_FLOW_DARCY_FLOW_ASSEMBLY_HH_ */
Element::n_neighs_vb
unsigned int n_neighs_vb() const
Return number of neighbours.
Definition: elements.h:65
LocDofVec
arma::Col< IntIdx > LocDofVec
Definition: index_types.hh:28
FE_RT0
Raviart-Thomas element of order 0.
Definition: fe_rt.hh:60
linsys_BDDC.hh
Solver based on Multilevel BDDC - using corresponding class of OpenFTL package.
Boundary
Definition: accessors.hh:355
fe_rt.hh
Definitions of Raviart-Thomas finite elements.
AssemblyMH::loc_edge_dofs
std::vector< unsigned int > loc_edge_dofs
Definition: assembly_mh_old.hh:515
FEValues::vector_view
const FEValuesViews::Vector< spacedim > & vector_view(unsigned int i) const
Accessor to vector values of multicomponent FE.
Definition: fe_values.hh:277
FEValues::n_points
unsigned int n_points() const
Returns the number of quadrature points.
Definition: fe_values.hh:296
DHCellSide::side
Side side() const
Return Side of given cell and side_idx.
Definition: dh_cell_accessor.hh:198
LinSys
Definition: la_linsys_new.hh:169
fe_values_views.hh
LocalSystem
Definition: local_system.hh:45
RefElement
Definition: ref_element.hh:339
LocalSystem::add_value
void add_value(uint row, uint col, double mat_val, double rhs_val)
Adds a single entry into the local system.
Definition: local_system.cc:169
neighbours.h
AssemblyMH::fe_rt_
FE_RT0< dim > fe_rt_
Definition: assembly_mh_old.hh:497
AssemblyFlowBase
Definition: assembly_mh_old.hh:37
DarcyMH::EqFields::river
@ river
Definition: darcy_flow_mh.hh:154
FEValues::normal_vector
arma::vec::fixed< spacedim > normal_vector(unsigned int point_no)
Returns the normal vector to a side at given quadrature point.
Definition: fe_values.hh:257
AssemblyMH
Definition: assembly_mh_old.hh:87
Element::dim
unsigned int dim() const
Definition: elements.h:120
AssemblyMH::loc_system_vb_
LocalSystem loc_system_vb_
Definition: assembly_mh_old.hh:513
AssemblyMH::AssemblyFieldsPtrMH
std::shared_ptr< DarcyMH::EqFields > AssemblyFieldsPtrMH
Definition: assembly_mh_old.hh:90
DarcyFlowInterface::MortarP1
@ MortarP1
Definition: darcy_flow_interface.hh:33
FEValues::JxW
double JxW(const unsigned int point_no)
Return the product of Jacobian determinant and the quadrature weight at given quadrature point.
Definition: fe_values.hh:223
AssemblyFlowBase::update_water_content
virtual void update_water_content(const DHCellAccessor &dh_cell)=0
Updates water content in Richards.
Side::is_boundary
bool is_boundary() const
Returns true for side on the boundary.
Definition: accessors_impl.hh:202
DHCellAccessor::get_dof_indices
unsigned int get_dof_indices(std::vector< LongIdx > &indices) const
Fill vector of the global indices of dofs associated to the cell.
Definition: dh_cell_accessor.hh:80
fe_values.hh
Class FEValues calculates finite element data on the actual cells such as shape function values,...
value
static constexpr bool value
Definition: json.hpp:87
ASSERT_DBG
#define ASSERT_DBG(expr)
Definition: include_fadbad.hh:28
linsys.hh
Wrappers for linear systems based on MPIAIJ and MATIS format.
update_values
@ update_values
Shape function values.
Definition: update_flags.hh:87
LocalSystem::set_solution
void set_solution(uint loc_dof, double solution, double diag=0.0)
Set the position and value of known solution. E.g. Dirichlet boundary condition.
Definition: local_system.cc:81
FEValues::initialize
void initialize(Quadrature &_quadrature, FiniteElement< DIM > &_fe, UpdateFlags _flags)
Initialize structures and calculates cell-independent data.
Definition: fe_values.cc:137
THROW
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
Definition: exceptions.hh:53
std::vector< std::shared_ptr< AssemblyFlowBase > >
ElementAccessor< 3 >
AssemblyMH::AssemblyDataPtrMH
std::shared_ptr< DarcyMH::EqData > AssemblyDataPtrMH
Definition: assembly_mh_old.hh:91
update_quadrature_points
@ update_quadrature_points
Transformed quadrature points.
Definition: update_flags.hh:102
arma::vec3
Definition: doxy_dummy_defs.hh:17
LocalSystem::row_dofs
LocDofVec row_dofs
Definition: local_system.hh:53
ASSERT_EQ_DBG
#define ASSERT_EQ_DBG(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:332
AssemblyMH::assemble
void assemble(const DHCellAccessor &dh_cell) override
Definition: assembly_mh_old.hh:162
DHCellAccessor::dim
unsigned int dim() const
Return dimension of element appropriate to cell.
Definition: dh_cell_accessor.hh:101
LocalSystem::col_dofs
LocDofVec col_dofs
Definition: local_system.hh:53
AssemblyMH::af_
AssemblyFieldsPtrMH af_
Definition: assembly_mh_old.hh:508
update_normal_vectors
@ update_normal_vectors
Normal vectors.
Definition: update_flags.hh:124
Side::cond
Boundary cond() const
Definition: accessors_impl.hh:225
linsys_PETSC.hh
Solver based on the original PETSc solver using MPIAIJ matrix and succesive Schur complement construc...
NeighSideValues::fe_side_values_
FEValues< 3 > fe_side_values_
Definition: assembly_mh_old.hh:77
AssemblyMH::local_dofs_
LocDofVec local_dofs_
Definition: assembly_mh_old.hh:521
AssemblyMH::assemble_reconstruct
void assemble_reconstruct(const DHCellAccessor &) override
Definition: assembly_mh_old.hh:145
index_types.hh
DHCellSide::centre
arma::vec3 centre() const
Side centre.
Definition: dh_cell_accessor.hh:219
AssemblyMH::set_dofs_and_bc
void set_dofs_and_bc(const DHCellAccessor &dh_cell)
Definition: assembly_mh_old.hh:216
AssemblyMH::velocity_interpolation_quad_
QGauss velocity_interpolation_quad_
Definition: assembly_mh_old.hh:504
FEValues< 3 >
fe_p.hh
Definitions of basic Lagrangean finite elements with polynomial shape functions.
mortar_assembly.hh
Boundary::bc_ele_idx
uint bc_ele_idx()
Definition: accessors.hh:380
DHCellSide
Side accessor allows to iterate over sides of DOF handler cell.
Definition: dh_cell_accessor.hh:176
AssemblyMH::velocity_interpolation_fv_
FEValues< 3 > velocity_interpolation_fv_
Definition: assembly_mh_old.hh:505
AssemblyMH::fe_values_
FEValues< 3 > fe_values_
Definition: assembly_mh_old.hh:499
Armor::mat
ArmaMat< double, N, M > mat
Definition: armor.hh:888
FEValues::n_dofs
unsigned int n_dofs() const
Returns the number of shape functions.
Definition: fe_values.hh:302
DHCellAccessor::side_range
Range< DHCellSide > side_range() const
Returns range of cell sides.
Definition: dh_cell_accessor.hh:464
accessors.hh
AssemblyMH::global_dofs_
std::vector< LongIdx > global_dofs_
Definition: assembly_mh_old.hh:520
AssemblyMH::ad_
AssemblyDataPtrMH ad_
Definition: assembly_mh_old.hh:509
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:471
quadrature_lib.hh
Definitions of particular quadrature rules on simplices.
AssemblyMH::assemble_sides
void assemble_sides(const DHCellAccessor &dh_cell)
Definition: assembly_mh_old.hh:358
AssemblyFlowBase::~AssemblyFlowBase
virtual ~AssemblyFlowBase()
Definition: assembly_mh_old.hh:60
schur.hh
Assembly explicit Schur complement for the given linear system. Provides method for resolution of the...
DHCellAccessor::elm
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
Definition: dh_cell_accessor.hh:71
Side
Definition: accessors.hh:396
LinSys_BDDC
Definition: linsys_BDDC.hh:39
AssemblyMH::mortar_assembly
std::shared_ptr< MortarAssemblyBase > mortar_assembly
Definition: assembly_mh_old.hh:518
local_system.hh
AssemblyMH::loc_system_
LocalSystem loc_system_
Definition: assembly_mh_old.hh:512
AssemblyMH::quad_
QGauss quad_
Definition: assembly_mh_old.hh:498
NeighSideValues::side_quad_
QGauss side_quad_
Definition: assembly_mh_old.hh:68
mesh.h
DHCellAccessor::n_dofs
unsigned int n_dofs() const
Return number of dofs on given cell.
Definition: dh_cell_accessor.hh:420
Boundary::element_accessor
ElementAccessor< 3 > element_accessor()
Definition: accessors_impl.hh:253
DarcyMH::EqFields::none
@ none
Definition: darcy_flow_mh.hh:150
NeighSideValues::fe_p_disc_
FE_P_disc< dim+1 > fe_p_disc_
Definition: assembly_mh_old.hh:69
AssemblyMH::assembly_local_vb
void assembly_local_vb(ElementAccessor< 3 > ele, DHCellSide neighb_side)
Definition: assembly_mh_old.hh:184
DarcyMH::EqFields::BC_Type
BC_Type
Definition: darcy_flow_mh.hh:149
QGauss
Symmetric Gauss-Legendre quadrature formulae on simplices.
Definition: quadrature_lib.hh:34
AssemblyMH::assembly_dim_connections
void assembly_dim_connections(const DHCellAccessor &dh_cell)
Definition: assembly_mh_old.hh:436
DHCellSide::element
ElementAccessor< 3 > element() const
Definition: dh_cell_accessor.hh:223
AssemblyFlowBase::create
static MultidimAssembly create(Fields eq_fields, Data eq_data)
Definition: assembly_mh_old.hh:54
AssemblyMH::dirichlet_edge
std::vector< unsigned int > dirichlet_edge
Definition: assembly_mh_old.hh:510
DarcyMH::EqFields::total_flux
@ total_flux
Definition: darcy_flow_mh.hh:152
Element::n_sides
unsigned int n_sides() const
Definition: elements.h:131
LocalSystem::eliminate_solution
void eliminate_solution()
Definition: local_system.cc:102
AssemblyMH::loc_ele_dof
unsigned int loc_ele_dof
Definition: assembly_mh_old.hh:516
DHCellAccessor
Cell accessor allow iterate over DOF handler cells.
Definition: dh_cell_accessor.hh:43
AssemblyMH::assemble_element
void assemble_element(const DHCellAccessor &)
Definition: assembly_mh_old.hh:420
AssemblyFlowBase::fix_velocity
virtual void fix_velocity(const DHCellAccessor &dh_cell)=0
LocalSystem::reset
void reset()
Resets the matrix, RHS, dofs to zero and clears solution settings.
Definition: local_system.cc:45
AssemblyMH::update_water_content
void update_water_content(const DHCellAccessor &) override
Updates water content in Richards.
Definition: assembly_mh_old.hh:147
AssemblyMH::loc_side_dofs
std::vector< unsigned int > loc_side_dofs
Definition: assembly_mh_old.hh:514
darcy_flow_mh.hh
mixed-hybrid model of linear Darcy flow, possibly unsteady.
update_JxW_values
@ update_JxW_values
Transformed quadrature weights.
Definition: update_flags.hh:114
NeighSideValues
Definition: assembly_mh_old.hh:65
ASSERT_LT_DBG
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
Definition: asserts.hh:300
DHCellAccessor::get_loc_dof_indices
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
Definition: dh_cell_accessor.hh:88
DarcyMH::EqFields::seepage
@ seepage
Definition: darcy_flow_mh.hh:153
LocalSystem::get_matrix
const arma::mat & get_matrix()
Definition: local_system.hh:81
AssemblyMH::size
static unsigned int size()
Definition: assembly_mh_old.hh:210
ElementAccessor::idx
unsigned int idx() const
We need this method after replacing Region by RegionIdx, and movinf RegionDB instance into particular...
Definition: accessors.hh:218
AssemblyMH::fix_velocity
void fix_velocity(const DHCellAccessor &dh_cell) override
Definition: assembly_mh_old.hh:156
AssemblyMH::add_fluxes_in_balance_matrix
void add_fluxes_in_balance_matrix(const DHCellAccessor &dh_cell)
Definition: assembly_mh_old.hh:482
DarcyFlowInterface::MortarP0
@ MortarP0
Definition: darcy_flow_interface.hh:32
balance.hh
FEValues::reinit
void reinit(const ElementAccessor< spacedim > &cell)
Update cell-dependent data (gradients, Jacobians etc.)
Definition: fe_values.cc:536
AssemblyFlowBase::DECLARE_EXCEPTION
DECLARE_EXCEPTION(ExcBCNotSupported,<< "BC type not supported.\n")
fmt::internal::Data
BasicData Data
Definition: format.h:848
AssemblyFlowBase::assemble_reconstruct
virtual void assemble_reconstruct(const DHCellAccessor &dh_cell)=0
LocalSystem::set_sparsity
void set_sparsity(const arma::umat &sp)
Sets the sparsity pattern for the local system.
Definition: local_system.cc:207
DarcyMH::EqFields::dirichlet
@ dirichlet
Definition: darcy_flow_mh.hh:151
ElementAccessor::side
SideIter side(const unsigned int loc_index)
Definition: accessors_impl.hh:139
LinSys::get_solution_array
double * get_solution_array()
Definition: linsys.hh:325
AssemblyMH::ngh_values_
NeighSideValues<(dim< 3) ? dim :2 > ngh_values_
Definition: assembly_mh_old.hh:501
FE_P_disc< dim+1 >
AssemblyMH::assemble_sides_scale
void assemble_sides_scale(const DHCellAccessor &dh_cell, double scale)
Definition: assembly_mh_old.hh:368
ElementAccessor::measure
double measure() const
Computes the measure of the element.
Definition: accessors_impl.hh:67
AssemblyFlowBase::assemble
virtual void assemble(const DHCellAccessor &dh_cell)=0
ElementAccessor::centre
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.
Definition: accessors_impl.hh:89
DHCellSide::measure
double measure() const
Definition: dh_cell_accessor.hh:239