void Foam::LocalInteraction<CloudType>::info(Ostream& os) { // retrieve any stored data labelList npe0(patchData_.size(), 0); this->getModelProperty("nEscape", npe0); scalarList mpe0(patchData_.size(), 0.0); this->getModelProperty("massEscape", mpe0); labelList nps0(patchData_.size(), 0); this->getModelProperty("nStick", nps0); scalarList mps0(patchData_.size(), 0.0); this->getModelProperty("massStick", mps0); // accumulate current data labelList npe(nEscape_, 0); Pstream::listCombineGather(npe, plusEqOp<label>()); npe = npe + npe0; scalarList mpe(massEscape_); Pstream::listCombineGather(mpe, plusEqOp<scalar>()); mpe = mpe + mpe0; labelList nps(nStick_); Pstream::listCombineGather(nps, plusEqOp<label>()); nps = nps + nps0; scalarList mps(massStick_); Pstream::listCombineGather(mps, plusEqOp<scalar>()); mps = mps + mps0; forAll(patchData_, i) { os << " Parcel fate (number, mass) : patch " << patchData_[i].patchName() << nl << " - escape = " << npe[i] << ", " << mpe[i] << nl << " - stick = " << nps[i] << ", " << mps[i] << nl; } if (this->outputTime()) { this->setModelProperty("nEscape", npe); nEscape_ = 0; this->setModelProperty("massEscape", mpe); massEscape_ = 0.0; this->setModelProperty("nStick", nps); nStick_ = 0; this->setModelProperty("massStick", mps); massStick_ = 0.0; } }
PlasmaModel *WorkThread::updatePlasmaModel() { int size = nc*3/4; //Copy values from array to QVector. Required by QCustomPlot QVector<double> r(size),phi_(size),ne(size),ni(size),npe(size),npi(size); for(int i=0; i<size;i++){ r[i] = r_array[i]; phi_[i] = phi[i]; ne[i] = srho[0][i]; ni[i] = srho[1][i]; npe[i] = np_hist[0][i]; npi[i] = np_hist[1][i]; } //Set the vectors into model plasma->setR(r); plasma->setPhiDistribution(phi_); plasma->setElectronConcDistribution(ne); plasma->setIonConcDistribution(ni); plasma->setElectronsNumber(npe); plasma->setIonsNumber(npi); return plasma; }