numerics
Loading...
Searching...
No Matches
fluid.hpp File Reference

Weakly Compressible SPH (WCSPH) fluid solver – public interface. More...

#include "particle.hpp"
#include "rigid_body.hpp"
#include "spatial_hash.hpp"
#include "heat.hpp"
#include "core/policy.hpp"
#include <vector>

Go to the source code of this file.

Classes

struct  physics::FluidParams
 
class  physics::FluidSolver
 

Namespaces

namespace  physics
 

Detailed Description

Weakly Compressible SPH (WCSPH) fluid solver – public interface.

FluidSolver is a data container + dispatch hub. All physics computation lives in apps/fluid_sim/backends/{seq,omp}/, mirroring the structure of src/backends/{seq,omp}/ in the numerics library.

Execution policies (params.policy)

Backend::seq (default) Single-threaded. Newton's 3rd law pair traversal (iterate_pairs) visits each unique {i,j} pair once -> O(n*k/2).

Backend::omp OpenMP parallel for over particles. Per-particle neighbour query so each thread writes only to particles_[i] – no atomics needed. Falls back to seq when NUMERICS_HAS_OMP is not defined.

Policy dispatch in step() mirrors src/backends/dispatch.cpp: switch (params_.policy) { case Backend::omp: backends::omp::...; }

Definition in file fluid.hpp.