fragcloud

package
v0.0.0-...-022bd34 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFragHeader

func GetFragHeader() string

GetFragHeader returns a header string that can be used when listing out summary information about the frag using GetFragString().

Types

type Cloud

type Cloud struct {
	// contains filtered or unexported fields
}

A Cloud stores a list of fragments (and information to create the fragments given a list of elements)

func NewCloud

func NewCloud(elemSize, minVf, minDens, minMass, maxMass, minKe, minVel float64) *Cloud

NewCloud creates a new Cloud object. If minVf, minDens, minMass, minKe, or minVel are less than zero then NewCloud will replace the negative numbers with the default values 0.001, 7.6, 2.5, 0.0, 0.0 respectively.

func (*Cloud) Collapse

func (d *Cloud) Collapse(center, axis [3]float64, length, radius float64)

func (*Cloud) CreateFragments

func (d *Cloud) CreateFragments(eList []*Element)

CreateFragments parses a list of elements and determines the fragments.

func (*Cloud) FragListString

func (d *Cloud) FragListString() string

FragListString returns a string with a header line and one line summarizing each fragment

func (*Cloud) Fragments

func (d *Cloud) Fragments() []*Fragment

Fragments returns the list of fragments from the cloud.

func (*Cloud) KeStats

func (d *Cloud) KeStats() (min, max, avg float64)

KeStats returns the minimum, maximum, and average kinetic energy of the fragments in the cloud.

func (*Cloud) KeString

func (d *Cloud) KeString() string

KeString returns a string documenting the minimum, maximum, and average kinetic energy of the fragments.

func (*Cloud) MassStats

func (d *Cloud) MassStats() (min, max, tot, avg float64)

MassStats returns the minimum, the maximum, the total, and the average fragment mass for the cloud.

func (*Cloud) MassString

func (d *Cloud) MassString() string

MassString returns a string documenting the minimum, maximum, total, and average fragment mass along with the missing mass.

func (*Cloud) MissingMass

func (d *Cloud) MissingMass() float64

MissingMass returns the mass of fragment material that was not included in the fragments due to one of the minimum constraints.

func (*Cloud) NumFragsString

func (d *Cloud) NumFragsString() string

NumFragsString returns a string documenting the number of fragments.

func (*Cloud) ReflectX

func (d *Cloud) ReflectX()

func (*Cloud) ReflectY

func (d *Cloud) ReflectY()

func (*Cloud) ReflectZ

func (d *Cloud) ReflectZ()

func (*Cloud) RotateN1N2

func (d *Cloud) RotateN1N2(angle float64, center, n1, n2 Node)

func (*Cloud) RotateN1N2N3

func (d *Cloud) RotateN1N2N3(angle float64, center, n1, n2, n3 Node)

func (*Cloud) RotateX

func (d *Cloud) RotateX(angle float64, center Node)

func (*Cloud) RotateY

func (d *Cloud) RotateY(angle float64, center Node)

func (*Cloud) RotateZ

func (d *Cloud) RotateZ(angle float64, center Node)

func (*Cloud) Translate

func (d *Cloud) Translate(dir [3]float64)

func (*Cloud) VelStats

func (d *Cloud) VelStats() (min, max, avg float64)

VelStats returns the minimum, maximum, and average velocity of the fragments in the cloud.

func (*Cloud) VelocityString

func (d *Cloud) VelocityString() string

VelocityString returns a string documenting the minimum, maximum, and average velocity of the fragments.

type Element

type Element struct {
	Volm  float64    // volume fraction of the element that is fragment
	Dens  float64    // density of the fragment material in the element
	Size  float64    // length of the cube
	Mass  float64    // mass of the fragment material in the element
	Vol   float64    // volume of the fragment material in the element
	Vel   [3]float64 // velocity of the material in the element
	Nodes []*Node    // coordinates of the corners of the element
}

Element stores data about the fragment material in a cth element

func NewElement

func NewElement(volm, dens, size float64, vel, pos [3]float64) *Element

CreateElement is used to create a Element specifically calculating the index position and nodal locations

func (*Element) Idx

func (e *Element) Idx() [3]int64

Idx calculates the x,y,z integer index of the element assuming all the elements are the same size. This is used for determining if there is an adjacent element and therefor part of the same fragment.

func (*Element) Pos

func (e *Element) Pos() [3]float64

Pos calculates the center of an element (assumes no degenerate elements)

func (*Element) ReflectX

func (e *Element) ReflectX()

func (*Element) ReflectY

func (e *Element) ReflectY()

func (*Element) ReflectZ

func (e *Element) ReflectZ()

func (*Element) RotateN1N2

func (e *Element) RotateN1N2(angle float64, center, n1, n2 Node)

func (*Element) RotateN1N2N3

func (e *Element) RotateN1N2N3(angle float64, center, n1, n2, n3 Node)

func (*Element) RotateX

func (e *Element) RotateX(angle float64, center Node)

func (*Element) RotateY

func (e *Element) RotateY(angle float64, center Node)

func (*Element) RotateZ

func (e *Element) RotateZ(angle float64, center Node)

func (*Element) Translate

func (e *Element) Translate(dir [3]float64)

type Fragment

type Fragment struct {
	// contains filtered or unexported fields
}

Fragment stores information about a fragment.

func NewFragment

func NewFragment(tol float64) *Fragment

NewFragment creates a new fragment object and its associatie mesh.

func (*Fragment) AddElement

func (f *Fragment) AddElement(e *Element)

AddElement allows an element to be added to a fragment.

func (*Fragment) Cd

func (f *Fragment) Cd() float64

Cd returns the coefficient of drag of the fragment.

func (*Fragment) Elements

func (f *Fragment) Elements() []*Element

Elements returns the elements that make up the fragment.

func (*Fragment) GetFragString

func (f *Fragment) GetFragString() string

GetFragString returns a string containing the mass, velocity (x,y,z), speed, kinetic energy, number of elements, number of nodes, position (x,y,z), coefficient of drag, and the presented area for each fragment.

func (*Fragment) Ke

func (f *Fragment) Ke() float64

Ke returns the kinetic energy of the fragment.

func (*Fragment) Mass

func (f *Fragment) Mass() float64

Mass returns the mass of the fragment.

func (*Fragment) Nodes

func (f *Fragment) Nodes(minid int64) (map[*Node](int64), int64)

Nodes returns the fragments nodemap. Along with the element node lists this would allow you to make a finite element model of the fragment.

func (*Fragment) Pa

func (f *Fragment) Pa() float64

Pa returns the presented area of the fragment.

func (*Fragment) Pos

func (f *Fragment) Pos() [3]float64

Pos returns the position of the fragment.

func (*Fragment) ReflectX

func (f *Fragment) ReflectX()

func (*Fragment) ReflectY

func (f *Fragment) ReflectY()

func (*Fragment) ReflectZ

func (f *Fragment) ReflectZ()

func (*Fragment) RotateN1N2

func (f *Fragment) RotateN1N2(angle float64, center, n1, n2 Node)

func (*Fragment) RotateN1N2N3

func (f *Fragment) RotateN1N2N3(angle float64, center, n1, n2, n3 Node)

func (*Fragment) RotateX

func (f *Fragment) RotateX(angle float64, center Node)

func (*Fragment) RotateY

func (f *Fragment) RotateY(angle float64, center Node)

func (*Fragment) RotateZ

func (f *Fragment) RotateZ(angle float64, center Node)

func (*Fragment) Translate

func (f *Fragment) Translate(dir [3]float64)

func (*Fragment) Vel

func (f *Fragment) Vel() [3]float64

Vel returns the velocity of the fragment.

type Mesh

type Mesh struct {
	Elements []*Element
	// contains filtered or unexported fields
}

A Mesh contains a lists of nodes and (hex) elements as well as a NidList for each element, and the tolerance that is to be used to determine if two nodes are overlapping

func NewMesh

func NewMesh(tol float64) *Mesh

NewMesh returns a new Mesh object and sets the duplicate node tolerance.

func (*Mesh) Add

func (m *Mesh) Add(m2 *Mesh)

func (*Mesh) AddElement

func (m *Mesh) AddElement(e *Element)

AddElement adds element e to the mesh and adds nodes from the element that aren't already in the mesh. It also creates an NidList for the element and appends it to ElementNids..

func (*Mesh) Copy

func (m *Mesh) Copy() *Mesh

func (*Mesh) NodeMap

func (m *Mesh) NodeMap(minid int64) (map[*Node](int64), int64)

func (*Mesh) ReflectX

func (m *Mesh) ReflectX()

func (*Mesh) ReflectY

func (m *Mesh) ReflectY()

func (*Mesh) ReflectZ

func (m *Mesh) ReflectZ()

func (*Mesh) RotateN1N2

func (m *Mesh) RotateN1N2(angle float64, center, n1, n2 Node)

func (*Mesh) RotateN1N2N3

func (m *Mesh) RotateN1N2N3(angle float64, center, n1, n2, n3 Node)

func (*Mesh) RotateX

func (m *Mesh) RotateX(angle float64, center Node)

func (*Mesh) RotateY

func (m *Mesh) RotateY(angle float64, center Node)

func (*Mesh) RotateZ

func (m *Mesh) RotateZ(angle float64, center Node)

func (*Mesh) Translate

func (m *Mesh) Translate(dir [3]float64)

type NidList

type NidList [8]int

A NidList contains a list of 8 indexes into the node array of the mesh object. One index for each node of an element.

type Node

type Node [3]float64

Node stores the location of a point

func (*Node) ReflectX

func (n *Node) ReflectX()

func (*Node) ReflectY

func (n *Node) ReflectY()

func (*Node) ReflectZ

func (n *Node) ReflectZ()

func (*Node) RotateN1N2

func (n *Node) RotateN1N2(angle float64, center, n1, n2 Node)

func (*Node) RotateN1N2N3

func (n *Node) RotateN1N2N3(angle float64, center, n1, n2, n3 Node)

func (*Node) RotateX

func (n *Node) RotateX(angle float64, center Node)

func (*Node) RotateY

func (n *Node) RotateY(angle float64, center Node)

func (*Node) RotateZ

func (n *Node) RotateZ(angle float64, center Node)

func (*Node) Translate

func (n *Node) Translate(dir [3]float64)

Jump to

Keyboard shortcuts

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