8 #ifndef SRC_FLOW_DARCY_FLOW_ASSEMBLY_HH_ 9 #define SRC_FLOW_DARCY_FLOW_ASSEMBLY_HH_ 38 template<
template<
int dim>
class Impl >
39 static MultidimAssembly
create(
typename Impl<1>::AssemblyDataPtr data) {
40 return { std::make_shared<Impl<1> >(data),
41 std::make_shared<Impl<2> >(data),
42 std::make_shared<Impl<3> >(data) };
77 fe_values_(map_, quad_, fe_rt_,
83 velocity_interpolation_quad_(0),
87 system_(data->system_)
98 fe_values_.reinit(ele);
99 unsigned int ndofs = fe_values_.get_fe()->n_dofs();
100 unsigned int qsize = fe_values_.get_quadrature()->size();
101 arma::mat::fixed<dim+1,dim+1> local_matrix;
102 local_matrix.zeros();
105 for (
unsigned int k=0; k<qsize; k++)
107 for (
unsigned int i=0; i<ndofs; i++)
109 for (
unsigned int j=0; j<ndofs; j++)
110 local_matrix[i*ndofs+j] +=
111 arma::dot(fe_values_.shape_vector(i,k),
112 (ad_->anisotropy.value(ele->centre(), ele->element_accessor() )).i()
113 * fe_values_.shape_vector(j,k)
116 ad_->system_.loc_side_rhs[i] +=
119 fe_values_.shape_vector(i,k)
120 ) * fe_values_.JxW(k);
132 double scale = 1 / cs /conduct;
133 *(system_.local_matrix) = scale*assembly_local_geometry_matrix(ele.
full_iter());
142 fe_side_values_.reinit(ele_higher, ngh->
side()->
el_idx());
143 nv = fe_side_values_.normal_vector(0);
145 double value = ad_->sigma.value( ele->centre(), ele->element_accessor()) *
146 2*ad_->conductivity.value( ele->centre(), ele->element_accessor()) *
147 arma::dot(ad_->anisotropy.value( ele->centre(), ele->element_accessor())*nv, nv) *
148 ad_->cross_section.value( ngh->
side()->
centre(), ele_higher->element_accessor() ) *
149 ad_->cross_section.value( ngh->
side()->
centre(), ele_higher->element_accessor() ) /
150 ad_->cross_section.value( ele->centre(), ele->element_accessor() ) *
153 local_vb[0] = -value; local_vb[1] = value;
154 local_vb[2] = value; local_vb[3] = -value;
162 flux_in_center.zeros();
164 velocity_interpolation_fv_.reinit(ele);
165 for (
unsigned int li = 0; li < ele->n_sides(); li++) {
166 flux_in_center += ad_->mh_dh->side_flux( *(ele->side( li ) ) )
167 * velocity_interpolation_fv_.shape_vector(li,0);
170 flux_in_center /= ad_->cross_section.value(ele->centre(), ele->element_accessor() );
171 return flux_in_center;
const arma::vec3 centre() const
Class MappingP1 implements the affine transformation of the unit cell onto the actual cell...
std::vector< std::shared_ptr< AssemblyBase > > MultidimAssembly
QGauss< dim-1 > side_quad_
virtual void assembly_local_matrix(LocalElementAccessorBase< 3 > ele)=0
ElementAccessor< 3 > element_accessor()
virtual arma::vec3 make_element_vector(ElementFullIter ele)=0
arma::vec3 make_element_vector(ElementFullIter ele) override
arma::vec3 centre() const
Class FEValues calculates finite element data on the actual cells such as shape function values...
FESideValues< dim, 3 > fe_side_values_
FE_P_disc< 0, dim, 3 > fe_p_disc_
Symmetric Gauss-Legendre quadrature formulae on simplices.
std::shared_ptr< DarcyMH::EqData > AssemblyDataPtr
Transformed quadrature points.
Definitions of basic Lagrangean finite elements with polynomial shape functions.
Shape function gradients.
Mixed-hybrid model of linear Darcy flow, possibly unsteady.
FEValues< dim, 3 > velocity_interpolation_fv_
virtual void update_water_content(LocalElementAccessorBase< 3 > ele)
ElementFullIter element() const
void assembly_local_matrix(LocalElementAccessorBase< 3 > ele) override
FEValues< dim, 3 > fe_values_
Definitions of particular quadrature rules on simplices.
unsigned int el_idx() const
void assembly_local_vb(double *local_vb, ElementFullIter ele, Neighbour *ngh) override
static MultidimAssembly create(typename Impl< 1 >::AssemblyDataPtr data)
QGauss< dim > velocity_interpolation_quad_
arma::mat::fixed< dim+1, dim+1 > assembly_local_geometry_matrix(ElementFullIter ele)
virtual void assembly_local_vb(double *local_vb, ElementFullIter ele, Neighbour *ngh)=0
ElementFullIter full_iter()
Definitions of Raviart-Thomas finite elements.
Transformed quadrature weights.