Flow123d  DF_profiler_memory_monitor-e298ba0
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_ */
Cell accessor allow iterate over DOF handler cells.
Main class for computation of intersection of meshes of combined dimensions.
vector< unsigned int > IsecList
void fix_velocity(const DHCellAccessor &dh_cell)
AssemblyDataPtr eq_data_
AssemblyFieldsPtr eq_fields_
LocalSystem loc_system_
MixedMeshIntersections & mixed_mesh_
virtual void assembly(FMT_UNUSED const DHCellAccessor &dh_cell)
virtual ~MortarAssemblyBase()
MortarAssemblyBase(AssemblyFieldsPtr eq_fields, AssemblyDataPtr eq_data)
void fix_velocity_local(const IsecData &row_ele, const IsecData &col_ele)
void add_to_linsys(double scale)
vector< IsecData > isec_data_list
std::vector< arma::mat > tensor_average_
Row matrices to compute element pressure as average of boundary pressures.
std::vector< arma::vec > col_average_
void pressure_diff(const DHCellAccessor &dh_cell, double delta)
P0_CouplingAssembler(AssemblyFieldsPtr eq_fields, AssemblyDataPtr eq_data)
IntersectionQuadratureP0 quadrature_
arma::mat & tensor_average(unsigned int row_dim, unsigned int col_dim)
void assembly(const DHCellAccessor &dh_cell)
void assembly(const DHCellAccessor &dh_cell)
vector< double > dirichlet
P1_CouplingAssembler(AssemblyFieldsPtr eq_fields, AssemblyDataPtr eq_data)
void add_sides(const DHCellAccessor &dh_cell, unsigned int shift, vector< int > &dofs, vector< double > &dirichlet)
arma::Col< IntIdx > LocDofVec
Definition: index_types.hh:28
std::shared_ptr< DarcyMH::EqFields > AssemblyFieldsPtr
std::shared_ptr< DarcyMH::EqData > AssemblyDataPtr
ArmaMat< double, N, M > mat
Definition: armor.hh:936
ArmaVec< double, N > vec
Definition: armor.hh:933
#define FMT_UNUSED
Definition: posix.h:75
unsigned int dim
unsigned int n_dirichlet
arma::vec dirichlet_sol
LocDofVec dofs
double ele_z_coord_
LocDofVec vel_dofs
double delta
LocDofVec dirichlet_dofs