Flow123d  JS_before_hm-2196-g9bdbf60c0
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::EqFields> AssemblyFieldsPtr;
21 typedef std::shared_ptr<DarcyMH::EqData> AssemblyDataPtr;
22 
23 
25 public:
27 
29  : eq_fields_(eq_fields),
30  eq_data_(eq_data),
31  mixed_mesh_(eq_data->mesh->mixed_intersections()),
32  fix_velocity_flag(false)
33  {
34 
35  }
36 
37  virtual ~MortarAssemblyBase() {};
38 
39  // Default assembly is empty to allow dummy implementation for dimensions without coupling.
40  virtual void assembly(FMT_UNUSED const DHCellAccessor& dh_cell) {};
41 
42  void fix_velocity(const DHCellAccessor& dh_cell) {
43  fix_velocity_flag = true;
44  this->assembly(dh_cell);
45  fix_velocity_flag = false;
46  }
47 
48 protected:
54 
55 };
56 
57 
58 struct IsecData {
61  unsigned int dim;
62  double delta;
63  double ele_z_coord_;
66  unsigned int n_dirichlet;
67 };
68 
69 
71 public:
73  void assembly(const DHCellAccessor& dh_cell);
74  void pressure_diff(const DHCellAccessor& dh_cell, double delta);
75  void fix_velocity_local(const IsecData & row_ele, const IsecData &col_ele);
76 private:
77  inline arma::mat & tensor_average(unsigned int row_dim, unsigned int col_dim) {
78  return tensor_average_[4*row_dim + col_dim];
79  }
80 
81  void add_to_linsys(double scale);
82 
84 
85  /// Row matrices to compute element pressure as average of boundary pressures
90 
91 };
92 
93 
94 
96 public:
98 : MortarAssemblyBase(eq_fields, eq_data),
99  rhs(5),
100  dofs(5),
101  dirichlet(5)
102  {
103  rhs.zeros();
104  }
105 
106  void assembly(const DHCellAccessor& dh_cell);
107  void add_sides(const DHCellAccessor& dh_cell, unsigned int shift, vector<int> &dofs, vector<double> &dirichlet);
108 private:
109 
113 };
114 
115 
116 
117 #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:87
IsecData::ele_z_coord_
double ele_z_coord_
Definition: mortar_assembly.hh:63
IsecData::dirichlet_sol
arma::vec dirichlet_sol
Definition: mortar_assembly.hh:65
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:66
P1_CouplingAssembler::dirichlet
vector< double > dirichlet
Definition: mortar_assembly.hh:112
MortarAssemblyBase::loc_system_
LocalSystem loc_system_
Definition: mortar_assembly.hh:52
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:26
MortarAssemblyBase::eq_data_
AssemblyDataPtr eq_data_
Definition: mortar_assembly.hh:50
MortarAssemblyBase::fix_velocity
void fix_velocity(const DHCellAccessor &dh_cell)
Definition: mortar_assembly.hh:42
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:88
index_types.hh
IsecData
Definition: mortar_assembly.hh:58
MortarAssemblyBase
Definition: mortar_assembly.hh:24
AssemblyDataPtr
std::shared_ptr< DarcyMH::EqData > AssemblyDataPtr
Definition: mortar_assembly.hh:21
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:86
P1_CouplingAssembler
Definition: mortar_assembly.hh:95
IsecData::dirichlet_dofs
LocDofVec dirichlet_dofs
Definition: mortar_assembly.hh:64
P0_CouplingAssembler::assembly
void assembly(const DHCellAccessor &dh_cell)
Definition: mortar_assembly.cc:85
IsecData::vel_dofs
LocDofVec vel_dofs
Definition: mortar_assembly.hh:59
AssemblyFieldsPtr
std::shared_ptr< DarcyMH::EqFields > AssemblyFieldsPtr
Definition: mortar_assembly.hh:20
P0_CouplingAssembler
Definition: mortar_assembly.hh:70
local_system.hh
IsecData::delta
double delta
Definition: mortar_assembly.hh:62
mesh.h
IsecData::dim
unsigned int dim
Definition: mortar_assembly.hh:61
P0_CouplingAssembler::isec_data_list
vector< IsecData > isec_data_list
Definition: mortar_assembly.hh:83
P1_CouplingAssembler::P1_CouplingAssembler
P1_CouplingAssembler(AssemblyFieldsPtr eq_fields, AssemblyDataPtr eq_data)
Definition: mortar_assembly.hh:97
P1_CouplingAssembler::rhs
arma::vec rhs
Definition: mortar_assembly.hh:110
MortarAssemblyBase::assembly
virtual void assembly(FMT_UNUSED const DHCellAccessor &dh_cell)
Definition: mortar_assembly.hh:40
DHCellAccessor
Cell accessor allow iterate over DOF handler cells.
Definition: dh_cell_accessor.hh:43
MortarAssemblyBase::~MortarAssemblyBase
virtual ~MortarAssemblyBase()
Definition: mortar_assembly.hh:37
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
P1_CouplingAssembler::dofs
vector< int > dofs
Definition: mortar_assembly.hh:111
IntersectionQuadratureP0
Definition: intersection_quadrature.hh:153
MortarAssemblyBase::fix_velocity_flag
bool fix_velocity_flag
Definition: mortar_assembly.hh:53
P0_CouplingAssembler::P0_CouplingAssembler
P0_CouplingAssembler(AssemblyFieldsPtr eq_fields, AssemblyDataPtr eq_data)
Definition: mortar_assembly.cc:16
P0_CouplingAssembler::tensor_average
arma::mat & tensor_average(unsigned int row_dim, unsigned int col_dim)
Definition: mortar_assembly.hh:77
P0_CouplingAssembler::product_
arma::mat product_
Definition: mortar_assembly.hh:89
MortarAssemblyBase::eq_fields_
AssemblyFieldsPtr eq_fields_
Definition: mortar_assembly.hh:49
MortarAssemblyBase::mixed_mesh_
MixedMeshIntersections & mixed_mesh_
Definition: mortar_assembly.hh:51
MortarAssemblyBase::MortarAssemblyBase
MortarAssemblyBase(AssemblyFieldsPtr eq_fields, AssemblyDataPtr eq_data)
Definition: mortar_assembly.hh:28
FMT_UNUSED
#define FMT_UNUSED
Definition: posix.h:75
IsecData::dofs
LocDofVec dofs
Definition: mortar_assembly.hh:60