Documentation ¶
Index ¶
- Constants
- func EosGamma(x float32, c0 float32, d0 float32, gamma float32, p0 float32) float32
- func Float3_buffer_set(x int, buffer []float32, b *[3]float32)
- func Float3_set(x int, a *[3]float32, buffer []float32)
- func TaitEos(x float32, d0 float32, p0 float32) float32
- type Particle
- func (p *Particle) AddForce(x [3]float32)
- func (p *Particle) AddPosition(x [3]float32)
- func (p *Particle) AddVelocity(x [3]float32)
- func (p *Particle) Pressure(d0 float32, p0 float32) float32
- func (p *Particle) SetForce(x []float32)
- func (p *Particle) SetPosition(x []float32)
- func (p *Particle) SetVelocity(x []float32)
- type ParticleArray
- func (p *ParticleArray) AddBoundaryParticles(positions []float32) []float32
- func (p *ParticleArray) D0() float32
- func (p *ParticleArray) Densities() []float32
- func (p *ParticleArray) Density(index int) float32
- func (p *ParticleArray) Force(index int) []float32
- func (p *ParticleArray) Forces() []float32
- func (p *ParticleArray) Get(index int) Particle
- func (p *ParticleArray) Mass() float32
- func (p *ParticleArray) N() int
- func (p *ParticleArray) Position(index int) []float32
- func (p *ParticleArray) Positions() []float32
- func (p *ParticleArray) Pressure(index int, d0 float32, p0 float32) float32
- func (p *ParticleArray) Pressures() []float32
- func (p *ParticleArray) Set(index int, particle Particle)
- func (p *ParticleArray) SetReferenceDensity(d float32)
- func (p *ParticleArray) Total() int
- func (p *ParticleArray) Velocities() []float32
- func (p *ParticleArray) Velocity(index int) []float32
- type ParticleField
- type ParticleStructField
- func (p ParticleStructField) AddBoundaryParticles([]float32)
- func (p ParticleStructField) D0() float32
- func (p ParticleStructField) Densities() []float32
- func (p ParticleStructField) Density(x int) float32
- func (p ParticleStructField) Force(x int) []float32
- func (p ParticleStructField) Forces() []float32
- func (p ParticleStructField) Get(x int) Particle
- func (p ParticleStructField) Mass() float32
- func (p ParticleStructField) N() int
- func (p ParticleStructField) Position(x int) []float32
- func (p ParticleStructField) Positions() []float32
- func (p ParticleStructField) Pressure(x int, d0 float32, p0 float32) float32
- func (p ParticleStructField) Pressures() []float32
- func (p ParticleStructField) Set(x int, particle Particle)
- func (p ParticleStructField) Total() int
- func (p ParticleStructField) Velocities() []float32
- func (p ParticleStructField) Velocity(x int) []float32
Constants ¶
const FLUID_DENSITY = 87.0
const FLUID_KERN_RAD = 0.2
const FLUID_MASS = 0.1
Water Model
const FLUID_SOS = float32(1480.0)
const FLUID_STIFF = 6.1
const FLUID_WATER = 0
const PARTICLE_BOUND = 1
const PARTICLE_GHOST = 2
const PARTICLE_SPH = 0
Particle Const Enum Defs
const SAMPLER_ALL_NEIGHBORS = 3
const SAMPLER_HEURISTIC_NEIGHBORS = 2
const SPH_EOS_INF = -1
const SPH_MESH_COLLIS = 1
Collision Handling
const SPH_PARTICLE_COLLIS = 2
const SPH_THREAD_WAITING = 104
const SPH_VALID = 0
SPH Method Return Values
const THREAD_DONE = 103
const THREAD_ERR = 102
const THREAD_GO = 101
const THREAD_WAIT = 100
Go Routine Enums:
const USE_DFSPH = 3
const USE_FLIP = 5
const USE_GRID = 4
const USE_PCISPH = 2
const USE_STD = 0
SPH IMPLEMENTATION
const USE_WCSPH = 1
const VOXEL_CACHE_SAMPLER = 1
const VOXEL_SAMPLER = 0
SAMPLER Enums
Variables ¶
This section is empty.
Functions ¶
func Float3_buffer_set ¶
Set the a buffer size >= 3 with the size 3 b float32 array
func Float3_set ¶
func TaitEos ¶
EOS() - Tait Equation of State for Water like incrompressible fluids where gamma maps the stiffess parameter of the fluid with suggested values in the 6.0-7.0 range @param x - density input @param c0 - Speed of sound & reference pressure relation (2.15)gpa @param d0 - Reference density (1000)kg/m^3 or (1.0g/cm^3) @param gamma - Stifness parameter @param p0 - reference pressure for the system (101325 pa) or 1013.25hPA @notes The reference speed of sound c0 is taken to be approximately 10 times the maximum expected velocity for the system if
Types ¶
type Particle ¶
type Particle struct { Position [3]float32 Velocity [3]float32 Force [3]float32 Density float32 Press float32 }
Fixed Particle structure array
func (*Particle) AddPosition ¶
func (*Particle) AddVelocity ¶
func (*Particle) SetPosition ¶
func (*Particle) SetVelocity ¶
type ParticleArray ¶
type ParticleArray struct { ReferenceDensity float32 // contains filtered or unexported fields }
func NewParticleArray ¶
func NewParticleArray(n_particles int, n_boundary int, kernel float32, density float32, mass float32) ParticleArray
Returns the particle array given n particles and n_boundary particles
func (*ParticleArray) AddBoundaryParticles ¶
func (p *ParticleArray) AddBoundaryParticles(positions []float32) []float32
Adds in boundary particle buffer of positions
func (*ParticleArray) D0 ¶
func (p *ParticleArray) D0() float32
func (*ParticleArray) Densities ¶
func (p *ParticleArray) Densities() []float32
func (*ParticleArray) Density ¶
func (p *ParticleArray) Density(index int) float32
func (*ParticleArray) Force ¶
func (p *ParticleArray) Force(index int) []float32
func (*ParticleArray) Forces ¶
func (p *ParticleArray) Forces() []float32
func (*ParticleArray) Get ¶
func (p *ParticleArray) Get(index int) Particle
func (*ParticleArray) Mass ¶
func (p *ParticleArray) Mass() float32
func (*ParticleArray) N ¶
func (p *ParticleArray) N() int
func (*ParticleArray) Position ¶
func (p *ParticleArray) Position(index int) []float32
func (*ParticleArray) Positions ¶
func (p *ParticleArray) Positions() []float32
func (*ParticleArray) Pressure ¶
func (p *ParticleArray) Pressure(index int, d0 float32, p0 float32) float32
func (*ParticleArray) Pressures ¶
func (p *ParticleArray) Pressures() []float32
func (*ParticleArray) Set ¶
func (p *ParticleArray) Set(index int, particle Particle)
func (*ParticleArray) SetReferenceDensity ¶
func (p *ParticleArray) SetReferenceDensity(d float32)
func (*ParticleArray) Total ¶
func (p *ParticleArray) Total() int
func (*ParticleArray) Velocities ¶
func (p *ParticleArray) Velocities() []float32
func (*ParticleArray) Velocity ¶
func (p *ParticleArray) Velocity(index int) []float32
type ParticleField ¶
type ParticleField interface { Positions() []float32 Velocities() []float32 Densities() []float32 Forces() []float32 Pressure(x int, d0 float32, p0 float32) float32 Pressures() []float32 Density(x int) float32 Position(x int) []float32 Velocity(x int) []float32 Force(x int) []float32 Mass() float32 Set(x int, particle Particle) Get(x int) Particle D0() float32 AddBoundaryParticles([]float32) []float32 N() int Total() int //Total particles SetReferenceDensity(d float32) }
Particle Field Interface for interacting with both buffer based and struct based particle fields
type ParticleStructField ¶
type ParticleStructField struct { Particles []Particle Boundary []float32 ReferenceDensity float32 // contains filtered or unexported fields }
func NewParticleStructField ¶
func NewParticleStructField(n int, kernel float32, density float32, mass float32) ParticleStructField
func (ParticleStructField) AddBoundaryParticles ¶
func (p ParticleStructField) AddBoundaryParticles([]float32)
func (ParticleStructField) D0 ¶
func (p ParticleStructField) D0() float32
func (ParticleStructField) Densities ¶
func (p ParticleStructField) Densities() []float32
func (ParticleStructField) Density ¶
func (p ParticleStructField) Density(x int) float32
func (ParticleStructField) Force ¶
func (p ParticleStructField) Force(x int) []float32
func (ParticleStructField) Forces ¶
func (p ParticleStructField) Forces() []float32
func (ParticleStructField) Get ¶
func (p ParticleStructField) Get(x int) Particle
func (ParticleStructField) Mass ¶
func (p ParticleStructField) Mass() float32
func (ParticleStructField) N ¶
func (p ParticleStructField) N() int
func (ParticleStructField) Position ¶
func (p ParticleStructField) Position(x int) []float32
func (ParticleStructField) Positions ¶
func (p ParticleStructField) Positions() []float32
func (ParticleStructField) Pressure ¶
func (p ParticleStructField) Pressure(x int, d0 float32, p0 float32) float32
func (ParticleStructField) Pressures ¶
func (p ParticleStructField) Pressures() []float32
func (ParticleStructField) Set ¶
func (p ParticleStructField) Set(x int, particle Particle)
func (ParticleStructField) Total ¶
func (p ParticleStructField) Total() int
func (ParticleStructField) Velocities ¶
func (p ParticleStructField) Velocities() []float32
func (ParticleStructField) Velocity ¶
func (p ParticleStructField) Velocity(x int) []float32