Skip to content

Commit

Permalink
Rework MP surface model
Browse files Browse the repository at this point in the history
  • Loading branch information
tobre1 committed Oct 28, 2024
1 parent 44ea4db commit fc6eaa4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions include/viennaps/models/psMultiParticleProcess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ class MultiParticleSurfaceModel : public viennaps::SurfaceModel<NumericType> {
auto velocity =
SmartPointer<std::vector<NumericType>>::New(materialIds.size(), 0.);

std::vector<std::vector<NumericType> *> fluxPtrs;
for (const auto &label : fluxDataLabels_) {
fluxPtrs.push_back(rates->getScalarData(label));
}

std::vector<NumericType> fluxes(fluxPtrs.size());
for (std::size_t i = 0; i < velocity->size(); i++) {
std::vector<NumericType> fluxes;
for (auto &fluxDataLabel : fluxDataLabels_) {
fluxes.push_back(rates->getScalarData(fluxDataLabel)->at(i));
for (std::size_t j = 0; j < fluxPtrs.size(); j++) {
fluxes[j] = fluxPtrs[j]->at(i);
}
velocity->at(i) =
rateFunction_(fluxes, MaterialMap::mapToMaterial(materialIds[i]));
Expand Down

0 comments on commit fc6eaa4

Please sign in to comment.