Documentation ¶
Overview ¶
Package structure defines the structure model used for the Finite Element Method analysis.
Index ¶
- Variables
- type ConcLoadsById
- type Constraint
- type DistLoadsById
- type Element
- func (e Element) DirectionVersor() *g2d.Vector
- func (e Element) EndLink() *Constraint
- func (e Element) EndNodeID() contracts.StrID
- func (e Element) EndPoint() *g2d.Point
- func (e *Element) Equals(other *Element) bool
- func (e Element) GetID() contracts.StrID
- func (e Element) HasLoadsApplied() bool
- func (e Element) IsAxialMember() bool
- func (e Element) Length() float64
- func (e Element) LengthBetween(tStart, tEnd nums.TParam) float64
- func (e Element) LoadsCount() int
- func (e Element) Material() *Material
- func (e Element) NormalVersor() *g2d.Vector
- func (e Element) PointAt(t nums.TParam) *g2d.Point
- func (e Element) RefFrame() *g2d.RefFrame
- func (e Element) Section() *Section
- func (e Element) StartLink() *Constraint
- func (e Element) StartNodeID() contracts.StrID
- func (e Element) StartPoint() *g2d.Point
- func (e Element) StiffnessGlobalMat(startT, endT nums.TParam) mat.ReadOnlyMatrix
- func (e Element) String() string
- type ElementBuilder
- func (builder *ElementBuilder) AddConcentratedLoad(load *load.ConcentratedLoad) *ElementBuilder
- func (builder *ElementBuilder) AddConcentratedLoads(loads []*load.ConcentratedLoad) *ElementBuilder
- func (builder *ElementBuilder) AddDistributedLoad(load *load.DistributedLoad) *ElementBuilder
- func (builder *ElementBuilder) AddDistributedLoads(loads []*load.DistributedLoad) *ElementBuilder
- func (builder ElementBuilder) Build() *Element
- func (builder *ElementBuilder) IncludeOwnWeightLoad() *ElementBuilder
- func (builder *ElementBuilder) WithEndNode(endNode *Node, endLink *Constraint) *ElementBuilder
- func (builder *ElementBuilder) WithMaterial(material *Material) *ElementBuilder
- func (builder *ElementBuilder) WithSection(section *Section) *ElementBuilder
- func (builder *ElementBuilder) WithStartNode(startNode *Node, startLink *Constraint) *ElementBuilder
- 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]*Material
- func (el *ElementsSeq) GetSectionsByName() map[string]*Section
- func (el *ElementsSeq) LoadsCount() int
- func (el *ElementsSeq) MaterialsCount() int
- func (el *ElementsSeq) SectionsCount() int
- type Material
- type MaterialsByName
- type Node
- type NodesById
- type NodesByIdMap
- type Section
- type SectionsByName
- type StrMetadata
- type Structure
- type StructureData
Constants ¶
This section is empty.
Variables ¶
var ( // NilConstraint is a constraint where all DOF are free. NilConstraint = Constraint{false, false, false} // DispConstraint is a constraint where the displacement DOFs are constrained. DispConstraint = Constraint{true, true, false} // FullConstraint is a constraint where all the DOFs are constrained. FullConstraint = Constraint{true, true, true} )
Functions ¶
This section is empty.
Types ¶
type ConcLoadsById ¶
type ConcLoadsById = map[contracts.StrID][]*load.ConcentratedLoad
type Constraint ¶
type Constraint struct {
// contains filtered or unexported fields
}
A Constraint represents a condition on displacements and rotations.
Constraints are immutable, and therefore can be shared amont the elements that use them. Use the `MakeConstraint` factory function to get an existing instance of a constraint.
func MakeConstraint ¶
func MakeConstraint(isDxConstr, isDyConstr, isRzConst bool) *Constraint
MakeConstraint creates a new constraint with the given degrees of freedom constrained of free.
func (Constraint) AllowsDispX ¶
func (c Constraint) AllowsDispX() bool
AllowsDispX returns true if displacement in x degree of freedom is not constrainted.
func (Constraint) AllowsDispY ¶
func (c Constraint) AllowsDispY() bool
AllowsDispY returns true if displacement in y degree of freedom is not constrainted.
func (Constraint) AllowsRotation ¶
func (c Constraint) AllowsRotation() bool
AllowsRotation returns true is rotation degree of freedom is not constrained.
func (*Constraint) Equals ¶
func (c *Constraint) Equals(other *Constraint) bool
Equals tests whether this constraint equals other.
func (Constraint) String ¶
func (c Constraint) String() string
String representation of the constraint. Used in the serialization format.
type DistLoadsById ¶
type DistLoadsById = map[contracts.StrID][]*load.DistributedLoad
type Element ¶
type Element struct { ConcentratedLoads []*load.ConcentratedLoad DistributedLoads []*load.DistributedLoad // contains filtered or unexported fields }
An Element represents a resistant element defined between two structural nodes, a section and a material.
An Element can have distributed and concentrated loads applied to it.
To create an element, use the `ElementBuilder`.
TODO: choose the bending axis TODO: buckling analysis
func (Element) DirectionVersor ¶
func (Element) EndLink ¶
func (e Element) EndLink() *Constraint
func (*Element) Equals ¶
Equals tests whether this element is equal to other. Loads aren't compared, two bars with different set of loads might therefore be equal.
func (Element) HasLoadsApplied ¶
HasLoadsApplied returns true if any load, either concentrated of distributed, is applied to the element.
func (Element) IsAxialMember ¶
IsAxialMember returns true if this element is pinned in both ends and, in case of having loads applied, they are always in the end positions of the directrix and does not include moments about Z, but just forces in X and Y directions.
FIXME: is axial member a good name? a distributed Fx load would make this bar not an axial member, which seems weird...
func (Element) LoadsCount ¶
LoadsCount is the total number of concentrated and distributed loads applied to the element.
func (Element) NormalVersor ¶
func (Element) StartLink ¶
func (e Element) StartLink() *Constraint
func (Element) StartNodeID ¶
func (Element) StartPoint ¶
StartPoint returns the position of the start node of this element's geometry.
func (Element) StiffnessGlobalMat ¶
func (e Element) StiffnessGlobalMat(startT, endT nums.TParam) mat.ReadOnlyMatrix
StiffnessGlobalMat generates the local stiffness matrix for the element and applies the rotation defined by the elements' geometry reference frame.
It returns the element's stiffness matrix in the global reference frame.
type ElementBuilder ¶
type ElementBuilder struct {
// contains filtered or unexported fields
}
func MakeElementBuilder ¶
func MakeElementBuilder(id contracts.StrID) *ElementBuilder
func (*ElementBuilder) AddConcentratedLoad ¶
func (builder *ElementBuilder) AddConcentratedLoad(load *load.ConcentratedLoad) *ElementBuilder
func (*ElementBuilder) AddConcentratedLoads ¶
func (builder *ElementBuilder) AddConcentratedLoads(loads []*load.ConcentratedLoad) *ElementBuilder
func (*ElementBuilder) AddDistributedLoad ¶
func (builder *ElementBuilder) AddDistributedLoad(load *load.DistributedLoad) *ElementBuilder
func (*ElementBuilder) AddDistributedLoads ¶
func (builder *ElementBuilder) AddDistributedLoads(loads []*load.DistributedLoad) *ElementBuilder
func (ElementBuilder) Build ¶
func (builder ElementBuilder) Build() *Element
func (*ElementBuilder) IncludeOwnWeightLoad ¶
func (builder *ElementBuilder) IncludeOwnWeightLoad() *ElementBuilder
func (*ElementBuilder) WithEndNode ¶
func (builder *ElementBuilder) WithEndNode( endNode *Node, endLink *Constraint, ) *ElementBuilder
func (*ElementBuilder) WithMaterial ¶
func (builder *ElementBuilder) WithMaterial(material *Material) *ElementBuilder
func (*ElementBuilder) WithSection ¶
func (builder *ElementBuilder) WithSection(section *Section) *ElementBuilder
func (*ElementBuilder) WithStartNode ¶
func (builder *ElementBuilder) WithStartNode( startNode *Node, startLink *Constraint, ) *ElementBuilder
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 is the number of elements in the 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]*Material
GetMaterialsByName returns a map of all used materials by name.
func (*ElementsSeq) GetSectionsByName ¶
func (el *ElementsSeq) GetSectionsByName() map[string]*Section
GetSectionsByName returns a map of all used sections by name.
func (*ElementsSeq) LoadsCount ¶
func (el *ElementsSeq) LoadsCount() int
LoadsCount is the total number of concentrated and distributed loads applied to all elements.
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 Material ¶
type Material struct { Name string Density float64 YoungMod, ShearMod, PoissonRatio float64 YieldStrength, UltimateStrength float64 }
Material represents a the substance from which resistant elements are made of. Materials have the properties of: - Density - Young Modulus - Shear Modulus - Poisson Ratio - Yield Strength - Ultimate Strength
func MakeMaterial ¶
MakeMaterial creates a material with the given properties.
func MakeUnitMaterial ¶
func MakeUnitMaterial() *Material
MakeUnitMaterial creates a material with all properties set to 1.0.
type MaterialsByName ¶
type Node ¶
type Node struct { Position *g2d.Point ExternalConstraint *Constraint // contains filtered or unexported fields }
Node is a point in the structure where one or more resistant elements meet.
func MakeFreeNodeAtPosition ¶
MakeFreeNodeAtPosition creates a new node without external constraint, with the given id and position by coordinates.
func MakeNodeAtPosition ¶
func MakeNodeAtPosition( id contracts.StrID, x, y float64, externalConstraint *Constraint, ) *Node
MakeNodeAtPosition creates a new node with the given id, position coordinates and external constraint.
func (Node) DegreesOfFreedomNum ¶
DegreesOfFreedomNum returns the degrees of freedom numbers assigned to the node.
func (Node) HasDegreesOfFreedomNum ¶
HasDegreesOfFreedomNum returns true if the node has already been assigned degress of freedom.
func (Node) IsExternallyConstrained ¶
IsExternallyConstrained returns true if this node is externally constrained.
func (*Node) SetDegreesOfFreedomNum ¶
SetDegreesOfFreedomNum assigns numbers to the degress of freedom of the node.
type NodesById ¶
type NodesById struct {
// contains filtered or unexported fields
}
NodesById is a composable map of nodes with some useful methods.
func MakeNodesById ¶
func MakeNodesById(nodes NodesByIdMap) NodesById
func (*NodesById) ConstrainedNodesCount ¶
ConstrainedNodesCount is the number of nodes with an external constraint.
func (*NodesById) GetAllNodes ¶
GetAllNodes returns a slice containing all of the structure nodes.
func (*NodesById) GetNodeById ¶
GetNodeById returns the node with the given id. Panics if the node is doesn't exist in the structure.
func (*NodesById) NodesById ¶
func (n *NodesById) NodesById() NodesByIdMap
NodesById is a map where the nodes of the structure can be accessed by their id.
func (*NodesById) NodesCount ¶
NodesCount is the number of nodes in the structure.
type NodesByIdMap ¶
type Section ¶
type Section struct { Name string Area float64 IStrong, IWeak float64 // Moments of Inertia SStrong, SWeak float64 // Section Moduli }
A Section of a resistant element.
func MakeSection ¶
MakeSection creates a section with the given properties.
func MakeUnitSection ¶
func MakeUnitSection() *Section
MakeUnitSection creates a section with all properties set to 1.0.
type SectionsByName ¶
type StrMetadata ¶
type StrMetadata struct {
MajorVersion, MinorVersion int
}
StrMetadata includes information about what version of the software created or resolved the structure.
type Structure ¶
type Structure struct { Metadata StrMetadata NodesById ElementsSeq }
A Structure is a group of linear resistant elements joined together designed to withstand the application of external loads, concentrated and distributed.
type StructureData ¶
type StructureData struct { Nodes NodesByIdMap Materials MaterialsByName Sections SectionsByName ConcentratedLoads ConcLoadsById DistributedLoads DistLoadsById }