Flow123d  release_2.2.0-914-gf1a3a4f
mortar_assembly.hh
Go to the documentation of this file.
1 /*
2  * mortar_assembly.hh
3  *
4  * Created on: Feb 22, 2017
5  * Author: jb
6  */
7 
8 #ifndef SRC_FLOW_MORTAR_ASSEMBLY_HH_
9 #define SRC_FLOW_MORTAR_ASSEMBLY_HH_
10 
11 #include "mesh/mesh.h"
13 #include "flow/darcy_flow_mh.hh"
14 #include "la/local_system.hh"
15 #include <vector>
16 
17 
18 typedef std::shared_ptr<DarcyMH::EqData> AssemblyDataPtr;
19 
20 
22 public:
24 
26  : data_(data),
27  mixed_mesh_(data->mesh->mixed_intersections()),
28  fix_velocity_flag(false)
29  {
30 
31  }
32 
33  virtual ~MortarAssemblyBase() {};
34 
35  // Default assembly is empty to allow dummy implementation for dimensions without coupling.
36  virtual void assembly(LocalElementAccessorBase<3> ele_ac) {};
37 
39  fix_velocity_flag = true;
40  this->assembly(ele_ac);
41  fix_velocity_flag = false;
42  }
43 
44 protected:
49 
50 };
51 
52 
53 struct IsecData {
54  arma::uvec vel_dofs;
55  arma::uvec dofs;
56  unsigned int dim;
57  double delta;
58  double ele_z_coord_;
59  arma::uvec dirichlet_dofs;
60  arma::vec dirichlet_sol;
61  unsigned int n_dirichlet;
62 };
63 
64 
66 public:
69  void pressure_diff(LocalElementAccessorBase<3> ele_ac, double delta);
70  void fix_velocity_local(const IsecData & row_ele, const IsecData &col_ele);
71 private:
72  inline arma::mat & tensor_average(unsigned int row_dim, unsigned int col_dim) {
73  return tensor_average_[4*row_dim + col_dim];
74  }
75 
76  void add_to_linsys(double scale);
77 
79 
80  /// Row matrices to compute element pressure as average of boundary pressures
84  arma::mat product_;
86 
87 };
88 
89 
90 
92 public:
94 : MortarAssemblyBase(data),
95  rhs(5),
96  dofs(5),
97  dirichlet(5)
98  {
99  rhs.zeros();
100  }
101 
103  void add_sides(LocalElementAccessorBase<3> ele_ac, unsigned int shift, vector<int> &dofs, vector<double> &dirichlet);
104 private:
105 
106  arma::vec rhs;
109 };
110 
111 
112 
113 #endif /* SRC_FLOW_MORTAR_ASSEMBLY_HH_ */
std::vector< arma::mat > tensor_average_
Row matrices to compute element pressure as average of boundary pressures.
arma::vec dirichlet_sol
arma::uvec vel_dofs
virtual void assembly(LocalElementAccessorBase< 3 > ele_ac)
std::shared_ptr< DarcyMH::EqData > AssemblyDataPtr
virtual ~MortarAssemblyBase()
vector< double > dirichlet
AssemblyDataPtr data_
IntersectionQuadratureP0 quadrature_
MixedMeshIntersections & mixed_mesh_
double delta
LocalSystem loc_system_
P1_CouplingAssembler(AssemblyDataPtr data)
arma::uvec dofs
void fix_velocity(LocalElementAccessorBase< 3 > ele_ac)
MortarAssemblyBase(AssemblyDataPtr data)
LocalElementAccessorBase< 3 > slave_ac_
arma::mat & tensor_average(unsigned int row_dim, unsigned int col_dim)
vector< unsigned int > IsecList
std::vector< arma::vec > col_average_
unsigned int n_dirichlet
unsigned int dim
vector< IsecData > isec_data_list
double ele_z_coord_
mixed-hybrid model of linear Darcy flow, possibly unsteady.
arma::uvec dirichlet_dofs
Main class for computation of intersection of meshes of combined dimensions.