Flow123d  JS_before_hm-1881-gd692239a6
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 "system/index_types.hh"
12 #include "mesh/mesh.h"
14 #include "flow/darcy_flow_mh.hh"
15 #include "la/local_system.hh"
16 #include "fem/dh_cell_accessor.hh"
17 #include <vector>
18 
19 
20 typedef std::shared_ptr<DarcyMH::EqData> AssemblyDataPtr;
21 
22 
24 public:
26 
28  : data_(data),
29  mixed_mesh_(data->mesh->mixed_intersections()),
30  fix_velocity_flag(false)
31  {
32 
33  }
34 
35  virtual ~MortarAssemblyBase() {};
36 
37  // Default assembly is empty to allow dummy implementation for dimensions without coupling.
38  virtual void assembly(FMT_UNUSED const DHCellAccessor& dh_cell) {};
39 
40  void fix_velocity(const DHCellAccessor& dh_cell) {
41  fix_velocity_flag = true;
42  this->assembly(dh_cell);
43  fix_velocity_flag = false;
44  }
45 
46 protected:
51 
52 };
53 
54 
55 struct IsecData {
58  unsigned int dim;
59  double delta;
60  double ele_z_coord_;
63  unsigned int n_dirichlet;
64 };
65 
66 
68 public:
70  void assembly(const DHCellAccessor& dh_cell);
71  void pressure_diff(const DHCellAccessor& dh_cell, double delta);
72  void fix_velocity_local(const IsecData & row_ele, const IsecData &col_ele);
73 private:
74  inline arma::mat & tensor_average(unsigned int row_dim, unsigned int col_dim) {
75  return tensor_average_[4*row_dim + col_dim];
76  }
77 
78  void add_to_linsys(double scale);
79 
81 
82  /// Row matrices to compute element pressure as average of boundary pressures
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 
103  void assembly(const DHCellAccessor& dh_cell);
104  void add_sides(const DHCellAccessor& dh_cell, unsigned int shift, vector<int> &dofs, vector<double> &dirichlet);
105 private:
106 
110 };
111 
112 
113 
114 #endif /* SRC_FLOW_MORTAR_ASSEMBLY_HH_ */
LocDofVec
arma::Col< IntIdx > LocDofVec
Definition: index_types.hh:28
P0_CouplingAssembler::col_average_
std::vector< arma::vec > col_average_
Definition: mortar_assembly.hh:84
IsecData::ele_z_coord_
double ele_z_coord_
Definition: mortar_assembly.hh:60
IsecData::dirichlet_sol
arma::vec dirichlet_sol
Definition: mortar_assembly.hh:62
P1_CouplingAssembler::assembly
void assembly(const DHCellAccessor &dh_cell)
Definition: mortar_assembly.cc:288
Armor::vec
ArmaVec< double, N > vec
Definition: armor.hh:885
P0_CouplingAssembler::add_to_linsys
void add_to_linsys(double scale)
Definition: mortar_assembly.cc:208
LocalSystem
Definition: local_system.hh:45
intersection_quadrature.hh
???
IsecData::n_dirichlet
unsigned int n_dirichlet
Definition: mortar_assembly.hh:63
P1_CouplingAssembler::dirichlet
vector< double > dirichlet
Definition: mortar_assembly.hh:109
MortarAssemblyBase::loc_system_
LocalSystem loc_system_
Definition: mortar_assembly.hh:49
MixedMeshIntersections
Main class for computation of intersection of meshes of combined dimensions.
Definition: mixed_mesh_intersections.hh:64
P1_CouplingAssembler::add_sides
void add_sides(const DHCellAccessor &dh_cell, unsigned int shift, vector< int > &dofs, vector< double > &dirichlet)
Definition: mortar_assembly.cc:256
MortarAssemblyBase::IsecList
vector< unsigned int > IsecList
Definition: mortar_assembly.hh:25
MortarAssemblyBase::fix_velocity
void fix_velocity(const DHCellAccessor &dh_cell)
Definition: mortar_assembly.hh:40
std::vector< unsigned int >
P0_CouplingAssembler::pressure_diff
void pressure_diff(const DHCellAccessor &dh_cell, double delta)
Definition: mortar_assembly.cc:38
P0_CouplingAssembler::quadrature_
IntersectionQuadratureP0 quadrature_
Definition: mortar_assembly.hh:85
index_types.hh
IsecData
Definition: mortar_assembly.hh:55
MortarAssemblyBase
Definition: mortar_assembly.hh:23
P0_CouplingAssembler::P0_CouplingAssembler
P0_CouplingAssembler(AssemblyDataPtr data)
Definition: mortar_assembly.cc:16
AssemblyDataPtr
std::shared_ptr< DarcyMH::EqData > AssemblyDataPtr
Definition: mortar_assembly.hh:20
dh_cell_accessor.hh
Armor::mat
ArmaMat< double, N, M > mat
Definition: armor.hh:888
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:83
P1_CouplingAssembler
Definition: mortar_assembly.hh:92
IsecData::dirichlet_dofs
LocDofVec dirichlet_dofs
Definition: mortar_assembly.hh:61
P0_CouplingAssembler::assembly
void assembly(const DHCellAccessor &dh_cell)
Definition: mortar_assembly.cc:85
IsecData::vel_dofs
LocDofVec vel_dofs
Definition: mortar_assembly.hh:56
P0_CouplingAssembler
Definition: mortar_assembly.hh:67
local_system.hh
IsecData::delta
double delta
Definition: mortar_assembly.hh:59
mesh.h
IsecData::dim
unsigned int dim
Definition: mortar_assembly.hh:58
P0_CouplingAssembler::isec_data_list
vector< IsecData > isec_data_list
Definition: mortar_assembly.hh:80
P1_CouplingAssembler::rhs
arma::vec rhs
Definition: mortar_assembly.hh:107
MortarAssemblyBase::assembly
virtual void assembly(FMT_UNUSED const DHCellAccessor &dh_cell)
Definition: mortar_assembly.hh:38
DHCellAccessor
Cell accessor allow iterate over DOF handler cells.
Definition: dh_cell_accessor.hh:43
P1_CouplingAssembler::P1_CouplingAssembler
P1_CouplingAssembler(AssemblyDataPtr data)
Definition: mortar_assembly.hh:94
MortarAssemblyBase::~MortarAssemblyBase
virtual ~MortarAssemblyBase()
Definition: mortar_assembly.hh:35
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:242
MortarAssemblyBase::MortarAssemblyBase
MortarAssemblyBase(AssemblyDataPtr data)
Definition: mortar_assembly.hh:27
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:50
MortarAssemblyBase::data_
AssemblyDataPtr data_
Definition: mortar_assembly.hh:47
P0_CouplingAssembler::tensor_average
arma::mat & tensor_average(unsigned int row_dim, unsigned int col_dim)
Definition: mortar_assembly.hh:74
P0_CouplingAssembler::product_
arma::mat product_
Definition: mortar_assembly.hh:86
MortarAssemblyBase::mixed_mesh_
MixedMeshIntersections & mixed_mesh_
Definition: mortar_assembly.hh:48
FMT_UNUSED
#define FMT_UNUSED
Definition: posix.h:75
IsecData::dofs
LocDofVec dofs
Definition: mortar_assembly.hh:57