inputlib

package
v0.0.0-...-9516e97 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

README

[[file:../README.org][FrameFEA - Main README]]

* FrameFEA input file format 

** Units
The output data uses scientific notation so the only requirement for units is that they be consistant. If the node units are in inches, Youngs modulus should be in psi.

** Analysis Performed
One of the following conditions must be met in order for any analysis to be run:

NewmarkBeta:
- If NewmarkBetaParam, ModalParams, and StaticParams, and NO ConensationParams records are present in the input file, a NewmarkBeta analysis will be run.

Condensation:
- If CondensationParams, ModalParams, StaticParams, and NO NewmarkBetaParams records are present in the input file, a condensation analysis will be run.

Modal:
- If ModalParams, StaticParams, NO NewmarkBataParams, and NO CondensationParams records are present in the input file, a modal analysis will be run. 

Static:
- If StaticParams, NO ModalParams, NO NewmarkBetaParams, NO CondensationParams records are present in the input file, AND at least one load parameter, a static analysis will be run.

** Records
The records can be in any order, although all the current tools write like records together.

*** TODO Good records
*Comments*
- Description: Any line that starts with "//" is a comment. These lines are not read by any of the tools. Generally when the tools write out a file, they will put a comment before each section of like records describing the fields of the records to follow.
- Example: ~// This is a comment~


*Doc*
- Description: The Doc record allows documentation or other text to be included in the file. All RSV tools preserve Doc records, if possible. 
- Usage: ~Doc, text~
- Example: ~Doc, This is an example doc record~
- Fields:
  - Text :: [string] This can contain any text, including commas.


*StaticParams*
- Description: The StaticParams record defines basic parameters for a static analysis. There can only be one StaticParams record.
- Usage: ~StaticParams, Shear, Geom, Tol, Temp~
- Example: ~StaticParams, true, false, 1E-9, 0.0~
- Fields:
  - Shear :: [int] 1=Do, 0=Don't include shear deformation effects
  - Geom :: [int] 1=Do, 0=Don't include geometric stiffness effects
  - Tol :: [float64] Convergence tolerance for the static analysis when Geom == true
  - Temp :: [float64] Default temperature of elements that do not have a temperature specified by a load (for material property purposes).


*NewmarkBetaParams*
- Description: NewmarkBetaParams record has parameters ofr an implicit time integration analysis. There can be only on NewmarkBetaParams record.
- Usage: ~NewmarkBetaParams, Dt, Alpha, Beta, TerminationTime~
- Example: ~NewmarkBetaParams, 0.0001, 0.5, 0.25, 1.0~
- Fields:
  - Dt :: [float64] Desired time step
  - Alpha :: [float64] Parameter chosen to control the stability of the solution
  - Beta :: [float64] Parameter chosen to control the stability of the solution
  - TerminationTime :: [float64] Parameter that specifies a termination time for a time integration analysis with multiple steps. If 0 is specified then only one time step of durration Dt will be run. If TerminationTime is > 0, then multiple timesteps will be run, where the resulting accelerations, velocities, and displacements will be fed into the next simulation, until the simulation time exceeds the TerminationTime.

*Reaction Record* 
- Description: The Reaction Record
- Usage: ~Reaction, NID, X, Y, Z, Xx, Yy, Zz~
- Example: ~Reaction, 1, 1, 1, 1, 0, 1, 0~
- Fields:
  - NID :: [int] Node ID
  - X, Y, Z :: [int] Position reactions 0 = free, 1 = fixed.
  - Xx, Yy, Zz :: [int] Rotation reactions 0 = free, 1 = fixed.


*BodyLoad Record*
- Description: A BodyLoad represents gravitational acceleration for self-weight loading. Only one BodyLoad record is allowed.
- Usage: ~BodyLoad, ID, Gx, Gy, Gz~
- Example: ~BodyLoad, 1, 0.0, 0.0, -9.8~
- Fields:   
  - ID :: [int] Body load ID
  - Gx, Gy, Gz :: [float64] Acceleration in the x, y, and z directions


*NodalLoad*
- Description: A NodalLoad represents a load applied to a particular node.
- Usage: ~NodalLoad, ID, NID, X, Y, Z, Xx, Yy, Zz~
- Example: ~NodalLoad, 1, 1, 24.3, 15.5, 8.9, 24.3, 15.5, 8.9~
- Fields:   
  - ID :: [int] Nodal load ID
  - NID :: [int] Node ID.
  - X, Y, Z :: [float64] Applied loads in the x, y, and z directions
  - Xx, Yy, Zz [float64] Applied Moments about the x, y, and z axis


*ElementPointLoad*
- Description: An ElementPointLoad applied at a point along the element Pos distance from NID1
- Usage: ~ElementPointLoad, ID, EID, X, Y, Z, Pos~
- Example: ~ElementPointLoad, ID, 24.3, 15.5, 8.9~
- Fields:   
  - ID :: [int] Element point load ID
  - EID :: [int] Element ID
  - X, Y, Z :: [float64] Applied loads in the x, y, and z directions
  - Pos :: [float64] Distance of the loaded point from node NID1 of element EID


*TrapezoidLoad*
- Description: A trapezoidLoad
- Usage: ~TrapezoidLoad, ID, EID, X1, X2, Wx1, Wx2, Y1, Y2, Wy1, Wy2, Z1, Z2, Wz1, Wz2~
- Example: ~TrapezoidLoad, 1, 24.3, 15.5, 8.9, 24.3, 15.5, 8.9~
- Fields:   
  - ID :: [int] Trapezoid load ID
  - EID :: [int] Element ID
  - X1, X2 :: [float64] start and stop location on the local x-axis
  - Wx1, Wx2 :: [float64] start and stop load in the local x-direction
  - Y1, Y2 :: [float64] start and stop location on the local y-axis
  - Wy1, Wy2 :: [float64] start and stop load in the local y-direction
  - Z1, Z2 :: [float64] start and stop location on the local z-axis
  - Wz1, Wz2 :: [float64] start and stop load in the local z-direction


*UniformLoad*
- Description: A UniformLoad record describes
- Usage: ~UniformLoad, ID, EID, Ux, Uy, Uz~
- Example: ~UniformLoad, 1, 24.3, 15.5, 8.9~
- Fields:   
  - ID :: [int] Uniform load ID
  - EID :: [int] Element ID.
  - Ux, Uy, Uz :: [float64] Uniformly distributed load in the x, y, and z dirs


*TemperatureLoad*
- Description: A TemperatureLoad record describes
- Usage: ~TemperatureLoad, ID, EID, Hy, Hz, DtyPos, DtyNeg, DtzPos, DtzNeg~
- Example: ~TemperatureLoad, 1, 24.3, 15.5, 8.9, 24.3~
- Fields:   
  - ID :: [int] Temperature load ID
  - EID :: [int] Element ID
  - Hy, Hz :: [float64] cross-section dimension in the local y/z coordinate dirs.
  - DtyPos, DtyNeg :: [float64] temperature change on the local +y/-y face of the element
  - DtzPos, DtzNeg :: [float64] temperature change on the local +z/-z face of the element


*NodalDisplacement*
- Description: A NodalDisplacement record describes a prescribed displacement of a node.
- Usage: ~NodalDisplacement, ID, NID, Dx, Dy, Dz, Dxx, Dyy, Dzz~
- Example: ~NodalDisplacement, 1, 12345, 24.3, 15.5, 8.9, 24.3, 15.5, 8.9~
- Fields:   
  - ID :: [int] load ID
  - NID :: [int] Node ID
  - Dx, Dy, Dz :: [float64] Displacement in the x, y, and z directions
  - Dxx, Dyy, Dzz :: [float64] Rotations about the x, y, and z axis


*NodalVelocity*
- Description: A NodalVelocity record describes a prescribed velocity of a node.
- Usage: ~NodalVelocity, ID, NID, Vx, Vy, Vz, Vxx, Vyy, Vzz~
- Example: ~NodalVelocity, 1, 12345, 24.3, 15.5, 8.9, 24.3, 15.5, 8.9~
- Fields:   
  - ID :: [int] load ID
  - NID :: [int] Node ID
  - Vx, Vy, Vz :: [float64] Velocity in the x, y, and z directions
  - Vxx, Vyy, Vzz :: [float64] Rotational Velocities about the x, y, and z axis


*NodalAcceleration*
- Description: A NodalAcceleration record describes a prescribed acceleration of a node.
- Usage: ~NodalAcceleration, ID, NID, Ax, Ay, Az, Axx, Ayy, Azz~
- Example: ~NodalAcceleration, 1, 12345, 24.3, 15.5, 8.9, 24.3, 15.5, 8.9~
- Fields:   
  - ID :: [int] load ID
  - NID :: [int] Node ID
  - Ax, Ay, Az :: [float64] Acceleration in the x, y, and z directions
  - Axx, Ayy, Azz :: [float64] Rotational accelerations about the x, y, and z axis






*** TODO To Be Converted to the new format for records
**** Node Record 
**Node, ID, X, Y, Z, Rad**

The Node Record 

Where:

- ID (int): Node ID
- X, Y, Z (float64): Location of the node in x, y, z
- Rad (float64): nodal radius

**** Element Record 
**Element, ID, NID1, NID2, NID3, MID, Ax, Asy, Asz, Jx, Iy, Iz, Temp**

The Element record describes

Where:

- ID (int): Element ID
- NID1, NID2 (int): The element's nodes
- NID3 (int): beam orientation node as in lsdyna
- MID (int): Material ID
- Ax (float64): Cross sectional area
- Asy, Asz (float64): Shear area in the y and z directions
- Jx (float64): Torsional moment of inertia of a frame element
- Iy, Iz (float64): Moment of inertia for bending about the local y and z axis
- Temp (float64): temperature of the element. If <= 0 or not present the default temp from staticparams will be used

**** Material Record 
**Material, ID, Label, Rho, Youngs, ThermCoef, Poisson**

The Material record describes material properties that can be associated with an element by the material's ID. The Young's modulus, Thermal Coefficient, and Poissons Ratio can vary with temperature or be constant.

Where:

- ID (int): Material ID
- Label : string: Name of the material
- Rho (float64): Density of the material
- Youngs (float64/string): Young's Modulus (float64) or Curve record ID for a curve relating Young's Modulus and temperature. A Curve ID should start with a "T" follwed by the ID. (each item in the curve will be Temp:Youngs)
- ThermCoef (float64/string): Thermal Coefficient (float64) or Curve record ID for a curve relating thermal coefficient and temperature. A Curve ID should start with a "T" follwed by the ID. (each item in the curve will be Temp:ThermCoef)
- Poisson (float64/string): Poisson's ratio (float64) or Curve record ID for a curve relating Poisson's Ratio and temperature. A Curve ID should start with a "T" follwed by the ID. (each item in the curve will be Temp:Poisson)

**** Curve Record 
**Curve, ID, XVal1:YVal1, XVal2:YVal2, XVal3:YVal3, ...**

The Curve record describes a two dimensional curve consisting of x:y pairs.

Where:

- ID (int): Curve ID
- XVal1, XVal2, ... (float64): X values at points 1, 2, etc...
- YVal1, YVal2, ... (float64): Y values at points 1, 2, etc...

**** ModalParams
**ModalParams, NumModes, ModalMethod, LumpFlag, ModalTol, ModalFreqShift**

The ModalParams record describes parameters needed for a modal analysis and indicates that one should be performed. Only one ModalParams record is allowed.

Where:

- NumModes (int): number of desired modes
- ModalMethod (int): modal analysis method: 1=Jacobi-Subspace or 2=Stodola
- LumpFlag : bool : true = lumped mass matrix or false = consistent mass matrix
- ModalTol (float64): convergence tolerance for modal analysis
- ModalFreqShift (float64): modal frequency shift for unrestrained structures, shift-factor for rigid-body-modes

**** NodalMass
**NodalMass, ID, Mass, InertiaX, InertiaY, InertiaZ**

A NodalMass record 

Where:

- ID (int): node ID
- Mass (float64): node mass for each node
- InertiaX (float64): node inertia about global X axis
- InertiaY (float64): node inertia about global Y axis
- InertiaZ (float64): node inertia about global Z axis

**** ElementMass
**ElementMass, ID, Mass**

An ElementMass record

Where:

- ID (int): Element ID
- Mass (float64): Extra frame element mass

**** CondensationParams
**CondensationParams, CondesationMethod**

A CondensationParams record indicates that a matrix condensation should be performed using the described method. Only one CondensationParams record is allowed. 

Where:

- CondensationMethod (int): Matrix condensation method 1 (static), 2 (dynamic), or 3 (modal).  

**** CondensedNode
**CondensedNode, NID, X, Y, Z, Xx, Yy, Zz**

A CondensedNode record describes the condensed degrees of freedom for a node.

Where:

- NID (int): Node ID
- X, Y, Z (int): Position reactions 0 = don't condense, 1 = condense.
- Xx, Yy, Zz (int): Rotation reactions 0 = don't condense, 1 = condense. 

**** CondensedModes
**CondensedModes, Mode1, Mode2, Mode3, ... **

A CondensedModes record contains a vector of the condensed mode numbers. Only one CondensedMode record is allowed.

Where:

- Mode1, Mode2, ... (int) Condensation Mode Numbers



** Example FrameFEA input file:
The following is an example of an input file.

```
| // Doc, | Text                                         |
| Doc,    | This is an example of all the input records. |

| // StaticParams, | Shear, | Geom,  |  Tol, | Temp |
| StaticParams,    | false, | false, | 293.0 |      |

| // Node, | ID, | X,   | Y,   | Z,   | Rad |
| Node,    | 1,  | 0.0, | 0.0, | 0.0, | 0.0 |
| Node,    | 2,  | 1.0, | 0.0, | 0.0, | 0.0 |
| Node,    | 3,  | 2.0, | 0.0, | 0.0, | 0.0 |
| Node,    | 4,  | 3.0, | 0.0, | 0.0, | 0.0 |
| Node,    | 5,  | 0.0, | 1.0, | 0.0, | 0.0 |

| // Reaction, | NID, | X, | Y, | Z, | Xx, | Yy, | Zz  |
| Reaction,    | 1,   | 1, | 1, | 1, | 1,  | 1,  |   0 |
| Reaction,    | 2,   | 0, | 0, | 1, | 1,  | 1,  |   0 |

\tiny
| // Element, | EID, | NID1, | NID2, | NID3, | MID, | Ax, | Asy, | Asz, | Jx, | Iy, | Iz,     | Temp |
| Element,    | 1,   | 1,    | 2,    | 13,   | 1,   | 10, | 1,   | 1,   | 1,  | 1,  | 0.0100, |    0 |
| Element,    | 2,   | 2,    | 3,    | 14,   | 1,   | 10, | 1,   | 1,   | 1,  | 1,  | 0.0100, |    0 |
| Element,    | 3,   | 3,    | 4,    | 15,   | 1,   | 10, | 1,   | 1,   | 1,  | 1,  | 0.0100, |    0 |
\normalsize

| // Material, | ID, | Label,       | Rho,                       | Youngs, | ThermCoef, | Poisson |
| Material,    | 1,  | exampleMat1, | 7.3300e-07, | 1.0,    | T2,        | 29000.0 |
| Material,    | 2,  | exampleMat2, | 7.3300e-07, | T1,     | 1.0,       | T3      |

| // Curve, | ID, | XVal1:YVal1, | XVal2:YVal2, | XVal3:YVal3, ... |
| Curve,    | 1,  | 1.0:0.0,     |    1.5:100.0 |                  |
| Curve,    | 2,  | 1.5:0.0,     |    2.5:100.0 |                  |
| Curve,    | 3,  | 29000:0.0,   |  20000:100.0 |                  |

| // BodyLoad, | ID, | Gx, | Gy, | Gz  |
| BodyLoad,    | 1,  | 0,  | 0,  |   0 |

| // NodalLoad, | ID, | NID, | X,  | Y, | Z, | Xx, | Yy, | Zz  |
| NodalLoad,    | 1,  | 3,   | 20, | 0, | 0, | 0,  | 0,  |   0 |
| NodalLoad,    | 2,  | 4,   | 10, | 0, | 0, | 0,  | 0,  |   0 |
| NodalLoad,    | 3,  | 5,   | 20, | 0, | 0, | 0,  | 0,  |   0 |

| // ElementPointLoad, | ID, | EID, | X, | Y,    | Z,    | Pos  |
| ElementPointLoad,    | 1,  | 1,   | 0, | 100,  | -900, |  600 |
| ElementPointLoad,    | 2,  | 2,   | 0, | -200, | 200,  |  800 |

\tiny
| // TrapezoidLoad, | ID, | EID, | X1, | X2, | Wx1,    | Wx2,    | Y1, | Y2,  | Wy1,    | Wy2, | Z1, | Z2,  | Wz1      |  , Wz2 |
| TrapezoidLoad,    | 1,  | 3,   | 20, | 80, | 0.0100, | 0.0500, | 0,  | 0,   | 0,      | 0,   | 80, | 830, | -0.0500, | 0.0700 |
| TrapezoidLoad,    | 2,  | 4,   | 0,  | 0,  | 0,      | 0,      | 68, | 330, | 0.0500, | 0,   | 80, | 830, | -0.0500, | 0.0700 |
\normalsize

| // UniformLoad, | ID, | EID, | Ux, | Uy,    |    Uz |
| UniformLoad,    | 1,  | 2,   | 0,  | 0.100, |     0 |
| UniformLoad,    | 2,  | 1,   | 0,  | 0,     | 0.100 |

| // TemperatureLoad, | ID, | EID, | Hy, | Hz, | DtyPos, | DtyNeg, | DtzPos, | DtzNeg  |
| TemperatureLoad,    | 1,  | 10,  | 5,  | 5,  | 10,     | 10,     | 10,     |      10 |
| TemperatureLoad,    | 2,  | 13,  | 5,  | 5,  | 15,     | 15,     | 15,     |      15 |
| TemperatureLoad,    | 3,  | 15,  | 5,  | 5,  | 17,     | 17,     | 17,     |      17 |

| // NodalDisplacement, | ID, | NID, | Dx,                     | Dy, | Dz, | Dxx, | Dyy, | Dzz  |
| NodalDisplacement,    | 1,  | 1,   | 0,                      | -1, | 0,  | 0,   | 0,   |    0 |
| NodalDisplacement,    | 2,  | 8,   | 0.1000, | 0,  | 0,  | 0,   | 0,   |    0 |

\tiny
| // ModalParams, | NumModes,    | ModalMethod, | LumpFlag, | ModalTol, | ModalFreqShift             |   |
|                 | ModalParams, | 6,           | 1,        | 0,        | 1.000e-09, | 0 |
\normalsize

| // NodalMass, | ID, | Mass,                   | InertiaX, | InertiaY, | InertiaZ  |
| NodalMass,    | 1,  | 0.100, | 0,        | 0,        |         0 |

| // ElementMass, | ID, | Mass |
| ElementMass,    | 1,  | 50.0 |

| // CondensationParams, | CondesationMethod |
| CondensationParams,    |                 2 |

| // CondensedNode, | NID, | X, | Y, | Z, | Xx, | Yy, | Zz  |
| CondensedNode,    | 12,  | 1, | 1, | 0, | 0,  | 0,  |   1 |

| // CondensedModes, | Mode1, | Mode2, | Mode3, | ...  |
| CondensedModes,    | 1,     | 2,     |      3 |      |

```

Documentation

Index

Constants

View Source
const FileSuffix = ".ffin"

FileSuffix specifies the filename suffix to be used for files of this type

Variables

This section is empty.

Functions

func IMapInt

func IMapInt(OrigMap map[int]int) (InvMap map[int]int)

IMapInt returns the inverse of type map[int]int (map[1]2 -> map[2]1)

func ReadFile

func ReadFile(fileName string) (frameData *FrameData, inDataPtr *Description, err error)

ReadFile reads an framefea file into a Description and converts it to FrameData.

Types

type BodyLoad

type BodyLoad struct {
	ID         int     `csvrecField:"int"` // bodyload id
	Gx, Gy, Gz float64 `csvrecField:"flt"` // Acceleration in the x, y, and z directions
}

BodyLoad describes a body load (like gravity) that will be applied to the whole model.

type CondensationParam

type CondensationParam struct {
	CondensationMethod int `csvrecField:"int"` // matrix condensation method: 0, 1, 2, or 3
}

CondensationParam contains the parameters necessary for matrix condensation.

type CondensedMode

type CondensedMode struct {
	Modes []int `csvrecField:"intlist"` // condensation mode numbers
}

CondensedMode contains a vector of the condensed mode numbers

type CondensedNode

type CondensedNode struct {
	Nid        int  `csvrecField:"int"`  // node id
	X, Y, Z    bool `csvrecField:"bool"` // Position reactions 0 = free, 1 = fixed.
	Xx, Yy, Zz bool `csvrecField:"bool"` // Rotation reactions 0 = free, 1 = fixed.
}

CondensedNode contains the condensed degrees of freedom for a node.

type Curve

type Curve struct {
	ID     int          `csvrecField:"int"`       // curve id
	Points [][2]float64 `csvrecField:"fpairlist"` // curve point list Points[0][0] is the x of point zero Points[0][1] is the y of point zero.
}

Curve is a slice of CurvePt

func (*Curve) GetYVal

func (a *Curve) GetYVal(xval float64) (yval float64, err error)

GetYVal returns the interpolated value from the Curve.

type Description

type Description struct {
	Filename           string
	Docs               []*Doc               `csvrecRec:"Doc"`
	StaticParams       []*StaticParam       `csvrecRec:"StaticParams"` /*Sp*/
	Nodes              []*Node              `csvrecRec:"Node"`         /*Nl*/
	Reactions          []*Reaction          `csvrecRec:"Reaction"`     /*Rl*/
	Elements           []*Element           `csvrecRec:"Element"`      /*El*/
	Materials          []*Material          `csvrecRec:"Material"`     /*Ml*/
	Curves             []*Curve             `csvrecRec:"Curve"`
	BodyLoads          []*BodyLoad          `csvrecRec:"BodyLoad"`          /*Bll*/
	ElementPointLoads  []*ElementPointLoad  `csvrecRec:"ElementPointLoad"`  /*Epll*/
	NodalDisplacements []*NodalDisplacement `csvrecRec:"NodalDisplacement"` /*Ndl*/
	NodalVelocities    []*NodalVelocity     `csvrecRec:"NodalVelocity"`
	NodalAccelerations []*NodalAcceleration `csvrecRec:"NodalAcceleration"`
	NodalLoads         []*NodalLoad         `csvrecRec:"NodalLoad"`          /*Nll*/
	TemperatureLoads   []*TemperatureLoad   `csvrecRec:"TemperatureLoad"`    /*Templl*/
	TrapezoidLoads     []*TrapezoidLoad     `csvrecRec:"TrapezoidLoad"`      /*Trapll*/
	UniformLoads       []*UniformLoad       `csvrecRec:"UniformLoad"`        /*Ull*/
	ModalParams        []*ModalParam        `csvrecRec:"ModalParams"`        /*Mp*/
	NodalMasses        []*NodalMass         `csvrecRec:"NodalMass"`          /*Nml*/
	ElementMasses      []*ElementMass       `csvrecRec:"ElementMass"`        /*Eml*/
	CondensationParams []*CondensationParam `csvrecRec:"CondensationParams"` /*Cp*/
	CondensedNodes     []*CondensedNode     `csvrecRec:"CondensedNode"`      /*Cnl*/
	CondensedModes     []*CondensedMode     `csvrecRec:"CondensedModes"`     /*Dcm*/
	NewmarkBetaParams  []*NewmarkBetaParam  `csvrecRec:"NewmarkBetaParams"`
}

Description contains the framefea input data as read (or to be written) from the file.

func (*Description) WriteFile

func (inData *Description) WriteFile(fileName, toolName string) error

WriteFile writes a Description struct to a file.

type Doc

type Doc struct {
	Text string `csvrecField:"cstr"` // Doc name
}

Doc describes a Documentation record.

type Element

type Element struct {
	ID       int     `csvrecField:"int"` // element id
	Nid1     int     `csvrecField:"int"` // element nodes
	Nid2     int     `csvrecField:"int"` // element nodes
	Nid3     int     `csvrecField:"int"` // beam orientation node as in lsdyna
	Mid      int     `csvrecField:"int"` // material id
	Ax       float64 `csvrecField:"flt"` // Cross sectional area
	Asy, Asz float64 `csvrecField:"flt"` // Shear area in the y and z directions
	Jx       float64 `csvrecField:"flt"` // Torsional moment of inertia of a frame element
	Iy, Iz   float64 `csvrecField:"flt"` // Moment of inertia for bending about the local y and z axis
	Temp     float64 `csvrecField:"flt"` // Temperature of the Element
}

Element defines the properties and orientation of a frame element.

type ElementMass

type ElementMass struct {
	ID   int     `csvrecField:"int"` // Element ID
	Mass float64 `csvrecField:"flt"` // Extra frame element mass
}

ElementMass describes a mass to be added to an element for use in modal analysis.

type ElementPointLoad

type ElementPointLoad struct {
	ID      int     `csvrecField:"int"` // load id
	Eid     int     `csvrecField:"int"` // node id
	X, Y, Z float64 `csvrecField:"flt"` // node x, y, z
	Pos     float64 `csvrecField:"flt"` // nodal radius
}

ElementPointLoad describes a point load somewhere on and element.

type FrameData

type FrameData struct {
	Shear bool // indicates shear deformation
	Geom  bool // indicates  geometric nonlinearity

	// Node Info
	NumNodes   int           // number of Nodes
	Xyz        []femath.Vec3 // {NumNodes} X,Y,Z node coordinates (global)
	NodeRadius []float64     // {NumNodes} node size radius, for finite sizes

	// Reaction Info
	ReactedDof   []bool // {Dof} Dof's with reactions formally "r"
	UnreactedDof []bool // {Dof} Dof's without reactions formally "q" (calculated)

	// Element Info
	NumElems     int       // Number of Frame Elements
	N1, N2       []int     // {NumElems} begin and end node numbers
	Ax, Asy, Asz []float64 // {NumElems} cross section areas, incl. shear
	Jx, Iy, Iz   []float64 // {NumElems} section inertias
	E, G         []float64 // {NumElems} elastic modulus, shear modulus
	ElemRoll     []float64 // {NumElems} roll of each member, radians
	ElemDensity  []float64 // {NumElems} member densities

	L  []float64 //  node-to-node length of each element (calculated)
	Le []float64 //  effective length, accounts for node size (calculated)

	// Load Info
	PerformStaticAnalysis bool
	StaticTol             float64   // Convergence tolerance for the static analysis when Geom == true
	AnalyzeLoadCase       bool      //  Are there mechanical loads in Mechanical Loads
	MechanicalLoads       []float64 // {Dof} mechanical load vectors, all load cases
	Dp                    []float64 // {Dof} prescribed node displacements

	TempLoads    bool      // Are there temperature loads in the load case
	ThermalLoads []float64 // {Dof} thermal load vectors, all load cases

	EqFMech [][]float64 //  {numElems}{12} equivalent end forces from mech loads global (calculated)
	EqFTemp [][]float64 //  {numElems}{12} equivalent end forces from temp loads global (calculated)

	// Dynamic Analysis Data
	PerformModalAnalysis bool
	NumModes             int       // number of desired modes
	ModalMethod          int       // modal analysis method: 1=Jacobi-Subspace or 2=Stodola
	LumpFlag             bool      // true: lumped mass matrix or false: consistent mass matrix
	ModalTol             float64   // convergence tolerance for modal analysis
	ModalFreqShift       float64   // modal frequency shift for unrestrained structures, shift-factor for rigid-body-modes
	NMs                  []float64 // {NumNodes} node mass for each node
	NMx                  []float64 // {NumNodes} node inertia about global X axis
	NMy                  []float64 // {NumNodes} node inertia about global Y axis
	NMz                  []float64 // {NumNodes} node inertia about global Z axis
	EMs                  []float64 // {NumElems} lumped mass for each frame element

	// matrix Condensation Data
	PerformCondensation bool
	Cdof                int   // number of condensed degrees of freedom
	CondensationMethod  int   // matrix condensation method: 0, 1, 2, or 3
	CondensationData    []int // {DoF} matrix condensation data
	CondensedModeNums   []int // {DoF} vector of condensed mode numbers	*/

	// Newmark-beta Data
	PerformNewmarkBetaAnalysis bool
	NBAlpha                    float64
	NBBeta                     float64
	NBDt                       float64
	NBTermTime                 float64
	Vi                         []float64 // {Dof} initial nodal velocities
	Ai                         []float64 // {Dof} initial nodal accelerations

	// convenience maps
	NodeMap  map[int]int // map of external node number to internal node number
	INodeMap map[int]int // inverse of NodeMap. map of internal to external node number
	DofMap   map[int]int // map of external node ID to lowest degree of freedom (the x dir)
	ElemMap  map[int]int // map of external to internal element number
	IElemMap map[int]int // inverse of ElemMap. map of internal to external element number
	// contains filtered or unexported fields
}

FrameData contains all the input data in a form that can be used directly to run analyses (Assembled loads, nodes and elements that just use index id's etc...)

func CreateFrameData

func CreateFrameData(in *Description) (fd *FrameData, err error)

CreateFrameData converts the Inputfile struct to a FrameData struct that can be used to run analyses.

func (*FrameData) DoF

func (fd *FrameData) DoF() int

DoF returns the number of degrees of freedom described by a FrameInput2 structure (6*NumNodes).

func (*FrameData) NewCondensationInput

func (fd *FrameData) NewCondensationInput() (mi *condensation.Input)

NewCondensationInput converts a FrameData structure to the CondensationInput structure needed for matrix condensation.

func (*FrameData) NewModalInput

func (fd *FrameData) NewModalInput() (mi *modal.Input)

NewModalInput converts a FrameData structure to the ModalInput structure needed for a modal analysis.

func (*FrameData) NewNewmarkBetaInput

func (fd *FrameData) NewNewmarkBetaInput() (si *newmarkbeta.Input)

NewNewmarkBetaInput converts a FrameData structure to the NewmarkBetaInput structure needed for NewmarkBeta time integration analysis.

func (*FrameData) NewStaticInput

func (fd *FrameData) NewStaticInput() (si *static.Input)

NewStaticInput converts a FrameData structure to the StaticInput structure needed for a static structural analysis.

type Material

type Material struct {
	ID            int     `csvrecField:"int"` // id
	Name          string  `csvrecField:"str"` // name
	Rho           float64 `csvrecField:"flt"` // density
	YoungsStr     string  `csvrecField:"str"`
	ThermCoefStr  string  `csvrecField:"str"`
	PoissonStr    string  `csvrecField:"str"`
	Youngs        float64 // Youngs modulous
	ThermCoef     float64 // Coefficient of thermal expansion
	Poisson       float64 // Poisson's Ratio
	YoungsCurv    *Curve  // pointer to Youngs Modulus vs. temperature curve
	ThermCoefCurv *Curve  // pointer to thermal coefficient vs. temperature curve
	PoissonCurv   *Curve  // pointer to Poisson's ratio vs. temperature curve
}

A Material defines temperature dependent material properties and failure criteria.

func (Material) GetPoisson

func (mat Material) GetPoisson(temp float64) (val float64, err error)

GetPoisson returns the Poisson's Ratio at the temperature given.

func (Material) GetThermCoef

func (mat Material) GetThermCoef(temp float64) (val float64, err error)

GetThermCoef returns the Thermal Coefficient at the temperature given.

func (Material) GetYoungs

func (mat Material) GetYoungs(temp float64) (val float64, err error)

GetYoungs returns the Young's Modulus at the temperature given.

type ModalParam

type ModalParam struct {
	NumModes       int     `csvrecField:"int"`  // number of desired modes
	ModalMethod    int     `csvrecField:"int"`  // modal analysis method: 1=Jacobi-Subspace or 2=Stodola
	LumpFlag       bool    `csvrecField:"bool"` // true: lumped mass matrix or false: consistent mass matrix
	ModalTol       float64 `csvrecField:"flt"`  // convergence tolerance for modal analysis
	ModalFreqShift float64 `csvrecField:"flt"`  // modal frequency shift for unrestrained structures, shift-factor for rigid-body-modes
}

ModalParam contains parameters necessary for a modal analysis.

type NewmarkBetaParam

type NewmarkBetaParam struct {
	Dt              float64 `csvrecField:"flt"` // desired time step.
	Alpha           float64 `csvrecField:"flt"` // parameter chosen to control the stability of the solution
	Beta            float64 `csvrecField:"flt"` // parameter chosen to control the stability of the solution
	TerminationTime float64 `csvrecField:"flt"` // parameter that specifies a termination time for a time integration analysis with multiple steps. If 0 is specified then only one time step of durration Dt will be run. I TerminationTime is > 0 then multiple timesteps will be run, where the resulting accelerations, velocities, and displacements will be fed into the next simulation, until the simulation time exceeds the TerminationTime.
}

NewmarkBetaParam performs implicit time integration on the model

type NodalAcceleration

type NodalAcceleration struct {
	ID            int     `csvrecField:"int"` // load id
	Nid           int     `csvrecField:"int"` // node id
	Ax, Ay, Az    float64 `csvrecField:"flt"` // Accelerations in the x, y, and z directions
	Axx, Ayy, Azz float64 `csvrecField:"flt"` // rotational acceleration about the x, y, and z axis
}

NodalAcceleration describes an initial acceleration of a node.

type NodalDisplacement

type NodalDisplacement struct {
	ID            int     `csvrecField:"int"` // load id
	Nid           int     `csvrecField:"int"` // node id
	Dx, Dy, Dz    float64 `csvrecField:"flt"` // Displacements in the x, y, and z directions
	Dxx, Dyy, Dzz float64 `csvrecField:"flt"` // Rotations about the x, y, and z axis
}

NodalDisplacement describes a prescribed displacement of a node.

type NodalLoad

type NodalLoad struct {
	ID         int     `csvrecField:"int"` // load id
	Nid        int     `csvrecField:"int"` // node id
	X, Y, Z    float64 `csvrecField:"flt"` // Applied loads in the x, y, z directions
	Xx, Yy, Zz float64 `csvrecField:"flt"` // Applied moments about the x, y, z axis
}

NodalLoad describes a load/moment applied at a particular node.

type NodalMass

type NodalMass struct {
	ID       int     `csvrecField:"int"` // node id
	Mass     float64 `csvrecField:"flt"` // node mass for each node
	InertiaX float64 `csvrecField:"flt"` // node inertia about global X axis
	InertiaY float64 `csvrecField:"flt"` // node inertia about global Y axis
	InertiaZ float64 `csvrecField:"flt"` // node inertia about global Z axis
}

NodalMass describes extra mass and/or inertia applied to a node.

type NodalVelocity

type NodalVelocity struct {
	ID            int     `csvrecField:"int"` // load id
	Nid           int     `csvrecField:"int"` // node id
	Vx, Vy, Vz    float64 `csvrecField:"flt"` // Velocities in the x, y, and z directions
	Vxx, Vyy, Vzz float64 `csvrecField:"flt"` // rotational velocities about the x, y, and z axis
}

NodalVelocity describes an initial velocity of a node.

type Node

type Node struct {
	ID  int        `csvrecField:"int"`   // node id
	Loc [3]float64 `csvrecField:"f3vec"` // node x, y, z
	Rad float64    `csvrecField:"flt"`   // nodal radius
}

Node describes a node in 3d space.

func Roll2Node

func Roll2Node(node1, node2 *Node, roll float64, id int) (node3 *Node)

Roll2Node creates the third node for an element when the endpoints and roll are known

type Reaction

type Reaction struct {
	Nid        int  `csvrecField:"int"`  // node id
	X, Y, Z    bool `csvrecField:"bool"` // Position reactions 0 = free, 1 = fixed.
	Xx, Yy, Zz bool `csvrecField:"bool"` // Rotation reactions 0 = free, 1 = fixed.
}

Reaction descripes the constrained degrees of freedom of a node.

type StaticParam

type StaticParam struct {
	Shear bool    `csvrecField:"bool"` // true=Do, false=Don't include shear deformation effects
	Geom  bool    `csvrecField:"bool"` // true=Do, false=Don't include geometric stiffness effects
	Tol   float64 `csvrecField:"flt"`  // Convergence tolerance for the static analysis when Geom == true
	Temp  float64 `csvrecField:"flt"`  // this is the default temperature of elements that do not have a temperature specified by a load  (for material property purposes)
}

StaticParam contains parameters necessary for a static analysis.

type TemperatureLoad

type TemperatureLoad struct {
	ID             int     `csvrecField:"int"` // load id
	Eid            int     `csvrecField:"int"` // node id
	Hy, Hz         float64 `csvrecField:"flt"` // y and z depth
	DtyPos, DtyNeg float64 `csvrecField:"flt"` // the temperature change on the local +/-y face of the element.
	DtzPos, DtzNeg float64 `csvrecField:"flt"` // the temperature change on the local +/-z face of the element.
}

TemperatureLoad describes a temperature gradiant applied to an element.

type TrapezoidLoad

type TrapezoidLoad struct {
	ID       int     `csvrecField:"int"` // load id
	Eid      int     `csvrecField:"int"` // element id
	X1, X2   float64 `csvrecField:"flt"` // start and stop location in the local x-direction
	Wx1, Wx2 float64 `csvrecField:"flt"` // start and stop load in the local x-direction
	Y1, Y2   float64 `csvrecField:"flt"` // start and stop location in the local y-direction
	Wy1, Wy2 float64 `csvrecField:"flt"` // start and stop load in the local y-direction
	Z1, Z2   float64 `csvrecField:"flt"` // start and stop location in the local z-direction
	Wz1, Wz2 float64 `csvrecField:"flt"` // start and stop load in the local z-direction
}

TrapezoidLoad describes a trapezoidal load applied to an element.

type UniformLoad

type UniformLoad struct {
	ID         int     `csvrecField:"int"` // load id
	Eid        int     `csvrecField:"int"` // Element id
	Ux, Uy, Uz float64 `csvrecField:"flt"` // Uniformly distributed load in the x, y, and z dirs
}

UniformLoad describes a uniform load applied to an element.

Jump to

Keyboard shortcuts

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