Skip to content

Commit

Permalink
Set particle plugin index to locally stored indices.
Browse files Browse the repository at this point in the history
  • Loading branch information
MFraters committed Jun 20, 2024
1 parent 9ec159d commit 530c96a
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion source/particle/integrator/rk_2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace aspect
void
RK2<dim>::initialize ()
{
const auto &property_information = this->get_particle_world(0).get_property_manager().get_data_info();
const auto &property_information = this->get_particle_world(this->get_particle_world_index()).get_property_manager().get_data_info();
property_index_old_location = property_information.get_position_by_field_name("internal: integrator properties");
}

Expand Down
2 changes: 1 addition & 1 deletion source/particle/integrator/rk_4.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace aspect
void
RK4<dim>::initialize ()
{
const auto &property_information = this->get_particle_world(0).get_property_manager().get_data_info();
const auto &property_information = this->get_particle_world(this->get_particle_world_index()).get_property_manager().get_data_info();

property_indices[0] = property_information.get_position_by_field_name("internal: integrator properties");
property_indices[1] = property_indices[0] + dim;
Expand Down
2 changes: 1 addition & 1 deletion source/particle/interpolator/bilinear_least_squares.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ namespace aspect
{
prm.enter_subsection("Bilinear least squares");
{
const auto &particle_property_information = this->get_particle_world(0).get_property_manager().get_data_info();
const auto &particle_property_information = this->get_particle_world(this->get_particle_world_index()).get_property_manager().get_data_info();
const unsigned int n_property_components = particle_property_information.n_components();
const unsigned int n_internal_components = particle_property_information.get_components_by_field_name("internal: integrator properties");

Expand Down
2 changes: 1 addition & 1 deletion source/particle/interpolator/quadratic_least_squares.cc
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ namespace aspect
{
prm.enter_subsection("Quadratic least squares");
{
const auto &particle_property_information = this->get_particle_world(0).get_property_manager().get_data_info();
const auto &particle_property_information = this->get_particle_world(this->get_particle_world_index()).get_property_manager().get_data_info();
const unsigned int n_property_components = particle_property_information.n_components();
const unsigned int n_internal_components = particle_property_information.get_components_by_field_name("internal: integrator properties");

Expand Down
4 changes: 2 additions & 2 deletions source/particle/property/cpo_bingham_average.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace aspect
{
const unsigned int my_rank = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD);
this->random_number_generator.seed(random_number_seed+my_rank);
const auto &manager = this->get_particle_world(0).get_property_manager();
const auto &manager = this->get_particle_world(this->get_particle_world_index()).get_property_manager();
AssertThrow(manager.plugin_name_exists("crystal preferred orientation"),
ExcMessage("No crystal preferred orientation property plugin found."));

Expand Down Expand Up @@ -252,7 +252,7 @@ namespace aspect
{
// Get a pointer to the CPO particle property.
cpo_particle_property = std::make_unique<const Particle::Property::CrystalPreferredOrientation<dim>> (
this->get_particle_world(0).get_property_manager().template get_matching_property<Particle::Property::CrystalPreferredOrientation<dim>>());
this->get_particle_world(this->get_particle_world_index()).get_property_manager().template get_matching_property<Particle::Property::CrystalPreferredOrientation<dim>>());

random_number_seed = prm.get_integer ("Random number seed");
n_grains = cpo_particle_property->get_number_of_grains();
Expand Down
4 changes: 2 additions & 2 deletions source/particle/property/cpo_elastic_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace aspect
void
CpoElasticTensor<dim>::initialize ()
{
const auto &manager = this->get_particle_world(0).get_property_manager();
const auto &manager = this->get_particle_world(this->get_particle_world_index()).get_property_manager();
AssertThrow(manager.plugin_name_exists("crystal preferred orientation"),
ExcMessage("No crystal preferred orientation property plugin found."));

Expand Down Expand Up @@ -147,7 +147,7 @@ namespace aspect
{
// Get a reference to the CPO particle property.
const Particle::Property::CrystalPreferredOrientation<dim> &cpo_particle_property =
this->get_particle_world(0).get_property_manager().template get_matching_property<Particle::Property::CrystalPreferredOrientation<dim>>();
this->get_particle_world(this->get_particle_world_index()).get_property_manager().template get_matching_property<Particle::Property::CrystalPreferredOrientation<dim>>();


const SymmetricTensor<2,6> C_average = voigt_average_elastic_tensor(cpo_particle_property,
Expand Down
2 changes: 1 addition & 1 deletion source/particle/property/elastic_tensor_decomposition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ namespace aspect
void
ElasticTensorDecomposition<dim>::initialize ()
{
const Particle::Property::Manager<dim> &manager = this->get_particle_world(0).get_property_manager();
const Particle::Property::Manager<dim> &manager = this->get_particle_world(this->get_particle_world_index()).get_property_manager();
AssertThrow(manager.plugin_name_exists("crystal preferred orientation"),
ExcMessage("No cpo property plugin found."));
AssertThrow(manager.plugin_name_exists("cpo elastic tensor"),
Expand Down
2 changes: 1 addition & 1 deletion tests/particle_property_post_initialize_function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace aspect
initialize ()
{
std::cout << "initialize" << std::endl;
const Particle::Property::Manager<dim> &manager = this->get_particle_world(0).get_property_manager();
const Particle::Property::Manager<dim> &manager = this->get_particle_world(this->get_particle_world_index()).get_property_manager();
post_initialized_info = manager.get_data_info().get_field_index_by_name("initial position");
std::cout << "initial position: post_initialized_info = " << post_initialized_info << std::endl;

Expand Down

0 comments on commit 530c96a

Please sign in to comment.