2 #include "../../include/matrixFreePDE.h" 4 template <
int dim,
int degree>
6 QGauss<dim> quadrature_formula(degree+1);
7 FE_Q<dim> FE (QGaussLobatto<1>(degree+1));
8 FEValues<dim> fe_values (FE, quadrature_formula, update_values | update_JxW_values | update_quadrature_points);
9 const unsigned int n_q_points = quadrature_formula.size();
10 std::vector<double> cVal(n_q_points);
16 typename DoFHandler<dim>::active_cell_iterator cell= this->dofHandlersSet[0]->begin_active(), endc = this->dofHandlersSet[0]->end();
20 for (; cell!=endc; ++cell) {
21 if (cell->is_locally_owned()){
22 fe_values.reinit (cell);
24 fe_values.get_function_values(*variableSet[index], cVal);
26 for (
unsigned int q=0; q<n_q_points; ++q){
27 value+=(cVal[q])*fe_values.JxW(q);
32 value=Utilities::MPI::sum(value, MPI_COMM_WORLD);
38 integratedField = value;
44 template <
int dim,
int degree>
47 computing_timer.enter_section(
"matrixFreePDE: computeIntegralMF");
50 integral_index = index;
55 integratedField=Utilities::MPI::sum(integrated_var, MPI_COMM_WORLD);
58 computing_timer.exit_section(
"matrixFreePDE: computeIntegralMF");
61 template <
int dim,
int degree>
63 std::vector<vectorType*> &dst,
64 const std::vector<vectorType*> &src,
65 const std::pair<unsigned int,unsigned int> &cell_range) {
67 dealii::FEEvaluation<dim,degree,degree+1,1,double> var(data,0);
70 for (
unsigned int cell=cell_range.first; cell<cell_range.second; ++cell){
72 var.read_dof_values_plain(*src[0]);
73 var.evaluate(
true,
false,
false);
75 unsigned int num_q_points = var.n_q_points;
77 dealii::AlignedVector<dealii::VectorizedArray<double> > JxW(num_q_points);
78 var.fill_JxW_values(JxW);
81 for (
unsigned int q=0; q<num_q_points; ++q){
84 dealii::VectorizedArray<double> val = var.get_value(q);
85 assembler_lock.acquire ();
86 for (
unsigned i=0; i<val.n_array_elements;i++){
87 integrated_var += val[i]*JxW[q][i];
89 assembler_lock.release ();
97 #include "../../include/matrixFreePDE_template_instantiations.h"
void getIntegralMF(const MatrixFree< dim, double > &data, std::vector< vectorType *> &dst, const std::vector< vectorType *> &src, const std::pair< unsigned int, unsigned int > &cell_range)
void computeIntegral(double &integratedField, int index, std::vector< vectorType *> postProcessedSet)
void computeIntegralMF(double &integratedField, int index, const std::vector< vectorType *> postProcessedSet)