field

package
v0.0.0-...-ddc071b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const SAMPLES = 150

Variables

This section is empty.

Functions

This section is empty.

Types

type DensityField

type DensityField struct {
	Ref model.ParticleArray
}

func (DensityField) Set

func (p DensityField) Set(x float32, i int)

func (DensityField) Value

func (p DensityField) Value(i int) float32

type Field

type Field interface {
	Value(i int) float32
	Set(x float32, i int)
}

type ForceField

type ForceField struct {
	Ref model.ParticleArray
}

func (ForceField) Set

func (p ForceField) Set(x []float32, i int)

func (ForceField) Value

func (p ForceField) Value(i int) []float32

type PressureField

type PressureField struct {
	Ref model.ParticleArray
}

func (PressureField) Set

func (p PressureField) Set(x float32, i int)

func (PressureField) Value

func (p PressureField) Value(i int) float32

type SPHField

type SPHField struct {
	Particles model.ParticleArray
	// contains filtered or unexported fields
}

Manage SPH Field and Particle Field interactions

func InitSPH

func InitSPH(parts model.ParticleArray, ref *lsh.HashSampler, kern kernel.Kernel, basis int) SPHField

func (*SPHField) AlignWithGrid

func (p *SPHField) AlignWithGrid(mGrid grid.Grid)

func (*SPHField) BoundaryParticles

func (p *SPHField) BoundaryParticles(colliders []*mesh.Mesh) []float32

func (*SPHField) Curl

func (p *SPHField) Curl(i int, field TensorField) []float32

Curl computes non-symmetric curl

func (*SPHField) D0

func (p *SPHField) D0() float32

func (*SPHField) Density

func (p *SPHField) Density(i int)

Density -- Computes density field for SPH Field - Boundary particle contribute to infinite density

func (*SPHField) DensityF

func (p *SPHField) DensityF(pos vector.Vec, positions []float32) float32

func (*SPHField) Div

func (p *SPHField) Div(i int, field TensorField) float32

Computes the Divergence of a tensor field

func (*SPHField) Field

func (p *SPHField) Field() *SPHField

func (*SPHField) GetFields

func (p *SPHField) GetFields() map[string]Field

func (*SPHField) GetKernelLength

func (p *SPHField) GetKernelLength() float32

func (*SPHField) GetSampler

func (p *SPHField) GetSampler() *lsh.HashSampler

func (*SPHField) GetTensorFields

func (p *SPHField) GetTensorFields() map[string]TensorField

func (*SPHField) Gradient

func (p *SPHField) Gradient(i int, field Field) []float32

Computes gradient vector at particle i given a scalar field

func (*SPHField) Interpolate

func (p *SPHField) Interpolate(position []float32, field Field) float32

nterpolates a scalar field given a position giving a continuous field

func (*SPHField) Kernel

func (p *SPHField) Kernel() kernel.Kernel

func (*SPHField) Laplacian

func (p *SPHField) Laplacian(i int, field Field) float32

Computes a laplacian value at the particle i for the given scalar field

func (*SPHField) LaplacianForce

func (p *SPHField) LaplacianForce(i int, field TensorField) []float32

Computes a laplacian value at the particle i for the given scalar field

func (*SPHField) Mass

func (p *SPHField) Mass() float32

func (*SPHField) NN

func (p *SPHField) NN()

Sampler Nearest Neighbors Update

type ScalarField

type ScalarField struct {
	Values []float32
}

func (ScalarField) Set

func (p ScalarField) Set(x float32, i int)

func (ScalarField) Value

func (p ScalarField) Value(i int) float32

type TensorField

type TensorField interface {
	Value(i int) []float32
	Set(value []float32, i int)
}

type Vector3Field

type Vector3Field struct {
	Values [][3]float32
}

Vector 3 Field implements Tensor Field Interface

func (Vector3Field) Set

func (p Vector3Field) Set(x []float32, i int)

func (Vector3Field) Value

func (p Vector3Field) Value(i int) []float32

type VelocityField

type VelocityField struct {
	Ref model.ParticleArray
}

func (VelocityField) Set

func (p VelocityField) Set(x []float32, i int)

func (VelocityField) Value

func (p VelocityField) Value(i int) []float32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL