Public Member Functions | |
PerThreadData (const unsigned int n_solution_vectors, const unsigned int n_components, const unsigned int max_n_q_points, const unsigned int subdomain_id, const unsigned int material_id) | |
void | resize (const unsigned int n_components, const unsigned int max_n_q_points) |
Public Attributes | |
std::vector< std::vector < std::vector< double > > > | phi |
std::vector< std::vector < std::vector< Tensor< 1, dim > > > > | psi |
std::vector< std::vector < std::vector< Tensor< 1, dim > > > > | neighbor_psi |
std::vector< Point< dim > > | normal_vectors |
std::vector< double > | coefficient_values1 |
std::vector< Vector< double > > | coefficient_values |
std::vector< double > | JxW_values |
const unsigned int | subdomain_id |
const unsigned int | material_id |
Thus, every thread gets an instance of this class to work with and needs not allocate memory itself, or synchronise with other threads.
The sizes of the arrays are initialized with the maximal number of entries necessary for the hp case. Within the loop over individual cells, we then resize the arrays as necessary. Since for std::vector resizing to a smaller size doesn't imply memory allocation, this is fast.
KellyErrorEstimator< dim, spacedim >::PerThreadData::PerThreadData | ( | const unsigned int | n_solution_vectors, | |
const unsigned int | n_components, | |||
const unsigned int | max_n_q_points, | |||
const unsigned int | subdomain_id, | |||
const unsigned int | material_id | |||
) |
Constructor.
void KellyErrorEstimator< dim, spacedim >::PerThreadData::resize | ( | const unsigned int | n_components, | |
const unsigned int | max_n_q_points | |||
) |
Constructor.
std::vector<std::vector<std::vector<double> > > KellyErrorEstimator< dim, spacedim >::PerThreadData::phi |
A vector to store the jump of the normal vectors in the quadrature points for each of the solution vectors (i.e. a temporary value). This vector is not allocated inside the functions that use it, but rather globally, since memory allocation is slow, in particular in presence of multiple threads where synchronisation makes things even slower.
std::vector<std::vector<std::vector<Tensor<1,dim> > > > KellyErrorEstimator< dim, spacedim >::PerThreadData::psi |
A vector for the gradients of the finite element function on one cell
Let psi be a short name for a grad u_h
, where the third index be the component of the finite element, and the second index the number of the quadrature point. The first index denotes the index of the solution vector.
std::vector<std::vector<std::vector<Tensor<1,dim> > > > KellyErrorEstimator< dim, spacedim >::PerThreadData::neighbor_psi |
The same vector for a neighbor cell
std::vector<Point<dim> > KellyErrorEstimator< dim, spacedim >::PerThreadData::normal_vectors |
The normal vectors of the finite element function on one face
std::vector<double> KellyErrorEstimator< dim, spacedim >::PerThreadData::coefficient_values1 |
Two arrays needed for the values of coefficients in the jumps, if they are given.
std::vector<Vector<double> > KellyErrorEstimator< dim, spacedim >::PerThreadData::coefficient_values |
std::vector<double> KellyErrorEstimator< dim, spacedim >::PerThreadData::JxW_values |
Array for the products of Jacobian determinants and weights of quadraturs points.
const unsigned int KellyErrorEstimator< dim, spacedim >::PerThreadData::subdomain_id |
The subdomain id we are to care for.
const unsigned int KellyErrorEstimator< dim, spacedim >::PerThreadData::material_id |
The material id we are to care for.