From: kronbichler Date: Thu, 31 Oct 2013 12:58:57 +0000 (+0000) Subject: Adjust some fields for face integration X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0ec0e5958e105628125bb626703a173eca49415;p=dealii-svn.git Adjust some fields for face integration git-svn-id: https://svn.dealii.org/trunk@31495 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/matrix_free/fe_evaluation.h b/deal.II/include/deal.II/matrix_free/fe_evaluation.h index aa3ff08f55..7a18e32fd2 100644 --- a/deal.II/include/deal.II/matrix_free/fe_evaluation.h +++ b/deal.II/include/deal.II/matrix_free/fe_evaluation.h @@ -3841,9 +3841,9 @@ namespace internal res0 += val0 * in[stride*ind]; } if (add == false) - out[stride*col] = res0; + out[stride*col] = res0; else - out[stride*col] += res0; + out[stride*col] += res0; } // increment: in regular case, just go to the next point in @@ -3874,6 +3874,79 @@ namespace internal + // This method applies the tensor product operation to produce face values + // out from cell values. As opposed to the apply_tensor_product method, this + // method assumes that the directions orthogonal to the face have + // fe_degree+1 degrees of freedom per direction and not n_q_points_1d for + // those directions lower than the one currently applied + template + inline + void + apply_tensor_product_face (const Number *shape_data, + const Number in [], + Number out []) + { + const int n_blocks1 = dim > 1 ? (fe_degree+1) : 1; + const int n_blocks2 = dim > 2 ? (fe_degree+1) : 1; + + AssertIndexRange (face_direction, dim); + const int mm = dof_to_quad ? (fe_degree+1) : 1, + nn = dof_to_quad ? 1 : (fe_degree+1); + + const int stride = Utilities::fixed_int_power::value; + + for (int i2=0; i2 face_indices; /** - * Stores one-dimensional values of shape - * functions on subface. Since there are two - * subfaces, store two variants. Not - * vectorized. + * Stores one-dimensional values of shape functions evaluated in zero + * and one, i.e., on the one-dimensional faces. Not vectorized. */ std::vector face_value[2]; /** - * Stores one-dimensional gradients of shape - * functions on subface. Since there are two - * subfaces, store two variants. Not - * vectorized. + * Stores one-dimensional gradients of shape functions evaluated in zero + * and one, i.e., on the one-dimensional faces. Not vectorized. */ std::vector face_gradient[2]; + /** + * Stores one-dimensional values of shape functions on subface. Since + * there are two subfaces, store two variants. Not vectorized. + */ + std::vector subface_value[2]; + /** * Non-vectorized version of shape * values. Needed when evaluating face info. diff --git a/deal.II/include/deal.II/matrix_free/shape_info.templates.h b/deal.II/include/deal.II/matrix_free/shape_info.templates.h index 1f9147f828..852a6369a0 100644 --- a/deal.II/include/deal.II/matrix_free/shape_info.templates.h +++ b/deal.II/include/deal.II/matrix_free/shape_info.templates.h @@ -91,10 +91,12 @@ namespace internal this->shape_values.resize_fast (array_size); this->shape_hessians.resize_fast (array_size); + this->face_value[0].resize(n_dofs_1d); this->face_gradient[0].resize(n_dofs_1d); - this->face_value[0].resize(array_size); + this->subface_value[0].resize(array_size); + this->face_value[1].resize(n_dofs_1d); this->face_gradient[1].resize(n_dofs_1d); - this->face_value[1].resize(array_size); + this->subface_value[1].resize(array_size); this->shape_values_number.resize (array_size); this->shape_gradient_number.resize (array_size); @@ -120,13 +122,15 @@ namespace internal shape_hessians[i*n_q_points_1d+q] = fe.shape_grad_grad(my_i,q_point)[0][0]; q_point[0] *= 0.5; - face_value[0][i*n_q_points_1d+q] = fe.shape_value(my_i,q_point); + subface_value[0][i*n_q_points_1d+q] = fe.shape_value(my_i,q_point); q_point[0] += 0.5; - face_value[1][i*n_q_points_1d+q] = fe.shape_value(my_i,q_point); + subface_value[1][i*n_q_points_1d+q] = fe.shape_value(my_i,q_point); } Point q_point; + this->face_value[0][i] = fe.shape_value(my_i,q_point); this->face_gradient[0][i] = fe.shape_grad(my_i,q_point)[0]; q_point[0] = 1; + this->face_value[1][i] = fe.shape_value(my_i,q_point); this->face_gradient[1][i] = fe.shape_grad(my_i,q_point)[0]; }