paralleldynamics.hh
来自「open lattice boltzmann project www.open」· HH 代码 · 共 434 行 · 第 1/2 页
HH
434 行
T parameter = T(); if (hasBulkCell) { parameter = baseCells[0] -> getDynamics() -> getParameter(whichParameter); } singleton::mpi().bCastThroughMaster(¶meter, 1, hasBulkCell); return parameter;}template<typename T, template<typename U> class Lattice>void ParallelDynamics<T,Lattice>::setParameter(int whichParameter, T value) { for (unsigned iCell=0; iCell<baseCells.size(); ++iCell) { baseCells[iCell] -> getDynamics() -> setParameter(whichParameter, value); }}template<typename T, template<typename U> class Lattice>T ParallelDynamics<T,Lattice>::getOmega() const { T omega = T(); if (hasBulkCell) { omega = baseCells[0] -> getDynamics() -> getOmega(); } singleton::mpi().bCastThroughMaster(&omega, 1, hasBulkCell); return omega;}template<typename T, template<typename U> class Lattice>void ParallelDynamics<T,Lattice>::setOmega(T omega_) { for (unsigned iCell=0; iCell<baseCells.size(); ++iCell) { baseCells[iCell] -> getDynamics() -> setOmega(omega_); }}////////////////// Class ConstParallelDynamics /////////////////////////template<typename T, template<typename U> class Lattice>ConstParallelDynamics<T,Lattice>::ConstParallelDynamics(std::vector<Cell<T,Lattice> const*>& baseCells_, bool hasBulkCell_) : baseCells(baseCells_), hasBulkCell(hasBulkCell_){ }template<typename T, template<typename U> class Lattice>Dynamics<T,Lattice>* ConstParallelDynamics<T,Lattice>::clone() const { return new ConstParallelDynamics(baseCells, hasBulkCell);}template<typename T, template<typename U> class Lattice>T ConstParallelDynamics<T,Lattice>::computeEquilibrium(int iPop, T rho, const T u[Lattice<T>::d], T uSqr) const{ T eq = T(); if (hasBulkCell) { eq = baseCells[0] -> computeEquilibrium(iPop, rho, u, uSqr); } singleton::mpi().bCastThroughMaster(&eq, 1, hasBulkCell); return eq;}template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::iniEquilibrium(Cell<T,Lattice>& cell, T rho, const T u[Lattice<T>::d]){ }template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::collide(Cell<T,Lattice>& cell, LatticeStatistics<T>& statistics_){ }template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::staticCollide ( Cell<T,Lattice>& cell, const T u[Lattice<T>::d], LatticeStatistics<T>& statistics_ ){ }template<typename T, template<typename U> class Lattice>T ConstParallelDynamics<T,Lattice>::computeRho(Cell<T,Lattice> const& cell) const { T rho = T(); if (hasBulkCell) { rho = baseCells[0] -> computeRho(); } singleton::mpi().bCastThroughMaster(&rho, 1, hasBulkCell); return rho;}template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::computeU(Cell<T,Lattice> const& cell, T u[Lattice<T>::d] ) const{ if (hasBulkCell) { baseCells[0] -> computeU(u); } singleton::mpi().bCastThroughMaster(u, Lattice<T>::d, hasBulkCell);}template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::computeJ(Cell<T,Lattice> const& cell, T j[Lattice<T>::d] ) const{ if (hasBulkCell) { baseCells[0] -> getDynamics() -> computeJ(*baseCells[0], j); } singleton::mpi().bCastThroughMaster(j, Lattice<T>::d, hasBulkCell);}template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::computeStress ( Cell<T,Lattice> const& cell, T rho, const T u[Lattice<T>::d], T pi[util::TensorVal<Lattice<T> >::n] ) const{ if (hasBulkCell) { baseCells[0] -> getDynamics() -> computeStress(*baseCells[0], rho, u, pi); } singleton::mpi().bCastThroughMaster(pi, util::TensorVal<Lattice<T> >::n, hasBulkCell);}template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::computeRhoU ( Cell<T,Lattice> const& cell, T& rho, T u[Lattice<T>::d] ) const{ if (hasBulkCell) { baseCells[0] -> computeRhoU(rho, u); } singleton::mpi().bCastThroughMaster(&rho, 1, hasBulkCell); singleton::mpi().bCastThroughMaster(u, Lattice<T>::d, hasBulkCell);}template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::computeAllMomenta ( Cell<T,Lattice> const& cell, T& rho, T u[Lattice<T>::d], T pi[util::TensorVal<Lattice<T> >::n] ) const{ if (hasBulkCell) { baseCells[0] -> computeAllMomenta(rho, u, pi); } singleton::mpi().bCastThroughMaster(&rho, 1, hasBulkCell); singleton::mpi().bCastThroughMaster(u, Lattice<T>::d, hasBulkCell); singleton::mpi().bCastThroughMaster(pi, util::TensorVal<Lattice<T> >::n, hasBulkCell);}template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::computePopulations(Cell<T,Lattice> const& cell, T* f) const{ if (hasBulkCell) { baseCells[0] -> computePopulations(f); } singleton::mpi().bCastThroughMaster(f, Lattice<T>::q, hasBulkCell);}template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::computeExternalField ( Cell<T,Lattice> const& cell, int pos, int size, T* ext ) const{ if (hasBulkCell) { baseCells[0] -> computeExternalField(pos, size, ext); } singleton::mpi().bCastThroughMaster(ext, Lattice<T>::ExternalField::numScalars, hasBulkCell);}template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::defineRho(Cell<T,Lattice>& cell, T rho){ }template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::defineU(Cell<T,Lattice>& cell, const T u[Lattice<T>::d]){ }template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::defineRhoU(Cell<T,Lattice>& cell, T rho, const T u[Lattice<T>::d]){ }template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::defineAllMomenta ( Cell<T,Lattice>& cell, T rho, const T u[Lattice<T>::d], const T pi[util::TensorVal<Lattice<T> >::n] ){ }template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::definePopulations ( Cell<T,Lattice>& cell, const T* f){ }template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::defineExternalField ( Cell<T,Lattice>& cell, int pos, int size, const T* ext ){ }template<typename T, template<typename U> class Lattice>T ConstParallelDynamics<T,Lattice>::getParameter(int whichParameter) const { T parameter = T(); if (hasBulkCell) { parameter = baseCells[0] -> getDynamics() -> getParameter(whichParameter); } singleton::mpi().bCastThroughMaster(¶meter, 1, hasBulkCell); return parameter;}template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::setParameter(int whichParameter, T value){ }template<typename T, template<typename U> class Lattice>T ConstParallelDynamics<T,Lattice>::getOmega() const { T omega = T(); if (hasBulkCell) { omega = baseCells[0] -> getDynamics() -> getOmega(); } singleton::mpi().bCastThroughMaster(&omega, 1, hasBulkCell); return omega;}template<typename T, template<typename U> class Lattice>void ConstParallelDynamics<T,Lattice>::setOmega(T omega_){ }#endif}#endif // defined MULTIBLOCK_DYNAMICS_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?