26#ifndef SUBGRID_UTILITIES_H
27#define SUBGRID_UTILITIES_H
39template<
typename T,
typename PARTICLETYPE,
typename DESCRIPTOR>
46 using namespace descriptors;
47 constexpr unsigned D = DESCRIPTOR::d;
52 auto& blockLattice = sLattice.
getBlock(iC);
54 const auto& cuboid = blockGeometry.getCuboid();
57 blockLattice, converter, cuboid);
59 forParticlesInParticleSystem<T,PARTICLETYPE>( particleSystem,
62 Vector<T,D> position = particle.template getField<GENERAL,POSITION>();
65 blockInterpPhysVelF(fluidVel.
data(), position.
data());
67 particle.template setField<MOBILITY,VELOCITY>( fluidVel );
74template<
typename T,
typename PARTICLETYPE>
81 while (noP<noOfParticles){
90 bool inside[1] = {
false };
91 ind(inside, pos.
data());
100#ifdef PARALLEL_MODE_MPI
103template<
typename T,
typename PARTICLETYPE,
bool verbose=true>
106 std::size_t& noActive, std::size_t reprParticleID=0 )
109 std::size_t noFound = 0;
110 std::size_t noExcaped = 0;
120 if constexpr (verbose){
121 if (globalId==reprParticleID){
128 materialIndicatorOutput, particle );
129 if (outputVicinity){ noExcaped++; }
138 T escapeRate = T(noExcaped)/T(noFound);
139 T captureRate = 1.-escapeRate;
142 if constexpr (verbose){
144 clout <<
"globalNumOfParticles=" << noFound;
145 clout <<
"; activeParticles=" << noActive;
146 clout <<
"; escapedParticles=" << noExcaped << std::endl;
147 clout <<
"captureRate=" << captureRate <<
"; escapeRate=" << escapeRate;
IndicatorF3D is an application from .
virtual Vector< S, 3 > & getMax()
virtual Vector< S, 3 > & getMin()
class for marking output with some text
Representation of a statistic for a parallel 2D geometry.
BlockGeometry< T, D > & getBlockGeometry(int locIC)
Read and write access to a single block geometry.
Super class maintaining block lattices for a cuboid decomposition.
BlockLattice< T, DESCRIPTOR > & getBlock(int locC)
Return BlockLattice with local index locC.
Conversion between physical and lattice units, as well as discretization.
constexpr const T * data() const any_platform
void reduceAndBcast(T &reductVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
Reduction operation, followed by a broadcast.
O generate()
Generate scalar or vector filled with scalars.
bool isActive(Particle< T, PARTICLETYPE > particle)
auto getGlobalID(Particle< T, PARTICLETYPE > particle)
bool checkMaterialVicinity(SuperIndicatorMaterial< T, PARTICLETYPE::d > &materialIndicator, Particle< T, PARTICLETYPE > &particle)
void forSystemsInSuperParticleSystem(SuperParticleSystem< T, PARTICLETYPE > &sParticleSystem, F f)
void forParticlesInSuperParticleSystem(SuperParticleSystem< T, PARTICLETYPE > &sParticleSystem, F f)
ParallelParticleLocator addSubgridSphere3D(SuperParticleSystem< T, PARTICLETYPE > &sParticleSystem, const Vector< T, 3 > &position, T radius, T density=0., const Vector< T, 3 > &velocity=Vector< T, 3 >(0.))
void printSubgridParticleInfo(Particle< T, PARTICLETYPE > &particle, const std::string &streamName="ParticleInfo")
void captureStatistics(SuperParticleSystem< T, PARTICLETYPE > &sParticleSystem, SuperIndicatorMaterial< T, PARTICLETYPE::d > &materialIndicatorOutput, std::size_t &noActive, std::size_t reprParticleID=0)
void addParticles(SuperParticleSystem< T, PARTICLETYPE > &supParticleSystem, IndicatorF3D< T > &ind, T partRho, T radius, const std::size_t noOfParticles, util::Randomizer< T > &randomizer)
void initializeParticleVelocity(SuperLattice< T, DESCRIPTOR > &sLattice, SuperGeometry< T, DESCRIPTOR::d > &superGeometry, UnitConverter< T, DESCRIPTOR > const &converter, SuperParticleSystem< T, PARTICLETYPE > &supParticleSystem)
Top level namespace for all of OpenLB.
std::conditional_t< DESCRIPTOR::d==2, BlockLatticeInterpPhysVelocity2D< T, DESCRIPTOR >, BlockLatticeInterpPhysVelocity3D< T, DESCRIPTOR > > BlockLatticeInterpPhysVelocity
std::conditional_t< D==2, SuperIndicatorMaterial2D< T >, SuperIndicatorMaterial3D< T > > SuperIndicatorMaterial