> in principle, it should be possible to do so. But, in order to save on memory
> allocations, some of the local vectors are set to their size before the loop.
> That would have to be changed. You will also have to consider if you want to
> start out using the same quadrature for all degrees to start with. It may be
> sub-optimal, but easier to implement.
We have in other places used the following idiom:
std::vector<types::global_dof_index> dof_indices;
for (cell=dof_handler.begin_active(); cell!=dof_handler.end(); ++cell)
{
dof_indices.resize (cell->get_fe().dofs_per_cell);
cell->get_dof_indices (dof_indices);
...
}
The resize operation is fast if enough memory has already been allocated and
is only slow if the previously allocated memory is not sufficient to satisfy
the current request. Of course, this happens at most FECollection::size()
times and, consequently, is not a major bottleneck. I think this could also be
applied to the various MeshWorker loops where you need to do similar operations.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@math.tamu.edu
www:
http://www.math.tamu.edu/~bangerth/