PRISMS-PF  v2.1
postprocessor.cc
Go to the documentation of this file.
1 //#include "../../include/postprocessor.h"
2 #include "../../include/matrixFreePDE.h"
3 
4 template <int dim,int degree>
5 void MatrixFreePDE<dim,degree>::computePostProcessedFields(std::vector<vectorType*> &postProcessedSet) {
6 
7 
8  // Zero out the postProcessedSet
9  for(unsigned int fieldIndex=0; fieldIndex<userInputs.pp_number_of_variables; fieldIndex++){
10  vectorType *U;
11  U=new vectorType;
12  postProcessedSet.push_back(U);
13  matrixFreeObject.initialize_dof_vector(*U, 0); *U=0;
14  }
15 
16  integrated_postprocessed_fields.clear();
17  for (unsigned int index=0; index<userInputs.num_integrated_fields; index++){
18  integrated_postprocessed_fields.push_back(0.0);
19  }
20 
21  //call to integrate and assemble
22  matrixFreeObject.cell_loop (&MatrixFreePDE<dim,degree>::getPostProcessedFields, this, postProcessedSet, solutionSet);
23 
24 }
25 
26 template <int dim,int degree>
27 void MatrixFreePDE<dim,degree>::getPostProcessedFields(const dealii::MatrixFree<dim,double> &data,
28  std::vector<vectorType*> &dst,
29  const std::vector<vectorType*> &src,
30  const std::pair<unsigned int,unsigned int> &cell_range) {
31 
32  //initialize FEEvaulation objects
33  variableContainer<dim,degree,dealii::VectorizedArray<double> > variable_list(data,userInputs.pp_baseVarInfoList);
34  variableContainer<dim,degree,dealii::VectorizedArray<double> > pp_variable_list(data,userInputs.pp_varInfoList,0);
35 
36  //loop over cells
37  for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell){
38 
39  // Initialize, read DOFs, and set evaulation flags for each variable
40  variable_list.reinit_and_eval(src, cell);
41  pp_variable_list.reinit(cell);
42 
43  unsigned int num_q_points = variable_list.get_num_q_points();
44 
45  dealii::AlignedVector<dealii::VectorizedArray<double> > JxW(num_q_points);
46  pp_variable_list.get_JxW(JxW);
47 
48  //loop over quadrature points
49  for (unsigned int q=0; q<num_q_points; ++q){
50  variable_list.q_point = q;
51  pp_variable_list.q_point = q;
52 
53  dealii::Point<dim, dealii::VectorizedArray<double> > q_point_loc = variable_list.get_q_point_location();
54 
55  // Calculate the residuals
56  postProcessedFields(variable_list,pp_variable_list,q_point_loc);
57  }
58 
59  pp_variable_list.integrate_and_distribute(dst);
60  }
61 }
62 
63 #include "../../include/matrixFreePDE_template_instantiations.h"
void reinit(unsigned int cell)
void integrate_and_distribute(std::vector< vectorType *> &dst)
void computePostProcessedFields(std::vector< vectorType *> &postProcessedSet)
Definition: postprocessor.cc:5
void get_JxW(dealii::AlignedVector< T > &JxW)
void postProcessedFields(const std::vector< modelVariable< dim > > &modelVariablesList, std::vector< modelResidual< dim > > &modelResidualsList, const dealii::Point< dim, dealii::VectorizedArray< double > > q_point_loc, const list_of_CIJ< dim > material_moduli)
Definition: postprocess.h:14
unsigned int q_point
dealii::parallel::distributed::Vector< double > vectorType
Definition: FloodFiller.h:15
void reinit_and_eval(const std::vector< vectorType *> &src, unsigned int cell)
unsigned int get_num_q_points()
dealii::Point< dim, T > get_q_point_location()
void getPostProcessedFields(const dealii::MatrixFree< dim, double > &data, std::vector< vectorType *> &dst, const std::vector< vectorType *> &src, const std::pair< unsigned int, unsigned int > &cell_range)