src/multiGrid/multiGridDataAnalysisWrapper3D.hh 上面为我找到的computeVelocity源码,大致就是通过 applyProcessingFunctional ( new BoxVelocityFunctional3D<T,Descriptor>, domain, lattice, velocity, lattice.getReferenceLevel() ); 来运行一下数据处理器(data processor)。
而在下面的源码中,lattice.get(iX,iY,iZ).computeVelocity()是不是又套娃回来了?
template<typename T, template<typename U> class Descriptor> void BoxVelocityFunctional3D<T,Descriptor>::process ( Box3D domain, BlockLattice3D<T,Descriptor>& lattice, TensorField3D<T,Descriptor<T>::d>& tensorField) { Dot3D offset = computeRelativeDisplacement(lattice, tensorField); for (plint iX=domain.x0; iX<=domain.x1; ++iX) { for (plint iY=domain.y0; iY<=domain.y1; ++iY) { for (plint iZ=domain.z0; iZ<=domain.z1; ++iZ) { lattice.get(iX,iY,iZ).computeVelocity ( tensorField.get(iX+offset.x,iY+offset.y,iZ+offset.z) ); } } } } template<typename T, template<typename U> class Descriptor> BoxVelocityFunctional3D<T,Descriptor>* BoxVelocityFunctional3D<T,Descriptor>::clone() const { return new BoxVelocityFunctional3D<T,Descriptor>(*this); } template<typename T, template<typename U> class Descriptor> void BoxVelocityFunctional3D<T,Descriptor>::getTypeOfModification(std::vector<modif::ModifT>& modified) const { modified[0] = modif::nothing; modified[1] = modif::staticVariables; } template<typename T, template<typename U> class Descriptor> BlockDomain::DomainT BoxVelocityFunctional3D<T,Descriptor>::appliesTo() const { return BlockDomain::bulk; }src/dataProcessors/dataAnalysisFunctional3D.hh
