Skip to content

Commit

Permalink
Reduce statically allocated memory size
Browse files Browse the repository at this point in the history
  • Loading branch information
gassmoeller committed Sep 27, 2024
1 parent 4a31088 commit e7f4b2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/aspect/particle/property/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ namespace aspect
* The solution vector at each particle position. This vector is
* only filled if the update function requires the solution values.
*/
small_vector<small_vector<double>> solution;
std::vector<small_vector<double,50>> solution;

/**
* The solution gradients at each particle position.
* This vector is only filled if the update function requires the
* gradients of the solution values.
*/
small_vector<small_vector<Tensor<1,dim>>> gradients;
std::vector<small_vector<Tensor<1,dim>,50>> gradients;

/**
* Cell iterator of the cell that is currently being updated.
Expand Down
4 changes: 2 additions & 2 deletions source/particle/world.cc
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,10 @@ namespace aspect
}

if (update_flags & update_values)
inputs.solution.resize(n_particles,small_vector<double>(evaluator.n_components()));
inputs.solution.resize(n_particles,small_vector<double,50>(evaluator.n_components()));

if (update_flags & update_gradients)
inputs.gradients.resize(n_particles,small_vector<Tensor<1,dim>>(evaluator.n_components()));
inputs.gradients.resize(n_particles,small_vector<Tensor<1,dim>,50>(evaluator.n_components()));

for (unsigned int i = 0; i<n_particles; ++i)
{
Expand Down

0 comments on commit e7f4b2d

Please sign in to comment.