20 quadrature_(*(data->mesh))
25 for(
uint row_dim=0; row_dim<4; row_dim ++)
26 for(
uint col_dim=0; col_dim<4; col_dim ++) {
28 row_avg.fill(1.0 / (row_dim+1));
30 col_avg.fill(1.0 / (col_dim+1));
48 i_data.
dofs.resize(nsides);
55 for(
unsigned int i_side=0; i_side < nsides; i_side++ ) {
68 double bc_pressure =
data_->bc_pressure.value(b_ele.
centre(), b_ele);
113 if (ele.
dim() > 2)
return;
115 if (isec_list.size() == 0)
return;
120 double m_sigma =
data_->sigma.value( ele_centre, ele);
121 double m_conductivity =
data_->conductivity.value( ele_centre, ele);
122 double m_crossection =
data_->cross_section.value( ele_centre, ele );
124 double master_sigma = 2*m_sigma*m_conductivity *
141 double cs_sqr_avg = 0.0;
142 double isec_sum = 0.0;
143 unsigned int slave_dim = 0;
145 for(; i < isec_list.size(); ++i) {
149 slave_dim = ele_slave.
dim();
150 if (slave_dim == ele.
dim())
break;
151 if (! non_zero)
continue;
153 double cs =
data_->cross_section.value(ele_slave.centre(), ele_slave);
156 cs_sqr_avg += cs*cs*isec_measure;
157 isec_sum += isec_measure;
161 if ( ! (slave_dim == 2 && ele.
dim() ==2 ) ) {
162 if( fabs(isec_sum - ele.
measure()) > 1E-5) {
164 for(
auto & isec : isec_list) {
166 out +=
fmt::format(
" {}", dh_cell_slave.elm().idx());
180 master_sigma = master_sigma * (cs_sqr_avg / isec_sum)
189 if (i < isec_list.size()) {
192 for(; i < isec_list.size(); ++i) {
196 isec_sum += isec_measure;
202 master_sigma = 100 * m_conductivity/ m_crossection / isec_sum;
213 for(
IsecData &col_ele : isec_data_list) {
216 double s = -scale * row_ele.delta * col_ele.delta;
222 for(
uint i=0; i< row_ele.n_dirichlet; i++)
250 for(
uint icol=0; icol < n_cols; icol++ ) pressure[icol] =
data_->full_solution.get(col_ele.
dofs[icol]);
253 for(
uint irow=0; irow < n_rows; irow++ )
data_->full_solution.add( row_ele.
vel_dofs[irow], add_velocity[irow] );
261 for(
unsigned int i_side=0; i_side < ele->
n_sides(); i_side++ ) {
273 dofs[shift + i_side] = -dofs[shift + i_side];
274 double bc_pressure =
data_->bc_pressure.value(b_ele.
centre(), b_ele);
275 dirichlet[shift + i_side] = bc_pressure;
void set_solution_col(uint loc_col, double solution)
const arma::mat & get_matrix()
const arma::vec & get_rhs()
void add_sides(const DHCellAccessor &dh_cell, unsigned int shift, vector< int > &dofs, vector< double > &dirichlet)
void add_to_linsys(double scale)
void set_matrix(arma::mat matrix)
Wrappers for linear systems based on MPIAIJ and MATIS format.
std::string format(CStringRef format_str, ArgList args)
std::shared_ptr< DarcyMH::EqData > AssemblyDataPtr
Cell accessor allow iterate over DOF handler cells.
std::vector< std::vector< ILpair > > element_intersections_
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
bool reinit(const IntersectionLocalBase *isec)
SideIter side(const unsigned int loc_index)
void pressure_diff(const DHCellAccessor &dh_cell, double delta)
IntersectionQuadratureP0 quadrature_
unsigned int n_dofs() const
Return number of dofs on given cell.
MixedMeshIntersections & mixed_mesh_
void fix_velocity_local(const IsecData &row_ele, const IsecData &col_ele)
void assembly(const DHCellAccessor &dh_cell)
P0_CouplingAssembler(AssemblyDataPtr data)
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
ArmaMat< double, N, M > mat
bool is_boundary() const
Returns true for side on the boundary.
void assembly(const DHCellAccessor &dh_cell)
unsigned int n_sides() const
void reset()
Resets the matrix, RHS, dofs to zero and clears solution settings.
double measure() const
Computes the measure of the element.
arma::mat & tensor_average(unsigned int row_dim, unsigned int col_dim)
void set_solution_row(uint loc_row, double solution, double diag=0.0)
std::vector< arma::vec > col_average_
void set_rhs(arma::vec rhs)
#define WarningOut()
Macro defining 'warning' record of log.
vector< IsecData > isec_data_list
unsigned int idx() const
Return local idx of element in boundary / bulk part of element vector.
void eliminate_solution()
ElementAccessor< 3 > element_accessor()