Documentation
¶
Index ¶
- Constants
- type SPH
- func (p *SPH) CFL() float32
- func (p *SPH) CacheIncr() float32
- func (p *SPH) Delta() float32
- func (p *SPH) DensityAll()
- func (p *SPH) ExternalAll(force vector.Vec)
- func (p *SPH) Field() *field.SPHField
- func (p *SPH) GradientPressureForce()
- func (p *SPH) MaxV() float32
- func (p *SPH) N() int
- func (p *SPH) NN()
- func (p *SPH) Particles() model.ParticleArray
- func (p *SPH) PressureAll() int
- func (p *SPH) SetViscosity(x float32)
- func (p *SPH) Time() float32
- func (p *SPH) Update()
- func (p *SPH) Viscosity() float32
- func (p *SPH) ViscousAll()
Constants ¶
const ( VISCOSITY_WATER = 1.3059 CACHE_L = 0.8 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SPH ¶
type SPH struct {
// contains filtered or unexported fields
}
SPH Standard SPH Particle System - Implements SPHSystem Interface
func Init ¶
InitSPH() Creates SPH particle grid using where n3 is the cubic root of the number of particles desired so that N = n3*n3*n3 and the kernel smoothing lengthing is taken to be the the cubic average scale vector which is defaulted to 1.0. So that h = (||s||/(N3)). To ensure that the GPU shader is well formed n3 must be a multiple of the local gpu group size which is 4. So n3 = 4 * X.
func (*SPH) ExternalAll ¶
External add an external force to all particles
func (*SPH) GradientPressureForce ¶
func (p *SPH) GradientPressureForce()
Computes gradient pressure force and adds to the particle
func (*SPH) N ¶
Get the number of live particles , does not include boundary particles in the field particle list
func (*SPH) Particles ¶
func (p *SPH) Particles() model.ParticleArray
Get the field particles list, note that boundary particles are appended
func (*SPH) PressureAll ¶
Iterates over density field and calculates the particle pressures using tait EOS mapping
func (*SPH) SetViscosity ¶
func (*SPH) Update ¶
func (p *SPH) Update()
Update updates all particle positions -- non-blocking mutex locked
func (*SPH) ViscousAll ¶
func (p *SPH) ViscousAll()
(N)Applys an artificial viscosity force by calculating the laplacian of the velocity field And maps the force to the particle force fields