3 #include "../../include/matrixFreePDE.h" 6 template <
int dim,
int degree>
9 bool invMInitialized=
false;
10 unsigned int parabolicFieldIndex=0;
11 for(
unsigned int fieldIndex=0; fieldIndex<fields.size(); fieldIndex++){
13 matrixFreeObject.initialize_dof_vector (invM, fieldIndex);
14 parabolicFieldIndex=fieldIndex;
20 if (!invMInitialized){
21 pcout <<
"matrixFreePDE.h: no PARABOLIC field... hence setting parabolicFieldIndex to 0 and marching ahead withn invM computation\n";
26 matrixFreeObject.initialize_dof_vector (invM, parabolicFieldIndex);
30 if (fields[parabolicFieldIndex].type==
SCALAR){
31 VectorizedArray<double> one = make_vectorized_array (1.0);
32 FEEvaluation<dim,degree> fe_eval(matrixFreeObject, parabolicFieldIndex);
33 const unsigned int n_q_points = fe_eval.n_q_points;
34 for (
unsigned int cell=0; cell<matrixFreeObject.n_macro_cells(); ++cell){
36 for (
unsigned int q=0; q<n_q_points; ++q){
37 fe_eval.submit_value(one,q);
39 fe_eval.integrate (
true,
false);
40 fe_eval.distribute_local_to_global (invM);
44 dealii::Tensor<1, dim, dealii::VectorizedArray<double> > oneV;
45 for (
unsigned int i=0;i<dim;i++){
49 FEEvaluation<dim,degree,degree+1,dim> fe_eval(matrixFreeObject, parabolicFieldIndex);
51 const unsigned int n_q_points = fe_eval.n_q_points;
52 for (
unsigned int cell=0; cell<matrixFreeObject.n_macro_cells(); ++cell){
54 for (
unsigned int q=0; q<n_q_points; ++q){
55 fe_eval.submit_value(oneV,q);
57 fe_eval.integrate (
true,
false);
58 fe_eval.distribute_local_to_global (invM);
63 invM.compress(VectorOperation::add);
65 for (
unsigned int k=0; k<invM.local_size(); ++k){
66 if (std::abs(invM.local_element(k))>1.0e-15){
67 invM.local_element(k) = 1./invM.local_element(k);
70 invM.local_element(k) = 0;
73 pcout <<
"computed mass matrix (using FE space for field: " << parabolicFieldIndex <<
")\n";
76 #include "../../include/matrixFreePDE_template_instantiations.h"