Flow123d  release_3.0.0-973-g92f55e826
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/side_impl.hh"
12 #include "mesh/mesh.h"
14 #include "flow/darcy_flow_mh.hh"
15 #include "la/local_system.hh"
16 #include <vector>
17 
18 
19 typedef std::shared_ptr<DarcyMH::EqData> AssemblyDataPtr;
20 
21 
23 public:
25 
27  : data_(data),
28  mixed_mesh_(data->mesh->mixed_intersections()),
29  fix_velocity_flag(false)
30  {
31 
32  }
33 
34  virtual ~MortarAssemblyBase() {};
35 
36  // Default assembly is empty to allow dummy implementation for dimensions without coupling.
37  virtual void assembly(LocalElementAccessorBase<3> ele_ac) {};
38 
40  fix_velocity_flag = true;
41  this->assembly(ele_ac);
42  fix_velocity_flag = false;
43  }
44 
45 protected:
50 
51 };
52 
53 
54 struct IsecData {
57  unsigned int dim;
58  double delta;
59  double ele_z_coord_;
61  arma::vec dirichlet_sol;
62  unsigned int n_dirichlet;
63 };
64 
65 
67 public:
70  void pressure_diff(LocalElementAccessorBase<3> ele_ac, double delta);
71  void fix_velocity_local(const IsecData & row_ele, const IsecData &col_ele);
72 private:
73  inline arma::mat & tensor_average(unsigned int row_dim, unsigned int col_dim) {
74  return tensor_average_[4*row_dim + col_dim];
75  }
76 
77  void add_to_linsys(double scale);
78 
80 
81  /// Row matrices to compute element pressure as average of boundary pressures
85  arma::mat product_;
87 
88 };
89 
90 
91 
93 public:
95 : MortarAssemblyBase(data),
96  rhs(5),
97  dofs(5),
98  dirichlet(5)
99  {
100  rhs.zeros();
101  }
102 
104  void add_sides(LocalElementAccessorBase<3> ele_ac, unsigned int shift, vector<int> &dofs, vector<double> &dirichlet);
105 private:
106 
107  arma::vec rhs;
110 };
111 
112 
113 
114 #endif /* SRC_FLOW_MORTAR_ASSEMBLY_HH_ */
P0_CouplingAssembler::col_average_
std::vector< arma::vec > col_average_
Definition: mortar_assembly.hh:83
IsecData::ele_z_coord_
double ele_z_coord_
Definition: mortar_assembly.hh:59
IsecData::dirichlet_sol
arma::vec dirichlet_sol
Definition: mortar_assembly.hh:61
LocalSystem::DofVec
arma::Col< LongIdx > DofVec
Definition: local_system.hh:30
P1_CouplingAssembler::assembly
void assembly(LocalElementAccessorBase< 3 > ele_ac)
Definition: mortar_assembly.cc:274
P0_CouplingAssembler::add_to_linsys
void add_to_linsys(double scale)
Definition: mortar_assembly.cc:200
LocalSystem
Definition: local_system.hh:27
IsecData::dirichlet_dofs
LocalSystem::DofVec dirichlet_dofs
Definition: mortar_assembly.hh:60
intersection_quadrature.hh
???
P1_CouplingAssembler::add_sides
void add_sides(LocalElementAccessorBase< 3 > ele_ac, unsigned int shift, vector< int > &dofs, vector< double > &dirichlet)
Definition: mortar_assembly.cc:247
IsecData::n_dirichlet
unsigned int n_dirichlet
Definition: mortar_assembly.hh:62
P1_CouplingAssembler::dirichlet
vector< double > dirichlet
Definition: mortar_assembly.hh:109
MortarAssemblyBase::loc_system_
LocalSystem loc_system_
Definition: mortar_assembly.hh:48
MixedMeshIntersections
Main class for computation of intersection of meshes of combined dimensions.
Definition: mixed_mesh_intersections.hh:64
P0_CouplingAssembler::slave_ac_
LocalElementAccessorBase< 3 > slave_ac_
Definition: mortar_assembly.hh:86
MortarAssemblyBase::IsecList
vector< unsigned int > IsecList
Definition: mortar_assembly.hh:24
std::vector< unsigned int >
LocalElementAccessorBase< 3 >
P0_CouplingAssembler::quadrature_
IntersectionQuadratureP0 quadrature_
Definition: mortar_assembly.hh:84
MortarAssemblyBase::assembly
virtual void assembly(LocalElementAccessorBase< 3 > ele_ac)
Definition: mortar_assembly.hh:37
IsecData
Definition: mortar_assembly.hh:54
P0_CouplingAssembler::assembly
void assembly(LocalElementAccessorBase< 3 > ele_ac)
Definition: mortar_assembly.cc:80
MortarAssemblyBase
Definition: mortar_assembly.hh:22
P0_CouplingAssembler::P0_CouplingAssembler
P0_CouplingAssembler(AssemblyDataPtr data)
Definition: mortar_assembly.cc:15
AssemblyDataPtr
std::shared_ptr< DarcyMH::EqData > AssemblyDataPtr
Definition: mortar_assembly.hh:19
P0_CouplingAssembler::tensor_average_
std::vector< arma::mat > tensor_average_
Row matrices to compute element pressure as average of boundary pressures.
Definition: mortar_assembly.hh:82
P1_CouplingAssembler
Definition: mortar_assembly.hh:92
IsecData::vel_dofs
LocalSystem::DofVec vel_dofs
Definition: mortar_assembly.hh:55
P0_CouplingAssembler
Definition: mortar_assembly.hh:66
local_system.hh
IsecData::delta
double delta
Definition: mortar_assembly.hh:58
mesh.h
IsecData::dim
unsigned int dim
Definition: mortar_assembly.hh:57
IsecData::dofs
LocalSystem::DofVec dofs
Definition: mortar_assembly.hh:56
P0_CouplingAssembler::isec_data_list
vector< IsecData > isec_data_list
Definition: mortar_assembly.hh:79
P1_CouplingAssembler::rhs
arma::vec rhs
Definition: mortar_assembly.hh:107
MortarAssemblyBase::fix_velocity
void fix_velocity(LocalElementAccessorBase< 3 > ele_ac)
Definition: mortar_assembly.hh:39
P1_CouplingAssembler::P1_CouplingAssembler
P1_CouplingAssembler(AssemblyDataPtr data)
Definition: mortar_assembly.hh:94
side_impl.hh
MortarAssemblyBase::~MortarAssemblyBase
virtual ~MortarAssemblyBase()
Definition: mortar_assembly.hh:34
darcy_flow_mh.hh
mixed-hybrid model of linear Darcy flow, possibly unsteady.
P0_CouplingAssembler::fix_velocity_local
void fix_velocity_local(const IsecData &row_ele, const IsecData &col_ele)
Definition: mortar_assembly.cc:233
MortarAssemblyBase::MortarAssemblyBase
MortarAssemblyBase(AssemblyDataPtr data)
Definition: mortar_assembly.hh:26
P1_CouplingAssembler::dofs
vector< int > dofs
Definition: mortar_assembly.hh:108
IntersectionQuadratureP0
Definition: intersection_quadrature.hh:153
MortarAssemblyBase::fix_velocity_flag
bool fix_velocity_flag
Definition: mortar_assembly.hh:49
MortarAssemblyBase::data_
AssemblyDataPtr data_
Definition: mortar_assembly.hh:46
P0_CouplingAssembler::pressure_diff
void pressure_diff(LocalElementAccessorBase< 3 > ele_ac, double delta)
Definition: mortar_assembly.cc:38
P0_CouplingAssembler::tensor_average
arma::mat & tensor_average(unsigned int row_dim, unsigned int col_dim)
Definition: mortar_assembly.hh:73
P0_CouplingAssembler::product_
arma::mat product_
Definition: mortar_assembly.hh:85
MortarAssemblyBase::mixed_mesh_
MixedMeshIntersections & mixed_mesh_
Definition: mortar_assembly.hh:47