Documentation ¶
Overview ¶
Package preprocess defines the 'preprocessed' or 'sliced' structure model which is used for the Finite Element Analysis.
This package also provides the means for slicing or preprocessing the structure as it is defined in the 'structure' package.
Index ¶
- type ByGeometryPos
- type Element
- type ElementsSeq
- func (el *ElementsSeq) Elements() []*Element
- func (el *ElementsSeq) ElementsCount() int
- func (el *ElementsSeq) GetElementById(id contracts.StrID) *Element
- func (el *ElementsSeq) GetMaterialsByName() map[string]*structure.Material
- func (el *ElementsSeq) GetSectionsByName() map[string]*structure.Section
- func (el *ElementsSeq) MaterialsCount() int
- func (el *ElementsSeq) SectionsCount() int
- type Node
- func (n *Node) AddLocalExternalLoad(loadTorsor *math.Torsor)
- func (n *Node) AddLocalLeftLoad(fx, fy, mz float64)
- func (n *Node) AddLocalRightLoad(fx, fy, mz float64)
- func (n Node) DegreesOfFreedomNum() [3]int
- func (n *Node) DistanceTo(other *Node) float64
- func (n *Node) Equals(other *Node) bool
- func (n Node) HasDegreesOfFreedomNum() bool
- func (n Node) LocalLeftFx() float64
- func (n Node) LocalLeftFy() float64
- func (n Node) LocalLeftMz() float64
- func (n Node) LocalRightFx() float64
- func (n Node) LocalRightFy() float64
- func (n Node) LocalRightMz() float64
- func (n Node) NetLocalFx() float64
- func (n Node) NetLocalFy() float64
- func (n Node) NetLocalLoadTorsor() *math.Torsor
- func (n Node) NetLocalMz() float64
- func (n Node) NetLocalTorsor() *math.Torsor
- func (n *Node) SetDegreesOfFreedomNum(dx, dy, rz int)
- func (n Node) String() string
- type Structure
- func (str *Structure) AssignDof() *Structure
- func (s *Structure) DofsCount() int
- func (s *Structure) GetElementNodes(element *Element) (*structure.Node, *structure.Node)
- func (str *Structure) MakeSystemOfEquations() (mat.ReadOnlyMatrix, vec.ReadOnlyVector)
- func (s *Structure) SetDofsCount(dofsCount int) *Structure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByGeometryPos ¶
type ByGeometryPos []*Element
ByGeometryPos implements sort.Interface for []Element based on the position of the original geometry.
func (ByGeometryPos) Len ¶
func (a ByGeometryPos) Len() int
func (ByGeometryPos) Less ¶
func (a ByGeometryPos) Less(i, j int) bool
func (ByGeometryPos) Swap ¶
func (a ByGeometryPos) Swap(i, j int)
type Element ¶
Element after slicing the original structural element. Consists of a sequence of intermediate nodes with the element's loads applied to them.
func MakeElement ¶
MakeElement creates a new element given the original element and the nodes of the sliced result.
func (*Element) Equals ¶
Equals compares this bar with another one and returns true if both have the same nodes.
func (Element) NodesCount ¶
NodesCount returns the number of nodes in the sliced element.
type ElementsSeq ¶
type ElementsSeq struct {
// contains filtered or unexported fields
}
func (*ElementsSeq) Elements ¶
func (el *ElementsSeq) Elements() []*Element
Elements returns a slice containing all elements.
func (*ElementsSeq) ElementsCount ¶
func (el *ElementsSeq) ElementsCount() int
ElementsCount returns the number of elements in the original structure.
func (*ElementsSeq) GetElementById ¶
func (el *ElementsSeq) GetElementById(id contracts.StrID) *Element
GetElementById returns the element with the given id or panics. This operation has an O(n) time complexity as it needs to iterate over all elements.
func (*ElementsSeq) GetMaterialsByName ¶
func (el *ElementsSeq) GetMaterialsByName() map[string]*structure.Material
GetMaterialsByName returns a map of all used materials by name.
func (*ElementsSeq) GetSectionsByName ¶
func (el *ElementsSeq) GetSectionsByName() map[string]*structure.Section
GetSectionsByName returns a map of all used sections by name.
func (*ElementsSeq) MaterialsCount ¶
func (el *ElementsSeq) MaterialsCount() int
MaterialsCount is the number of different materials used in the elements. Two materials are considered different if their names are.
func (*ElementsSeq) SectionsCount ¶
func (el *ElementsSeq) SectionsCount() int
SectionsCount is the number of different sections used in the elements. Two sections are considered different if their names are.
type Node ¶
A Node represents an intermediate point in a sliced element.
This point has a T Parameter associated, external loads applied and degrees of freedom numbering for the global system.
The "leftLocalLoad" is the equivalent load, in local coordinates, from the finite element located to the left of the node.
The "rightLocalLoad" is the equivalent load, in local coordinates, from the finite element located to the right of the node.
func MakeNode ¶
MakeNode creates a new node with given T parameter value, position and local external loads {fx, fy, mz}.
func MakeUnloadedNode ¶
MakeUnloadedNode creates a new node with given T parameter value, position, and no loads applied.
func (*Node) AddLocalExternalLoad ¶
AddLocalExternalLoad adds the given load values to the externally applied load.
func (*Node) AddLocalLeftLoad ¶
AddLocalLeftLoad adds the given load values to the load applied from the finite element where this node is to the left of it (where this node is the element's trailing node).
func (*Node) AddLocalRightLoad ¶
AddLocalRightLoad adds the given load values to the load applied from the finite element where this node is to the right of it (where this node is the element's leading node).
func (Node) DegreesOfFreedomNum ¶
DegreesOfFreedomNum returns the degrees of freedom numbers assigned to the node.
func (*Node) DistanceTo ¶
DistanceTo computes the distance between this an other node.
func (Node) HasDegreesOfFreedomNum ¶
HasDegreesOfFreedomNum returns true if the node has already been assigned degress of freedom. If any of the DOFs is -1, it's assumed that this node hasn't been assigned DOFs.
func (Node) LocalLeftFx ¶
func (Node) LocalLeftFy ¶
func (Node) LocalLeftMz ¶
func (Node) LocalRightFx ¶
func (Node) LocalRightFy ¶
func (Node) LocalRightMz ¶
func (Node) NetLocalFx ¶
NetLocalFx returns the magnitude of the net force in X, projected in local coordinates.
func (Node) NetLocalFy ¶
NetLocalFy returns the magnitude of the net force in Y, projected in local coordinates.
func (Node) NetLocalLoadTorsor ¶
NetLocalLoadTorsor returns the torsor of net load values {Fx, Fy, Mz} projected in local coordinates.
func (Node) NetLocalMz ¶
NetLocalMz returns the magnitude of the net moment about Z, projected in local coordinates.
func (Node) NetLocalTorsor ¶
NetLocalTorsor returns the resulting torsor of adding the external loads and the loads added by the left and right finite elements, all projected in local coordinates.
func (*Node) SetDegreesOfFreedomNum ¶
SetDegreesOfFreedomNum adds degrees of freedom numbers to the node. These degrees of freedom numbers are also the position in the system of equations for the corresponding stiffness terms.
type Structure ¶
type Structure struct { Metadata structure.StrMetadata structure.NodesById ElementsSeq // contains filtered or unexported fields }
Structure result of preprocessing original structure, ready to be solved. The elements of a preprocessed structure are already sliced.
A preprocessed structure can be created using the MakeStructure function. The created structure doesn't have the degrees of freedom assigned. For that, the following function must be called:
structure.AssignDof()
func MakeStructure ¶
func MakeStructure( metadata structure.StrMetadata, nodesById structure.NodesById, elements []*Element, ) *Structure
MakeStructure creates a preprocessed structure.
func StructureModel ¶
StructureModel preprocesses the structure by concurrently slicing each of the structural members. The resulting sliced structure includes the degrees of freedom numbering.
func (*Structure) AssignDof ¶
AssignDof assigns degrees of freedom numbers to all nodes on sliced elements.
Structural nodes are given degrees of freedom to help in the correct assignment of DOF numbers to the elements that meet in the node. Structural elements are first sorted by their geometry positions, so the degrees of freedom numbers follow a logical sequence.
func (*Structure) DofsCount ¶
DofsCount is the number of degrees of freedom in the preprocessed structure.
func (*Structure) GetElementNodes ¶
GetElementNodes returns the element's start and end nodes.
func (*Structure) MakeSystemOfEquations ¶
func (str *Structure) MakeSystemOfEquations() (mat.ReadOnlyMatrix, vec.ReadOnlyVector)
MakeSystemOfEquations generates the system of equations matrix and vector from the preprocessed structure.
It computes each of the sliced element's stiffness matrices and assembles them into one global matrix. It also assembles the global loads vector from the sliced element nodes.
func (*Structure) SetDofsCount ¶
SetDofsCount sets the number of degrees of freedom the preprocessed structure has. This method is to be used when the structure is read from a file where the DOFs are already assigned.